-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Mark a package as non-relocatable #7237
Description
This is a feature request to add the possibility to mark packages as non-relocatable.
We have since a while the possibility to build binary caches of packages that have been installed. This enhances a lot the user the experience, as the installation time may be dramatically reduced for specs whose binary artifacts are available.
However not all the packages may be relocated. The simplest example that comes to my mind is packages that have absolute paths hardcoded somewhere (maybe in a config.h file that gets generated at configure or build time).
What I propose here is to be able to mark packages as non-relocatable:
class EnvironmentModules(Package):
relocatable = False
...and that should have the effect of skipping this node when creating the binary cache of the DAG (thus enforcing a source build).
Expected Result
The binary cache of a dependency DAG containing nodes that are not relocatable should enforce building those nodes from sources.
Actual Result
Sometimes we put in cache packages that are not relocatable, and that may cause failures at run-time:
$ spack install --use-cache environment-modules
...
==> Installing environment-modules
==> Searching for binary cache of environment-modules
==> Installing environment-modules from binary cache
==> Fetching http://0.0.0.0:32679/build_cache/linux-ubuntu14.04-x86_64/gcc-4.8/environment-modules-3.2.10/linux-ubuntu14.04-x86_64-gcc-4.8-environment-modules-3.2.10-bwjr7qmyssvp2bjk2jnqw75c2qqedrde.spack
######################################################################## 100,0%
gpg: Signature made ven 09 feb 2018 22:03:38 CET using RSA key ID A1A440B6
gpg: Good signature from "Massimiliano Culpo (GPG created for Spack) <[email protected]>"
==> Relocating package from
/home/spack/opt/spack to /home/mculpo/PycharmProjects/spack/opt/spack.
==> Successfully installed environment-modules from binary cache
[+] /home/mculpo/PycharmProjects/spack/opt/spack/linux-ubuntu14.04-x86_64/gcc-4.8/environment-modules-3.2.10-bwjr7qmyssvp2bjk2jnqw75c2qqedrde
$ . share/spack/setup-env.sh
$ module av
init.c(556):ERROR:161: Cannot initialize TCL