diff --git a/packages/bazel/apple-clang-14.0.3.patch b/packages/bazel/apple-clang-14.0.3.patch new file mode 100644 index 0000000000000000000000000000000000000000..c826951b5c9699a2fa9394a34a1faa34343b9b9e --- /dev/null +++ b/packages/bazel/apple-clang-14.0.3.patch @@ -0,0 +1,13 @@ +--- a/third_party/zlib/gzguts.h 1980-01-01 00:00:00 ++++ b/third_party/zlib/gzguts.h 2023-04-03 12:23:10 +@@ -3,6 +3,10 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + ++#ifndef _WIN32 ++ #include <unistd.h> ++#endif ++ + #ifdef _LARGEFILE64_SOURCE + # ifndef _LARGEFILE_SOURCE + # define _LARGEFILE_SOURCE 1 diff --git a/packages/bazel/bazelconfiguration-0.3.patch b/packages/bazel/bazelconfiguration-0.3.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6a974a98a9cbb6dd4118c3d056c61949571af07 --- /dev/null +++ b/packages/bazel/bazelconfiguration-0.3.patch @@ -0,0 +1,16 @@ +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java +@@ -150,6 +150,13 @@ + builder.put("PATH", null); + builder.put("LD_LIBRARY_PATH", null); + } ++ ++ Map<String, String> spackEnv = System.getenv(); ++ for (String envName : spackEnv.keySet()) { ++ if (envName.startsWith("SPACK_")) { ++ builder.put(envName, spackEnv.get(envName)); ++ } ++ } + } + + private static PathFragment determineShellExecutable(OS os, PathFragment fromOption) { diff --git a/packages/bazel/bazelruleclassprovider-0.14.patch b/packages/bazel/bazelruleclassprovider-0.14.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0aebdf359b6cd2e69bdca3820aa6faab9b03040 --- /dev/null +++ b/packages/bazel/bazelruleclassprovider-0.14.patch @@ -0,0 +1,16 @@ +--- 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 +@@ -168,6 +168,13 @@ public class BazelRuleClassProvider { + env.put("PATH", null); + } + ++ Map<String, String> spackEnv = System.getenv(); ++ for (String envName : spackEnv.keySet()) { ++ if (envName.startsWith("SPACK_")) { ++ env.put(envName, spackEnv.get(envName)); ++ } ++ } ++ + // Shell environment variables specified via options take precedence over the + // ones inherited from the fragments. In the long run, these fragments will + // be replaced by appropriate default rc files anyway. diff --git a/packages/bazel/bazelruleclassprovider-0.25.patch b/packages/bazel/bazelruleclassprovider-0.25.patch new file mode 100644 index 0000000000000000000000000000000000000000..0d68cd98d97c1a2ca718577f449605878d48af07 --- /dev/null +++ b/packages/bazel/bazelruleclassprovider-0.25.patch @@ -0,0 +1,16 @@ +--- 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 +@@ -181,6 +181,13 @@ public class BazelRuleClassProvider { + env.put("PATH", null); + } + ++ Map<String, String> spackEnv = System.getenv(); ++ for (String envName : spackEnv.keySet()) { ++ if (envName.startsWith("SPACK_")) { ++ env.put(envName, spackEnv.get(envName)); ++ } ++ } ++ + // Shell environment variables specified via options take precedence over the + // ones inherited from the fragments. In the long run, these fragments will + // be replaced by appropriate default rc files anyway. diff --git a/packages/bazel/bazelruleclassprovider_fj-0.25.patch b/packages/bazel/bazelruleclassprovider_fj-0.25.patch new file mode 100644 index 0000000000000000000000000000000000000000..709e5ee0202c07e6bc5b6202d654dbe2b97168a7 --- /dev/null +++ b/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<String, String> 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/packages/bazel/blaze_util_posix-0.29.1.patch b/packages/bazel/blaze_util_posix-0.29.1.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa773a33a5d7a4a87086c17b8cdb56b685e3c67c --- /dev/null +++ b/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/packages/bazel/build-0.29.1.patch b/packages/bazel/build-0.29.1.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3ed9ab254b253066ce37f9b0eb497ebb1e589d4 --- /dev/null +++ b/packages/bazel/build-0.29.1.patch @@ -0,0 +1,61 @@ +From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001 +From: Harsh Bhatia <bhatia4@llnl.gov> +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/packages/bazel/cc_configure-0.3.0.patch b/packages/bazel/cc_configure-0.3.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..79e12269a6bfeb05e684400a68450a9f3a709470 --- /dev/null +++ b/packages/bazel/cc_configure-0.3.0.patch @@ -0,0 +1,24 @@ +--- a/tools/cpp/cc_configure.bzl ++++ b/tools/cpp/cc_configure.bzl +@@ -173,8 +173,19 @@ + else: + inc_dirs = result.stderr[index1 + 1:index2].strip() + +- return [repository_ctx.path(_cxx_inc_convert(p)) +- for p in inc_dirs.split("\n")] ++ default_inc_directories = [ ++ repository_ctx.path(_cxx_inc_convert(p)) ++ for p in inc_dirs.split("\n") ++ ] ++ ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ default_inc_directories.append( ++ repository_ctx.path(_cxx_inc_convert(path)) ++ ) ++ ++ return default_inc_directories + + def _add_option_if_supported(repository_ctx, cc, option): + """Checks that `option` is supported by the C compiler.""" diff --git a/packages/bazel/cc_configure-0.5.0.patch b/packages/bazel/cc_configure-0.5.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..470986bec6650579a8a58951752fb0bfc43943a7 --- /dev/null +++ b/packages/bazel/cc_configure-0.5.0.patch @@ -0,0 +1,24 @@ +--- a/tools/cpp/cc_configure.bzl ++++ b/tools/cpp/cc_configure.bzl +@@ -200,8 +200,19 @@ + else: + inc_dirs = result.stderr[index1 + 1:index2].strip() + +- return [_escape_string(repository_ctx.path(_cxx_inc_convert(p))) +- for p in inc_dirs.split("\n")] ++ default_inc_directories = [ ++ _escape_string(repository_ctx.path(_cxx_inc_convert(p))) ++ for p in inc_dirs.split("\n") ++ ] ++ ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ default_inc_directories.append( ++ repository_ctx.path(_cxx_inc_convert(path)) ++ ) ++ ++ return default_inc_directories + + + def _add_option_if_supported(repository_ctx, cc, option): diff --git a/packages/bazel/compile-0.13.patch b/packages/bazel/compile-0.13.patch new file mode 100644 index 0000000000000000000000000000000000000000..13c82e7631bbcde85d0fd4301297166a32815721 --- /dev/null +++ b/packages/bazel/compile-0.13.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -92,7 +92,7 @@ + log "Building output/bazel" + # We set host and target platform directly since the defaults in @bazel_tools + # have not yet been generated. +-bazel_build "src:bazel${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \ + --host_platform=@bazel_tools//platforms:host_platform \ + --platforms=@bazel_tools//platforms:target_platform \ + || fail "Could not build Bazel" diff --git a/packages/bazel/compile-0.16.patch b/packages/bazel/compile-0.16.patch new file mode 100644 index 0000000000000000000000000000000000000000..f61f521a15b9affe110a6b8c703c6ad31c234fa0 --- /dev/null +++ b/packages/bazel/compile-0.16.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -92,7 +92,7 @@ display "." + log "Building output/bazel" + # We set host and target platform directly since the defaults in @bazel_tools + # have not yet been generated. +-bazel_build "src:bazel_nojdk${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \ + --host_platform=@bazel_tools//platforms:host_platform \ + --platforms=@bazel_tools//platforms:target_platform \ + || fail "Could not build Bazel" diff --git a/packages/bazel/compile-0.21.patch b/packages/bazel/compile-0.21.patch new file mode 100644 index 0000000000000000000000000000000000000000..d666a0f055ca04560c5cb0c885708b8c42acd794 --- /dev/null +++ b/packages/bazel/compile-0.21.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -92,7 +92,7 @@ display "." + log "Building output/bazel" + # We set host and target platform directly since the defaults in @bazel_tools + # have not yet been generated. +-bazel_build "src:bazel_nojdk${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \ + --action_env=PATH \ + --host_platform=@bazel_tools//platforms:host_platform \ + --platforms=@bazel_tools//platforms:target_platform \ diff --git a/packages/bazel/compile-0.29.patch b/packages/bazel/compile-0.29.patch new file mode 100644 index 0000000000000000000000000000000000000000..6cb2eb0b57277f39bbb6d7d3f372e8adfa27722e --- /dev/null +++ b/packages/bazel/compile-0.29.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -63,7 +63,7 @@ + log "Building output/bazel" + # We set host and target platform directly because we are building for the local + # host. +-bazel_build "src:bazel_nojdk${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \ + --action_env=PATH \ + --host_platform=@local_config_platform//:host \ + --platforms=@local_config_platform//:host \ diff --git a/packages/bazel/compile-0.3.patch b/packages/bazel/compile-0.3.patch new file mode 100644 index 0000000000000000000000000000000000000000..82db6efb6e86f766c169d93f11e8272385e30eba --- /dev/null +++ b/packages/bazel/compile-0.3.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -99,7 +99,7 @@ + new_step 'Building Bazel with Bazel' + display "." + log "Building output/bazel" +- bazel_build "src:bazel${EXE_EXT}" ++ CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" + cp -f "bazel-bin/src/bazel${EXE_EXT}" "output/bazel${EXE_EXT}" + chmod 0755 "output/bazel${EXE_EXT}" + BAZEL="$(pwd)/output/bazel${EXE_EXT}" diff --git a/packages/bazel/compile-0.4.patch b/packages/bazel/compile-0.4.patch new file mode 100644 index 0000000000000000000000000000000000000000..80eab26a88279781198f6a23e6ccf4675175dd45 --- /dev/null +++ b/packages/bazel/compile-0.4.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -124,7 +124,7 @@ + new_step 'Building Bazel with Bazel' + display "." + log "Building output/bazel" +- bazel_build "src:bazel${EXE_EXT}" \ ++ CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \ + || fail "Could not build Bazel" + bazel_bin_path="$(get_bazel_bin_path)/src/bazel${EXE_EXT}" + [ -e "$bazel_bin_path" ] \ diff --git a/packages/bazel/compile-0.6.patch b/packages/bazel/compile-0.6.patch new file mode 100644 index 0000000000000000000000000000000000000000..64eb408e5df8743d6083e904d7b3049575115c49 --- /dev/null +++ b/packages/bazel/compile-0.6.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -85,7 +85,7 @@ + log "Building output/bazel" + # We set host and target platform directly since the defaults in @bazel_tools + # have not yet been generated. +-bazel_build "src:bazel${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \ + --experimental_host_platform=//tools/platforms:host_platform \ + --experimental_platforms=//tools/platforms:target_platform \ + || fail "Could not build Bazel" diff --git a/packages/bazel/compile-0.9.patch b/packages/bazel/compile-0.9.patch new file mode 100644 index 0000000000000000000000000000000000000000..135de3a00fdadc3e1e4fa3b6d64d1da90f2ec67e --- /dev/null +++ b/packages/bazel/compile-0.9.patch @@ -0,0 +1,11 @@ +--- a/compile.sh ++++ b/compile.sh +@@ -92,7 +92,7 @@ + log "Building output/bazel" + # We set host and target platform directly since the defaults in @bazel_tools + # have not yet been generated. +-bazel_build "src:bazel${EXE_EXT}" \ ++CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \ + --host_platform=//tools/platforms:host_platform \ + --platforms=//tools/platforms:target_platform \ + || fail "Could not build Bazel" diff --git a/packages/bazel/cppcompileaction-0.3.0.patch b/packages/bazel/cppcompileaction-0.3.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..dd23972d9925de9b9631361ad5d7759e985f6d66 --- /dev/null +++ b/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/packages/bazel/cppcompileaction-0.3.2.patch b/packages/bazel/cppcompileaction-0.3.2.patch new file mode 100644 index 0000000000000000000000000000000000000000..c15d3bf64a180050bbdd00e59620f40b0fb2d168 --- /dev/null +++ b/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/packages/bazel/gcc11_1.patch b/packages/bazel/gcc11_1.patch new file mode 100644 index 0000000000000000000000000000000000000000..5868f20291ee13c0a8988b312c05e2e7f1fefa3c --- /dev/null +++ b/packages/bazel/gcc11_1.patch @@ -0,0 +1,12 @@ +diff --git a/third_party/ijar/zlib_client.h b/third_party/ijar/zlib_client.h +index ed6616362fcc..c4b051e0100c 100644 +--- a/third_party/ijar/zlib_client.h ++++ b/third_party/ijar/zlib_client.h +@@ -16,6 +16,7 @@ + #define THIRD_PARTY_IJAR_ZLIB_CLIENT_H_ + + #include <limits.h> ++#include <limits> + + #include "third_party/ijar/common.h" + diff --git a/packages/bazel/gcc11_2.patch b/packages/bazel/gcc11_2.patch new file mode 100644 index 0000000000000000000000000000000000000000..aac5b08b07348e4db69e4d76a715c49e52e5a32e --- /dev/null +++ b/packages/bazel/gcc11_2.patch @@ -0,0 +1,14 @@ +diff --git a/third_party/ijar/zlib_client.h b/third_party/ijar/zlib_client.h +index c4b051e0100c..0a917ff0a99a 100644 +--- a/third_party/ijar/zlib_client.h ++++ b/third_party/ijar/zlib_client.h +@@ -16,7 +16,9 @@ + #define THIRD_PARTY_IJAR_ZLIB_CLIENT_H_ + + #include <limits.h> ++ + #include <limits> ++#include <stdexcept> + + #include "third_party/ijar/common.h" + diff --git a/packages/bazel/gcc11_3.patch b/packages/bazel/gcc11_3.patch new file mode 100644 index 0000000000000000000000000000000000000000..78d24e768ebe18619cb624ae4dc0be1a6e5a855a --- /dev/null +++ b/packages/bazel/gcc11_3.patch @@ -0,0 +1,17 @@ +diff --git a/third_party/ijar/mapped_file_unix.cc b/third_party/ijar/mapped_file_unix.cc +index 6e3a90871844..65179e3290ec 100644 +--- a/third_party/ijar/mapped_file_unix.cc ++++ b/third_party/ijar/mapped_file_unix.cc +@@ -15,10 +15,11 @@ + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> +-#include <unistd.h> + #include <sys/mman.h> ++#include <unistd.h> + + #include <algorithm> ++#include <limits> + + #include "third_party/ijar/mapped_file.h" + diff --git a/packages/bazel/gcc11_4.patch b/packages/bazel/gcc11_4.patch new file mode 100644 index 0000000000000000000000000000000000000000..972c9035d648f9df6c6da75dd41c96318d95e3f8 --- /dev/null +++ b/packages/bazel/gcc11_4.patch @@ -0,0 +1,44 @@ +--- a/third_party/grpc/grpc_1.33.1.patch ++++ b/third_party/grpc/grpc_1.33.1.patch +@@ -58,6 +58,14 @@ index 09fcad95a2..9b737e5deb 100644 + ) + + native.bind( ++@@ -245,6 +245,7 @@ def grpc_deps(): ++ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", ++ "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", ++ ], +++ patches = ["@com_github_grpc_grpc//:third_party/abseil-cpp/absl.patch"], ++ ) ++ ++ if "bazel_toolchains" not in native.existing_rules(): + diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl + index 4c1dfad2e8..f63c54ddef 100644 + --- a/bazel/grpc_extra_deps.bzl +@@ -120,3 +128,25 @@ index c047f0c515..7c24fbc617 100644 + ":windows": "@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h", + ":android": "@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h", + "//conditions:default": "@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h", ++ ++--- /dev/null +++++ b/third_party/abseil-cpp/absl.patch ++@@ -0,0 +1,18 @@ +++0e2c62da1dcaf6529abab952bdcc96c6de2d9506 by Abseil Team <absl-team@google.com>: +++ +++Add missing <limits> include +++ +++PiperOrigin-RevId: 339054753 +++ +++-- +++ +++--- absl/synchronization/internal/graphcycles.cc ++++++ absl/synchronization/internal/graphcycles.cc +++@@ -37,6 +37,7 @@ +++ +++ #include <algorithm> +++ #include <array> ++++#include <limits> +++ #include "absl/base/internal/hide_ptr.h" +++ #include "absl/base/internal/raw_logging.h" +++ #include "absl/base/internal/spinlock.h" + diff --git a/packages/bazel/unix_cc_configure-0.10.patch b/packages/bazel/unix_cc_configure-0.10.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdd24e1152b5ac76c027690b720068550c9ef8e6 --- /dev/null +++ b/packages/bazel/unix_cc_configure-0.10.patch @@ -0,0 +1,22 @@ +--- a/tools/cpp/unix_cc_configure.bzl ++++ b/tools/cpp/unix_cc_configure.bzl +@@ -147,9 +147,18 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, additional_flags = []): + else: + inc_dirs = result.stderr[index1 + 1:index2].strip() + +- return [_prepare_include_path(repository_ctx, _cxx_inc_convert(p)) +- for p in inc_dirs.split("\n")] ++ default_inc_directories = [ ++ _prepare_include_path(repository_ctx, _cxx_inc_convert(p)) ++ for p in inc_dirs.split("\n") ++ ] ++ ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ default_inc_directories.append(path) ++ ++ return default_inc_directories + + + def _is_option_supported(repository_ctx, cc, option): diff --git a/packages/bazel/unix_cc_configure-0.15.patch b/packages/bazel/unix_cc_configure-0.15.patch new file mode 100644 index 0000000000000000000000000000000000000000..74fd8bfb79b868dc2f8a9d0ac83fdd878b432495 --- /dev/null +++ b/packages/bazel/unix_cc_configure-0.15.patch @@ -0,0 +1,22 @@ +--- a/tools/cpp/unix_cc_configure.bzl ++++ b/tools/cpp/unix_cc_configure.bzl +@@ -145,11 +145,18 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, lang_flag, additional_fl + else: + inc_dirs = result.stderr[index1 + 1:index2].strip() + +- return [ ++ default_inc_directories = [ + _prepare_include_path(repository_ctx, _cxx_inc_convert(p)) + for p in inc_dirs.split("\n") + ] + ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ default_inc_directories.append(path) ++ ++ return default_inc_directories ++ + def _is_compiler_option_supported(repository_ctx, cc, option): + """Checks that `option` is supported by the C compiler. Doesn't %-escape the option.""" + result = repository_ctx.execute([ diff --git a/packages/bazel/unix_cc_configure-0.5.3.patch b/packages/bazel/unix_cc_configure-0.5.3.patch new file mode 100644 index 0000000000000000000000000000000000000000..79b583ba84606d75fa35797229e08f723f538dc6 --- /dev/null +++ b/packages/bazel/unix_cc_configure-0.5.3.patch @@ -0,0 +1,24 @@ +--- a/tools/cpp/unix_cc_configure.bzl ++++ b/tools/cpp/unix_cc_configure.bzl +@@ -117,9 +117,19 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc): + else: + inc_dirs = result.stderr[index1 + 1:index2].strip() + +- return [escape_string(repository_ctx.path(_cxx_inc_convert(p))) +- for p in inc_dirs.split("\n")] ++ default_inc_directories = [ ++ escape_string(repository_ctx.path(_cxx_inc_convert(p))) ++ for p in inc_dirs.split("\n") ++ ] + ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ default_inc_directories.append( ++ repository_ctx.path(_cxx_inc_convert(path)) ++ ) ++ ++ return default_inc_directories + + def _add_option_if_supported(repository_ctx, cc, option): + """Checks that `option` is supported by the C compiler. Doesn't %-escape the option.""" diff --git a/packages/bazel/unix_cc_configure-3.0.patch b/packages/bazel/unix_cc_configure-3.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..1140b0c306c5ef89519d5b82767e18c34a5119f7 --- /dev/null +++ b/packages/bazel/unix_cc_configure-3.0.patch @@ -0,0 +1,19 @@ +diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl +index 5feb10b76a..cde0b8f8f1 100644 +--- a/tools/cpp/unix_cc_configure.bzl ++++ b/tools/cpp/unix_cc_configure.bzl +@@ -151,8 +151,14 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, lang_flag, additional_fl + ).stdout.strip() + "/share" + inc_directories.append(_prepare_include_path(repository_ctx, resource_dir)) + ++ env = repository_ctx.os.environ ++ if "SPACK_INCLUDE_DIRS" in env: ++ for path in env["SPACK_INCLUDE_DIRS"].split(":"): ++ inc_directories.append(path) ++ + return inc_directories + ++ + def _is_compiler_option_supported(repository_ctx, cc, option): + """Checks that `option` is supported by the C compiler. Doesn't %-escape the option.""" + result = repository_ctx.execute([ diff --git a/packages/bazel/unix_cc_configure_fj-0.29.1.patch b/packages/bazel/unix_cc_configure_fj-0.29.1.patch new file mode 100644 index 0000000000000000000000000000000000000000..376aeee2f20e04562d1f13a2c86e9af7d05f034b --- /dev/null +++ b/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/packages/bazel/unix_cc_configure_fj-5.0.patch b/packages/bazel/unix_cc_configure_fj-5.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f1304b7247904f64b41968b198bc62af63bdea7 --- /dev/null +++ b/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/packages/bazel/unix_cc_configure_fj-5.2.patch b/packages/bazel/unix_cc_configure_fj-5.2.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7ad3e30815341d95f305e2dfa2a8b4fdbd9dbde --- /dev/null +++ b/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.