diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2023-09-08 09:25:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 09:25:50 +0200 |
commit | 39b9f214a8b633eaa18270e20564cd75078a792e (patch) | |
tree | de815688b73867492859aad87a2c77ca31f6918c /.github | |
parent | 7631b5ea14fb48f8859015b48fc379e06c9d4141 (diff) | |
download | spack-39b9f214a8b633eaa18270e20564cd75078a792e.tar.gz spack-39b9f214a8b633eaa18270e20564cd75078a792e.tar.bz2 spack-39b9f214a8b633eaa18270e20564cd75078a792e.tar.xz spack-39b9f214a8b633eaa18270e20564cd75078a792e.zip |
Speed-up `spack external find` execution (#39843)
* Perform external spec detection with multiple workers
The logic to perform external spec detection has been refactored
into classes. These classes use the GoF "template" pattern to account
for the small differences between searching for "executables" and
for "libraries", while unifying the larger part of the algorithm.
A ProcessPoolExecutor is used to parallelize the work.
* Speed-up external find by tagging detectable packages automatically
Querying packages by tag is much faster than inspecting the repository,
since tags are cached. This commit adds a "detectable" tag to every
package that implements the detection protocol, and external detection
uses it to search for packages.
* Pass package names instead of package classes to workers
The slowest part of the search is importing the Python modules
associated with candidate packages. The import is done serially
before we distribute the work to the pool of executors.
This commit pushes the import of the Python module to the job
performed by the workers, and passes just the name of the packages
to the executors.
In this way imports can be done in parallel.
* Rework unit-tests for Windows
Some unit tests were doing a full e2e run of a command
just to check a input handling. Make the test more
focused by just stressing a specific function.
Mark as xfailed 2 tests on Windows, that will be fixed
by a PR in the queue. The tests are failing because we
monkeypatch internals in the parent process, but the
monkeypatching is not done in the "spawned" child
process.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/windows_python.yml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/.github/workflows/windows_python.yml b/.github/workflows/windows_python.yml index a8cda5bd9a..ad1c0aad3c 100644 --- a/.github/workflows/windows_python.yml +++ b/.github/workflows/windows_python.yml @@ -75,6 +75,5 @@ jobs: - name: Build Test run: | spack compiler find - spack external find cmake - spack external find ninja + spack -d external find cmake ninja spack -d install abseil-cpp |