···140140 # on aarch64 Darwin, `uname -m` returns "arm64"
141141 arch = with stdenv.hostPlatform; if isDarwin && isAarch64 then "arm64" else parsed.cpu.name;
142142143143- #build --extra_toolchains=@local_jdk//:all
144144- #build --tool_java_runtime_version=local_jdk
145145- #build --java_runtime_version=local_jdk
146146- #build --repo_env=JAVA_HOME=${buildJdk}${if isDarwin then "/zulu-11.jdk/Contents/Home" else "/lib/openjdk"}
147147-148143 bazelRC = writeTextFile {
149144 name = "bazel-rc";
150145 text = ''
···223218 # argument if it's found to be an empty string.
224219 ../trim-last-argument-to-gcc-if-empty.patch
225220226226- # XXX: This seems merged / not a real problem. See PR.
227227- # TODO: Remove when protobuf tests confirm it is not needed.
228228- # `java_proto_library` ignores `strict_proto_deps`
229229- # https://github.com/bazelbuild/bazel/pull/16146
230230- # ./strict_proto_deps.patch
231231-232232- # On Darwin, using clang 6 to build fails because of a linker error (see #105573),
233233- # but using clang 7 fails because libarclite_macosx.a cannot be found when linking
234234- # the xcode_locator tool.
235235- # This patch removes using the -fobjc-arc compiler option and makes the code
236236- # compile without automatic reference counting. Caveat: this leaks memory, but
237237- # we accept this fact because xcode_locator is only a short-lived process used during the build.
238238- ./no-arc.patch
239239-240221 # --experimental_strict_action_env (which may one day become the default
241222 # see bazelbuild/bazel#2574) hardcodes the default
242223 # action environment to a non hermetic value (e.g. "/usr/local/bin").
···303284 # nixpkgs's libSystem cannot use pthread headers directly, must import GCD headers instead
304285 sed -i -e "/#include <pthread\/spawn.h>/i #include <dispatch/dispatch.h>" src/main/cpp/blaze_util_darwin.cc
305286306306- # clang installed from Xcode has a compatibility wrapper that forwards
307307- # invocations of gcc to clang, but vanilla clang doesn't
308308- sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
309309-310310- # This is necessary to avoid:
311311- # "error: no visible @interface for 'NSDictionary' declares the selector
312312- # 'initWithContentsOfURL:error:'"
313313- # This can be removed when the apple_sdk is upgraded beyond 10.13+
314314- sedVerbose tools/osx/xcode_locator.m \
315315- -e '/initWithContentsOfURL:versionPlistUrl/ {
316316- N
317317- s/error:nil\];/\];/
318318- }'
319319-287287+ # XXX: What do these do ?
320288 sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
321289 wrappers=( tools/cpp/osx_cc_wrapper.sh.tpl )
322290 for wrapper in "''${wrappers[@]}"; do
···502470 # $out/bin/bazel-{version}-{os_arch} The binary _must_ exist with this
503471 # naming if your project contains a .bazelversion file.
504472 cp ./bazel_src/scripts/packages/bazel.sh $out/bin/bazel
505505- wrapProgram $out/bin/bazel $wrapperfile --suffix PATH : ${defaultShellPath}
506506- mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch}
473473+ versionned_bazel="$out/bin/bazel-${version}-${system}-${arch}"
474474+ mv ./bazel_src/output/bazel "$versionned_bazel"
475475+ wrapProgram "$versionned_bazel" --suffix PATH : ${defaultShellPath}
507476508477 mkdir $out/share
509478 cp ./bazel_src/output/parser_deploy.jar $out/share/parser_deploy.jar
···525494 ./bazel_src/output/bazel-complete.fish
526495 '';
527496528528- # Install check fails on `aarch64-darwin`
529529- # https://github.com/NixOS/nixpkgs/issues/145587
530530- doInstallCheck = false; #stdenv.hostPlatform.system != "aarch64-darwin";
531497 installCheckPhase = ''
532498 export TEST_TMPDIR=$(pwd)
533499···595561 inherit Foundation bazel_self lockfile repoCache;
596562 };
597563598598- updater = throw "TODO";
599599-564564+ # For ease of debugging
600565 inherit distDir repoCache;
601566 };
602567}