Steps to reproduce
Create an env in cd $(mktemp -d):
spack:
view: true
specs: [zlib]
config:
install_tree:
root: ./here
Run spack python
In [1]: from spack.environment import Environment, activate
In [2]: e = Environment(".")
In [3]: activate(e)
In [4]: e.concretize()
In [5]: e.install_all()
In [6]: e.all_specs()
Out[7]: []
And all_specs() is empty, because install_all() rereads the spack.yaml file from disk right here:
|
with self.write_transaction(): |
and no spack.lock was stored because I didn't call e.write() anywhere.
It'd be great if these simple operations did not depend on the filesystem at all... Clearly views write to the environment, but arbitrarily "clearing" the current environment and de-serializing it from disk is very unexpected.
Error message
none
Information on your system
- Spack: 0.16.2-3959-220a87812c
- Python: 3.8.11
- Platform: linux-ubuntu20.04-zen2
- Concretizer: clingo
General information
Steps to reproduce
Create an env in
cd $(mktemp -d):Run
spack pythonAnd
all_specs()is empty, becauseinstall_all()rereads the spack.yaml file from disk right here:spack/lib/spack/spack/environment.py
Line 1534 in d52a1b8
and no spack.lock was stored because I didn't call
e.write()anywhere.It'd be great if these simple operations did not depend on the filesystem at all... Clearly views write to the environment, but arbitrarily "clearing" the current environment and de-serializing it from disk is very unexpected.
Error message
none
Information on your system
General information
spack debug reportand reported the version of Spack/Python/Platform