Skip to content

Commit

Permalink
Rollback of commit b9f401b.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Broke tests on Mac: https://google.com/url?sa=D&q=http%3A%2F%2Fci.bazel.io%2Fjob%2FBazel%2FJAVA_VERSION%3D1.8%2CPLATFORM_NAME%3Ddarwin-x86_64%2F269%2Fconsole

*** Original change description ***

Speed-up bootstrap on OS X by removing tool compilation.

--
MOS_MIGRATED_REVID=110785493
  • Loading branch information
dslomov committed Dec 22, 2015
1 parent 5fd83b2 commit ac6ed79
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 47 deletions.
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,25 @@
/.classpath
/.factorypath
/.idea/
/base_workspace/*
/base_workspace/bazel-bin
/base_workspace/bazel-genfiles
/base_workspace/bazel-out
/base_workspace/bazel-base_workspace
/base_workspace/bazel-testlogs
/base_workspace/examples
/base_workspace/tools
/base_workspace/third_party
/base_workspace/src
/bazel.iml
/tools/jdk/jdk
/tools/objc/*.jar
/tools/objc/actoolwrapper.sh
/tools/objc/environment_plist.sh
/tools/objc/ibtoolwrapper.sh
/tools/objc/momctoolwrapper.sh
/tools/objc/momcwrapper.sh
/tools/objc/realpath
/tools/objc/StdRedirect.dylib
/tools/objc/swiftstdlibtoolwrapper.sh
/tools/objc/swiftstdlibtoolzip.sh
/tools/objc/xcrunwrapper.sh
31 changes: 26 additions & 5 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function usage() {
echo " General purpose commands:" >&2
echo " build = compile,tools,init (default)" >&2
echo " compile = compile a Bazel binary for usage" >&2
echo " tools = compile and install tooling for Bazel" >&2
echo " init = initialize the base workspace" >&2
echo " Commands for developers:" >&2
echo " all = build,determinism,test" >&2
Expand All @@ -41,15 +42,17 @@ function usage() {
}

function parse_options() {
local keywords="(build|compile|init|all|determinism|bootstrap|test)"
local keywords="(build|compile|tools|init|all|determinism|bootstrap|test)"
COMMANDS="${1:-build}"
[[ "${COMMANDS}" =~ ^$keywords(,$keywords)*$ ]] || usage "$@"
DO_COMPILE=
DO_TOOLS_COMPILATION=
DO_CHECKSUM=
DO_FULL_CHECKSUM=1
DO_TESTS=
DO_BASE_WORKSPACE_INIT=
[[ "${COMMANDS}" =~ (compile|build|all) ]] && DO_COMPILE=1
[[ "${COMMANDS}" =~ (tools|build|all) ]] && DO_TOOLS_COMPILATION=1
[[ "${COMMANDS}" =~ (init|build|all) ]] && DO_BASE_WORKSPACE_INIT=1
[[ "${COMMANDS}" =~ (bootstrap|determinism|all) ]] && DO_CHECKSUM=1
[[ "${COMMANDS}" =~ (bootstrap) ]] && DO_FULL_CHECKSUM=
Expand Down Expand Up @@ -85,11 +88,29 @@ if [ "${EMBED_LABEL-x}" = "x" ]; then
EMBED_LABEL="head (@${git_sha1:-non-git})"
fi

if [[ $PLATFORM == "darwin" ]] && \
xcodebuild -showsdks 2> /dev/null | grep -q '\-sdk iphonesimulator'; then
EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS-} --define IPHONE_SDK=1"
fi
source scripts/bootstrap/bootstrap.sh
if [ $DO_TOOLS_COMPILATION ]; then
if [[ $PLATFORM == "darwin" ]]; then
bazel_bootstrap //src/tools/xcode/actoolwrapper:actoolwrapper tools/objc/actoolwrapper.sh 0755
bazel_bootstrap //src/tools/xcode/ibtoolwrapper:ibtoolwrapper tools/objc/ibtoolwrapper.sh 0755
bazel_bootstrap //src/tools/xcode/momcwrapper:momcwrapper tools/objc/momcwrapper.sh 0755
bazel_bootstrap //src/tools/xcode/swiftstdlibtoolwrapper:swiftstdlibtoolwrapper tools/objc/swiftstdlibtoolzip.sh 0755
bazel_bootstrap //src/tools/xcode/xcrunwrapper:xcrunwrapper tools/objc/xcrunwrapper.sh 0755
bazel_bootstrap //src/objc_tools/bundlemerge:bundlemerge_deploy.jar \
tools/objc/precomp_bundlemerge_deploy.jar
bazel_bootstrap //src/objc_tools/plmerge:plmerge_deploy.jar \
tools/objc/precomp_plmerge_deploy.jar
bazel_bootstrap //src/objc_tools/xcodegen:xcodegen_deploy.jar \
tools/objc/precomp_xcodegen_deploy.jar
if xcodebuild -showsdks 2> /dev/null | grep -q '\-sdk iphonesimulator'; then
bazel_bootstrap //src/tools/xcode/stdredirect:StdRedirect.dylib \
tools/objc/StdRedirect.dylib 0755
fi
bazel_bootstrap //src/tools/xcode/realpath:realpath tools/objc/realpath 0755
bazel_bootstrap //src/tools/xcode/environment:environment_plist \
tools/objc/environment_plist.sh 0755
fi
fi

if [ $DO_COMPILE ]; then
new_step 'Building Bazel with Bazel'
Expand Down
3 changes: 1 addition & 2 deletions scripts/bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ fi
--javabuilder_top=//src/java_tools/buildjar:bootstrap_deploy.jar \
--genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar \
--ijar_top=//third_party/ijar \
--strategy=Javac=worker --worker_quit_after_build \
${EXTRA_BAZEL_ARGS-}"}
--strategy=Javac=worker --worker_quit_after_build"}

function bazel_bootstrap() {
local mode=${3:-"0644"}
Expand Down
31 changes: 1 addition & 30 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,6 @@ genrule(
""",
)

filegroup(
name = "darwin_tools",
srcs = [
"//src/tools/xcode/actoolwrapper:actoolwrapper",
"//src/tools/xcode/ibtoolwrapper:ibtoolwrapper",
"//src/tools/xcode/momcwrapper:momcwrapper",
"//src/tools/xcode/swiftstdlibtoolwrapper:swiftstdlibtoolwrapper",
"//src/tools/xcode/environment:environment_plist",
"//src/tools/xcode/xcrunwrapper:xcrunwrapper",
"//src/objc_tools/bundlemerge:bundlemerge_deploy.jar",
"//src/objc_tools/plmerge:plmerge_deploy.jar",
"//src/objc_tools/xcodegen:xcodegen_deploy.jar",
"//src/tools/xcode/realpath:realpath",
] + select({
":iphonesdk": ["//src/tools/xcode/stdredirect:StdRedirect.dylib"],
"//conditions:default": [],
}),
)

genrule(
name = "embedded_tools",
srcs = [
Expand All @@ -102,11 +83,7 @@ genrule(
"//src/java_tools/singlejar:SingleJar_deploy.jar",
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar",
"//third_party/ijar",
] + select({
":darwin": [":darwin_tools"],
":darwin_x86_64": [":darwin_tools"],
"//conditions:default": [],
}),
],
outs = ["embedded_tools.zip"],
cmd = "$(location :create_embedded_tools.sh) $@ $(SRCS)",
)
Expand Down Expand Up @@ -168,12 +145,6 @@ config_setting(
visibility = ["//visibility:public"],
)

config_setting(
name = "iphonesdk",
values = {"define": "IPHONE_SDK=1"},
visibility = ["//visibility:public"],
)

config_setting(
name = "freebsd",
values = {"cpu": "freebsd"},
Expand Down
4 changes: 0 additions & 4 deletions src/create_embedded_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ for i in $*; do
*SingleJar_deploy.jar) OUTPUT_PATH=tools/jdk/SingleJar_deploy.jar ;;
*GenClass_deploy.jar) OUTPUT_PATH=tools/jdk/GenClass_deploy.jar ;;
*ijar) OUTPUT_PATH=tools/jdk/ijar ;;
*src/objc_tools/*) OUTPUT_PATH=tools/objc/precomp_${i##*/} ;;
*xcode*StdRedirect.dylib) OUTPUT_PATH=tools/objc/StdRedirect.dylib ;;
*xcode*realpath) OUTPUT_PATH=tools/objc/realpath ;;
*src/tools/xcode/*) OUTPUT_PATH=tools/objc/${i##*/}.sh ;;
*) OUTPUT_PATH=$(echo $i | sed 's_^.*bazel-out/[^/]*/bin/__') ;;
esac

Expand Down
2 changes: 1 addition & 1 deletion src/tools/xcode/actoolwrapper/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//src:__subpackages__"])
package(default_visibility = ["//src/test:__subpackages__"])

filegroup(
name = "srcs",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/xcode/ibtoolwrapper/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//src:__subpackages__"])
package(default_visibility = ["//src/test:__subpackages__"])

filegroup(
name = "srcs",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/xcode/momcwrapper/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//src:__subpackages__"])
package(default_visibility = ["//src/test:__subpackages__"])

filegroup(
name = "srcs",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/xcode/swiftstdlibtoolwrapper/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//src:__subpackages__"])
package(default_visibility = ["//src/test:__subpackages__"])

filegroup(
name = "srcs",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/xcode/xcrunwrapper/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//src:__subpackages__"])
package(default_visibility = ["//src/test:__subpackages__"])

filegroup(
name = "srcs",
Expand Down

0 comments on commit ac6ed79

Please sign in to comment.