spack/lib/spack
Peter Scheibel 916cdfbb56
Environment modifications: de-prioritize external packages (#23824)
Prior to any Spack build, Spack modifies PATH etc. to help the build
find the dependencies it needs. It also allows any package to define
custom environment modifications (and furthermore a package can
specify environment modifications to apply when it is used as a
dependency). If an external package defines custom environment
modifications that alter PATH, and the external package is in a merged
or system prefix, then that prefix could "override" the Spack-built
packages.

This commit reorders environment modifications so that PrependPath
actions which expose Spack-built packages override PrependPath actions
for custom environment modifications of external packages.

In more detail, the original order of environment modifications is:

* Modules
* Compiler flag variables
* PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH for dependencies
* Custom package.py modifications in the following order:
  * dependencies
  * root

This commit changes the order:

* Modules
* Compiler flag variables
* For each external dependency
  * PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH modifications
  * Custom modifications
* For each Spack-built dependency
  * PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH modifications
  * Custom modifications
2021-06-24 16:13:46 -07:00
..
docs Implement CVS fetcher (#23212) 2021-06-22 09:51:31 -07:00
env cc: change mode to ccld for loopopt edit (#23482) 2021-05-13 21:31:20 -07:00
external spack: update archspec 2021-05-20 14:56:04 -07:00
llnl Log performance improvement (#23925) 2021-05-31 20:33:14 -07:00
spack Environment modifications: de-prioritize external packages (#23824) 2021-06-24 16:13:46 -07:00