Merge pull request #96402 from matthewbauer/bazel-jdk-headless

Fix Bazel on macOS
This commit is contained in:
Matthew Bauer 2020-09-02 16:29:47 -05:00 committed by GitHub
commit 304de03193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 4 deletions

View file

@ -236,6 +236,8 @@ stdenv.mkDerivation rec {
fetch --experimental_distdir=${distDir}
build --copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt="/g')"
build --host_copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt="/g')"
build --linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt="/g')"
build --host_linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt="/g')"
build --linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt="-Wl,/g')"
build --host_linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt="-Wl,/g')"
build --host_javabase='@local_jdk//:jdk'
@ -245,6 +247,8 @@ stdenv.mkDerivation rec {
# add the same environment vars to compile.sh
sed -e "/\$command \\\\$/a --copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_javabase='@local_jdk//:jdk' \\\\" \

View file

@ -417,6 +417,8 @@ stdenv.mkDerivation rec {
fetch --distdir=${distDir}
build --copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt="/g')"
build --host_copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt="/g')"
build --linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt="/g')"
build --host_linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt="/g')"
build --linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt="-Wl,/g')"
build --host_linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt="-Wl,/g')"
build --host_javabase='@local_jdk//:jdk'
@ -426,6 +428,8 @@ stdenv.mkDerivation rec {
# add the same environment vars to compile.sh
sed -e "/\$command \\\\$/a --copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_javabase='@local_jdk//:jdk' \\\\" \

View file

@ -417,6 +417,8 @@ stdenv.mkDerivation rec {
fetch --distdir=${distDir}
build --copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt="/g')"
build --host_copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt="/g')"
build --linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt="/g')"
build --host_linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt="/g')"
build --linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt="-Wl,/g')"
build --host_linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt="-Wl,/g')"
build --host_javabase='@local_jdk//:jdk'
@ -426,6 +428,8 @@ stdenv.mkDerivation rec {
# add the same environment vars to compile.sh
sed -e "/\$command \\\\$/a --copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_javabase='@local_jdk//:jdk' \\\\" \

View file

@ -429,6 +429,8 @@ stdenv.mkDerivation rec {
fetch --distdir=${distDir}
build --copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt="/g')"
build --host_copt="$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt="/g')"
build --linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt="/g')"
build --host_linkopt="$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt="/g')"
build --linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt="-Wl,/g')"
build --host_linkopt="-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt="-Wl,/g')"
build --host_javabase='@local_jdk//:jdk'
@ -438,6 +440,8 @@ stdenv.mkDerivation rec {
# add the same environment vars to compile.sh
sed -e "/\$command \\\\$/a --copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_copt=\"$(echo $NIX_CFLAGS_COMPILE | sed -e 's/ /" --host_copt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"$(echo $(< ${stdenv.cc}/nix-support/libcxx-ldflags) | sed -e 's/ /" --host_linkopt=\"/g')\" \\\\" \
-e "/\$command \\\\$/a --linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_linkopt=\"-Wl,$(echo $NIX_LDFLAGS | sed -e 's/ /" --host_linkopt=\"-Wl,/g')\" \\\\" \
-e "/\$command \\\\$/a --host_javabase='@local_jdk//:jdk' \\\\" \

View file

@ -9184,6 +9184,7 @@ in
openjdk_headless = openjdk8_headless;
jdk8 = openjdk8;
jdk8_headless = openjdk8_headless;
jre8 = openjdk8.jre;
jre8_headless = openjdk8_headless.jre;
@ -10463,7 +10464,7 @@ in
bazel_0_26 = callPackage ../development/tools/build-managers/bazel/bazel_0_26 {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation;
buildJdk = jdk8;
buildJdk = jdk8_headless;
buildJdkName = "jdk8";
runJdk = jdk11_headless;
stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
@ -10472,7 +10473,7 @@ in
bazel_0_29 = callPackage ../development/tools/build-managers/bazel/bazel_0_29 {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation;
buildJdk = jdk8;
buildJdk = jdk8_headless;
buildJdkName = "jdk8";
runJdk = jdk11_headless;
stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
@ -10482,7 +10483,7 @@ in
bazel_1 = callPackage ../development/tools/build-managers/bazel/bazel_1 {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation;
buildJdk = jdk8;
buildJdk = jdk8_headless;
buildJdkName = "jdk8";
runJdk = jdk11_headless;
stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
@ -10492,7 +10493,7 @@ in
bazel_3 = callPackage ../development/tools/build-managers/bazel/bazel_3 {
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Foundation;
buildJdk = jdk8;
buildJdk = jdk8_headless;
buildJdkName = "jdk8";
runJdk = jdk11_headless;
stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;