Compare commits

...

4 Commits

Author SHA1 Message Date
trws
ddc5dc7da3 [@spackbot] updating style on behalf of trws 2023-11-06 19:57:13 +00:00
Tom Scogland
0663ac3633 compilers set in run env shouldn't impact build
Adds `drop` to EnvironmentModifications courtesy of @haampie, and uses
it to clear modifications of CC, CXX, F77 and FC made by
`setup_{,dependent_}run_environment` routines when producing an
environment in BUILD context.
2023-11-06 11:48:42 -08:00
Tom Scogland
f80df0ca47 select the system certificates more reliably
The rust build requires cargo to connect to its servers, it needs system
certificates to connect through MITM proxies or other various issues in
corporate systems.  This searches for more common locations to find
those certificates and the name used by RHEL in addition to the usual
debian convention.  Fixes rust build on TOSS4.
2023-11-06 11:46:00 -08:00
Tom Scogland
367abcb801 ignore missing python bindings in llvm 17+
The python bindings to llvm have been removed in version 17, but those
in the clang portion of the project still exist.  This ignores the now
missing llvm bindings but retains the variant to control installing the
clang bindings.
2023-11-06 11:44:38 -08:00
4 changed files with 34 additions and 5 deletions

View File

@ -1016,10 +1016,16 @@ def get_env_modifications(self) -> EnvironmentModifications:
self._make_runnable(dspec, env)
if self.should_setup_run_env & flag:
run_env_mods = EnvironmentModifications()
for spec in dspec.dependents(deptype=dt.LINK | dt.RUN):
if id(spec) in self.nodes_in_subdag:
pkg.setup_dependent_run_environment(env, spec)
pkg.setup_run_environment(env)
pkg.setup_dependent_run_environment(run_env_mods, spec)
pkg.setup_run_environment(run_env_mods)
run_env_dict = run_env_mods.group_by_name()
if self.context == Context.BUILD:
run_env_mods.drop("CC", "CXX", "F77", "FC")
env.extend(run_env_mods)
return env
def _make_buildtime_detectable(self, dep: spack.spec.Spec, env: EnvironmentModifications):

View File

@ -596,6 +596,14 @@ def group_by_name(self) -> Dict[str, ModificationList]:
modifications[item.name].append(item)
return modifications
def drop(self, *name) -> bool:
"""Drop all modifications to the variable with the given name."""
old_mods = self.env_modifications
new_mods = [x for x in self.env_modifications if x.name not in name]
self.env_modifications = new_mods
return len(old_mods) != len(new_mods)
def is_unset(self, variable_name: str) -> bool:
"""Returns True if the last modification to a variable is to unset it, False otherwise."""
modifications = self.group_by_name()

View File

@ -977,7 +977,9 @@ def post_install(self):
ninja()
ninja("install")
if "+python" in self.spec:
install_tree("llvm/bindings/python", python_platlib)
if spec.version < Version("17.0.0"):
# llvm bindings were removed in v17: https://releases.llvm.org/17.0.1/docs/ReleaseNotes.html#changes-to-the-python-bindings
install_tree("llvm/bindings/python", python_platlib)
if "+clang" in self.spec:
install_tree("clang/bindings/python", python_platlib)

View File

@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
from spack.package import *
@ -92,8 +93,20 @@ def setup_build_environment(self, env):
env.set("AR", ar.path)
# Manually inject the path of openssl's certs for build.
certs = join_path(self.spec["openssl"].prefix, "etc/openssl/cert.pem")
env.set("CARGO_HTTP_CAINFO", certs)
certs = None
for p in (
"etc/openssl/cert.pem",
"../etc/openssl/cert.pem",
"etc/ssl/certs/ca-bundle.crt",
"../etc/ssl/certs/ca-bundle.crt",
):
certs = join_path(self.spec["openssl"].prefix, p)
if os.path.exists(certs):
break
else:
certs = None
if certs is not None:
env.set("CARGO_HTTP_CAINFO", certs)
def configure(self, spec, prefix):
opts = []