Bootstrap most of Spack dependencies using environments#34029
Bootstrap most of Spack dependencies using environments#34029alalazo merged 23 commits intospack:developfrom
Conversation
|
A few notes in addition to the description:
|
|
@alalazo I agree with you that there are a lot of dangers in mixing the stores. I would primarily like to reuse the bootstrapped dependencies from
|
spack/lib/spack/spack/bootstrap/core.py Lines 5 to 23 in d5142d1
To be clear:
Footnotes
|
| "-C", | ||
| str(self.environment_root()), | ||
| "-j", | ||
| str(spack.build_environment.determine_number_of_jobs(parallel=True)), |
There was a problem hiding this comment.
One issue here is that it will regenerate the view for every package being installed
There was a problem hiding this comment.
This is in any case much faster than a serial installation, so I guess we can optimize later to generate a depfile that can install without generating the view?1
Footnotes
-
It's also ugly that we have to spawn another process to generate the Makefile, but given the difference in performance I think it's preferable to
env.install_all(). ↩
3a3ebef to
c22012b
Compare
753d836 to
f415929
Compare
lib/spack/spack/bootstrap/config.py
Outdated
| with spack.environment.no_active_environment(): | ||
| with spack.platforms.prevent_cray_detection(): | ||
| with spack.platforms.use_platform(spack.platforms.real_host()): | ||
| with spack.repo.use_repositories(spack.paths.packages_path): | ||
| with spack.store.use_store(bootstrap_store_path): |
There was a problem hiding this comment.
Thoughts on maybe collapsing this to a single with statement with multiple values? The semantics are the same, but avoiding the extra four levels of nesting might be nice.
|
All my testing shows this working well, mac, linux, arm, x86, I have yet to find a problem with bootstrapping. The one thing that struck me as a bit odd though, I'm getting output describing what's going to be built after it's built rather than before but I'm not seeing obviously why that is: |
|
Took me a while to find, but the unit tests failing here are because some environment modification leak, fixed in b8f0964, of tests running before them. The unit tests have been modified in #30882
That's because |
|
Got it, doing some more testing, but I'm reminded of a related bootstrap question. Do we need to keep using a development version of clingo? As it is, we're forcing an increase in build dependencies to do it, is there no release new enough to get rid of the re2c and bison dependencies? Especially with an external cmake and python available, the size of the build set is substantially larger because of it: |
This is a hack to install from wheels two Python packages. We might do better in the future.
For some reason to be debugged later this triggers an in-memory bug with the first installation with env.install_all(). To be investigated why the bug is triggered.
b8f0964 to
49df9dc
Compare
|
@trws Is there any further request for changes? |
|
I don't see any more problems with this, but now that core bootstrap is split out it looks like it should be a great deal easier to solve the bootstrap locking problem. In fact I think you have solved it for everything but the core set because of the way the environment install works. Would you be willing to take a stab at adding locking to the bootstrap.core end, perhaps shortly after this merges? |
Sure! |
|
@spackbot run pipeline |
|
I've started that pipeline for you! |
|
Merging, since the spec only that is reported broken is also broken in develop, see https://gitlab.spack.io/spack/spack/-/jobs/4817633 |
|
I'll work on fixing that spec next. For the record the pipeline finished here https://gitlab.spack.io/spack/spack/-/pipelines/233092 and so far never reported back to the PR status: |
This commit reworks the bootstrapping procedure to use Spack environments as much as possible. The `spack.bootstrap` module has also been reorganized into a Python package. A distinction is made among "core" Spack dependencies (clingo, GnuPG, patchelf) and other dependencies. For a number of reasons, explained in the `spack.bootstrap.core` module docstring, "core" dependencies are bootstrapped with the current ad-hoc method. All the other dependencies are instead bootstrapped using a Spack environment that lives in a directory specific to the interpreter and the architecture being used.

The main objective of this PR is to rework the bootstrapping procedure to use Spack environments as much as possible.
While doing so, the
spack.bootstrapmodule has been reorganized into a Python package. For reviewers, the new code is underspack.bootstrap.environment(most of the other changes are just adding docs or linting).In this PR a distinction is made among "core" Spack dependencies (clingo, GnuPG, patchelf) and other dependencies. For a number of reasons, explained in the
spack.bootstrap.coremodule docstring, "core" dependencies are bootstrapped with the current ad-hoc method. All the other dependencies are instead bootstrapped using a Spack environment that lives in a directory specific to the interpreter and the architecture being used. An example of the directory structure is:The bootstrapping output has been reduced and now looks like:

Modifications:
pytestto the list of bootstrapped dependencies--devargument tospack bootstrap nowspack.bootstrapinto a package and linted it