From 8d1c723576fb78151057ad5af64a9daef74af427 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 5 Jul 2022 21:28:50 -0700 Subject: Bazel: new versions, patches, conflicts, and java version contraints (#31402) --- .../bazel/bazelruleclassprovider_fj-0.25.patch | 11 ++++ .../packages/bazel/blaze_util_posix-0.29.1.patch | 12 +++++ .../builtin/packages/bazel/build-0.29.1.patch | 61 ++++++++++++++++++++++ .../packages/bazel/cppcompileaction-0.3.0.patch | 11 ++++ .../packages/bazel/cppcompileaction-0.3.2.patch | 11 ++++ .../builtin/packages/bazel/disabledepcheck.patch | 11 ---- .../packages/bazel/disabledepcheck_old.patch | 11 ---- .../builtin/packages/bazel/linux_ppc-0.29.1.patch | 61 ---------------------- var/spack/repos/builtin/packages/bazel/package.py | 39 ++++++++++---- .../builtin/packages/bazel/patch_for_fcc.patch | 37 ------------- .../builtin/packages/bazel/patch_for_fcc2.patch | 11 ---- .../bazel/unix_cc_configure_fj-0.29.1.patch | 20 +++++++ .../packages/bazel/unix_cc_configure_fj-5.0.patch | 23 ++++++++ .../packages/bazel/unix_cc_configure_fj-5.2.patch | 23 ++++++++ 14 files changed, 201 insertions(+), 141 deletions(-) create mode 100644 var/spack/repos/builtin/packages/bazel/bazelruleclassprovider_fj-0.25.patch create mode 100644 var/spack/repos/builtin/packages/bazel/blaze_util_posix-0.29.1.patch create mode 100644 var/spack/repos/builtin/packages/bazel/build-0.29.1.patch create mode 100644 var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.0.patch create mode 100644 var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.2.patch delete mode 100644 var/spack/repos/builtin/packages/bazel/disabledepcheck.patch delete mode 100644 var/spack/repos/builtin/packages/bazel/disabledepcheck_old.patch delete mode 100644 var/spack/repos/builtin/packages/bazel/linux_ppc-0.29.1.patch delete mode 100644 var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch delete mode 100644 var/spack/repos/builtin/packages/bazel/patch_for_fcc2.patch create mode 100644 var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-0.29.1.patch create mode 100644 var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.0.patch create mode 100644 var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.2.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/bazel/bazelruleclassprovider_fj-0.25.patch b/var/spack/repos/builtin/packages/bazel/bazelruleclassprovider_fj-0.25.patch new file mode 100644 index 0000000000..709e5ee020 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/bazelruleclassprovider_fj-0.25.patch @@ -0,0 +1,11 @@ +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java +@@ -185,7 +185,7 @@ public class BazelRuleClassProvider { + + Map spackEnv = System.getenv(); + for (String envName : spackEnv.keySet()) { +- if (envName.startsWith("SPACK_")) { ++ if ((envName.startsWith("SPACK_")) || (envName.equals("fcc_ENV")) || (envName.equals("FCC_ENV"))) { + env.put(envName, spackEnv.get(envName)); + } + } diff --git a/var/spack/repos/builtin/packages/bazel/blaze_util_posix-0.29.1.patch b/var/spack/repos/builtin/packages/bazel/blaze_util_posix-0.29.1.patch new file mode 100644 index 0000000000..aa773a33a5 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/blaze_util_posix-0.29.1.patch @@ -0,0 +1,12 @@ +diff -Naur a/src/main/cpp/blaze_util_posix.cc b/src/main/cpp/blaze_util_posix.cc +--- a/src/main/cpp/blaze_util_posix.cc 1980-01-01 00:00:00.000000000 -0800 ++++ b/src/main/cpp/blaze_util_posix.cc 2022-06-30 23:34:08.000000000 -0700 +@@ -600,7 +600,7 @@ + // Prefer OFD locks if available. POSIX locks can be lost "accidentally" + // due to any close() on the lock file, and are not reliably preserved + // across execve() on Linux, which we need for --batch mode. +- if (fcntl(fd, F_OFD_SETLK, lock) == 0) return 0; ++ if (fcntl(fd, F_SETLK, lock) == 0) return 0; + if (errno != EINVAL) { + if (errno != EACCES && errno != EAGAIN) { + BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) diff --git a/var/spack/repos/builtin/packages/bazel/build-0.29.1.patch b/var/spack/repos/builtin/packages/bazel/build-0.29.1.patch new file mode 100644 index 0000000000..c3ed9ab254 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/build-0.29.1.patch @@ -0,0 +1,61 @@ +From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001 +From: Harsh Bhatia +Date: Tue, 15 Dec 2020 15:56:10 -0800 +Subject: [PATCH] https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 + +--- + src/conditions/BUILD | 6 ++++++ + third_party/BUILD | 8 ++++++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/conditions/BUILD b/src/conditions/BUILD +index 2b28e28057..faa41a439d 100644 +--- a/src/conditions/BUILD ++++ b/src/conditions/BUILD +@@ -10,6 +10,12 @@ filegroup( + visibility = ["//src:__pkg__"], + ) + ++config_setting( ++ name = "linux_ppc", ++ values = {"cpu": "ppc"}, ++ visibility = ["//visibility:public"], ++) ++ + config_setting( + name = "linux_x86_64", + values = {"cpu": "k8"}, +diff --git a/third_party/BUILD b/third_party/BUILD +index 159006d741..4fcae54c00 100644 +--- a/third_party/BUILD ++++ b/third_party/BUILD +@@ -523,12 +523,13 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({ + "//src/conditions:darwin": "*.so *.dll", + "//src/conditions:darwin_x86_64": "*.so *.dll", + "//src/conditions:linux_x86_64": "*.jnilib *.dll", ++ "//src/conditions:linux_ppc": "*.so *.jnilib *.dll", + # The .so file is an x86 one, so we can just remove it if the CPU is not x86 + "//src/conditions:arm": "*.so *.jnilib *.dll", + "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll", + # Play it safe -- better have a big binary than a slow binary + # zip -d does require an argument. Supply something bogus. +- "//conditions:default": "*.bogusextension", ++ "//conditions:default": "", + }) + + # Remove native libraries that are for a platform different from the one we are +@@ -537,7 +538,10 @@ genrule( + name = "filter_netty_dynamic_libs", + srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"], + outs = ["netty_tcnative/netty-tcnative-filtered.jar"], +- cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES, ++ cmd = "cp $< $@ && " + ++ # End successfully if there is nothing to be deleted from the archive ++ "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " + ++ "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi", + ) + + java_import( +-- +2.21.0 (Apple Git-122.2) + diff --git a/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.0.patch b/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.0.patch new file mode 100644 index 0000000000..dd23972d99 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.0.patch @@ -0,0 +1,11 @@ +--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java.orig 2020-06-08 13:42:14.035342560 -0400 ++++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java 2020-06-08 13:42:25.149375458 -0400 +@@ -963,7 +963,7 @@ + // are, it's probably due to a non-hermetic #include, & we should stop + // the build with an error. + if (execPath.startsWith(execRoot)) { +- execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path ++ // execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path + } else { + problems.add(execPathFragment.getPathString()); + continue; diff --git a/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.2.patch b/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.2.patch new file mode 100644 index 0000000000..c15d3bf64a --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/cppcompileaction-0.3.2.patch @@ -0,0 +1,11 @@ +--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java.orig 2020-03-25 08:54:37.914186251 -0400 ++++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java 2020-03-25 08:55:01.356250657 -0400 +@@ -148,7 +148,7 @@ + if (execPath.startsWith(execRoot)) { + execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path + } else { +- problems.add(execPathFragment.getPathString()); ++ // problems.add(execPathFragment.getPathString()); + continue; + } + } diff --git a/var/spack/repos/builtin/packages/bazel/disabledepcheck.patch b/var/spack/repos/builtin/packages/bazel/disabledepcheck.patch deleted file mode 100644 index c15d3bf64a..0000000000 --- a/var/spack/repos/builtin/packages/bazel/disabledepcheck.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java.orig 2020-03-25 08:54:37.914186251 -0400 -+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java 2020-03-25 08:55:01.356250657 -0400 -@@ -148,7 +148,7 @@ - if (execPath.startsWith(execRoot)) { - execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path - } else { -- problems.add(execPathFragment.getPathString()); -+ // problems.add(execPathFragment.getPathString()); - continue; - } - } diff --git a/var/spack/repos/builtin/packages/bazel/disabledepcheck_old.patch b/var/spack/repos/builtin/packages/bazel/disabledepcheck_old.patch deleted file mode 100644 index dd23972d99..0000000000 --- a/var/spack/repos/builtin/packages/bazel/disabledepcheck_old.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java.orig 2020-06-08 13:42:14.035342560 -0400 -+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java 2020-06-08 13:42:25.149375458 -0400 -@@ -963,7 +963,7 @@ - // are, it's probably due to a non-hermetic #include, & we should stop - // the build with an error. - if (execPath.startsWith(execRoot)) { -- execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path -+ // execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path - } else { - problems.add(execPathFragment.getPathString()); - continue; diff --git a/var/spack/repos/builtin/packages/bazel/linux_ppc-0.29.1.patch b/var/spack/repos/builtin/packages/bazel/linux_ppc-0.29.1.patch deleted file mode 100644 index c3ed9ab254..0000000000 --- a/var/spack/repos/builtin/packages/bazel/linux_ppc-0.29.1.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001 -From: Harsh Bhatia -Date: Tue, 15 Dec 2020 15:56:10 -0800 -Subject: [PATCH] https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 - ---- - src/conditions/BUILD | 6 ++++++ - third_party/BUILD | 8 ++++++-- - 2 files changed, 12 insertions(+), 2 deletions(-) - -diff --git a/src/conditions/BUILD b/src/conditions/BUILD -index 2b28e28057..faa41a439d 100644 ---- a/src/conditions/BUILD -+++ b/src/conditions/BUILD -@@ -10,6 +10,12 @@ filegroup( - visibility = ["//src:__pkg__"], - ) - -+config_setting( -+ name = "linux_ppc", -+ values = {"cpu": "ppc"}, -+ visibility = ["//visibility:public"], -+) -+ - config_setting( - name = "linux_x86_64", - values = {"cpu": "k8"}, -diff --git a/third_party/BUILD b/third_party/BUILD -index 159006d741..4fcae54c00 100644 ---- a/third_party/BUILD -+++ b/third_party/BUILD -@@ -523,12 +523,13 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({ - "//src/conditions:darwin": "*.so *.dll", - "//src/conditions:darwin_x86_64": "*.so *.dll", - "//src/conditions:linux_x86_64": "*.jnilib *.dll", -+ "//src/conditions:linux_ppc": "*.so *.jnilib *.dll", - # The .so file is an x86 one, so we can just remove it if the CPU is not x86 - "//src/conditions:arm": "*.so *.jnilib *.dll", - "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll", - # Play it safe -- better have a big binary than a slow binary - # zip -d does require an argument. Supply something bogus. -- "//conditions:default": "*.bogusextension", -+ "//conditions:default": "", - }) - - # Remove native libraries that are for a platform different from the one we are -@@ -537,7 +538,10 @@ genrule( - name = "filter_netty_dynamic_libs", - srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"], - outs = ["netty_tcnative/netty-tcnative-filtered.jar"], -- cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES, -+ cmd = "cp $< $@ && " + -+ # End successfully if there is nothing to be deleted from the archive -+ "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " + -+ "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi", - ) - - java_import( --- -2.21.0 (Apple Git-122.2) - diff --git a/var/spack/repos/builtin/packages/bazel/package.py b/var/spack/repos/builtin/packages/bazel/package.py index 751403faf4..e03fc257de 100644 --- a/var/spack/repos/builtin/packages/bazel/package.py +++ b/var/spack/repos/builtin/packages/bazel/package.py @@ -20,6 +20,14 @@ class Bazel(Package): tags = ['build-tools'] + version('5.2.0', sha256='820a94dbb14071ed6d8c266cf0c080ecb265a5eea65307579489c4662c2d582a') + version('5.1.1', sha256='7f5d3bc1d344692b2400f3765fd4b5c0b636eb4e7a8a7b17923095c7b56a4f78') + version('5.1.0', sha256='4de301f509fc6d0cbc697b2017384ecdc94df8f36245bbcbedc7ea6780acc9f5') + version('5.0.0', sha256='072dd62d237dbc11e0bac02e118d8c2db4d0ba3ba09f1a0eb1e2a460fb8419db') + version('4.2.2', sha256='9981d0d53a356c4e87962847750a97c9e8054e460854748006c80f0d7e2b2d33') + version('4.2.1', sha256='12ea7aa11e2bdb12de1dceb9939a22e96f5a480437cb17c123379d8e0fdf5e82') + version('4.2.0', sha256='74814b63920aaee47dbbbee7082e5c4317e4eebaf07e03c5fb5626e1716f1034') + version('4.1.0', sha256='f377d755c96a50f6bd2f423562598d822f43356783330a0b780ad442864d6eeb') version('4.0.0', sha256='d350f80e70654932db252db380d2ec0144a00e86f8d9f2b4c799ffdb48e9cdd1') version('3.7.2', sha256='de255bb42163a915312df9f4b86e5b874b46d9e8d4b72604b5123c3a845ed9b1') version('3.7.1', sha256='c9244e5905df6b0190113e26082c72d58b56b1b0dec66d076f083ce4089b0307') @@ -113,14 +121,13 @@ class Bazel(Package): variant('nodepfail', default=True, description='Disable failing dependency checks due to injected absolute paths - required for most builds using bazel with spack') depends_on('java', type=('build', 'run')) + depends_on('java@11', when='@5.3:', type=('build', 'run')) + depends_on('java@8,11', when='@3.3:5.2', type=('build', 'run')) + depends_on('java@8', when='@0.6:3.2', type=('build', 'run')) + depends_on('java@7:8', when='@:0.5', type=('build', 'run')) depends_on('python+pythoncmd', type=('build', 'run')) depends_on('zip', when='platform=linux', type=('build', 'run')) - # make work on power9 (2x commits) - # https://github.com/bazelbuild/bazel/commit/5cff4f1edf8b95bf0612791632255852332f72b5 - # https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 - patch('linux_ppc-0.29.1.patch', when='@0.29.1') - # Pass Spack environment variables to the build patch('bazelruleclassprovider-0.25.patch', when='@0.25:') patch('bazelruleclassprovider-0.14.patch', when='@0.14:0.24') @@ -144,9 +151,21 @@ class Bazel(Package): patch('compile-0.4.patch', when='@0.4:0.5') patch('compile-0.3.patch', when='@:0.3') - # for fcc - patch('patch_for_fcc.patch', when='@0.29.1:%fj') - patch('patch_for_fcc2.patch', when='@0.25:%fj') + # Disable dependency search + patch('cppcompileaction-0.3.2.patch', when='@0.3.2:+nodepfail') + patch('cppcompileaction-0.3.0.patch', when='@0.3.0:0.3.1+nodepfail') + + # Fix build on power9 (2x commits) + # https://github.com/bazelbuild/bazel/commit/5cff4f1edf8b95bf0612791632255852332f72b5 + # https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 + patch('build-0.29.1.patch', when='@0.29.1') + + # Fix build with Fujitsu compiler + patch('blaze_util_posix-0.29.1.patch', when='@0.29.1:%fj') + patch('unix_cc_configure_fj-5.2.patch', when='@5.2:%fj') + patch('unix_cc_configure_fj-5.0.patch', when='@5.0:5.1%fj') + patch('unix_cc_configure_fj-0.29.1.patch', when='@0.29.1:4%fj') + patch('bazelruleclassprovider_fj-0.25.patch', when='@0.25:%fj') conflicts( '%fj', when='@:0.24.1', @@ -154,8 +173,8 @@ class Bazel(Package): 'please use a newer release.' ) - patch('disabledepcheck.patch', when='@0.3.2:+nodepfail') - patch('disabledepcheck_old.patch', when='@0.3.0:0.3.1+nodepfail') + # https://blog.bazel.build/2021/05/21/bazel-4-1.html + conflicts('platform=darwin target=aarch64:', when='@:4.0') executables = ['^bazel$'] diff --git a/var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch b/var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch deleted file mode 100644 index d90448b0ba..0000000000 --- a/var/spack/repos/builtin/packages/bazel/patch_for_fcc.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/src/main/cpp/blaze_util_posix.cc b/src/main/cpp/blaze_util_posix.cc -index 87ba899180..1c967ee818 100644 ---- a/src/main/cpp/blaze_util_posix.cc -+++ b/src/main/cpp/blaze_util_posix.cc -@@ -565,7 +565,8 @@ static int setlk(int fd, struct flock *lock) { - // Prefer OFD locks if available. POSIX locks can be lost "accidentally" - // due to any close() on the lock file, and are not reliably preserved - // across execve() on Linux, which we need for --batch mode. -- if (fcntl(fd, F_OFD_SETLK, lock) == 0) return 0; -+ //if (fcntl(fd, F_OFD_SETLK, lock) == 0) return 0; -+ if (fcntl(fd, F_SETLK, lock) == 0) return 0; - if (errno != EINVAL) { - if (errno != EACCES && errno != EAGAIN) { - BAZEL_DIE(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR) -diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl -index ccb18a431a..0c5c8fd6f0 100644 ---- a/tools/cpp/unix_cc_configure.bzl -+++ b/tools/cpp/unix_cc_configure.bzl -@@ -379,7 +379,8 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools): - "", - False, - ), ":") -- gold_linker_path = _find_gold_linker_path(repository_ctx, cc) -+ #gold_linker_path = _find_gold_linker_path(repository_ctx, cc) -+ gold_linker_path = None - cc_path = repository_ctx.path(cc) - if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"): - # cc is outside the repository, set -B -@@ -468,7 +469,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools): - # Security hardening requires optimization. - # We need to undef it as some distributions now have it enabled by default. - "-U_FORTIFY_SOURCE", -- "-fstack-protector", -+ #"-fstack-protector", - # All warnings are enabled. Maybe enable -Werror as well? - "-Wall", - # Enable a few more warnings that aren't part of -Wall. diff --git a/var/spack/repos/builtin/packages/bazel/patch_for_fcc2.patch b/var/spack/repos/builtin/packages/bazel/patch_for_fcc2.patch deleted file mode 100644 index 709e5ee020..0000000000 --- a/var/spack/repos/builtin/packages/bazel/patch_for_fcc2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java -+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java -@@ -185,7 +185,7 @@ public class BazelRuleClassProvider { - - Map spackEnv = System.getenv(); - for (String envName : spackEnv.keySet()) { -- if (envName.startsWith("SPACK_")) { -+ if ((envName.startsWith("SPACK_")) || (envName.equals("fcc_ENV")) || (envName.equals("FCC_ENV"))) { - env.put(envName, spackEnv.get(envName)); - } - } diff --git a/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-0.29.1.patch b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-0.29.1.patch new file mode 100644 index 0000000000..376aeee2f2 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-0.29.1.patch @@ -0,0 +1,20 @@ +diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl +--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800 ++++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:53:17.000000000 -0700 +@@ -379,7 +379,7 @@ + "", + False, + ), ":") +- gold_linker_path = _find_gold_linker_path(repository_ctx, cc) ++ gold_linker_path = None + cc_path = repository_ctx.path(cc) + if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"): + # cc is outside the repository, set -B +@@ -468,7 +468,6 @@ + # Security hardening requires optimization. + # We need to undef it as some distributions now have it enabled by default. + "-U_FORTIFY_SOURCE", +- "-fstack-protector", + # All warnings are enabled. Maybe enable -Werror as well? + "-Wall", + # Enable a few more warnings that aren't part of -Wall. diff --git a/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.0.patch b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.0.patch new file mode 100644 index 0000000000..5f1304b724 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.0.patch @@ -0,0 +1,23 @@ +diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl +--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800 ++++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:35:14.000000000 -0700 +@@ -417,10 +417,7 @@ + bazel_linklibs, + False, + ), ":") +- gold_or_lld_linker_path = ( +- _find_linker_path(repository_ctx, cc, "lld", is_clang) or +- _find_linker_path(repository_ctx, cc, "gold", is_clang) +- ) ++ gold_or_lld_linker_path = None + cc_path = repository_ctx.path(cc) + if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"): + # cc is outside the repository, set -B +@@ -531,7 +528,6 @@ + # Security hardening requires optimization. + # We need to undef it as some distributions now have it enabled by default. + "-U_FORTIFY_SOURCE", +- "-fstack-protector", + # All warnings are enabled. Maybe enable -Werror as well? + "-Wall", + # Enable a few more warnings that aren't part of -Wall. diff --git a/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.2.patch b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.2.patch new file mode 100644 index 0000000000..f7ad3e3081 --- /dev/null +++ b/var/spack/repos/builtin/packages/bazel/unix_cc_configure_fj-5.2.patch @@ -0,0 +1,23 @@ +diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl +--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800 ++++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:58:26.945067883 -0700 +@@ -419,10 +419,7 @@ + bazel_linklibs, + False, + ), ":") +- gold_or_lld_linker_path = ( +- _find_linker_path(repository_ctx, cc, "lld", is_clang) or +- _find_linker_path(repository_ctx, cc, "gold", is_clang) +- ) ++ gold_or_lld_linker_path = None + cc_path = repository_ctx.path(cc) + if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"): + # cc is outside the repository, set -B +@@ -530,7 +527,6 @@ + "%{cxx_builtin_include_directories}": get_starlark_list(builtin_include_directories), + "%{compile_flags}": get_starlark_list( + [ +- "-fstack-protector", + # All warnings are enabled. Maybe enable -Werror as well? + "-Wall", + # Enable a few more warnings that aren't part of -Wall. -- cgit v1.2.3-70-g09d2