spack/var/spack/repos/builtin/packages/bazel/unix_cc_configure-0.5.3.patch
Sinan 448e09e5b2 Add latest version of bazel (#13813)
* use bazel commit in #13112, and add version 0.24.1, and corresponding cc_env patch

* undo preferred java version by dodo47

* patch for v0.26

* Update install steps

* Add patches for more versions

* Add unit tests

* Update patches for new Spack env vars

* env is already defined, use spackEnv
2019-11-25 11:59:12 -06:00

25 lines
885 B
Diff

--- 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."""