bootstrap: fix bootstrapping GnuPG from different macOS versions (#28350)
This commit is contained in:
parent
38fee7e0da
commit
91fc4cf28f
@ -575,7 +575,9 @@ def ensure_executables_in_path_or_raise(executables, abstract_spec):
|
||||
root=True, order='post', deptype=('link', 'run')
|
||||
):
|
||||
env_mods.extend(
|
||||
spack.user_environment.environment_modifications_for_spec(dep)
|
||||
spack.user_environment.environment_modifications_for_spec(
|
||||
dep, set_package_py_globals=False
|
||||
)
|
||||
)
|
||||
cmd.add_default_envmod(env_mods)
|
||||
return cmd
|
||||
|
@ -856,7 +856,9 @@ def _make_runnable(pkg, env):
|
||||
env.prepend_path('PATH', bin_dir)
|
||||
|
||||
|
||||
def modifications_from_dependencies(spec, context, custom_mods_only=True):
|
||||
def modifications_from_dependencies(
|
||||
spec, context, custom_mods_only=True, set_package_py_globals=True
|
||||
):
|
||||
"""Returns the environment modifications that are required by
|
||||
the dependencies of a spec and also applies modifications
|
||||
to this spec's package at module scope, if need be.
|
||||
@ -889,6 +891,11 @@ def modifications_from_dependencies(spec, context, custom_mods_only=True):
|
||||
spec (spack.spec.Spec): spec for which we want the modifications
|
||||
context (str): either 'build' for build-time modifications or 'run'
|
||||
for run-time modifications
|
||||
custom_mods_only (bool): if True returns only custom modifications, if False
|
||||
returns custom and default modifications
|
||||
set_package_py_globals (bool): whether or not to set the global variables in the
|
||||
package.py files (this may be problematic when using buildcaches that have
|
||||
been built on a different but compatible OS)
|
||||
"""
|
||||
if context not in ['build', 'run', 'test']:
|
||||
raise ValueError(
|
||||
@ -962,7 +969,8 @@ def add_modifications_for_dep(dep):
|
||||
# PKG_CONFIG_PATH)
|
||||
if dep in custom_mod_deps:
|
||||
dpkg = dep.package
|
||||
set_module_variables_for_package(dpkg)
|
||||
if set_package_py_globals:
|
||||
set_module_variables_for_package(dpkg)
|
||||
# Allow dependencies to modify the module
|
||||
dpkg.setup_dependent_package(spec.package.module, spec)
|
||||
if context == 'build':
|
||||
|
@ -65,11 +65,19 @@ def unconditional_environment_modifications(view):
|
||||
return env
|
||||
|
||||
|
||||
def environment_modifications_for_spec(spec, view=None):
|
||||
def environment_modifications_for_spec(spec, view=None, set_package_py_globals=True):
|
||||
"""List of environment (shell) modifications to be processed for spec.
|
||||
|
||||
This list is specific to the location of the spec or its projection in
|
||||
the view."""
|
||||
the view.
|
||||
|
||||
Args:
|
||||
spec (spack.spec.Spec): spec for which to list the environment modifications
|
||||
view: view associated with the spec passed as first argument
|
||||
set_package_py_globals (bool): whether or not to set the global variables in the
|
||||
package.py files (this may be problematic when using buildcaches that have
|
||||
been built on a different but compatible OS)
|
||||
"""
|
||||
spec = spec.copy()
|
||||
if view and not spec.external:
|
||||
spec.prefix = prefix.Prefix(view.get_projection_for_spec(spec))
|
||||
@ -86,12 +94,13 @@ def environment_modifications_for_spec(spec, view=None):
|
||||
# before asking for package-specific modifications
|
||||
env.extend(
|
||||
spack.build_environment.modifications_from_dependencies(
|
||||
spec, context='run'
|
||||
spec, context='run', set_package_py_globals=set_package_py_globals
|
||||
)
|
||||
)
|
||||
|
||||
# Package specific modifications
|
||||
spack.build_environment.set_module_variables_for_package(spec.package)
|
||||
if set_package_py_globals:
|
||||
spack.build_environment.set_module_variables_for_package(spec.package)
|
||||
|
||||
spec.package.setup_run_environment(env)
|
||||
|
||||
return env
|
||||
|
Loading…
Reference in New Issue
Block a user