Compare commits
175 Commits
develop-20
...
isolate-ut
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ba62db9add | ||
![]() |
aef5c35065 | ||
![]() |
7ee62d8202 | ||
![]() |
1ff78a7959 | ||
![]() |
0b92a19620 | ||
![]() |
ee36214f83 | ||
![]() |
4516b742dd | ||
![]() |
6e24ea55ea | ||
![]() |
bc06e2bc17 | ||
![]() |
330a5c0010 | ||
![]() |
1f0a8755c7 | ||
![]() |
425d3ba8a6 | ||
![]() |
2972dea418 | ||
![]() |
953209fe2d | ||
![]() |
1d07e4cb8d | ||
![]() |
3fd543328b | ||
![]() |
30cafc553a | ||
![]() |
3a6ad72ac1 | ||
![]() |
736c46e22d | ||
![]() |
a543fd79f1 | ||
![]() |
ab50aa61db | ||
![]() |
d06a102e69 | ||
![]() |
b0f0d2f1fb | ||
![]() |
6029b600f0 | ||
![]() |
e6107e336c | ||
![]() |
9ef57c3c86 | ||
![]() |
3b021bb4ac | ||
![]() |
42bac83c2e | ||
![]() |
7e38e9e515 | ||
![]() |
cf5ffedc23 | ||
![]() |
3a9aea753d | ||
![]() |
c61da8381c | ||
![]() |
8de814eddf | ||
![]() |
c9341a2532 | ||
![]() |
8b202b3fb2 | ||
![]() |
2ecc260e0e | ||
![]() |
6130fe8f57 | ||
![]() |
d3aa7a620e | ||
![]() |
2794e14870 | ||
![]() |
cc1e990c7e | ||
![]() |
59e6b0b100 | ||
![]() |
ec53d02814 | ||
![]() |
389c77cf83 | ||
![]() |
17c87b4c29 | ||
![]() |
91453c5ba0 | ||
![]() |
a587a10c86 | ||
![]() |
cfe77fcd90 | ||
![]() |
6cf36a1817 | ||
![]() |
ee40cfa830 | ||
![]() |
04f64d4ac6 | ||
![]() |
779fef7d41 | ||
![]() |
5be3ca396b | ||
![]() |
e420441bc2 | ||
![]() |
a039dc16fa | ||
![]() |
b31c89b110 | ||
![]() |
bc4f3d6cbd | ||
![]() |
40209506b7 | ||
![]() |
6ff07c7753 | ||
![]() |
d874c6d79c | ||
![]() |
927e739e0a | ||
![]() |
dd607d11d5 | ||
![]() |
d436e97fc6 | ||
![]() |
f3983d60c2 | ||
![]() |
40e705d39e | ||
![]() |
d92457467a | ||
![]() |
4c2734fe14 | ||
![]() |
34d791189d | ||
![]() |
eec9eced1b | ||
![]() |
3bc8a7aa5f | ||
![]() |
3b045c289d | ||
![]() |
4b93c57d44 | ||
![]() |
377e7de0d2 | ||
![]() |
0a9c84dd25 | ||
![]() |
2ececcd03e | ||
![]() |
f4f67adf49 | ||
![]() |
220898b4de | ||
![]() |
450f938056 | ||
![]() |
889b729e52 | ||
![]() |
3987604b89 | ||
![]() |
b6f8cb821c | ||
![]() |
72216b503f | ||
![]() |
c06f353f55 | ||
![]() |
367ca3f0ec | ||
![]() |
2c4bc287b8 | ||
![]() |
fcb3d62093 | ||
![]() |
306377684b | ||
![]() |
29b75a7ace | ||
![]() |
4b41b11c30 | ||
![]() |
92e0d42b64 | ||
![]() |
1ebd37d20c | ||
![]() |
b719c905f1 | ||
![]() |
430b2dff5c | ||
![]() |
ef8e6a969c | ||
![]() |
0e65e84768 | ||
![]() |
e0da7154ad | ||
![]() |
6f08daf670 | ||
![]() |
c2d29ca38c | ||
![]() |
f037ef7451 | ||
![]() |
f84557a81b | ||
![]() |
18efd808da | ||
![]() |
5299b84319 | ||
![]() |
70fb0b35e5 | ||
![]() |
4f7f3cbbdf | ||
![]() |
4205ac74e8 | ||
![]() |
72ed14e4a9 | ||
![]() |
ed54359454 | ||
![]() |
ea610d3fe2 | ||
![]() |
cd33becebc | ||
![]() |
8ccfe9f710 | ||
![]() |
abc294e3a2 | ||
![]() |
c482534c1d | ||
![]() |
fbec91e491 | ||
![]() |
3d744e7c95 | ||
![]() |
b4bafbbf7e | ||
![]() |
bd3a1d28bf | ||
![]() |
e0ef78b26e | ||
![]() |
d768e6ea5c | ||
![]() |
8d0e0d5c77 | ||
![]() |
13b711f620 | ||
![]() |
d76a774957 | ||
![]() |
ee8e40003b | ||
![]() |
dc715d9840 | ||
![]() |
89173b6d24 | ||
![]() |
848d270548 | ||
![]() |
ea347b6468 | ||
![]() |
b1b4ef6d1b | ||
![]() |
c564b2d969 | ||
![]() |
343517e794 | ||
![]() |
6fff0d4aed | ||
![]() |
34bce3f490 | ||
![]() |
7cb70e3258 | ||
![]() |
df777dbbaa | ||
![]() |
f28ccae3df | ||
![]() |
ecdc296ef8 | ||
![]() |
9b5c85e919 | ||
![]() |
ea8dcb73db | ||
![]() |
089e117904 | ||
![]() |
1456d9b727 | ||
![]() |
c485709f62 | ||
![]() |
7db386a018 | ||
![]() |
92d076e683 | ||
![]() |
f70ef51f1a | ||
![]() |
e9d968d95f | ||
![]() |
918d6baed4 | ||
![]() |
624df2a1bb | ||
![]() |
ee0d3a3be2 | ||
![]() |
de64ce5541 | ||
![]() |
f556e52bf6 | ||
![]() |
81e7d39bd2 | ||
![]() |
61055d9ee5 | ||
![]() |
c1a8bb2a12 | ||
![]() |
7e9ddca0ff | ||
![]() |
7cad4bb8d9 | ||
![]() |
2d71c6bb8e | ||
![]() |
285de8ad4d | ||
![]() |
89a0ea01a7 | ||
![]() |
e49f55ba53 | ||
![]() |
3c54177c5d | ||
![]() |
24a38e6782 | ||
![]() |
3cf7f7b800 | ||
![]() |
d7e756a26b | ||
![]() |
721f15bbeb | ||
![]() |
efa316aafa | ||
![]() |
6ac23545ec | ||
![]() |
432f5d64e3 | ||
![]() |
f2192a48ce | ||
![]() |
70bed662fc | ||
![]() |
ae38987cb4 | ||
![]() |
b361ffbe22 | ||
![]() |
964440a08b | ||
![]() |
aeb1bec8f3 | ||
![]() |
cf163eecc5 | ||
![]() |
7ec62d117e | ||
![]() |
5154d69629 | ||
![]() |
d272c49fb6 |
2
.github/workflows/build-containers.yml
vendored
2
.github/workflows/build-containers.yml
vendored
@@ -57,7 +57,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
|
||||
|
||||
- uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
|
||||
- uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3
|
||||
id: docker_meta
|
||||
with:
|
||||
images: |
|
||||
|
4
.github/workflows/style/requirements.txt
vendored
4
.github/workflows/style/requirements.txt
vendored
@@ -2,6 +2,6 @@ black==23.11.0
|
||||
clingo==5.6.2
|
||||
flake8==6.1.0
|
||||
isort==5.12.0
|
||||
mypy==1.6.1
|
||||
mypy==1.7.1
|
||||
types-six==1.16.21.9
|
||||
vermin==1.5.2
|
||||
vermin==1.6.0
|
||||
|
2
.github/workflows/unit_tests.yaml
vendored
2
.github/workflows/unit_tests.yaml
vendored
@@ -215,7 +215,7 @@ jobs:
|
||||
$(which spack) bootstrap disable spack-install
|
||||
$(which spack) solve zlib
|
||||
common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
|
||||
$(which spack) unit-test --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
|
||||
$(which spack) unit-test --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
|
||||
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|
||||
with:
|
||||
flags: unittests,macos
|
||||
|
287
CHANGELOG.md
287
CHANGELOG.md
@@ -1,3 +1,290 @@
|
||||
# v0.21.0 (2023-11-11)
|
||||
|
||||
`v0.21.0` is a major feature release.
|
||||
|
||||
## Features in this release
|
||||
|
||||
1. **Better error messages with condition chaining**
|
||||
|
||||
In v0.18, we added better error messages that could tell you what problem happened,
|
||||
but they couldn't tell you *why* it happened. `0.21` adds *condition chaining* to the
|
||||
solver, and Spack can now trace back through the conditions that led to an error and
|
||||
build a tree of causes potential causes and where they came from. For example:
|
||||
|
||||
```console
|
||||
$ spack solve hdf5 ^cmake@3.0.1
|
||||
==> Error: concretization failed for the following reasons:
|
||||
|
||||
1. Cannot satisfy 'cmake@3.0.1'
|
||||
2. Cannot satisfy 'cmake@3.0.1'
|
||||
required because hdf5 ^cmake@3.0.1 requested from CLI
|
||||
3. Cannot satisfy 'cmake@3.18:' and 'cmake@3.0.1
|
||||
required because hdf5 ^cmake@3.0.1 requested from CLI
|
||||
required because hdf5 depends on cmake@3.18: when @1.13:
|
||||
required because hdf5 ^cmake@3.0.1 requested from CLI
|
||||
4. Cannot satisfy 'cmake@3.12:' and 'cmake@3.0.1
|
||||
required because hdf5 depends on cmake@3.12:
|
||||
required because hdf5 ^cmake@3.0.1 requested from CLI
|
||||
required because hdf5 ^cmake@3.0.1 requested from CLI
|
||||
```
|
||||
|
||||
More details in #40173.
|
||||
|
||||
2. **OCI build caches**
|
||||
|
||||
You can now use an arbitrary [OCI](https://opencontainers.org) registry as a build
|
||||
cache:
|
||||
|
||||
```console
|
||||
$ spack mirror add my_registry oci://user/image # Dockerhub
|
||||
$ spack mirror add my_registry oci://ghcr.io/haampie/spack-test # GHCR
|
||||
$ spack mirror set --push --oci-username ... --oci-password ... my_registry # set login creds
|
||||
$ spack buildcache push my_registry [specs...]
|
||||
```
|
||||
|
||||
And you can optionally add a base image to get *runnable* images:
|
||||
|
||||
```console
|
||||
$ spack buildcache push --base-image ubuntu:23.04 my_registry python
|
||||
Pushed ... as [image]:python-3.11.2-65txfcpqbmpawclvtasuog4yzmxwaoia.spack
|
||||
|
||||
$ docker run --rm -it [image]:python-3.11.2-65txfcpqbmpawclvtasuog4yzmxwaoia.spack
|
||||
```
|
||||
|
||||
This creates a container image from the Spack installations on the host system,
|
||||
without the need to run `spack install` from a `Dockerfile` or `sif` file. It also
|
||||
addresses the inconvenience of losing binaries of dependencies when `RUN spack
|
||||
install` fails inside `docker build`.
|
||||
|
||||
Further, the container image layers and build cache tarballs are the same files. This
|
||||
means that `spack install` and `docker pull` use the exact same underlying binaries.
|
||||
If you previously used `spack install` inside of `docker build`, this feature helps
|
||||
you save storage by a factor two.
|
||||
|
||||
More details in #38358.
|
||||
|
||||
3. **Multiple versions of build dependencies**
|
||||
|
||||
Increasingly, complex package builds require multiple versions of some build
|
||||
dependencies. For example, Python packages frequently require very specific versions
|
||||
of `setuptools`, `cython`, and sometimes different physics packages require different
|
||||
versions of Python to build. The concretizer enforced that every solve was *unified*,
|
||||
i.e., that there only be one version of every package. The concretizer now supports
|
||||
"duplicate" nodes for *build dependencies*, but enforces unification through
|
||||
transitive link and run dependencies. This will allow it to better resolve complex
|
||||
dependency graphs in ecosystems like Python, and it also gets us very close to
|
||||
modeling compilers as proper dependencies.
|
||||
|
||||
This change required a major overhaul of the concretizer, as well as a number of
|
||||
performance optimizations. See #38447, #39621.
|
||||
|
||||
4. **Cherry-picking virtual dependencies**
|
||||
|
||||
You can now select only a subset of virtual dependencies from a spec that may provide
|
||||
more. For example, if you want `mpich` to be your `mpi` provider, you can be explicit
|
||||
by writing:
|
||||
|
||||
```
|
||||
hdf5 ^[virtuals=mpi] mpich
|
||||
```
|
||||
|
||||
Or, if you want to use, e.g., `intel-parallel-studio` for `blas` along with an external
|
||||
`lapack` like `openblas`, you could write:
|
||||
|
||||
```
|
||||
strumpack ^[virtuals=mpi] intel-parallel-studio+mkl ^[virtuals=lapack] openblas
|
||||
```
|
||||
|
||||
The `virtuals=mpi` is an edge attribute, and dependency edges in Spack graphs now
|
||||
track which virtuals they satisfied. More details in #17229 and #35322.
|
||||
|
||||
Note for packaging: in Spack 0.21 `spec.satisfies("^virtual")` is true if and only if
|
||||
the package specifies `depends_on("virtual")`. This is different from Spack 0.20,
|
||||
where depending on a provider implied depending on the virtual provided. See #41002
|
||||
for an example where `^mkl` was being used to test for several `mkl` providers in a
|
||||
package that did not depend on `mkl`.
|
||||
|
||||
5. **License directive**
|
||||
|
||||
Spack packages can now have license metadata, with the new `license()` directive:
|
||||
|
||||
```python
|
||||
license("Apache-2.0")
|
||||
```
|
||||
|
||||
Licenses use [SPDX identifiers](https://spdx.org/licenses), and you can use SPDX
|
||||
expressions to combine them:
|
||||
|
||||
```python
|
||||
license("Apache-2.0 OR MIT")
|
||||
```
|
||||
|
||||
Like other directives in Spack, it's conditional, so you can handle complex cases like
|
||||
Spack itself:
|
||||
|
||||
```python
|
||||
license("LGPL-2.1", when="@:0.11")
|
||||
license("Apache-2.0 OR MIT", when="@0.12:")
|
||||
```
|
||||
|
||||
More details in #39346, #40598.
|
||||
|
||||
6. **`spack deconcretize` command**
|
||||
|
||||
We are getting close to having a `spack update` command for environments, but we're
|
||||
not quite there yet. This is the next best thing. `spack deconcretize` gives you
|
||||
control over what you want to update in an already concrete environment. If you have
|
||||
an environment built with, say, `meson`, and you want to update your `meson` version,
|
||||
you can run:
|
||||
|
||||
```console
|
||||
spack deconcretize meson
|
||||
```
|
||||
|
||||
and have everything that depends on `meson` rebuilt the next time you run `spack
|
||||
concretize`. In a future Spack version, we'll handle all of this in a single command,
|
||||
but for now you can use this to drop bits of your lockfile and resolve your
|
||||
dependencies again. More in #38803.
|
||||
|
||||
7. **UI Improvements**
|
||||
|
||||
The venerable `spack info` command was looking shabby compared to the rest of Spack's
|
||||
UI, so we reworked it to have a bit more flair. `spack info` now makes much better
|
||||
use of terminal space and shows variants, their values, and their descriptions much
|
||||
more clearly. Conditional variants are grouped separately so you can more easily
|
||||
understand how packages are structured. More in #40998.
|
||||
|
||||
`spack checksum` now allows you to filter versions from your editor, or by version
|
||||
range. It also notifies you about potential download URL changes. See #40403.
|
||||
|
||||
8. **Environments can include definitions**
|
||||
|
||||
Spack did not previously support using `include:` with The
|
||||
[definitions](https://spack.readthedocs.io/en/latest/environments.html#spec-list-references)
|
||||
section of an environment, but now it does. You can use this to curate lists of specs
|
||||
and more easily reuse them across environments. See #33960.
|
||||
|
||||
9. **Aliases**
|
||||
|
||||
You can now add aliases to Spack commands in `config.yaml`, e.g. this might enshrine
|
||||
your favorite args to `spack find` as `spack f`:
|
||||
|
||||
```yaml
|
||||
config:
|
||||
aliases:
|
||||
f: find -lv
|
||||
```
|
||||
|
||||
See #17229.
|
||||
|
||||
10. **Improved autoloading of modules**
|
||||
|
||||
Spack 0.20 was the first release to enable autoloading of direct dependencies in
|
||||
module files.
|
||||
|
||||
The downside of this was that `module avail` and `module load` tab completion would
|
||||
show users too many modules to choose from, and many users disabled generating
|
||||
modules for dependencies through `exclude_implicits: true`. Further, it was
|
||||
necessary to keep hashes in module names to avoid file name clashes.
|
||||
|
||||
In this release, you can start using `hide_implicits: true` instead, which exposes
|
||||
only explicitly installed packages to the user, while still autoloading
|
||||
dependencies. On top of that, you can safely use `hash_length: 0`, as this config
|
||||
now only applies to the modules exposed to the user -- you don't have to worry about
|
||||
file name clashes for hidden dependencies.
|
||||
|
||||
Note: for `tcl` this feature requires Modules 4.7 or higher
|
||||
|
||||
11. **Updated container labeling**
|
||||
|
||||
Nightly Docker images from the `develop` branch will now be tagged as `:develop` and
|
||||
`:nightly`. The `:latest` tag is no longer associated with `:develop`, but with the
|
||||
latest stable release. Releases will be tagged with `:{major}`, `:{major}.{minor}`
|
||||
and `:{major}.{minor}.{patch}`. `ubuntu:18.04` has also been removed from the list of
|
||||
generated Docker images, as it is no longer supported. See #40593.
|
||||
|
||||
## Other new commands and directives
|
||||
|
||||
* `spack env activate` without arguments now loads a `default` environment that you do
|
||||
not have to create (#40756).
|
||||
* `spack find -H` / `--hashes`: a new shortcut for piping `spack find` output to
|
||||
other commands (#38663)
|
||||
* Add `spack checksum --verify`, fix `--add` (#38458)
|
||||
* New `default_args` context manager factors out common args for directives (#39964)
|
||||
* `spack compiler find --[no]-mixed-toolchain` lets you easily mix `clang` and
|
||||
`gfortran` on Linux (#40902)
|
||||
|
||||
## Performance improvements
|
||||
|
||||
* `spack external find` execution is now much faster (#39843)
|
||||
* `spack location -i` now much faster on success (#40898)
|
||||
* Drop redundant rpaths post install (#38976)
|
||||
* ASP-based solver: avoid cycles in clingo using hidden directive (#40720)
|
||||
* Fix multiple quadratic complexity issues in environments (#38771)
|
||||
|
||||
## Other new features of note
|
||||
|
||||
* archspec: update to v0.2.2, support for Sapphire Rapids, Power10, Neoverse V2 (#40917)
|
||||
* Propagate variants across nodes that don't have that variant (#38512)
|
||||
* Implement fish completion (#29549)
|
||||
* Can now distinguish between source/binary mirror; don't ping mirror.spack.io as much (#34523)
|
||||
* Improve status reporting on install (add [n/total] display) (#37903)
|
||||
|
||||
## Windows
|
||||
|
||||
This release has the best Windows support of any Spack release yet, with numerous
|
||||
improvements and much larger swaths of tests passing:
|
||||
|
||||
* MSVC and SDK improvements (#37711, #37930, #38500, #39823, #39180)
|
||||
* Windows external finding: update default paths; treat .bat as executable on Windows (#39850)
|
||||
* Windows decompression: fix removal of intermediate file (#38958)
|
||||
* Windows: executable/path handling (#37762)
|
||||
* Windows build systems: use ninja and enable tests (#33589)
|
||||
* Windows testing (#36970, #36972, #36973, #36840, #36977, #36792, #36834, #34696, #36971)
|
||||
* Windows PowerShell support (#39118, #37951)
|
||||
* Windows symlinking and libraries (#39933, #38599, #34701, #38578, #34701)
|
||||
|
||||
## Notable refactors
|
||||
* User-specified flags take precedence over others in Spack compiler wrappers (#37376)
|
||||
* Improve setup of build, run, and test environments (#35737, #40916)
|
||||
* `make` is no longer a required system dependency of Spack (#40380)
|
||||
* Support Python 3.12 (#40404, #40155, #40153)
|
||||
* docs: Replace package list with packages.spack.io (#40251)
|
||||
* Drop Python 2 constructs in Spack (#38720, #38718, #38703)
|
||||
|
||||
## Binary cache and stack updates
|
||||
* e4s arm stack: duplicate and target neoverse v1 (#40369)
|
||||
* Add macOS ML CI stacks (#36586)
|
||||
* E4S Cray CI Stack (#37837)
|
||||
* e4s cray: expand spec list (#38947)
|
||||
* e4s cray sles ci: expand spec list (#39081)
|
||||
|
||||
## Removals, deprecations, and syntax changes
|
||||
* ASP: targets, compilers and providers soft-preferences are only global (#31261)
|
||||
* Parser: fix ambiguity with whitespace in version ranges (#40344)
|
||||
* Module file generation is disabled by default; you'll need to enable it to use it (#37258)
|
||||
* Remove deprecated "extra_instructions" option for containers (#40365)
|
||||
* Stand-alone test feature deprecation postponed to v0.22 (#40600)
|
||||
* buildcache push: make `--allow-root` the default and deprecate the option (#38878)
|
||||
|
||||
## Notable Bugfixes
|
||||
* Bugfix: propagation of multivalued variants (#39833)
|
||||
* Allow `/` in git versions (#39398)
|
||||
* Fetch & patch: actually acquire stage lock, and many more issues (#38903)
|
||||
* Environment/depfile: better escaping of targets with Git versions (#37560)
|
||||
* Prevent "spack external find" to error out on wrong permissions (#38755)
|
||||
* lmod: allow core compiler to be specified with a version range (#37789)
|
||||
|
||||
## Spack community stats
|
||||
|
||||
* 7,469 total packages, 303 new since `v0.20.0`
|
||||
* 150 new Python packages
|
||||
* 34 new R packages
|
||||
* 353 people contributed to this release
|
||||
* 336 committers to packages
|
||||
* 65 committers to core
|
||||
|
||||
|
||||
# v0.20.3 (2023-10-31)
|
||||
|
||||
## Bugfixes
|
||||
|
@@ -50,4 +50,4 @@ packages:
|
||||
# Apple bundles libuuid in libsystem_c version 1353.100.2,
|
||||
# although the version number used here isn't critical
|
||||
- spec: apple-libuuid@1353.100.2
|
||||
prefix: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
|
||||
prefix: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
|
||||
|
@@ -182,6 +182,7 @@ section of the configuration:
|
||||
padded_length: 128
|
||||
|
||||
|
||||
.. _binary_caches_oci:
|
||||
|
||||
-----------------------------------------
|
||||
OCI / Docker V2 registries as build cache
|
||||
|
@@ -82,7 +82,7 @@ class already contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('cmake', type='build')
|
||||
depends_on("cmake", type="build")
|
||||
|
||||
|
||||
If you need to specify a particular version requirement, you can
|
||||
@@ -90,7 +90,7 @@ override this in your package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('cmake@2.8.12:', type='build')
|
||||
depends_on("cmake@2.8.12:", type="build")
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@@ -137,10 +137,10 @@ and without the :meth:`~spack.build_systems.cmake.CMakeBuilder.define` and
|
||||
|
||||
def cmake_args(self):
|
||||
args = [
|
||||
'-DWHATEVER:STRING=somevalue',
|
||||
self.define('ENABLE_BROKEN_FEATURE', False),
|
||||
self.define_from_variant('DETECT_HDF5', 'hdf5'),
|
||||
self.define_from_variant('THREADS'), # True if +threads
|
||||
"-DWHATEVER:STRING=somevalue",
|
||||
self.define("ENABLE_BROKEN_FEATURE", False),
|
||||
self.define_from_variant("DETECT_HDF5", "hdf5"),
|
||||
self.define_from_variant("THREADS"), # True if +threads
|
||||
]
|
||||
|
||||
return args
|
||||
@@ -151,10 +151,10 @@ and CMake simply ignores the empty command line argument. For example the follow
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('example', default=True, when='@2.0:')
|
||||
variant("example", default=True, when="@2.0:")
|
||||
|
||||
def cmake_args(self):
|
||||
return [self.define_from_variant('EXAMPLE', 'example')]
|
||||
return [self.define_from_variant("EXAMPLE", "example")]
|
||||
|
||||
will generate ``'cmake' '-DEXAMPLE=ON' ...`` when `@2.0: +example` is met, but will
|
||||
result in ``'cmake' '' ...`` when the spec version is below ``2.0``.
|
||||
@@ -193,9 +193,9 @@ a variant to control this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='RelWithDebInfo',
|
||||
description='CMake build type',
|
||||
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
||||
variant("build_type", default="RelWithDebInfo",
|
||||
description="CMake build type",
|
||||
values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel"))
|
||||
|
||||
However, not every CMake package accepts all four of these options.
|
||||
Grep the ``CMakeLists.txt`` file to see if the default values are
|
||||
@@ -205,9 +205,9 @@ package overrides the default variant with:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
variant('build_type', default='DebugRelease',
|
||||
description='The build type to build',
|
||||
values=('Debug', 'Release', 'DebugRelease'))
|
||||
variant("build_type", default="DebugRelease",
|
||||
description="The build type to build",
|
||||
values=("Debug", "Release", "DebugRelease"))
|
||||
|
||||
For more information on ``CMAKE_BUILD_TYPE``, see:
|
||||
https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
|
||||
@@ -250,7 +250,7 @@ generator is Ninja. To switch to the Ninja generator, simply add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
generator = 'Ninja'
|
||||
generator = "Ninja"
|
||||
|
||||
|
||||
``CMakePackage`` defaults to "Unix Makefiles". If you switch to the
|
||||
@@ -258,7 +258,7 @@ Ninja generator, make sure to add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('ninja', type='build')
|
||||
depends_on("ninja", type="build")
|
||||
|
||||
to the package as well. Aside from that, you shouldn't need to do
|
||||
anything else. Spack will automatically detect that you are using
|
||||
@@ -288,7 +288,7 @@ like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
root_cmakelists_dir = 'src'
|
||||
root_cmakelists_dir = "src"
|
||||
|
||||
|
||||
Note that this path is relative to the root of the extracted tarball,
|
||||
@@ -304,7 +304,7 @@ different sub-directory, simply override ``build_directory`` like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
build_directory = 'my-build'
|
||||
build_directory = "my-build"
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Build and install targets
|
||||
@@ -324,8 +324,8 @@ library or build the documentation, you can add these like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
build_targets = ['all', 'docs']
|
||||
install_targets = ['install', 'docs']
|
||||
build_targets = ["all", "docs"]
|
||||
install_targets = ["install", "docs"]
|
||||
|
||||
^^^^^^^
|
||||
Testing
|
||||
|
@@ -53,18 +53,24 @@ Install the oneAPI compilers::
|
||||
|
||||
Add the compilers to your ``compilers.yaml`` so spack can use them::
|
||||
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
|
||||
|
||||
Verify that the compilers are available::
|
||||
|
||||
spack compiler list
|
||||
|
||||
Note that 2024 and later releases do not include ``icc``. Before 2024,
|
||||
the package layout was different::
|
||||
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
|
||||
|
||||
The ``intel-oneapi-compilers`` package includes 2 families of
|
||||
compilers:
|
||||
|
||||
* ``intel``: ``icc``, ``icpc``, ``ifort``. Intel's *classic*
|
||||
compilers.
|
||||
compilers. 2024 and later releases contain ``ifort``, but not
|
||||
``icc`` and ``icpc``.
|
||||
* ``oneapi``: ``icx``, ``icpx``, ``ifx``. Intel's new generation of
|
||||
compilers based on LLVM.
|
||||
|
||||
@@ -89,8 +95,8 @@ Install the oneAPI compilers::
|
||||
|
||||
Add the compilers to your ``compilers.yaml`` so Spack can use them::
|
||||
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
|
||||
spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
|
||||
|
||||
Verify that the compilers are available::
|
||||
|
||||
@@ -146,8 +152,7 @@ Compilers
|
||||
To use the compilers, add some information about the installation to
|
||||
``compilers.yaml``. For most users, it is sufficient to do::
|
||||
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/bin
|
||||
|
||||
Adapt the paths above if you did not install the tools in the default
|
||||
location. After adding the compilers, using them is the same
|
||||
@@ -156,6 +161,12 @@ Another option is to manually add the configuration to
|
||||
``compilers.yaml`` as described in :ref:`Compiler configuration
|
||||
<compiler-config>`.
|
||||
|
||||
Before 2024, the directory structure was different::
|
||||
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
|
||||
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
|
||||
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
|
@@ -934,9 +934,9 @@ a *virtual* ``mkl`` package is declared in Spack.
|
||||
.. code-block:: python
|
||||
|
||||
# Examples for absolute and conditional dependencies:
|
||||
depends_on('mkl')
|
||||
depends_on('mkl', when='+mkl')
|
||||
depends_on('mkl', when='fftw=mkl')
|
||||
depends_on("mkl")
|
||||
depends_on("mkl", when="+mkl")
|
||||
depends_on("mkl", when="fftw=mkl")
|
||||
|
||||
The ``MKLROOT`` environment variable (part of the documented API) will be set
|
||||
during all stages of client package installation, and is available to both
|
||||
@@ -972,8 +972,8 @@ a *virtual* ``mkl`` package is declared in Spack.
|
||||
def configure_args(self):
|
||||
args = []
|
||||
...
|
||||
args.append('--with-blas=%s' % self.spec['blas'].libs.ld_flags)
|
||||
args.append('--with-lapack=%s' % self.spec['lapack'].libs.ld_flags)
|
||||
args.append("--with-blas=%s" % self.spec["blas"].libs.ld_flags)
|
||||
args.append("--with-lapack=%s" % self.spec["lapack"].libs.ld_flags)
|
||||
...
|
||||
|
||||
.. tip::
|
||||
@@ -989,13 +989,13 @@ a *virtual* ``mkl`` package is declared in Spack.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.spec['blas'].headers.include_flags
|
||||
self.spec["blas"].headers.include_flags
|
||||
|
||||
and to generate linker options (``-L<dir> -llibname ...``), use the same as above,
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
self.spec['blas'].libs.ld_flags
|
||||
self.spec["blas"].libs.ld_flags
|
||||
|
||||
See
|
||||
:ref:`MakefilePackage <makefilepackage>`
|
||||
|
@@ -88,7 +88,7 @@ override the ``luarocks_args`` method like so:
|
||||
.. code-block:: python
|
||||
|
||||
def luarocks_args(self):
|
||||
return ['flag1', 'flag2']
|
||||
return ["flag1", "flag2"]
|
||||
|
||||
One common use of this is to override warnings or flags for newer compilers, as in:
|
||||
|
||||
|
@@ -48,8 +48,8 @@ class automatically adds the following dependencies:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('java', type=('build', 'run'))
|
||||
depends_on('maven', type='build')
|
||||
depends_on("java", type=("build", "run"))
|
||||
depends_on("maven", type="build")
|
||||
|
||||
|
||||
In the ``pom.xml`` file, you may see sections like:
|
||||
@@ -72,8 +72,8 @@ should add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('java@7:', type='build')
|
||||
depends_on('maven@3.5.4:', type='build')
|
||||
depends_on("java@7:", type="build")
|
||||
depends_on("maven@3.5.4:", type="build")
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -88,9 +88,9 @@ the build phase. For example:
|
||||
|
||||
def build_args(self):
|
||||
return [
|
||||
'-Pdist,native',
|
||||
'-Dtar',
|
||||
'-Dmaven.javadoc.skip=true'
|
||||
"-Pdist,native",
|
||||
"-Dtar",
|
||||
"-Dmaven.javadoc.skip=true"
|
||||
]
|
||||
|
||||
|
||||
|
@@ -86,8 +86,8 @@ the ``MesonPackage`` base class already contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('meson', type='build')
|
||||
depends_on('ninja', type='build')
|
||||
depends_on("meson", type="build")
|
||||
depends_on("ninja", type="build")
|
||||
|
||||
|
||||
If you need to specify a particular version requirement, you can
|
||||
@@ -95,8 +95,8 @@ override this in your package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('meson@0.43.0:', type='build')
|
||||
depends_on('ninja', type='build')
|
||||
depends_on("meson@0.43.0:", type="build")
|
||||
depends_on("ninja", type="build")
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
@@ -121,7 +121,7 @@ override the ``meson_args`` method like so:
|
||||
.. code-block:: python
|
||||
|
||||
def meson_args(self):
|
||||
return ['--warnlevel=3']
|
||||
return ["--warnlevel=3"]
|
||||
|
||||
|
||||
This method can be used to pass flags as well as variables.
|
||||
|
@@ -118,7 +118,7 @@ so ``PerlPackage`` contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
extends('perl')
|
||||
extends("perl")
|
||||
|
||||
|
||||
If your package requires a specific version of Perl, you should
|
||||
@@ -132,14 +132,14 @@ properly. If your package uses ``Makefile.PL`` to build, add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('perl-extutils-makemaker', type='build')
|
||||
depends_on("perl-extutils-makemaker", type="build")
|
||||
|
||||
|
||||
If your package uses ``Build.PL`` to build, add:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('perl-module-build', type='build')
|
||||
depends_on("perl-module-build", type="build")
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^
|
||||
@@ -165,11 +165,11 @@ arguments to ``Makefile.PL`` or ``Build.PL`` by overriding
|
||||
.. code-block:: python
|
||||
|
||||
def configure_args(self):
|
||||
expat = self.spec['expat'].prefix
|
||||
expat = self.spec["expat"].prefix
|
||||
|
||||
return [
|
||||
'EXPATLIBPATH={0}'.format(expat.lib),
|
||||
'EXPATINCPATH={0}'.format(expat.include),
|
||||
"EXPATLIBPATH={0}".format(expat.lib),
|
||||
"EXPATINCPATH={0}".format(expat.include),
|
||||
]
|
||||
|
||||
|
||||
|
@@ -83,7 +83,7 @@ base class already contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('qt', type='build')
|
||||
depends_on("qt", type="build")
|
||||
|
||||
|
||||
If you want to specify a particular version requirement, or need to
|
||||
@@ -91,7 +91,7 @@ link to the ``qt`` libraries, you can override this in your package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('qt@5.6.0:')
|
||||
depends_on("qt@5.6.0:")
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Passing arguments to qmake
|
||||
@@ -103,7 +103,7 @@ override the ``qmake_args`` method like so:
|
||||
.. code-block:: python
|
||||
|
||||
def qmake_args(self):
|
||||
return ['-recursive']
|
||||
return ["-recursive"]
|
||||
|
||||
|
||||
This method can be used to pass flags as well as variables.
|
||||
@@ -118,7 +118,7 @@ sub-directory by adding the following to the package:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
build_directory = 'src'
|
||||
build_directory = "src"
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@@ -163,28 +163,28 @@ attributes that can be used to set ``homepage``, ``url``, ``list_url``, and
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
cran = 'caret'
|
||||
cran = "caret"
|
||||
|
||||
is equivalent to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
homepage = 'https://cloud.r-project.org/package=caret'
|
||||
url = 'https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz'
|
||||
list_url = 'https://cloud.r-project.org/src/contrib/Archive/caret'
|
||||
homepage = "https://cloud.r-project.org/package=caret"
|
||||
url = "https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz"
|
||||
list_url = "https://cloud.r-project.org/src/contrib/Archive/caret"
|
||||
|
||||
Likewise, the following ``bioc`` attribute:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
bioc = 'BiocVersion'
|
||||
bioc = "BiocVersion"
|
||||
|
||||
is equivalent to:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
homepage = 'https://bioconductor.org/packages/BiocVersion/'
|
||||
git = 'https://git.bioconductor.org/packages/BiocVersion'
|
||||
homepage = "https://bioconductor.org/packages/BiocVersion/"
|
||||
git = "https://git.bioconductor.org/packages/BiocVersion"
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -200,7 +200,7 @@ base class contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
extends('r')
|
||||
extends("r")
|
||||
|
||||
|
||||
Take a close look at the homepage for ``caret``. If you look at the
|
||||
@@ -209,7 +209,7 @@ You should add this to your package like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('r@3.2.0:', type=('build', 'run'))
|
||||
depends_on("r@3.2.0:", type=("build", "run"))
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^
|
||||
@@ -227,7 +227,7 @@ and list all of their dependencies in the following sections:
|
||||
* LinkingTo
|
||||
|
||||
As far as Spack is concerned, all 3 of these dependency types
|
||||
correspond to ``type=('build', 'run')``, so you don't have to worry
|
||||
correspond to ``type=("build", "run")``, so you don't have to worry
|
||||
about the details. If you are curious what they mean,
|
||||
https://github.com/spack/spack/issues/2951 has a pretty good summary:
|
||||
|
||||
@@ -330,7 +330,7 @@ the dependency:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('r-lattice@0.20:', type=('build', 'run'))
|
||||
depends_on("r-lattice@0.20:", type=("build", "run"))
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
@@ -361,20 +361,20 @@ like so:
|
||||
.. code-block:: python
|
||||
|
||||
def configure_args(self):
|
||||
mpi_name = self.spec['mpi'].name
|
||||
mpi_name = self.spec["mpi"].name
|
||||
|
||||
# The type of MPI. Supported values are:
|
||||
# OPENMPI, LAM, MPICH, MPICH2, or CRAY
|
||||
if mpi_name == 'openmpi':
|
||||
Rmpi_type = 'OPENMPI'
|
||||
elif mpi_name == 'mpich':
|
||||
Rmpi_type = 'MPICH2'
|
||||
if mpi_name == "openmpi":
|
||||
Rmpi_type = "OPENMPI"
|
||||
elif mpi_name == "mpich":
|
||||
Rmpi_type = "MPICH2"
|
||||
else:
|
||||
raise InstallError('Unsupported MPI type')
|
||||
raise InstallError("Unsupported MPI type")
|
||||
|
||||
return [
|
||||
'--with-Rmpi-type={0}'.format(Rmpi_type),
|
||||
'--with-mpi={0}'.format(spec['mpi'].prefix),
|
||||
"--with-Rmpi-type={0}".format(Rmpi_type),
|
||||
"--with-mpi={0}".format(spec["mpi"].prefix),
|
||||
]
|
||||
|
||||
|
||||
|
@@ -84,8 +84,8 @@ The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
summary = 'An implementation of the AsciiDoc text processor and publishing toolchain'
|
||||
description = 'A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.'
|
||||
summary = "An implementation of the AsciiDoc text processor and publishing toolchain"
|
||||
description = "A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML 5, DocBook 5, and other formats."
|
||||
|
||||
|
||||
Either of these can be used for the description of the Spack package.
|
||||
@@ -98,7 +98,7 @@ The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
homepage = 'https://asciidoctor.org'
|
||||
homepage = "https://asciidoctor.org"
|
||||
|
||||
|
||||
This should be used as the official homepage of the Spack package.
|
||||
@@ -112,21 +112,21 @@ the base class contains:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
extends('ruby')
|
||||
extends("ruby")
|
||||
|
||||
|
||||
The ``*.gemspec`` file may contain something like:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
required_ruby_version = '>= 2.3.0'
|
||||
required_ruby_version = ">= 2.3.0"
|
||||
|
||||
|
||||
This can be added to the Spack package using:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('ruby@2.3.0:', type=('build', 'run'))
|
||||
depends_on("ruby@2.3.0:", type=("build", "run"))
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
@@ -124,7 +124,7 @@ are wrong, you can provide the names yourself by overriding
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import_modules = ['PyQt5']
|
||||
import_modules = ["PyQt5"]
|
||||
|
||||
|
||||
These tests often catch missing dependencies and non-RPATHed
|
||||
|
@@ -63,8 +63,8 @@ run package-specific unit tests.
|
||||
.. code-block:: python
|
||||
|
||||
def installtest(self):
|
||||
with working_dir('test'):
|
||||
pytest = which('py.test')
|
||||
with working_dir("test"):
|
||||
pytest = which("py.test")
|
||||
pytest()
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ the following dependency automatically:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
depends_on('python@2.5:', type='build')
|
||||
depends_on("python@2.5:", type="build")
|
||||
|
||||
|
||||
Waf only supports Python 2.5 and up.
|
||||
@@ -113,7 +113,7 @@ phase, you can use:
|
||||
args = []
|
||||
|
||||
if self.run_tests:
|
||||
args.append('--test')
|
||||
args.append("--test")
|
||||
|
||||
return args
|
||||
|
||||
|
@@ -24,6 +24,16 @@ image, or to set up a proper entrypoint to run the image. These tasks are
|
||||
usually both necessary and repetitive, so Spack comes with a command
|
||||
to generate recipes for container images starting from a ``spack.yaml``.
|
||||
|
||||
.. seealso::
|
||||
|
||||
This page is a reference for generating recipes to build container images.
|
||||
It means that your environment is built from scratch inside the container
|
||||
runtime.
|
||||
|
||||
Since v0.21, Spack can also create container images from existing package installations
|
||||
on your host system. See :ref:`binary_caches_oci` for more information on
|
||||
that topic.
|
||||
|
||||
--------------------
|
||||
A Quick Introduction
|
||||
--------------------
|
||||
|
@@ -383,7 +383,33 @@ like this:
|
||||
|
||||
which means every spec will be required to use ``clang`` as a compiler.
|
||||
|
||||
Note that in this case ``all`` represents a *default set of requirements* -
|
||||
Requirements on variants for all packages are possible too, but note that they
|
||||
are only enforced for those packages that define these variants, otherwise they
|
||||
are disregarded. For example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
packages:
|
||||
all:
|
||||
require:
|
||||
- "+shared"
|
||||
- "+cuda"
|
||||
|
||||
will just enforce ``+shared`` on ``zlib``, which has a boolean ``shared`` variant but
|
||||
no ``cuda`` variant.
|
||||
|
||||
Constraints in a single spec literal are always considered as a whole, so in a case like:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
packages:
|
||||
all:
|
||||
require: "+shared +cuda"
|
||||
|
||||
the default requirement will be enforced only if a package has both a ``cuda`` and
|
||||
a ``shared`` variant, and will never be partially enforced.
|
||||
|
||||
Finally, ``all`` represents a *default set of requirements* -
|
||||
if there are specific package requirements, then the default requirements
|
||||
under ``all`` are disregarded. For example, with a configuration like this:
|
||||
|
||||
@@ -391,12 +417,18 @@ under ``all`` are disregarded. For example, with a configuration like this:
|
||||
|
||||
packages:
|
||||
all:
|
||||
require: '%clang'
|
||||
require:
|
||||
- 'build_type=Debug'
|
||||
- '%clang'
|
||||
cmake:
|
||||
require: '%gcc'
|
||||
require:
|
||||
- 'build_type=Debug'
|
||||
- '%gcc'
|
||||
|
||||
Spack requires ``cmake`` to use ``gcc`` and all other nodes (including ``cmake``
|
||||
dependencies) to use ``clang``.
|
||||
dependencies) to use ``clang``. If enforcing ``build_type=Debug`` is needed also
|
||||
on ``cmake``, it must be repeated in the specific ``cmake`` requirements.
|
||||
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Setting requirements on virtual specs
|
||||
|
@@ -1,13 +1,13 @@
|
||||
sphinx==7.2.6
|
||||
sphinxcontrib-programoutput==0.17
|
||||
sphinx_design==0.5.0
|
||||
sphinx-rtd-theme==1.3.0
|
||||
sphinx-rtd-theme==2.0.0
|
||||
python-levenshtein==0.23.0
|
||||
docutils==0.18.1
|
||||
pygments==2.16.1
|
||||
docutils==0.20.1
|
||||
pygments==2.17.2
|
||||
urllib3==2.1.0
|
||||
pytest==7.4.3
|
||||
isort==5.12.0
|
||||
black==23.11.0
|
||||
flake8==6.1.0
|
||||
mypy==1.7.0
|
||||
mypy==1.7.1
|
||||
|
@@ -286,6 +286,54 @@ def make_error(attribute_name, config_data, summary):
|
||||
return errors
|
||||
|
||||
|
||||
@config_packages
|
||||
def _avoid_mismatched_variants(error_cls):
|
||||
"""Warns if variant preferences have mismatched types or names."""
|
||||
errors = []
|
||||
packages_yaml = spack.config.CONFIG.get_config("packages")
|
||||
|
||||
def make_error(config_data, summary):
|
||||
s = io.StringIO()
|
||||
s.write("Occurring in the following file:\n")
|
||||
syaml.dump_config(config_data, stream=s, blame=True)
|
||||
return error_cls(summary=summary, details=[s.getvalue()])
|
||||
|
||||
for pkg_name in packages_yaml:
|
||||
# 'all:' must be more forgiving, since it is setting defaults for everything
|
||||
if pkg_name == "all" or "variants" not in packages_yaml[pkg_name]:
|
||||
continue
|
||||
|
||||
preferences = packages_yaml[pkg_name]["variants"]
|
||||
if not isinstance(preferences, list):
|
||||
preferences = [preferences]
|
||||
|
||||
for variants in preferences:
|
||||
current_spec = spack.spec.Spec(variants)
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(pkg_name)
|
||||
for variant in current_spec.variants.values():
|
||||
# Variant does not exist at all
|
||||
if variant.name not in pkg_cls.variants:
|
||||
summary = (
|
||||
f"Setting a preference for the '{pkg_name}' package to the "
|
||||
f"non-existing variant '{variant.name}'"
|
||||
)
|
||||
errors.append(make_error(preferences, summary))
|
||||
continue
|
||||
|
||||
# Variant cannot accept this value
|
||||
s = spack.spec.Spec(pkg_name)
|
||||
try:
|
||||
s.update_variant_validate(variant.name, variant.value)
|
||||
except Exception:
|
||||
summary = (
|
||||
f"Setting the variant '{variant.name}' of the '{pkg_name}' package "
|
||||
f"to the invalid value '{str(variant)}'"
|
||||
)
|
||||
errors.append(make_error(preferences, summary))
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
#: Sanity checks on package directives
|
||||
package_directives = AuditClass(
|
||||
group="packages",
|
||||
@@ -451,7 +499,7 @@ def _ensure_packages_are_pickeleable(pkgs, error_cls):
|
||||
@package_properties
|
||||
def _ensure_packages_are_unparseable(pkgs, error_cls):
|
||||
"""Ensure that all packages can unparse and that unparsed code is valid Python"""
|
||||
import spack.util.package_hash as ph
|
||||
import spack.package_hash as ph
|
||||
|
||||
errors = []
|
||||
for pkg_name in pkgs:
|
||||
@@ -598,7 +646,11 @@ def _linting_package_file(pkgs, error_cls):
|
||||
if pkg_cls.homepage.startswith("http://"):
|
||||
https = re.sub("http", "https", pkg_cls.homepage, 1)
|
||||
try:
|
||||
response = urlopen(https)
|
||||
response = urlopen(
|
||||
https,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except Exception as e:
|
||||
msg = 'Error with attempting https for "{0}": '
|
||||
errors.append(error_cls(msg.format(pkg_cls.name), [str(e)]))
|
||||
|
@@ -38,12 +38,14 @@
|
||||
import spack.config as config
|
||||
import spack.database as spack_db
|
||||
import spack.error
|
||||
import spack.gpg
|
||||
import spack.hooks
|
||||
import spack.hooks.sbang
|
||||
import spack.mirror
|
||||
import spack.oci.image
|
||||
import spack.oci.oci
|
||||
import spack.oci.opener
|
||||
import spack.paths
|
||||
import spack.platforms
|
||||
import spack.relocate as relocate
|
||||
import spack.repo
|
||||
@@ -52,7 +54,6 @@
|
||||
import spack.traverse as traverse
|
||||
import spack.util.crypto
|
||||
import spack.util.file_cache as file_cache
|
||||
import spack.util.gpg
|
||||
import spack.util.path
|
||||
import spack.util.spack_json as sjson
|
||||
import spack.util.spack_yaml as syaml
|
||||
@@ -230,7 +231,11 @@ def _associate_built_specs_with_mirror(self, cache_key, mirror_url):
|
||||
)
|
||||
return
|
||||
|
||||
spec_list = db.query_local(installed=False, in_buildcache=True)
|
||||
spec_list = [
|
||||
s
|
||||
for s in db.query_local(installed=any, in_buildcache=any)
|
||||
if s.external or db.query_local_by_spec_hash(s.dag_hash()).in_buildcache
|
||||
]
|
||||
|
||||
for indexed_spec in spec_list:
|
||||
dag_hash = indexed_spec.dag_hash()
|
||||
@@ -482,7 +487,10 @@ def _fetch_and_cache_index(self, mirror_url, cache_entry={}):
|
||||
scheme = urllib.parse.urlparse(mirror_url).scheme
|
||||
|
||||
if scheme != "oci" and not web_util.url_exists(
|
||||
url_util.join(mirror_url, BUILD_CACHE_RELATIVE_PATH, "index.json")
|
||||
url_util.join(mirror_url, BUILD_CACHE_RELATIVE_PATH, "index.json"),
|
||||
fetch_method=spack.config.get("config:url_fetch_method", "urllib"),
|
||||
verify_ssl=spack.config.get("config:verify_ssl"),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -528,7 +536,9 @@ def _fetch_and_cache_index(self, mirror_url, cache_entry={}):
|
||||
def binary_index_location():
|
||||
"""Set up a BinaryCacheIndex for remote buildcache dbs in the user's homedir."""
|
||||
cache_root = os.path.join(misc_cache_location(), "indices")
|
||||
return spack.util.path.canonicalize_path(cache_root)
|
||||
return spack.util.path.canonicalize_path(
|
||||
cache_root, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
|
||||
#: Default binary cache index instance
|
||||
@@ -823,7 +833,7 @@ def tarball_path_name(spec, ext):
|
||||
|
||||
def select_signing_key(key=None):
|
||||
if key is None:
|
||||
keys = spack.util.gpg.signing_keys()
|
||||
keys = spack.gpg.signing_keys()
|
||||
if len(keys) == 1:
|
||||
key = keys[0]
|
||||
|
||||
@@ -848,7 +858,7 @@ def sign_specfile(key, force, specfile_path):
|
||||
raise NoOverwriteException(signed_specfile_path)
|
||||
|
||||
key = select_signing_key(key)
|
||||
spack.util.gpg.sign(key, specfile_path, signed_specfile_path, clearsign=True)
|
||||
spack.gpg.sign(key, specfile_path, signed_specfile_path, clearsign=True)
|
||||
|
||||
|
||||
def _read_specs_and_push_index(file_list, read_method, cache_prefix, db, temp_dir, concurrency):
|
||||
@@ -900,6 +910,7 @@ def _read_specs_and_push_index(file_list, read_method, cache_prefix, db, temp_di
|
||||
url_util.join(cache_prefix, "index.json"),
|
||||
keep_original=False,
|
||||
extra_args={"ContentType": "application/json", "CacheControl": "no-cache"},
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
|
||||
# Push the hash
|
||||
@@ -908,6 +919,7 @@ def _read_specs_and_push_index(file_list, read_method, cache_prefix, db, temp_di
|
||||
url_util.join(cache_prefix, "index.json.hash"),
|
||||
keep_original=False,
|
||||
extra_args={"ContentType": "text/plain", "CacheControl": "no-cache"},
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
|
||||
|
||||
@@ -972,9 +984,13 @@ def _specs_from_cache_fallback(cache_prefix):
|
||||
def url_read_method(url):
|
||||
contents = None
|
||||
try:
|
||||
_, _, spec_file = web_util.read_from_url(url)
|
||||
_, _, spec_file = web_util.read_from_url(
|
||||
url,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
contents = codecs.getreader("utf-8")(spec_file).read()
|
||||
except (URLError, web_util.SpackWebError) as url_err:
|
||||
except (URLError, web_util.WebError) as url_err:
|
||||
tty.error("Error reading specfile: {0}".format(url))
|
||||
tty.error(url_err)
|
||||
return contents
|
||||
@@ -982,7 +998,9 @@ def url_read_method(url):
|
||||
try:
|
||||
file_list = [
|
||||
url_util.join(cache_prefix, entry)
|
||||
for entry in web_util.list_url(cache_prefix)
|
||||
for entry in web_util.list_url(
|
||||
cache_prefix, verify_ssl=spack.config.get("config:verify_ssl", True)
|
||||
)
|
||||
if entry.endswith("spec.json") or entry.endswith("spec.json.sig")
|
||||
]
|
||||
read_fn = url_read_method
|
||||
@@ -1080,7 +1098,9 @@ def generate_key_index(key_prefix, tmpdir=None):
|
||||
try:
|
||||
fingerprints = (
|
||||
entry[:-4]
|
||||
for entry in web_util.list_url(key_prefix, recursive=False)
|
||||
for entry in web_util.list_url(
|
||||
key_prefix, recursive=False, verify_ssl=spack.config.get("config:verify_ssl", True)
|
||||
)
|
||||
if entry.endswith(".pub")
|
||||
)
|
||||
except KeyError as inst:
|
||||
@@ -1117,6 +1137,7 @@ def generate_key_index(key_prefix, tmpdir=None):
|
||||
url_util.join(key_prefix, "index.json"),
|
||||
keep_original=False,
|
||||
extra_args={"ContentType": "application/json"},
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
except Exception as err:
|
||||
msg = "Encountered problem pushing key index to {0}: {1}".format(key_prefix, err)
|
||||
@@ -1360,10 +1381,18 @@ def _build_tarball_in_stage_dir(spec: Spec, out_url: str, stage_dir: str, option
|
||||
spackfile_path = os.path.join(cache_prefix, tarball_path_name(spec, ".spack"))
|
||||
remote_spackfile_path = url_util.join(out_url, os.path.relpath(spackfile_path, stage_dir))
|
||||
|
||||
fetch_method = (spack.config.get("config:url_fetch_method", "urllib"),)
|
||||
verify_ssl = (spack.config.get("config:verify_ssl"),)
|
||||
timeout = spack.config.get("config:connect_timeout", 10)
|
||||
|
||||
url_args = {"fetch_method": fetch_method, "verify_ssl": verify_ssl, "timeout": timeout}
|
||||
|
||||
mkdirp(tarfile_dir)
|
||||
if web_util.url_exists(remote_spackfile_path):
|
||||
if web_util.url_exists(remote_spackfile_path, **url_args):
|
||||
if options.force:
|
||||
web_util.remove_url(remote_spackfile_path)
|
||||
web_util.remove_url(
|
||||
remote_spackfile_path, verify_ssl=spack.config.get("config:verify_ssl", True)
|
||||
)
|
||||
else:
|
||||
raise NoOverwriteException(url_util.format(remote_spackfile_path))
|
||||
|
||||
@@ -1383,12 +1412,13 @@ def _build_tarball_in_stage_dir(spec: Spec, out_url: str, stage_dir: str, option
|
||||
|
||||
# If force and exists, overwrite. Otherwise raise exception on collision.
|
||||
if options.force:
|
||||
if web_util.url_exists(remote_specfile_path):
|
||||
web_util.remove_url(remote_specfile_path)
|
||||
if web_util.url_exists(remote_signed_specfile_path):
|
||||
web_util.remove_url(remote_signed_specfile_path)
|
||||
elif web_util.url_exists(remote_specfile_path) or web_util.url_exists(
|
||||
remote_signed_specfile_path
|
||||
verify_ssl = spack.config.get("config:verify_ssl", True)
|
||||
if web_util.url_exists(remote_specfile_path, **url_args):
|
||||
web_util.remove_url(remote_specfile_path, verify_ssl=verify_ssl)
|
||||
if web_util.url_exists(remote_signed_specfile_path, **url_args):
|
||||
web_util.remove_url(remote_signed_specfile_path, verify_ssl=verify_ssl)
|
||||
elif web_util.url_exists(remote_specfile_path, **url_args) or web_util.url_exists(
|
||||
remote_signed_specfile_path, **url_args
|
||||
):
|
||||
raise NoOverwriteException(url_util.format(remote_specfile_path))
|
||||
|
||||
@@ -1422,11 +1452,17 @@ def _build_tarball_in_stage_dir(spec: Spec, out_url: str, stage_dir: str, option
|
||||
sign_specfile(key, options.force, specfile_path)
|
||||
|
||||
# push tarball and signed spec json to remote mirror
|
||||
web_util.push_to_url(spackfile_path, remote_spackfile_path, keep_original=False)
|
||||
web_util.push_to_url(
|
||||
spackfile_path,
|
||||
remote_spackfile_path,
|
||||
keep_original=False,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
web_util.push_to_url(
|
||||
signed_specfile_path if not options.unsigned else specfile_path,
|
||||
remote_signed_specfile_path if not options.unsigned else remote_specfile_path,
|
||||
keep_original=False,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
|
||||
# push the key to the build cache's _pgp directory so it can be
|
||||
@@ -1530,7 +1566,7 @@ def try_verify(specfile_path):
|
||||
suppress = config.get("config:suppress_gpg_warnings", False)
|
||||
|
||||
try:
|
||||
spack.util.gpg.verify(specfile_path, suppress_warnings=suppress)
|
||||
spack.gpg.verify(specfile_path, suppress_warnings=suppress)
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
@@ -2001,7 +2037,7 @@ def _extract_inner_tarball(spec, filename, extract_to, unsigned, remote_checksum
|
||||
if os.path.exists("%s.asc" % specfile_path):
|
||||
suppress = config.get("config:suppress_gpg_warnings", False)
|
||||
try:
|
||||
spack.util.gpg.verify("%s.asc" % specfile_path, specfile_path, suppress)
|
||||
spack.gpg.verify("%s.asc" % specfile_path, specfile_path, suppress)
|
||||
except Exception:
|
||||
raise NoVerifyException(
|
||||
"Spack was unable to verify package "
|
||||
@@ -2207,7 +2243,8 @@ def install_root_node(spec, unsigned=False, force=False, sha256=None):
|
||||
tty.debug("Verified SHA256 checksum of the build cache")
|
||||
|
||||
# don't print long padded paths while extracting/relocating binaries
|
||||
with spack.util.path.filter_padding():
|
||||
padding = spack.config.get("config:install_tree:padded_length", None)
|
||||
with spack.util.path.filter_padding(padding=padding):
|
||||
tty.msg('Installing "{0}" from a buildcache'.format(spec.format()))
|
||||
extract_tarball(spec, download_result, unsigned, force)
|
||||
spack.hooks.post_install(spec, False)
|
||||
@@ -2246,12 +2283,20 @@ def try_direct_fetch(spec, mirrors=None):
|
||||
mirror.fetch_url, BUILD_CACHE_RELATIVE_PATH, signed_specfile_name
|
||||
)
|
||||
try:
|
||||
_, _, fs = web_util.read_from_url(buildcache_fetch_url_signed_json)
|
||||
_, _, fs = web_util.read_from_url(
|
||||
buildcache_fetch_url_signed_json,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
specfile_is_signed = True
|
||||
except (URLError, web_util.SpackWebError, HTTPError) as url_err:
|
||||
except (URLError, web_util.WebError, HTTPError) as url_err:
|
||||
try:
|
||||
_, _, fs = web_util.read_from_url(buildcache_fetch_url_json)
|
||||
except (URLError, web_util.SpackWebError, HTTPError) as url_err_x:
|
||||
_, _, fs = web_util.read_from_url(
|
||||
buildcache_fetch_url_json,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except (URLError, web_util.WebError, HTTPError) as url_err_x:
|
||||
tty.debug(
|
||||
"Did not find {0} on {1}".format(
|
||||
specfile_name, buildcache_fetch_url_signed_json
|
||||
@@ -2355,10 +2400,19 @@ def get_keys(install=False, trust=False, force=False, mirrors=None):
|
||||
tty.debug("Finding public keys in {0}".format(url_util.format(fetch_url)))
|
||||
|
||||
try:
|
||||
_, _, json_file = web_util.read_from_url(keys_index)
|
||||
_, _, json_file = web_util.read_from_url(
|
||||
keys_index,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
json_index = sjson.load(codecs.getreader("utf-8")(json_file))
|
||||
except (URLError, web_util.SpackWebError) as url_err:
|
||||
if web_util.url_exists(keys_index):
|
||||
except (URLError, web_util.WebError) as url_err:
|
||||
if web_util.url_exists(
|
||||
keys_index,
|
||||
fetch_method=spack.config.get("config:url_fetch_method", "urllib"),
|
||||
verify_ssl=spack.config.get("config:verify_ssl"),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
):
|
||||
err_msg = [
|
||||
"Unable to find public keys in {0},",
|
||||
" caught exception attempting to read from {1}.",
|
||||
@@ -2389,7 +2443,7 @@ def get_keys(install=False, trust=False, force=False, mirrors=None):
|
||||
tty.debug("Found key {0}".format(fingerprint))
|
||||
if install:
|
||||
if trust:
|
||||
spack.util.gpg.trust(stage.save_filename)
|
||||
spack.gpg.trust(stage.save_filename)
|
||||
tty.debug("Added this key to trusted keys.")
|
||||
else:
|
||||
tty.debug(
|
||||
@@ -2407,7 +2461,7 @@ def push_keys(*mirrors, **kwargs):
|
||||
tmpdir = kwargs.get("tmpdir")
|
||||
remove_tmpdir = False
|
||||
|
||||
keys = spack.util.gpg.public_keys(*(keys or []))
|
||||
keys = spack.gpg.public_keys(*(keys or []))
|
||||
|
||||
try:
|
||||
for mirror in mirrors:
|
||||
@@ -2439,7 +2493,7 @@ def push_keys(*mirrors, **kwargs):
|
||||
export_target = os.path.join(prefix, filename)
|
||||
|
||||
# Export public keys (private is set to False)
|
||||
spack.util.gpg.export_keys(export_target, [fingerprint])
|
||||
spack.gpg.export_keys(export_target, [fingerprint])
|
||||
|
||||
# If mirror is local, the above export writes directly to the
|
||||
# mirror (export_target points directly to the mirror).
|
||||
@@ -2448,7 +2502,10 @@ def push_keys(*mirrors, **kwargs):
|
||||
# uploaded to the mirror.
|
||||
if not keys_local:
|
||||
spack.util.web.push_to_url(
|
||||
export_target, url_util.join(keys_url, filename), keep_original=False
|
||||
export_target,
|
||||
url_util.join(keys_url, filename),
|
||||
keep_original=False,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
|
||||
if regenerate_index:
|
||||
@@ -2482,7 +2539,12 @@ def needs_rebuild(spec, mirror_url):
|
||||
# Only check for the presence of the json version of the spec. If the
|
||||
# mirror only has the json version, or doesn't have the spec at all, we
|
||||
# need to rebuild.
|
||||
return not web_util.url_exists(specfile_path)
|
||||
return not web_util.url_exists(
|
||||
specfile_path,
|
||||
fetch_method=spack.config.get("config:url_fetch_method", "urllib"),
|
||||
verify_ssl=spack.config.get("config:verify_ssl"),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
|
||||
|
||||
def check_specs_against_mirrors(mirrors, specs, output_file=None):
|
||||
@@ -2648,7 +2710,11 @@ def get_remote_hash(self):
|
||||
# Failure to fetch index.json.hash is not fatal
|
||||
url_index_hash = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, "index.json.hash")
|
||||
try:
|
||||
response = self.urlopen(urllib.request.Request(url_index_hash, headers=self.headers))
|
||||
response = self.urlopen(
|
||||
urllib.request.Request(url_index_hash, headers=self.headers),
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except urllib.error.URLError:
|
||||
return None
|
||||
|
||||
@@ -2670,7 +2736,11 @@ def conditional_fetch(self) -> FetchIndexResult:
|
||||
url_index = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, "index.json")
|
||||
|
||||
try:
|
||||
response = self.urlopen(urllib.request.Request(url_index, headers=self.headers))
|
||||
response = self.urlopen(
|
||||
urllib.request.Request(url_index, headers=self.headers),
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except urllib.error.URLError as e:
|
||||
raise FetchIndexError("Could not fetch index from {}".format(url_index), e) from e
|
||||
|
||||
@@ -2718,7 +2788,11 @@ def conditional_fetch(self) -> FetchIndexResult:
|
||||
}
|
||||
|
||||
try:
|
||||
response = self.urlopen(urllib.request.Request(url, headers=headers))
|
||||
response = self.urlopen(
|
||||
urllib.request.Request(url, headers=headers),
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.getcode() == 304:
|
||||
# Not modified; that means fresh.
|
||||
|
@@ -213,7 +213,8 @@ def _root_spec(spec_str: str) -> str:
|
||||
if str(spack.platforms.host()) == "darwin":
|
||||
spec_str += " %apple-clang"
|
||||
elif str(spack.platforms.host()) == "windows":
|
||||
spec_str += " %msvc"
|
||||
# TODO (johnwparent): Remove version constraint when clingo patch is up
|
||||
spec_str += " %msvc@:19.37"
|
||||
else:
|
||||
spec_str += " %gcc"
|
||||
|
||||
|
@@ -45,7 +45,8 @@ def spec_for_current_python() -> str:
|
||||
def root_path() -> str:
|
||||
"""Root of all the bootstrap related folders"""
|
||||
return spack.util.path.canonicalize_path(
|
||||
spack.config.get("bootstrap:root", spack.paths.default_user_bootstrap_path)
|
||||
spack.config.get("bootstrap:root", spack.paths.default_user_bootstrap_path),
|
||||
replacements=spack.paths.path_replacements(),
|
||||
)
|
||||
|
||||
|
||||
@@ -79,12 +80,16 @@ def spack_python_interpreter() -> Generator:
|
||||
|
||||
def _store_path() -> str:
|
||||
bootstrap_root_path = root_path()
|
||||
return spack.util.path.canonicalize_path(os.path.join(bootstrap_root_path, "store"))
|
||||
return spack.util.path.canonicalize_path(
|
||||
os.path.join(bootstrap_root_path, "store"), replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
|
||||
def _config_path() -> str:
|
||||
bootstrap_root_path = root_path()
|
||||
return spack.util.path.canonicalize_path(os.path.join(bootstrap_root_path, "config"))
|
||||
return spack.util.path.canonicalize_path(
|
||||
os.path.join(bootstrap_root_path, "config"), replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
@@ -92,7 +92,9 @@ class Bootstrapper:
|
||||
def __init__(self, conf: ConfigDictionary) -> None:
|
||||
self.conf = conf
|
||||
self.name = conf["name"]
|
||||
self.metadata_dir = spack.util.path.canonicalize_path(conf["metadata"])
|
||||
self.metadata_dir = spack.util.path.canonicalize_path(
|
||||
conf["metadata"], replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
# Promote (relative) paths to file urls
|
||||
url = conf["info"]["url"]
|
||||
@@ -585,7 +587,9 @@ def bootstrapping_sources(scope: Optional[str] = None):
|
||||
list_of_sources = []
|
||||
for entry in source_configs:
|
||||
current = copy.copy(entry)
|
||||
metadata_dir = spack.util.path.canonicalize_path(entry["metadata"])
|
||||
metadata_dir = spack.util.path.canonicalize_path(
|
||||
entry["metadata"], replacements=spack.paths.path_replacements()
|
||||
)
|
||||
metadata_yaml = os.path.join(metadata_dir, METADATA_YAML_FILENAME)
|
||||
with open(metadata_yaml, encoding="utf-8") as stream:
|
||||
current.update(spack.util.spack_yaml.load(stream))
|
||||
|
@@ -16,6 +16,7 @@
|
||||
from llnl.util import tty
|
||||
|
||||
import spack.environment
|
||||
import spack.paths
|
||||
import spack.tengine
|
||||
import spack.util.cpus
|
||||
import spack.util.executable
|
||||
@@ -50,7 +51,8 @@ def environment_root(cls) -> pathlib.Path:
|
||||
environment_dir = f"{python_part}-{arch_part}-{interpreter_part}"
|
||||
return pathlib.Path(
|
||||
spack.util.path.canonicalize_path(
|
||||
os.path.join(bootstrap_root_path, "environments", environment_dir)
|
||||
os.path.join(bootstrap_root_path, "environments", environment_dir),
|
||||
replacements=spack.paths.path_replacements(),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -137,7 +139,9 @@ def _install_with_depfile(self) -> None:
|
||||
"-C",
|
||||
str(self.environment_root()),
|
||||
"-j",
|
||||
str(spack.util.cpus.determine_number_of_jobs(parallel=True)),
|
||||
str(
|
||||
spack.util.cpus.determine_number_of_jobs(parallel=True, config=spack.config.CONFIG)
|
||||
),
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
@@ -161,7 +165,7 @@ def _write_spack_yaml_file(self) -> None:
|
||||
|
||||
def isort_root_spec() -> str:
|
||||
"""Return the root spec used to bootstrap isort"""
|
||||
return _root_spec("py-isort@4.3.5:")
|
||||
return _root_spec("py-isort@5")
|
||||
|
||||
|
||||
def mypy_root_spec() -> str:
|
||||
|
@@ -324,19 +324,29 @@ def set_compiler_environment_variables(pkg, env):
|
||||
# ttyout, ttyerr, etc.
|
||||
link_dir = spack.paths.build_env_path
|
||||
|
||||
# Set SPACK compiler variables so that our wrapper knows what to call
|
||||
# Set SPACK compiler variables so that our wrapper knows what to
|
||||
# call. If there is no compiler configured then use a default
|
||||
# wrapper which will emit an error if it is used.
|
||||
if compiler.cc:
|
||||
env.set("SPACK_CC", compiler.cc)
|
||||
env.set("CC", os.path.join(link_dir, compiler.link_paths["cc"]))
|
||||
else:
|
||||
env.set("CC", os.path.join(link_dir, "cc"))
|
||||
if compiler.cxx:
|
||||
env.set("SPACK_CXX", compiler.cxx)
|
||||
env.set("CXX", os.path.join(link_dir, compiler.link_paths["cxx"]))
|
||||
else:
|
||||
env.set("CC", os.path.join(link_dir, "c++"))
|
||||
if compiler.f77:
|
||||
env.set("SPACK_F77", compiler.f77)
|
||||
env.set("F77", os.path.join(link_dir, compiler.link_paths["f77"]))
|
||||
else:
|
||||
env.set("F77", os.path.join(link_dir, "f77"))
|
||||
if compiler.fc:
|
||||
env.set("SPACK_FC", compiler.fc)
|
||||
env.set("FC", os.path.join(link_dir, compiler.link_paths["fc"]))
|
||||
else:
|
||||
env.set("FC", os.path.join(link_dir, "fc"))
|
||||
|
||||
# Set SPACK compiler rpath flags so that our wrapper knows what to use
|
||||
env.set("SPACK_CC_RPATH_ARG", compiler.cc_rpath_arg)
|
||||
@@ -743,15 +753,16 @@ def setup_package(pkg, dirty, context: Context = Context.BUILD):
|
||||
set_compiler_environment_variables(pkg, env_mods)
|
||||
set_wrapper_variables(pkg, env_mods)
|
||||
|
||||
tty.debug("setup_package: grabbing modifications from dependencies")
|
||||
env_mods.extend(setup_context.get_env_modifications())
|
||||
tty.debug("setup_package: collected all modifications from dependencies")
|
||||
|
||||
# architecture specific setup
|
||||
# Platform specific setup goes before package specific setup. This is for setting
|
||||
# defaults like MACOSX_DEPLOYMENT_TARGET on macOS.
|
||||
platform = spack.platforms.by_name(pkg.spec.architecture.platform)
|
||||
target = platform.target(pkg.spec.architecture.target)
|
||||
platform.setup_platform_environment(pkg, env_mods)
|
||||
|
||||
tty.debug("setup_package: grabbing modifications from dependencies")
|
||||
env_mods.extend(setup_context.get_env_modifications())
|
||||
tty.debug("setup_package: collected all modifications from dependencies")
|
||||
|
||||
if context == Context.TEST:
|
||||
env_mods.prepend_path("PATH", ".")
|
||||
elif context == Context.BUILD and not dirty and not env_mods.is_unset("CPATH"):
|
||||
|
89
lib/spack/spack/build_systems/cargo.py
Normal file
89
lib/spack/spack/build_systems/cargo.py
Normal file
@@ -0,0 +1,89 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import inspect
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
|
||||
import spack.builder
|
||||
import spack.package_base
|
||||
from spack.directives import build_system, depends_on
|
||||
from spack.multimethod import when
|
||||
|
||||
from ._checks import BaseBuilder, execute_install_time_tests
|
||||
|
||||
|
||||
class CargoPackage(spack.package_base.PackageBase):
|
||||
"""Specialized class for packages built using a Makefiles."""
|
||||
|
||||
#: This attribute is used in UI queries that need to know the build
|
||||
#: system base class
|
||||
build_system_class = "CargoPackage"
|
||||
|
||||
build_system("cargo")
|
||||
|
||||
with when("build_system=cargo"):
|
||||
depends_on("rust", type="build")
|
||||
|
||||
|
||||
@spack.builder.builder("cargo")
|
||||
class CargoBuilder(BaseBuilder):
|
||||
"""The Cargo builder encodes the most common way of building software with
|
||||
a rust Cargo.toml file. It has two phases that can be overridden, if need be:
|
||||
|
||||
1. :py:meth:`~.CargoBuilder.build`
|
||||
2. :py:meth:`~.CargoBuilder.install`
|
||||
|
||||
For a finer tuning you may override:
|
||||
|
||||
+-----------------------------------------------+----------------------+
|
||||
| **Method** | **Purpose** |
|
||||
+===============================================+======================+
|
||||
| :py:meth:`~.CargoBuilder.build_args` | Specify arguments |
|
||||
| | to ``cargo install`` |
|
||||
+-----------------------------------------------+----------------------+
|
||||
| :py:meth:`~.CargoBuilder.check_args` | Specify arguments |
|
||||
| | to ``cargo test`` |
|
||||
+-----------------------------------------------+----------------------+
|
||||
"""
|
||||
|
||||
phases = ("build", "install")
|
||||
|
||||
#: Callback names for install-time test
|
||||
install_time_test_callbacks = ["check"]
|
||||
|
||||
@property
|
||||
def build_directory(self):
|
||||
"""Return the directory containing the main Cargo.toml."""
|
||||
return self.pkg.stage.source_path
|
||||
|
||||
@property
|
||||
def build_args(self):
|
||||
"""Arguments for ``cargo build``."""
|
||||
return []
|
||||
|
||||
@property
|
||||
def check_args(self):
|
||||
"""Argument for ``cargo test`` during check phase"""
|
||||
return []
|
||||
|
||||
def build(self, pkg, spec, prefix):
|
||||
"""Runs ``cargo install`` in the source directory"""
|
||||
with fs.working_dir(self.build_directory):
|
||||
inspect.getmodule(pkg).cargo(
|
||||
"install", "--root", "out", "--path", ".", *self.build_args
|
||||
)
|
||||
|
||||
def install(self, pkg, spec, prefix):
|
||||
"""Copy build files into package prefix."""
|
||||
with fs.working_dir(self.build_directory):
|
||||
fs.install_tree("out", prefix)
|
||||
|
||||
spack.builder.run_after("install")(execute_install_time_tests)
|
||||
|
||||
def check(self):
|
||||
"""Run "cargo test"."""
|
||||
with fs.working_dir(self.build_directory):
|
||||
inspect.getmodule(self.pkg).cargo("test", *self.check_args)
|
@@ -136,12 +136,12 @@ def cuda_flags(arch_list):
|
||||
conflicts("%gcc@11:", when="+cuda ^cuda@:11.4.0")
|
||||
conflicts("%gcc@11.2:", when="+cuda ^cuda@:11.5")
|
||||
conflicts("%gcc@12:", when="+cuda ^cuda@:11.8")
|
||||
conflicts("%gcc@13:", when="+cuda ^cuda@:12.1")
|
||||
conflicts("%gcc@13:", when="+cuda ^cuda@:12.3")
|
||||
conflicts("%clang@12:", when="+cuda ^cuda@:11.4.0")
|
||||
conflicts("%clang@13:", when="+cuda ^cuda@:11.5")
|
||||
conflicts("%clang@14:", when="+cuda ^cuda@:11.7")
|
||||
conflicts("%clang@15:", when="+cuda ^cuda@:12.0")
|
||||
conflicts("%clang@16:", when="+cuda ^cuda@:12.1")
|
||||
conflicts("%clang@16:", when="+cuda ^cuda@:12.3")
|
||||
|
||||
# https://gist.github.com/ax3l/9489132#gistcomment-3860114
|
||||
conflicts("%gcc@10", when="+cuda ^cuda@:11.4.0")
|
||||
|
98
lib/spack/spack/build_systems/go.py
Normal file
98
lib/spack/spack/build_systems/go.py
Normal file
@@ -0,0 +1,98 @@
|
||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import inspect
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
|
||||
import spack.builder
|
||||
import spack.package_base
|
||||
from spack.directives import build_system, extends
|
||||
from spack.multimethod import when
|
||||
|
||||
from ._checks import BaseBuilder, execute_install_time_tests
|
||||
|
||||
|
||||
class GoPackage(spack.package_base.PackageBase):
|
||||
"""Specialized class for packages built using the Go toolchain."""
|
||||
|
||||
#: This attribute is used in UI queries that need to know the build
|
||||
#: system base class
|
||||
build_system_class = "GoPackage"
|
||||
|
||||
#: Legacy buildsystem attribute used to deserialize and install old specs
|
||||
legacy_buildsystem = "go"
|
||||
|
||||
build_system("go")
|
||||
|
||||
with when("build_system=go"):
|
||||
# TODO: this seems like it should be depends_on, see
|
||||
# setup_dependent_build_environment in go for why I kept it like this
|
||||
extends("go@1.14:", type="build")
|
||||
|
||||
|
||||
@spack.builder.builder("go")
|
||||
class GoBuilder(BaseBuilder):
|
||||
"""The Go builder encodes the most common way of building software with
|
||||
a golang go.mod file. It has two phases that can be overridden, if need be:
|
||||
|
||||
1. :py:meth:`~.GoBuilder.build`
|
||||
2. :py:meth:`~.GoBuilder.install`
|
||||
|
||||
For a finer tuning you may override:
|
||||
|
||||
+-----------------------------------------------+--------------------+
|
||||
| **Method** | **Purpose** |
|
||||
+===============================================+====================+
|
||||
| :py:meth:`~.GoBuilder.build_args` | Specify arguments |
|
||||
| | to ``go build`` |
|
||||
+-----------------------------------------------+--------------------+
|
||||
| :py:meth:`~.GoBuilder.check_args` | Specify arguments |
|
||||
| | to ``go test`` |
|
||||
+-----------------------------------------------+--------------------+
|
||||
"""
|
||||
|
||||
phases = ("build", "install")
|
||||
|
||||
#: Callback names for install-time test
|
||||
install_time_test_callbacks = ["check"]
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
env.set("GO111MODULE", "on")
|
||||
env.set("GOTOOLCHAIN", "local")
|
||||
|
||||
@property
|
||||
def build_directory(self):
|
||||
"""Return the directory containing the main go.mod."""
|
||||
return self.pkg.stage.source_path
|
||||
|
||||
@property
|
||||
def build_args(self):
|
||||
"""Arguments for ``go build``."""
|
||||
# Pass ldflags -s = --strip-all and -w = --no-warnings by default
|
||||
return ["-ldflags", "-s -w", "-o", f"{self.pkg.name}"]
|
||||
|
||||
@property
|
||||
def check_args(self):
|
||||
"""Argument for ``go test`` during check phase"""
|
||||
return []
|
||||
|
||||
def build(self, pkg, spec, prefix):
|
||||
"""Runs ``go build`` in the source directory"""
|
||||
with fs.working_dir(self.build_directory):
|
||||
inspect.getmodule(pkg).go("build", *self.build_args)
|
||||
|
||||
def install(self, pkg, spec, prefix):
|
||||
"""Install built binaries into prefix bin."""
|
||||
with fs.working_dir(self.build_directory):
|
||||
fs.mkdirp(prefix.bin)
|
||||
fs.install(pkg.name, prefix.bin)
|
||||
|
||||
spack.builder.run_after("install")(execute_install_time_tests)
|
||||
|
||||
def check(self):
|
||||
"""Run ``go test .`` in the source directory"""
|
||||
with fs.working_dir(self.build_directory):
|
||||
inspect.getmodule(self.pkg).go("test", *self.check_args)
|
@@ -7,9 +7,9 @@
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
from os.path import basename, dirname, isdir
|
||||
from os.path import basename, isdir
|
||||
|
||||
from llnl.util.filesystem import find_headers, find_libraries, join_path, mkdirp
|
||||
from llnl.util.filesystem import HeaderList, find_libraries, join_path, mkdirp
|
||||
from llnl.util.link_tree import LinkTree
|
||||
|
||||
from spack.directives import conflicts, variant
|
||||
@@ -55,10 +55,21 @@ def component_dir(self):
|
||||
"""Subdirectory for this component in the install prefix."""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def v2_layout_versions(self):
|
||||
"""Version that implements the v2 directory layout."""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def v2_layout(self):
|
||||
"""Returns true if this version implements the v2 directory layout."""
|
||||
return self.spec.satisfies(self.v2_layout_versions)
|
||||
|
||||
@property
|
||||
def component_prefix(self):
|
||||
"""Path to component <prefix>/<component>/<version>."""
|
||||
return self.prefix.join(join_path(self.component_dir, self.spec.version))
|
||||
v = self.spec.version.up_to(2) if self.v2_layout else self.spec.version
|
||||
return self.prefix.join(self.component_dir).join(str(v))
|
||||
|
||||
@property
|
||||
def env_script_args(self):
|
||||
@@ -112,8 +123,9 @@ def install_component(self, installer_path):
|
||||
shutil.rmtree("/var/intel/installercache", ignore_errors=True)
|
||||
|
||||
# Some installers have a bug and do not return an error code when failing
|
||||
if not isdir(join_path(self.prefix, self.component_dir)):
|
||||
raise RuntimeError("install failed")
|
||||
install_dir = self.component_prefix
|
||||
if not isdir(install_dir):
|
||||
raise RuntimeError("install failed to directory: {0}".format(install_dir))
|
||||
|
||||
def setup_run_environment(self, env):
|
||||
"""Adds environment variables to the generated module file.
|
||||
@@ -128,7 +140,7 @@ def setup_run_environment(self, env):
|
||||
if "~envmods" not in self.spec:
|
||||
env.extend(
|
||||
EnvironmentModifications.from_sourcing_file(
|
||||
join_path(self.component_prefix, "env", "vars.sh"), *self.env_script_args
|
||||
self.component_prefix.env.join("vars.sh"), *self.env_script_args
|
||||
)
|
||||
)
|
||||
|
||||
@@ -167,16 +179,21 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage):
|
||||
|
||||
"""
|
||||
|
||||
def header_directories(self, dirs):
|
||||
h = HeaderList([])
|
||||
h.directories = dirs
|
||||
return h
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
include_path = join_path(self.component_prefix, "include")
|
||||
return find_headers("*", include_path, recursive=True)
|
||||
return self.header_directories(
|
||||
[self.component_prefix.include, self.component_prefix.include.join(self.component_dir)]
|
||||
)
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
lib_path = join_path(self.component_prefix, "lib", "intel64")
|
||||
lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
|
||||
return find_libraries("*", root=lib_path, shared=True, recursive=True)
|
||||
# for v2_layout all libraries are in the top level, v1 sometimes put them in intel64
|
||||
return find_libraries("*", root=self.component_prefix.lib, recursive=not self.v2_layout)
|
||||
|
||||
|
||||
class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
|
||||
@@ -189,23 +206,13 @@ class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
|
||||
|
||||
"""
|
||||
|
||||
@property
|
||||
def include(self):
|
||||
return join_path(self.component_prefix, "sdk", "include")
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
return find_headers("*", self.include, recursive=True)
|
||||
|
||||
@property
|
||||
def lib(self):
|
||||
lib_path = join_path(self.component_prefix, "sdk", "lib64")
|
||||
lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
|
||||
return lib_path
|
||||
return self.header_directories([self.component_prefix.sdk.include])
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
return find_libraries("*", root=self.lib, shared=True, recursive=True)
|
||||
return find_libraries("*", self.component_prefix.sdk.lib64)
|
||||
|
||||
|
||||
class IntelOneApiStaticLibraryList:
|
||||
|
@@ -10,6 +10,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.builder
|
||||
import spack.config
|
||||
from spack.build_environment import SPACK_NO_PARALLEL_MAKE
|
||||
from spack.directives import build_system, extends, maintainers
|
||||
from spack.package_base import PackageBase
|
||||
@@ -93,7 +94,7 @@ def install(self, pkg, spec, prefix):
|
||||
"--copy",
|
||||
"-i",
|
||||
"-j",
|
||||
str(determine_number_of_jobs(parallel=parallel)),
|
||||
str(determine_number_of_jobs(parallel=parallel, config=spack.config.CONFIG)),
|
||||
"--",
|
||||
os.getcwd(),
|
||||
]
|
||||
|
@@ -26,7 +26,7 @@ def misc_cache_location():
|
||||
providers and for which packages provide which tags.
|
||||
"""
|
||||
path = spack.config.get("config:misc_cache", spack.paths.default_misc_cache_path)
|
||||
return spack.util.path.canonicalize_path(path)
|
||||
return spack.util.path.canonicalize_path(path, replacements=spack.paths.path_replacements())
|
||||
|
||||
|
||||
def _misc_cache():
|
||||
@@ -49,7 +49,7 @@ def fetch_cache_location():
|
||||
path = spack.config.get("config:source_cache")
|
||||
if not path:
|
||||
path = spack.paths.default_fetch_cache_path
|
||||
path = spack.util.path.canonicalize_path(path)
|
||||
path = spack.util.path.canonicalize_path(path, replacements=spack.paths.path_replacements())
|
||||
return path
|
||||
|
||||
|
||||
|
@@ -31,13 +31,13 @@
|
||||
import spack.binary_distribution as bindist
|
||||
import spack.config as cfg
|
||||
import spack.environment as ev
|
||||
import spack.gpg
|
||||
import spack.main
|
||||
import spack.mirror
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.util.git
|
||||
import spack.util.gpg as gpg_util
|
||||
import spack.util.spack_yaml as syaml
|
||||
import spack.util.url as url_util
|
||||
import spack.util.web as web_util
|
||||
@@ -1454,13 +1454,13 @@ def can_sign_binaries():
|
||||
"""Utility method to determine if this spack instance is capable of
|
||||
signing binary packages. This is currently only possible if the
|
||||
spack gpg keystore contains exactly one secret key."""
|
||||
return len(gpg_util.signing_keys()) == 1
|
||||
return len(spack.gpg.signing_keys()) == 1
|
||||
|
||||
|
||||
def can_verify_binaries():
|
||||
"""Utility method to determin if this spack instance is capable (at
|
||||
least in theory) of verifying signed binaries."""
|
||||
return len(gpg_util.public_keys()) >= 1
|
||||
return len(spack.gpg.public_keys()) >= 1
|
||||
|
||||
|
||||
def _push_mirror_contents(input_spec, sign_binaries, mirror_url):
|
||||
@@ -1756,7 +1756,11 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime):
|
||||
|
||||
gpg_path = None
|
||||
if gpg_url:
|
||||
gpg_path = web_util.fetch_url_text(gpg_url, dest_dir=os.path.join(work_dir, "_pgp"))
|
||||
gpg_path = web_util.fetch_url_text(
|
||||
gpg_url,
|
||||
dest_dir=os.path.join(work_dir, "_pgp"),
|
||||
fetch_method=spack.config.get("config:url_fetch_method"),
|
||||
)
|
||||
rel_gpg_path = gpg_path.replace(work_dir, "").lstrip(os.path.sep)
|
||||
|
||||
lock_file = fs.find(work_dir, "spack.lock")[0]
|
||||
@@ -2113,7 +2117,11 @@ def write_broken_spec(url, pkg_name, stack_name, job_url, pipeline_url, spec_dic
|
||||
with open(file_path, "w") as fd:
|
||||
fd.write(syaml.dump(broken_spec_details))
|
||||
web_util.push_to_url(
|
||||
file_path, url, keep_original=False, extra_args={"ContentType": "text/plain"}
|
||||
file_path,
|
||||
url,
|
||||
keep_original=False,
|
||||
extra_args={"ContentType": "text/plain"},
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
except Exception as err:
|
||||
# If there is an S3 error (e.g., access denied or connection
|
||||
@@ -2130,8 +2138,12 @@ def read_broken_spec(broken_spec_url):
|
||||
object.
|
||||
"""
|
||||
try:
|
||||
_, _, fs = web_util.read_from_url(broken_spec_url)
|
||||
except (URLError, web_util.SpackWebError, HTTPError):
|
||||
_, _, fs = web_util.read_from_url(
|
||||
broken_spec_url,
|
||||
verify_ssl=cfg.get("config:verify_ssl", True),
|
||||
timeout=cfg.get("config:connect_timeout", 10),
|
||||
)
|
||||
except (URLError, web_util.WebError, HTTPError):
|
||||
tty.warn("Unable to read broken spec from {0}".format(broken_spec_url))
|
||||
return None
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "add a spec to an environment"
|
||||
section = "environments"
|
||||
|
@@ -15,13 +15,14 @@
|
||||
import spack.bootstrap
|
||||
import spack.bootstrap.config
|
||||
import spack.bootstrap.core
|
||||
import spack.cmd.common.arguments
|
||||
import spack.config
|
||||
import spack.main
|
||||
import spack.mirror
|
||||
import spack.paths
|
||||
import spack.spec
|
||||
import spack.stage
|
||||
import spack.util.path
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "manage bootstrap configuration"
|
||||
section = "system"
|
||||
@@ -68,12 +69,8 @@
|
||||
|
||||
|
||||
def _add_scope_option(parser):
|
||||
scopes = spack.config.scopes()
|
||||
parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
help="configuration scope to read/modify",
|
||||
"--scope", action=arguments.ConfigScope, help="configuration scope to read/modify"
|
||||
)
|
||||
|
||||
|
||||
@@ -106,7 +103,7 @@ def setup_parser(subparser):
|
||||
disable.add_argument("name", help="name of the source to be disabled", nargs="?", default=None)
|
||||
|
||||
reset = sp.add_parser("reset", help="reset bootstrapping configuration to Spack defaults")
|
||||
spack.cmd.common.arguments.add_common_arguments(reset, ["yes_to_all"])
|
||||
arguments.add_common_arguments(reset, ["yes_to_all"])
|
||||
|
||||
root = sp.add_parser("root", help="get/set the root bootstrap directory")
|
||||
_add_scope_option(root)
|
||||
@@ -195,7 +192,9 @@ def _root(args):
|
||||
|
||||
root = spack.config.get("bootstrap:root", default=None, scope=args.scope)
|
||||
if root:
|
||||
root = spack.util.path.canonicalize_path(root)
|
||||
root = spack.util.path.canonicalize_path(
|
||||
root, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
print(root)
|
||||
|
||||
|
||||
@@ -339,7 +338,9 @@ def _add(args):
|
||||
raise RuntimeError(msg.format(args.name))
|
||||
|
||||
# Check that the metadata file exists
|
||||
metadata_dir = spack.util.path.canonicalize_path(args.metadata_dir)
|
||||
metadata_dir = spack.util.path.canonicalize_path(
|
||||
args.metadata_dir, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
if not os.path.exists(metadata_dir) or not os.path.isdir(metadata_dir):
|
||||
raise RuntimeError('the directory "{0}" does not exist'.format(args.metadata_dir))
|
||||
|
||||
@@ -388,7 +389,9 @@ def _remove(args):
|
||||
|
||||
|
||||
def _mirror(args):
|
||||
mirror_dir = spack.util.path.canonicalize_path(os.path.join(args.root_dir, LOCAL_MIRROR_DIR))
|
||||
mirror_dir = spack.util.path.canonicalize_path(
|
||||
os.path.join(args.root_dir, LOCAL_MIRROR_DIR), replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
# TODO: Here we are adding gnuconfig manually, but this can be fixed
|
||||
# TODO: as soon as we have an option to add to a mirror all the possible
|
||||
@@ -437,9 +440,24 @@ def write_metadata(subdir, metadata):
|
||||
instructions += cmd.format("local-sources", rel_directory)
|
||||
if args.binary_packages:
|
||||
abs_directory, rel_directory = write_metadata(subdir="binaries", metadata=BINARY_METADATA)
|
||||
shutil.copy(spack.util.path.canonicalize_path(CLINGO_JSON), abs_directory)
|
||||
shutil.copy(spack.util.path.canonicalize_path(GNUPG_JSON), abs_directory)
|
||||
shutil.copy(spack.util.path.canonicalize_path(PATCHELF_JSON), abs_directory)
|
||||
shutil.copy(
|
||||
spack.util.path.canonicalize_path(
|
||||
CLINGO_JSON, replacements=spack.paths.path_replacements()
|
||||
),
|
||||
abs_directory,
|
||||
)
|
||||
shutil.copy(
|
||||
spack.util.path.canonicalize_path(
|
||||
GNUPG_JSON, replacements=spack.paths.path_replacements()
|
||||
),
|
||||
abs_directory,
|
||||
)
|
||||
shutil.copy(
|
||||
spack.util.path.canonicalize_path(
|
||||
PATCHELF_JSON, replacements=spack.paths.path_replacements()
|
||||
),
|
||||
abs_directory,
|
||||
)
|
||||
instructions += cmd.format("local-binaries", rel_directory)
|
||||
print(instructions)
|
||||
|
||||
|
@@ -21,7 +21,6 @@
|
||||
|
||||
import spack.binary_distribution as bindist
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.error
|
||||
@@ -40,6 +39,7 @@
|
||||
import spack.util.web as web_util
|
||||
from spack.build_environment import determine_number_of_jobs
|
||||
from spack.cmd import display_specs
|
||||
from spack.cmd.common import arguments
|
||||
from spack.oci.image import (
|
||||
Digest,
|
||||
ImageReference,
|
||||
@@ -182,13 +182,10 @@ def setup_parser(subparser: argparse.ArgumentParser):
|
||||
)
|
||||
|
||||
# used to construct scope arguments below
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
check.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope containing mirrors to check",
|
||||
)
|
||||
check_spec_or_specfile = check.add_mutually_exclusive_group(required=True)
|
||||
@@ -921,7 +918,12 @@ def copy_buildcache_file(src_url, dest_url, local_path=None):
|
||||
try:
|
||||
temp_stage.create()
|
||||
temp_stage.fetch()
|
||||
web_util.push_to_url(local_path, dest_url, keep_original=True)
|
||||
web_util.push_to_url(
|
||||
local_path,
|
||||
dest_url,
|
||||
keep_original=True,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
except spack.error.FetchError as e:
|
||||
# Expected, since we have to try all the possible extensions
|
||||
tty.debug("no such file: {0}".format(src_url))
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "change an existing spec in an environment"
|
||||
section = "environments"
|
||||
|
@@ -11,6 +11,7 @@
|
||||
from llnl.util import tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.config
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.stage
|
||||
@@ -275,4 +276,4 @@ def add_versions_to_package(pkg: PackageBase, version_lines: str):
|
||||
tty.msg(f"Open {filename} to review the additions.")
|
||||
|
||||
if sys.stdout.isatty():
|
||||
editor(filename)
|
||||
editor(filename, debug=spack.config.get("config:debug"))
|
||||
|
@@ -16,9 +16,9 @@
|
||||
import spack.cmd.buildcache as buildcache
|
||||
import spack.config as cfg
|
||||
import spack.environment as ev
|
||||
import spack.gpg
|
||||
import spack.hash_types as ht
|
||||
import spack.mirror
|
||||
import spack.util.gpg as gpg_util
|
||||
import spack.util.timer as timer
|
||||
import spack.util.url as url_util
|
||||
import spack.util.web as web_util
|
||||
@@ -305,7 +305,7 @@ def ci_rebuild(args):
|
||||
# Fail early if signing is required but we don't have a signing key
|
||||
sign_binaries = require_signing is not None and require_signing.lower() == "true"
|
||||
if sign_binaries and not spack_ci.can_sign_binaries():
|
||||
gpg_util.list(False, True)
|
||||
spack.gpg.list(False, True)
|
||||
tty.die("SPACK_REQUIRE_SIGNING=True => spack must have exactly one signing key")
|
||||
|
||||
# Construct absolute paths relative to current $CI_PROJECT_DIR
|
||||
@@ -730,10 +730,17 @@ def ci_rebuild(args):
|
||||
broken_specs_url = ci_config["broken-specs-url"]
|
||||
just_built_hash = job_spec.dag_hash()
|
||||
broken_spec_path = url_util.join(broken_specs_url, just_built_hash)
|
||||
if web_util.url_exists(broken_spec_path):
|
||||
if web_util.url_exists(
|
||||
broken_spec_path,
|
||||
fetch_method=cfg.get("config:url_fetch_method", "urllib"),
|
||||
verify_ssl=cfg.get("config:verify_ssl"),
|
||||
timeout=cfg.get("config:connect_timeout", 10),
|
||||
):
|
||||
tty.msg("Removing {0} from the list of broken specs".format(broken_spec_path))
|
||||
try:
|
||||
web_util.remove_url(broken_spec_path)
|
||||
web_util.remove_url(
|
||||
broken_spec_path, verify_ssl=cfg.get("config:verify_ssl", True)
|
||||
)
|
||||
except Exception as err:
|
||||
# If there is an S3 error (e.g., access denied or connection
|
||||
# error), the first non boto-specific class in the exception
|
||||
|
@@ -12,13 +12,14 @@
|
||||
|
||||
import spack.bootstrap
|
||||
import spack.caches
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.cmd.test
|
||||
import spack.config
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.stage
|
||||
import spack.store
|
||||
import spack.util.path
|
||||
from spack.cmd.common import arguments
|
||||
from spack.paths import lib_path, var_path
|
||||
|
||||
description = "remove temporary build files and/or downloaded archives"
|
||||
@@ -133,7 +134,9 @@ def clean(parser, args):
|
||||
remove_python_cache()
|
||||
|
||||
if args.bootstrap:
|
||||
bootstrap_prefix = spack.util.path.canonicalize_path(spack.config.get("bootstrap:root"))
|
||||
bootstrap_prefix = spack.util.path.canonicalize_path(
|
||||
spack.config.get("bootstrap:root"), replacements=spack.paths.path_replacements()
|
||||
)
|
||||
msg = 'Removing bootstrapped software and configuration in "{0}"'
|
||||
tty.msg(msg.format(bootstrap_prefix))
|
||||
llnl.util.filesystem.remove_directory_contents(bootstrap_prefix)
|
||||
|
@@ -124,6 +124,33 @@ def __call__(self, parser, namespace, values, option_string=None):
|
||||
setattr(namespace, self.dest, deptype)
|
||||
|
||||
|
||||
class ConfigScope(argparse.Action):
|
||||
"""Pick the currently configured config scopes."""
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
kwargs.setdefault("metavar", spack.config.SCOPES_METAVAR)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def default(self):
|
||||
return self._default() if callable(self._default) else self._default
|
||||
|
||||
@default.setter
|
||||
def default(self, value):
|
||||
self._default = value
|
||||
|
||||
@property
|
||||
def choices(self):
|
||||
return spack.config.scopes().keys()
|
||||
|
||||
@choices.setter
|
||||
def choices(self, value):
|
||||
pass
|
||||
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
setattr(namespace, self.dest, values)
|
||||
|
||||
|
||||
def _cdash_reporter(namespace):
|
||||
"""Helper function to create a CDash reporter. This function gets an early reference to the
|
||||
argparse namespace under construction, so it can later use it to create the object.
|
||||
|
@@ -8,13 +8,13 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.deptypes as dt
|
||||
import spack.error
|
||||
import spack.paths
|
||||
import spack.spec
|
||||
import spack.store
|
||||
from spack import build_environment, traverse
|
||||
from spack.cmd.common import arguments
|
||||
from spack.context import Context
|
||||
from spack.util.environment import dump_environment, pickle_environment
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
import spack.compilers
|
||||
import spack.config
|
||||
import spack.spec
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "manage compilers"
|
||||
section = "system"
|
||||
@@ -23,8 +24,6 @@
|
||||
def setup_parser(subparser):
|
||||
sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="compiler_command")
|
||||
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
# Find
|
||||
find_parser = sp.add_parser(
|
||||
"find",
|
||||
@@ -47,9 +46,8 @@ def setup_parser(subparser):
|
||||
find_parser.add_argument("add_paths", nargs=argparse.REMAINDER)
|
||||
find_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope("compilers"),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope("compilers"),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
|
||||
@@ -60,20 +58,15 @@ def setup_parser(subparser):
|
||||
)
|
||||
remove_parser.add_argument("compiler_spec")
|
||||
remove_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=None,
|
||||
help="configuration scope to modify",
|
||||
"--scope", action=arguments.ConfigScope, default=None, help="configuration scope to modify"
|
||||
)
|
||||
|
||||
# List
|
||||
list_parser = sp.add_parser("list", help="list available compilers")
|
||||
list_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_list_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_list_scope(),
|
||||
help="configuration scope to read from",
|
||||
)
|
||||
|
||||
@@ -82,9 +75,8 @@ def setup_parser(subparser):
|
||||
info_parser.add_argument("compiler_spec")
|
||||
info_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_list_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_list_scope(),
|
||||
help="configuration scope to read from",
|
||||
)
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import spack.config
|
||||
from spack.cmd.common import arguments
|
||||
from spack.cmd.compiler import compiler_list
|
||||
|
||||
description = "list available compilers"
|
||||
@@ -12,13 +12,8 @@
|
||||
|
||||
|
||||
def setup_parser(subparser):
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
subparser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
help="configuration scope to read/modify",
|
||||
"--scope", action=arguments.ConfigScope, help="configuration scope to read/modify"
|
||||
)
|
||||
|
||||
|
||||
|
@@ -10,7 +10,6 @@
|
||||
import llnl.util.filesystem as fs
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd.common.arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.repo
|
||||
@@ -18,6 +17,7 @@
|
||||
import spack.schema.packages
|
||||
import spack.store
|
||||
import spack.util.spack_yaml as syaml
|
||||
from spack.cmd.common import arguments
|
||||
from spack.util.editor import editor
|
||||
|
||||
description = "get and set configuration options"
|
||||
@@ -26,14 +26,9 @@
|
||||
|
||||
|
||||
def setup_parser(subparser):
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
# User can only choose one
|
||||
subparser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
help="configuration scope to read/modify",
|
||||
"--scope", action=arguments.ConfigScope, help="configuration scope to read/modify"
|
||||
)
|
||||
|
||||
sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="config_command")
|
||||
@@ -101,13 +96,13 @@ def setup_parser(subparser):
|
||||
setup_parser.add_parser = add_parser
|
||||
|
||||
update = sp.add_parser("update", help="update configuration files to the latest format")
|
||||
spack.cmd.common.arguments.add_common_arguments(update, ["yes_to_all"])
|
||||
arguments.add_common_arguments(update, ["yes_to_all"])
|
||||
update.add_argument("section", help="section to update")
|
||||
|
||||
revert = sp.add_parser(
|
||||
"revert", help="revert configuration files to their state before update"
|
||||
)
|
||||
spack.cmd.common.arguments.add_common_arguments(revert, ["yes_to_all"])
|
||||
arguments.add_common_arguments(revert, ["yes_to_all"])
|
||||
revert.add_argument("section", help="section to update")
|
||||
|
||||
|
||||
@@ -185,7 +180,7 @@ def config_edit(args):
|
||||
if args.print_file:
|
||||
print(config_file)
|
||||
else:
|
||||
editor(config_file)
|
||||
editor(config_file, debug=spack.config.get("config:debug"))
|
||||
|
||||
|
||||
def config_list(args):
|
||||
|
@@ -11,6 +11,7 @@
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import mkdirp
|
||||
|
||||
import spack.config
|
||||
import spack.repo
|
||||
import spack.stage
|
||||
import spack.util.web
|
||||
@@ -172,6 +173,14 @@ def configure_args(self):
|
||||
return args"""
|
||||
|
||||
|
||||
class CargoPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for cargo-based packages"""
|
||||
|
||||
base_class_name = "CargoPackage"
|
||||
|
||||
body_def = ""
|
||||
|
||||
|
||||
class CMakePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for CMake-based packages"""
|
||||
|
||||
@@ -186,6 +195,14 @@ def cmake_args(self):
|
||||
return args"""
|
||||
|
||||
|
||||
class GoPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Go-module-based packages"""
|
||||
|
||||
base_class_name = "GoPackage"
|
||||
|
||||
body_def = ""
|
||||
|
||||
|
||||
class LuaPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for LuaRocks-based packages"""
|
||||
|
||||
@@ -575,28 +592,30 @@ def __init__(self, name, *args, **kwargs):
|
||||
|
||||
|
||||
templates = {
|
||||
"autotools": AutotoolsPackageTemplate,
|
||||
"autoreconf": AutoreconfPackageTemplate,
|
||||
"cmake": CMakePackageTemplate,
|
||||
"bundle": BundlePackageTemplate,
|
||||
"qmake": QMakePackageTemplate,
|
||||
"maven": MavenPackageTemplate,
|
||||
"scons": SconsPackageTemplate,
|
||||
"waf": WafPackageTemplate,
|
||||
"autotools": AutotoolsPackageTemplate,
|
||||
"bazel": BazelPackageTemplate,
|
||||
"bundle": BundlePackageTemplate,
|
||||
"cargo": CargoPackageTemplate,
|
||||
"cmake": CMakePackageTemplate,
|
||||
"generic": PackageTemplate,
|
||||
"go": GoPackageTemplate,
|
||||
"intel": IntelPackageTemplate,
|
||||
"lua": LuaPackageTemplate,
|
||||
"makefile": MakefilePackageTemplate,
|
||||
"maven": MavenPackageTemplate,
|
||||
"meson": MesonPackageTemplate,
|
||||
"octave": OctavePackageTemplate,
|
||||
"perlbuild": PerlbuildPackageTemplate,
|
||||
"perlmake": PerlmakePackageTemplate,
|
||||
"python": PythonPackageTemplate,
|
||||
"qmake": QMakePackageTemplate,
|
||||
"r": RPackageTemplate,
|
||||
"racket": RacketPackageTemplate,
|
||||
"perlmake": PerlmakePackageTemplate,
|
||||
"perlbuild": PerlbuildPackageTemplate,
|
||||
"octave": OctavePackageTemplate,
|
||||
"ruby": RubyPackageTemplate,
|
||||
"makefile": MakefilePackageTemplate,
|
||||
"intel": IntelPackageTemplate,
|
||||
"meson": MesonPackageTemplate,
|
||||
"lua": LuaPackageTemplate,
|
||||
"scons": SconsPackageTemplate,
|
||||
"sip": SIPPackageTemplate,
|
||||
"generic": PackageTemplate,
|
||||
"waf": WafPackageTemplate,
|
||||
}
|
||||
|
||||
|
||||
@@ -679,6 +698,8 @@ def __call__(self, stage, url):
|
||||
clues = [
|
||||
(r"/CMakeLists\.txt$", "cmake"),
|
||||
(r"/NAMESPACE$", "r"),
|
||||
(r"/Cargo\.toml$", "cargo"),
|
||||
(r"/go\.mod$", "go"),
|
||||
(r"/configure$", "autotools"),
|
||||
(r"/configure\.(in|ac)$", "autoreconf"),
|
||||
(r"/Makefile\.am$", "autoreconf"),
|
||||
@@ -966,4 +987,4 @@ def create(parser, args):
|
||||
|
||||
# Optionally open up the new package file in your $EDITOR
|
||||
if not args.skip_editor:
|
||||
editor(pkg_path)
|
||||
editor(pkg_path, debug=spack.config.get("config:debug"))
|
||||
|
@@ -10,10 +10,10 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.cmd.common.confirmation as confirmation
|
||||
import spack.environment as ev
|
||||
import spack.spec
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "remove specs from the concretized lockfile of an environment"
|
||||
section = "environments"
|
||||
|
@@ -9,11 +9,11 @@
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "show dependencies of a package"
|
||||
section = "basic"
|
||||
|
@@ -9,10 +9,10 @@
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.repo
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "show packages that depend on another"
|
||||
section = "basic"
|
||||
|
@@ -20,9 +20,9 @@
|
||||
from llnl.util.symlink import symlink
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
from spack.database import InstallStatuses
|
||||
from spack.error import SpackError
|
||||
|
||||
|
@@ -9,9 +9,9 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.repo
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "developer build: build from code in current working directory"
|
||||
section = "build"
|
||||
|
@@ -8,10 +8,11 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.paths
|
||||
import spack.spec
|
||||
import spack.util.path
|
||||
import spack.version
|
||||
from spack.cmd.common import arguments
|
||||
from spack.error import SpackError
|
||||
|
||||
description = "add a spec to an environment's dev-build information"
|
||||
@@ -55,7 +56,9 @@ def develop(parser, args):
|
||||
# download all dev specs
|
||||
for name, entry in env.dev_specs.items():
|
||||
path = entry.get("path", name)
|
||||
abspath = spack.util.path.canonicalize_path(path, default_wd=env.path)
|
||||
abspath = spack.util.path.canonicalize_path(
|
||||
path, default_wd=env.path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
if os.path.exists(abspath):
|
||||
msg = "Skipping developer download of %s" % entry["spec"]
|
||||
@@ -86,7 +89,9 @@ def develop(parser, args):
|
||||
|
||||
# default path is relative path to spec.name
|
||||
path = args.path or spec.name
|
||||
abspath = spack.util.path.canonicalize_path(path, default_wd=env.path)
|
||||
abspath = spack.util.path.canonicalize_path(
|
||||
path, default_wd=env.path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
# clone default: only if the path doesn't exist
|
||||
clone = args.clone
|
||||
|
@@ -10,11 +10,11 @@
|
||||
from llnl.util.tty.color import cprint, get_color_when
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.solver.asp as asp
|
||||
import spack.util.environment
|
||||
import spack.util.spack_json as sjson
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "compare two specs"
|
||||
section = "basic"
|
||||
|
@@ -9,6 +9,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.config
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
from spack.spec import Spec
|
||||
@@ -45,7 +46,7 @@ def edit_package(name, repo_path, namespace):
|
||||
else:
|
||||
raise spack.repo.UnknownPackageError(spec.name)
|
||||
|
||||
editor(path)
|
||||
editor(path, debug=spack.config.get("config:debug"))
|
||||
|
||||
|
||||
def setup_parser(subparser):
|
||||
|
@@ -20,7 +20,6 @@
|
||||
import spack.cmd
|
||||
import spack.cmd.common
|
||||
import spack.cmd.common.arguments
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.cmd.install
|
||||
import spack.cmd.modules
|
||||
import spack.cmd.uninstall
|
||||
@@ -31,6 +30,7 @@
|
||||
import spack.schema.env
|
||||
import spack.spec
|
||||
import spack.tengine
|
||||
from spack.cmd.common import arguments
|
||||
from spack.util.environment import EnvironmentModifications
|
||||
|
||||
description = "manage virtual environments"
|
||||
|
@@ -10,10 +10,10 @@
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd as cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.repo
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "list extensions for package"
|
||||
section = "extensions"
|
||||
|
@@ -14,12 +14,12 @@
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments
|
||||
import spack.config
|
||||
import spack.cray_manifest as cray_manifest
|
||||
import spack.detection
|
||||
import spack.error
|
||||
import spack.util.environment
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "manage external packages in Spack configuration"
|
||||
section = "config"
|
||||
@@ -29,8 +29,6 @@
|
||||
def setup_parser(subparser):
|
||||
sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="external_command")
|
||||
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
find_parser = sp.add_parser("find", help="add external packages to packages.yaml")
|
||||
find_parser.add_argument(
|
||||
"--not-buildable",
|
||||
@@ -48,15 +46,14 @@ def setup_parser(subparser):
|
||||
)
|
||||
find_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope("packages"),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope("packages"),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
find_parser.add_argument(
|
||||
"--all", action="store_true", help="search for all packages that Spack knows about"
|
||||
)
|
||||
spack.cmd.common.arguments.add_common_arguments(find_parser, ["tags", "jobs"])
|
||||
arguments.add_common_arguments(find_parser, ["tags", "jobs"])
|
||||
find_parser.add_argument("packages", nargs=argparse.REMAINDER)
|
||||
find_parser.epilog = (
|
||||
'The search is by default on packages tagged with the "build-tools" or '
|
||||
|
@@ -6,11 +6,11 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.repo
|
||||
import spack.traverse
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "fetch archives for packages"
|
||||
section = "build"
|
||||
|
@@ -12,9 +12,9 @@
|
||||
|
||||
import spack.bootstrap
|
||||
import spack.cmd as cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.repo
|
||||
from spack.cmd.common import arguments
|
||||
from spack.database import InstallStatuses
|
||||
|
||||
description = "list and search installed packages"
|
||||
|
@@ -7,11 +7,11 @@
|
||||
import os
|
||||
|
||||
import spack.binary_distribution
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.gpg
|
||||
import spack.mirror
|
||||
import spack.paths
|
||||
import spack.util.gpg
|
||||
import spack.util.url
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "handle GPG actions for spack"
|
||||
section = "packaging"
|
||||
@@ -129,40 +129,38 @@ def setup_parser(subparser):
|
||||
def gpg_create(args):
|
||||
"""create a new key"""
|
||||
if args.export or args.secret:
|
||||
old_sec_keys = spack.util.gpg.signing_keys()
|
||||
old_sec_keys = spack.gpg.signing_keys()
|
||||
|
||||
# Create the new key
|
||||
spack.util.gpg.create(
|
||||
name=args.name, email=args.email, comment=args.comment, expires=args.expires
|
||||
)
|
||||
spack.gpg.create(name=args.name, email=args.email, comment=args.comment, expires=args.expires)
|
||||
if args.export or args.secret:
|
||||
new_sec_keys = set(spack.util.gpg.signing_keys())
|
||||
new_sec_keys = set(spack.gpg.signing_keys())
|
||||
new_keys = new_sec_keys.difference(old_sec_keys)
|
||||
|
||||
if args.export:
|
||||
spack.util.gpg.export_keys(args.export, new_keys)
|
||||
spack.gpg.export_keys(args.export, new_keys)
|
||||
if args.secret:
|
||||
spack.util.gpg.export_keys(args.secret, new_keys, secret=True)
|
||||
spack.gpg.export_keys(args.secret, new_keys, secret=True)
|
||||
|
||||
|
||||
def gpg_export(args):
|
||||
"""export a gpg key, optionally including secret key"""
|
||||
keys = args.keys
|
||||
if not keys:
|
||||
keys = spack.util.gpg.signing_keys()
|
||||
spack.util.gpg.export_keys(args.location, keys, args.secret)
|
||||
keys = spack.gpg.signing_keys()
|
||||
spack.gpg.export_keys(args.location, keys, args.secret)
|
||||
|
||||
|
||||
def gpg_list(args):
|
||||
"""list keys available in the keyring"""
|
||||
spack.util.gpg.list(args.trusted, args.signing)
|
||||
spack.gpg.list(args.trusted, args.signing)
|
||||
|
||||
|
||||
def gpg_sign(args):
|
||||
"""sign a package"""
|
||||
key = args.key
|
||||
if key is None:
|
||||
keys = spack.util.gpg.signing_keys()
|
||||
keys = spack.gpg.signing_keys()
|
||||
if len(keys) == 1:
|
||||
key = keys[0]
|
||||
elif not keys:
|
||||
@@ -173,12 +171,12 @@ def gpg_sign(args):
|
||||
if not output:
|
||||
output = args.spec[0] + ".asc"
|
||||
# TODO: Support the package format Spack creates.
|
||||
spack.util.gpg.sign(key, " ".join(args.spec), output, args.clearsign)
|
||||
spack.gpg.sign(key, " ".join(args.spec), output, args.clearsign)
|
||||
|
||||
|
||||
def gpg_trust(args):
|
||||
"""add a key to the keyring"""
|
||||
spack.util.gpg.trust(args.keyfile)
|
||||
spack.gpg.trust(args.keyfile)
|
||||
|
||||
|
||||
def gpg_init(args):
|
||||
@@ -191,12 +189,12 @@ def gpg_init(args):
|
||||
for filename in filenames:
|
||||
if not filename.endswith(".key"):
|
||||
continue
|
||||
spack.util.gpg.trust(os.path.join(root, filename))
|
||||
spack.gpg.trust(os.path.join(root, filename))
|
||||
|
||||
|
||||
def gpg_untrust(args):
|
||||
"""remove a key from the keyring"""
|
||||
spack.util.gpg.untrust(args.signing, *args.keys)
|
||||
spack.gpg.untrust(args.signing, *args.keys)
|
||||
|
||||
|
||||
def gpg_verify(args):
|
||||
@@ -205,7 +203,7 @@ def gpg_verify(args):
|
||||
signature = args.signature
|
||||
if signature is None:
|
||||
signature = args.spec[0] + ".asc"
|
||||
spack.util.gpg.verify(signature, " ".join(args.spec))
|
||||
spack.gpg.verify(signature, " ".join(args.spec))
|
||||
|
||||
|
||||
def gpg_publish(args):
|
||||
|
@@ -5,10 +5,10 @@
|
||||
from llnl.util import tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
from spack.graph import DAGWithDependencyTypes, SimpleDAG, graph_ascii, graph_dot, static_graph_dot
|
||||
|
||||
description = "generate graphs of package dependency relationships"
|
||||
@@ -61,7 +61,7 @@ def graph(parser, args):
|
||||
args.dot = True
|
||||
env = ev.active_environment()
|
||||
if env:
|
||||
specs = env.all_specs()
|
||||
specs = env.concrete_roots()
|
||||
else:
|
||||
specs = spack.store.STORE.db.query()
|
||||
|
||||
|
@@ -11,13 +11,13 @@
|
||||
import llnl.util.tty.color as color
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.deptypes as dt
|
||||
import spack.fetch_strategy as fs
|
||||
import spack.install_test
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.version
|
||||
from spack.cmd.common import arguments
|
||||
from spack.package_base import preferred_version
|
||||
|
||||
description = "get detailed information on a particular package"
|
||||
|
@@ -14,7 +14,6 @@
|
||||
|
||||
import spack.build_environment
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.fetch_strategy
|
||||
@@ -23,6 +22,7 @@
|
||||
import spack.report
|
||||
import spack.spec
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
from spack.error import SpackError
|
||||
from spack.installer import PackageInstaller
|
||||
|
||||
|
@@ -15,9 +15,9 @@
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.deptypes as dt
|
||||
import spack.repo
|
||||
from spack.cmd.common import arguments
|
||||
from spack.version import VersionList
|
||||
|
||||
description = "list and search available packages"
|
||||
|
@@ -8,12 +8,12 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.cmd.find
|
||||
import spack.environment as ev
|
||||
import spack.store
|
||||
import spack.user_environment as uenv
|
||||
import spack.util.environment
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "add package to the user environment"
|
||||
section = "user environment"
|
||||
|
@@ -9,11 +9,11 @@
|
||||
|
||||
import spack.builder
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.stage
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "print out locations of packages and spack directories"
|
||||
section = "basic"
|
||||
|
@@ -8,11 +8,11 @@
|
||||
from llnl.util import tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.error
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
from spack.database import InstallStatuses
|
||||
|
||||
description = "mark packages as explicitly or implicitly installed"
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
import spack.caches
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.concretize
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
@@ -20,6 +19,7 @@
|
||||
import spack.spec
|
||||
import spack.util.path
|
||||
import spack.util.web as web_util
|
||||
from spack.cmd.common import arguments
|
||||
from spack.error import SpackError
|
||||
|
||||
description = "manage mirrors (source and binary)"
|
||||
@@ -88,18 +88,14 @@ def setup_parser(subparser):
|
||||
"--mirror-url", metavar="mirror_url", type=str, help="find mirror to destroy by url"
|
||||
)
|
||||
|
||||
# used to construct scope arguments below
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
# Add
|
||||
add_parser = sp.add_parser("add", help=mirror_add.__doc__)
|
||||
add_parser.add_argument("name", help="mnemonic name for mirror", metavar="mirror")
|
||||
add_parser.add_argument("url", help="url of mirror directory from 'spack mirror create'")
|
||||
add_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
add_parser.add_argument(
|
||||
@@ -117,9 +113,8 @@ def setup_parser(subparser):
|
||||
remove_parser.add_argument("name", help="mnemonic name for mirror", metavar="mirror")
|
||||
remove_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
|
||||
@@ -136,9 +131,8 @@ def setup_parser(subparser):
|
||||
)
|
||||
set_url_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
arguments.add_connection_args(set_url_parser, False)
|
||||
@@ -165,9 +159,8 @@ def setup_parser(subparser):
|
||||
set_parser.add_argument("--url", help="url of mirror directory from 'spack mirror create'")
|
||||
set_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
arguments.add_connection_args(set_parser, False)
|
||||
@@ -176,9 +169,8 @@ def setup_parser(subparser):
|
||||
list_parser = sp.add_parser("list", help=mirror_list.__doc__)
|
||||
list_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_list_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_list_scope(),
|
||||
help="configuration scope to read from",
|
||||
)
|
||||
|
||||
@@ -503,7 +495,9 @@ def mirror_destroy(args):
|
||||
elif args.mirror_url:
|
||||
mirror_url = args.mirror_url
|
||||
|
||||
web_util.remove_url(mirror_url, recursive=True)
|
||||
web_util.remove_url(
|
||||
mirror_url, recursive=True, verify_ssl=spack.config.get("config:verify_ssl", True)
|
||||
)
|
||||
|
||||
|
||||
def mirror(parser, args):
|
||||
|
@@ -14,11 +14,11 @@
|
||||
from llnl.util.tty import color
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.modules
|
||||
import spack.modules.common
|
||||
import spack.repo
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "manipulate module files"
|
||||
section = "environment"
|
||||
|
@@ -6,12 +6,12 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.traverse
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "patch expanded archive sources in preparation for install"
|
||||
section = "build"
|
||||
|
@@ -12,11 +12,11 @@
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.package_hash as ph
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.util.executable as exe
|
||||
import spack.util.package_hash as ph
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "query packages associated with particular git revisions"
|
||||
section = "developer"
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "remove specs from an environment"
|
||||
section = "environments"
|
||||
|
@@ -9,8 +9,10 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.config
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.util.path
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "manage package source repositories"
|
||||
section = "config"
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
def setup_parser(subparser):
|
||||
sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="repo_command")
|
||||
scopes = spack.config.scopes()
|
||||
|
||||
# Create
|
||||
create_parser = sp.add_parser("create", help=repo_create.__doc__)
|
||||
@@ -43,9 +44,8 @@ def setup_parser(subparser):
|
||||
list_parser = sp.add_parser("list", help=repo_list.__doc__)
|
||||
list_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_list_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_list_scope(),
|
||||
help="configuration scope to read from",
|
||||
)
|
||||
|
||||
@@ -54,9 +54,8 @@ def setup_parser(subparser):
|
||||
add_parser.add_argument("path", help="path to a Spack package repository directory")
|
||||
add_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
|
||||
@@ -67,9 +66,8 @@ def setup_parser(subparser):
|
||||
)
|
||||
remove_parser.add_argument(
|
||||
"--scope",
|
||||
choices=scopes,
|
||||
metavar=spack.config.SCOPES_METAVAR,
|
||||
default=spack.config.default_modify_scope(),
|
||||
action=arguments.ConfigScope,
|
||||
default=lambda: spack.config.default_modify_scope(),
|
||||
help="configuration scope to modify",
|
||||
)
|
||||
|
||||
@@ -86,7 +84,9 @@ def repo_add(args):
|
||||
path = args.path
|
||||
|
||||
# real_path is absolute and handles substitution.
|
||||
canon_path = spack.util.path.canonicalize_path(path)
|
||||
canon_path = spack.util.path.canonicalize_path(
|
||||
path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
# check if the path exists
|
||||
if not os.path.exists(canon_path):
|
||||
@@ -118,9 +118,13 @@ def repo_remove(args):
|
||||
namespace_or_path = args.namespace_or_path
|
||||
|
||||
# If the argument is a path, remove that repository from config.
|
||||
canon_path = spack.util.path.canonicalize_path(namespace_or_path)
|
||||
canon_path = spack.util.path.canonicalize_path(
|
||||
namespace_or_path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
for repo_path in repos:
|
||||
repo_canon_path = spack.util.path.canonicalize_path(repo_path)
|
||||
repo_canon_path = spack.util.path.canonicalize_path(
|
||||
repo_path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
if canon_path == repo_canon_path:
|
||||
repos.remove(repo_path)
|
||||
spack.config.set("repos", repos, args.scope)
|
||||
|
@@ -6,8 +6,8 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.repo
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "revert checked out package source code"
|
||||
section = "build"
|
||||
|
@@ -12,12 +12,12 @@
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment
|
||||
import spack.hash_types as ht
|
||||
import spack.package_base
|
||||
import spack.solver.asp as asp
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "concretize a specs using an ASP solver"
|
||||
section = "developer"
|
||||
|
@@ -10,11 +10,11 @@
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.hash_types as ht
|
||||
import spack.spec
|
||||
import spack.store
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "show what would be installed, given a spec"
|
||||
section = "build"
|
||||
|
@@ -8,13 +8,13 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.stage
|
||||
import spack.traverse
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "expand downloaded archive in preparation for install"
|
||||
section = "build"
|
||||
|
@@ -15,12 +15,12 @@
|
||||
from llnl.util.tty import colify
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.environment as ev
|
||||
import spack.install_test
|
||||
import spack.package_base
|
||||
import spack.repo
|
||||
import spack.report
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "run spack's tests for an install"
|
||||
section = "admin"
|
||||
|
@@ -10,11 +10,11 @@
|
||||
from llnl.util.filesystem import working_dir
|
||||
|
||||
import spack
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.config
|
||||
import spack.gpg
|
||||
import spack.paths
|
||||
import spack.util.git
|
||||
import spack.util.gpg
|
||||
from spack.cmd.common import arguments
|
||||
from spack.util.spack_yaml import syaml_dict
|
||||
|
||||
description = "set up spack for our tutorial (WARNING: modifies config!)"
|
||||
@@ -76,7 +76,7 @@ def tutorial(parser, args):
|
||||
spack.config.set("mirrors", mirror_config, scope="user")
|
||||
|
||||
tty.msg("Ensuring that we trust tutorial binaries", f"spack gpg trust {tutorial_key}")
|
||||
spack.util.gpg.trust(tutorial_key)
|
||||
spack.gpg.trust(tutorial_key)
|
||||
|
||||
# Note that checkout MUST be last. It changes Spack under our feet.
|
||||
# If you don't put this last, you'll get import errors for the code
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "remove specs from an environment"
|
||||
section = "environments"
|
||||
|
@@ -10,13 +10,13 @@
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.cmd.common.confirmation as confirmation
|
||||
import spack.environment as ev
|
||||
import spack.package_base
|
||||
import spack.spec
|
||||
import spack.store
|
||||
import spack.traverse as traverse
|
||||
from spack.cmd.common import arguments
|
||||
from spack.database import InstallStatuses
|
||||
|
||||
description = "remove installed packages"
|
||||
|
@@ -7,10 +7,10 @@
|
||||
import sys
|
||||
|
||||
import spack.cmd
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.error
|
||||
import spack.user_environment as uenv
|
||||
import spack.util.environment
|
||||
from spack.cmd.common import arguments
|
||||
|
||||
description = "remove package from the user environment"
|
||||
section = "user environment"
|
||||
|
@@ -8,9 +8,9 @@
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
from spack.cmd.common import arguments
|
||||
from spack.version import infinity_versions, ver
|
||||
|
||||
description = "list available versions of a package"
|
||||
|
@@ -154,6 +154,14 @@ def add_compilers_to_config(compilers, scope=None, init_config=True):
|
||||
"""
|
||||
compiler_config = get_compiler_config(scope, init_config)
|
||||
for compiler in compilers:
|
||||
if not compiler.cc:
|
||||
tty.debug(f"{compiler.spec} does not have a C compiler")
|
||||
if not compiler.cxx:
|
||||
tty.debug(f"{compiler.spec} does not have a C++ compiler")
|
||||
if not compiler.f77:
|
||||
tty.debug(f"{compiler.spec} does not have a Fortran77 compiler")
|
||||
if not compiler.fc:
|
||||
tty.debug(f"{compiler.spec} does not have a Fortran compiler")
|
||||
compiler_config.append(_to_dict(compiler))
|
||||
spack.config.set("compilers", compiler_config, scope=scope)
|
||||
|
||||
|
@@ -85,6 +85,14 @@ def cxx14_flag(self):
|
||||
else:
|
||||
return "-std=c++14"
|
||||
|
||||
@property
|
||||
def cxx17_flag(self):
|
||||
# https://www.intel.com/content/www/us/en/developer/articles/news/c17-features-supported-by-c-compiler.html
|
||||
if self.real_version < Version("19"):
|
||||
raise UnsupportedCompilerFlag(self, "the C++17 standard", "cxx17_flag", "< 19")
|
||||
else:
|
||||
return "-std=c++17"
|
||||
|
||||
@property
|
||||
def c99_flag(self):
|
||||
if self.real_version < Version("12"):
|
||||
|
@@ -6,6 +6,8 @@
|
||||
import os
|
||||
from os.path import dirname
|
||||
|
||||
from llnl.util import tty
|
||||
|
||||
from spack.compiler import Compiler
|
||||
|
||||
|
||||
@@ -135,3 +137,13 @@ def setup_custom_environment(self, pkg, env):
|
||||
# Executable "sycl-post-link" doesn't exist!
|
||||
if self.cxx:
|
||||
env.prepend_path("PATH", dirname(self.cxx))
|
||||
|
||||
# 2024 release bumped the libsycl version because of an ABI
|
||||
# change, 2024 compilers are required. You will see this
|
||||
# error:
|
||||
#
|
||||
# /usr/bin/ld: warning: libsycl.so.7, needed by ...., not found
|
||||
if pkg.spec.satisfies("%oneapi@:2023"):
|
||||
for c in ["dnn"]:
|
||||
if pkg.spec.satisfies(f"^intel-oneapi-{c}@2024:"):
|
||||
tty.warn(f"intel-oneapi-{c}@2024 SYCL APIs requires %oneapi@2024:")
|
||||
|
@@ -31,6 +31,7 @@
|
||||
import spack.config
|
||||
import spack.environment
|
||||
import spack.error
|
||||
import spack.paths
|
||||
import spack.platforms
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
@@ -91,7 +92,9 @@ def concretize_develop(self, spec):
|
||||
if not dev_info:
|
||||
return False
|
||||
|
||||
path = spack.util.path.canonicalize_path(dev_info["path"], default_wd=env.path)
|
||||
path = spack.util.path.canonicalize_path(
|
||||
dev_info["path"], default_wd=env.path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
if "dev_path" in spec.variants:
|
||||
assert spec.variants["dev_path"].value == path
|
||||
|
@@ -1451,7 +1451,9 @@ def fetch_remote_configs(url: str, dest_dir: str, skip_existing: bool = True) ->
|
||||
def _fetch_file(url):
|
||||
raw = raw_github_gitlab_url(url)
|
||||
tty.debug("Reading config from url {0}".format(raw))
|
||||
return web_util.fetch_url_text(raw, dest_dir=dest_dir)
|
||||
return web_util.fetch_url_text(
|
||||
raw, dest_dir=dest_dir, fetch_method=CONFIG.get("config:url_fetch_method")
|
||||
)
|
||||
|
||||
if not url:
|
||||
raise ConfigFileError("Cannot retrieve configuration without a URL")
|
||||
|
@@ -90,7 +90,8 @@
|
||||
def env_root_path():
|
||||
"""Override default root path if the user specified it"""
|
||||
return spack.util.path.canonicalize_path(
|
||||
spack.config.get("config:environments_root", default=default_env_path)
|
||||
spack.config.get("config:environments_root", default=default_env_path),
|
||||
replacements=spack.paths.path_replacements(),
|
||||
)
|
||||
|
||||
|
||||
@@ -478,7 +479,9 @@ def __init__(
|
||||
):
|
||||
self.base = base_path
|
||||
self.raw_root = root
|
||||
self.root = spack.util.path.canonicalize_path(root, default_wd=base_path)
|
||||
self.root = spack.util.path.canonicalize_path(
|
||||
root, default_wd=base_path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
self.projections = projections
|
||||
self.select = select
|
||||
self.exclude = exclude
|
||||
@@ -493,7 +496,9 @@ def exclude_fn(self, spec):
|
||||
|
||||
def update_root(self, new_path):
|
||||
self.raw_root = new_path
|
||||
self.root = spack.util.path.canonicalize_path(new_path, default_wd=self.base)
|
||||
self.root = spack.util.path.canonicalize_path(
|
||||
new_path, default_wd=self.base, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
def __eq__(self, other):
|
||||
return all(
|
||||
@@ -985,7 +990,9 @@ def included_config_scopes(self):
|
||||
missing = []
|
||||
for i, config_path in enumerate(reversed(includes)):
|
||||
# allow paths to contain spack config/environment variables, etc.
|
||||
config_path = substitute_path_variables(config_path)
|
||||
config_path = substitute_path_variables(
|
||||
config_path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
|
||||
include_url = urllib.parse.urlparse(config_path)
|
||||
|
||||
@@ -1296,7 +1303,9 @@ def develop(self, spec: Spec, path: str, clone: bool = False) -> bool:
|
||||
# to be created, then copy it afterwards somewhere else. It would be
|
||||
# better if we can create the `source_path` directly into its final
|
||||
# destination.
|
||||
abspath = spack.util.path.canonicalize_path(path, default_wd=self.path)
|
||||
abspath = spack.util.path.canonicalize_path(
|
||||
path, default_wd=self.path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
pkg_cls = spack.repo.PATH.get_pkg_class(spec.name)
|
||||
# We construct a package class ourselves, rather than asking for
|
||||
# Spec.package, since Spec only allows this when it is concrete
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
import spack.config
|
||||
import spack.error
|
||||
import spack.paths
|
||||
import spack.util.path
|
||||
|
||||
_extension_regexp = re.compile(r"spack-(\w[-\w]*)$")
|
||||
@@ -109,7 +110,8 @@ def ensure_package_creation(name):
|
||||
def get_extension_paths():
|
||||
"""Return the list of canonicalized extension paths from config:extensions."""
|
||||
extension_paths = spack.config.get("config:extensions") or []
|
||||
paths = [spack.util.path.canonicalize_path(p) for p in extension_paths]
|
||||
r = spack.paths.path_replacements()
|
||||
paths = [spack.util.path.canonicalize_path(p, replacements=r) for p in extension_paths]
|
||||
return paths
|
||||
|
||||
|
||||
|
@@ -301,7 +301,12 @@ def fetch(self):
|
||||
url = None
|
||||
errors = []
|
||||
for url in self.candidate_urls:
|
||||
if not web_util.url_exists(url):
|
||||
if not web_util.url_exists(
|
||||
url,
|
||||
fetch_method=spack.config.get("config:url_fetch_method", "urllib"),
|
||||
verify_ssl=spack.config.get("config:verify_ssl"),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
):
|
||||
tty.debug("URL does not exist: " + url)
|
||||
continue
|
||||
|
||||
@@ -338,8 +343,12 @@ def _fetch_urllib(self, url):
|
||||
|
||||
# Run urllib but grab the mime type from the http headers
|
||||
try:
|
||||
url, headers, response = web_util.read_from_url(url)
|
||||
except web_util.SpackWebError as e:
|
||||
url, headers, response = web_util.read_from_url(
|
||||
url,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
except web_util.WebError as e:
|
||||
# clean up archive on failure.
|
||||
if self.archive_file:
|
||||
os.remove(self.archive_file)
|
||||
@@ -385,7 +394,15 @@ def _fetch_curl(self, url):
|
||||
|
||||
timeout = self.extra_options.get("timeout")
|
||||
|
||||
base_args = web_util.base_curl_fetch_args(url, timeout)
|
||||
connect_timeout = spack.config.get("config:connect_timeout", 10)
|
||||
if timeout:
|
||||
timeout = max(int(timeout), int(connect_timeout))
|
||||
else:
|
||||
timeout = int(connect_timeout)
|
||||
|
||||
base_args = web_util.base_curl_fetch_args(
|
||||
url, timeout=timeout, verify_ssl=spack.config.get("config:verify_ssl")
|
||||
)
|
||||
curl_args = save_args + base_args + cookie_args
|
||||
|
||||
# Run curl but grab the mime type from the http headers
|
||||
@@ -403,7 +420,7 @@ def _fetch_curl(self, url):
|
||||
|
||||
try:
|
||||
web_util.check_curl_code(curl.returncode)
|
||||
except spack.error.FetchError as err:
|
||||
except web_util.WebError as err:
|
||||
raise spack.fetch_strategy.FailedDownloadError(url, str(err))
|
||||
|
||||
self._check_headers(headers)
|
||||
@@ -463,7 +480,10 @@ def archive(self, destination):
|
||||
raise NoArchiveFileError("Cannot call archive() before fetching.")
|
||||
|
||||
web_util.push_to_url(
|
||||
self.archive_file, url_util.path_to_file_url(destination), keep_original=True
|
||||
self.archive_file,
|
||||
url_util.path_to_file_url(destination),
|
||||
keep_original=True,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
)
|
||||
|
||||
@_needs_stage
|
||||
@@ -1330,7 +1350,11 @@ def fetch(self):
|
||||
basename = os.path.basename(parsed_url.path)
|
||||
|
||||
with working_dir(self.stage.path):
|
||||
_, headers, stream = web_util.read_from_url(self.url)
|
||||
_, headers, stream = web_util.read_from_url(
|
||||
self.url,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
|
||||
with open(basename, "wb") as f:
|
||||
shutil.copyfileobj(stream, f)
|
||||
@@ -1377,7 +1401,11 @@ def fetch(self):
|
||||
basename = os.path.basename(parsed_url.path)
|
||||
|
||||
with working_dir(self.stage.path):
|
||||
_, headers, stream = web_util.read_from_url(self.url)
|
||||
_, headers, stream = web_util.read_from_url(
|
||||
self.url,
|
||||
verify_ssl=spack.config.get("config:verify_ssl", True),
|
||||
timeout=spack.config.get("config:connect_timeout", 10),
|
||||
)
|
||||
|
||||
with open(basename, "wb") as f:
|
||||
shutil.copyfileobj(stream, f)
|
||||
|
@@ -8,10 +8,8 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
import spack.error
|
||||
import spack.paths
|
||||
import spack.util.error
|
||||
import spack.util.executable
|
||||
import spack.version
|
||||
|
||||
#: Executable instance for "gpg", initialized lazily
|
||||
GPG = None
|
||||
@@ -29,7 +27,7 @@ def clear():
|
||||
GPG, GPGCONF, SOCKET_DIR, GNUPGHOME = None, None, None, None
|
||||
|
||||
|
||||
def init(gnupghome=None, force=False):
|
||||
def init(gnupghome=None, force=False, gpg_path=None):
|
||||
"""Initialize the global objects in the module, if not set.
|
||||
|
||||
When calling any gpg executable, the GNUPGHOME environment
|
||||
@@ -56,7 +54,7 @@ def init(gnupghome=None, force=False):
|
||||
return
|
||||
|
||||
# Set the value of GNUPGHOME to be used in this module
|
||||
GNUPGHOME = gnupghome or os.getenv("SPACK_GNUPGHOME") or spack.paths.gpg_path
|
||||
GNUPGHOME = gnupghome or os.getenv("SPACK_GNUPGHOME") or gpg_path
|
||||
|
||||
# Set the executable objects for "gpg" and "gpgconf"
|
||||
with spack.bootstrap.ensure_bootstrap_configuration():
|
||||
@@ -165,7 +163,7 @@ def _get_unimported_public_keys(output):
|
||||
return keys
|
||||
|
||||
|
||||
class SpackGPGError(spack.error.SpackError):
|
||||
class SpackGPGError(spack.util.error.UtilityError):
|
||||
"""Class raised when GPG errors are detected."""
|
||||
|
||||
|
||||
@@ -334,11 +332,11 @@ def _verify_exe_or_raise(exe):
|
||||
raise SpackGPGError(msg)
|
||||
|
||||
output = exe("--version", output=str)
|
||||
match = re.search(r"^gpg(conf)? \(GnuPG\) (.*)$", output, re.M)
|
||||
match = re.search(r"^gpg(conf)? \(GnuPG\) (\d+).*$", output, re.M)
|
||||
if not match:
|
||||
raise SpackGPGError('Could not determine "{0}" version'.format(exe.name))
|
||||
|
||||
if spack.version.Version(match.group(2)) < spack.version.Version("2"):
|
||||
if int(match.group(2)) < 2:
|
||||
raise SpackGPGError(msg)
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
from llnl.util.filesystem import mkdirp
|
||||
from llnl.util.symlink import symlink
|
||||
|
||||
import spack.config
|
||||
import spack.util.editor as ed
|
||||
|
||||
|
||||
@@ -39,7 +40,7 @@ def set_up_license(pkg):
|
||||
write_license_file(pkg, license_path)
|
||||
|
||||
# use spack.util.executable so the editor does not hang on return here
|
||||
ed.editor(license_path, exec_fn=ed.executable)
|
||||
ed.editor(license_path, exec_fn=ed.executable, debug=spack.config.get("config:debug"))
|
||||
else:
|
||||
# Use already existing license file
|
||||
tty.msg("Found already existing license %s" % license_path)
|
||||
|
@@ -5,18 +5,18 @@
|
||||
|
||||
import os
|
||||
|
||||
import spack.util.file_permissions as fp
|
||||
import spack.package_prefs as pp
|
||||
|
||||
|
||||
def post_install(spec, explicit=None):
|
||||
if not spec.external:
|
||||
fp.set_permissions_by_spec(spec.prefix, spec)
|
||||
pp.set_permissions_by_spec(spec.prefix, spec)
|
||||
|
||||
# os.walk explicitly set not to follow links
|
||||
for root, dirs, files in os.walk(spec.prefix, followlinks=False):
|
||||
for d in dirs:
|
||||
if not os.path.islink(os.path.join(root, d)):
|
||||
fp.set_permissions_by_spec(os.path.join(root, d), spec)
|
||||
pp.set_permissions_by_spec(os.path.join(root, d), spec)
|
||||
for f in files:
|
||||
if not os.path.islink(os.path.join(root, f)):
|
||||
fp.set_permissions_by_spec(os.path.join(root, f), spec)
|
||||
pp.set_permissions_by_spec(os.path.join(root, f), spec)
|
||||
|
@@ -91,7 +91,8 @@ def get_test_stage_dir():
|
||||
the default test stage path
|
||||
"""
|
||||
return spack.util.path.canonicalize_path(
|
||||
spack.config.get("config:test_stage", spack.paths.default_test_path)
|
||||
spack.config.get("config:test_stage", spack.paths.default_test_path),
|
||||
replacements=spack.paths.path_replacements(),
|
||||
)
|
||||
|
||||
|
||||
|
@@ -491,7 +491,8 @@ def _process_binary_cache_tarball(
|
||||
|
||||
tty.msg(f"Extracting {package_id(pkg)} from binary cache")
|
||||
|
||||
with timer.measure("install"), spack.util.path.filter_padding():
|
||||
padding = spack.config.get("config:install_tree:padded_length", None)
|
||||
with timer.measure("install"), spack.util.path.filter_padding(padding=padding):
|
||||
binary_distribution.extract_tarball(
|
||||
pkg.spec, download_result, unsigned=unsigned, force=False, timer=timer
|
||||
)
|
||||
@@ -2492,7 +2493,8 @@ def build_process(pkg: "spack.package_base.PackageBase", install_args: dict) ->
|
||||
installer = BuildProcessInstaller(pkg, install_args)
|
||||
|
||||
# don't print long padded paths in executable debug output.
|
||||
with spack.util.path.filter_padding():
|
||||
padding = spack.config.get("config:install_tree:padded_length", None)
|
||||
with spack.util.path.filter_padding(padding=padding):
|
||||
return installer.run()
|
||||
|
||||
|
||||
|
@@ -1016,14 +1016,16 @@ def _main(argv=None):
|
||||
bootstrap_context = bootstrap.ensure_bootstrap_configuration()
|
||||
|
||||
with bootstrap_context:
|
||||
return finish_parse_and_run(parser, cmd_name, args.command, env_format_error)
|
||||
return finish_parse_and_run(parser, cmd_name, args, env_format_error)
|
||||
|
||||
|
||||
def finish_parse_and_run(parser, cmd_name, cmd, env_format_error):
|
||||
def finish_parse_and_run(parser, cmd_name, main_args, env_format_error):
|
||||
"""Finish parsing after we know the command to run."""
|
||||
# add the found command to the parser and re-run then re-parse
|
||||
command = parser.add_command(cmd_name)
|
||||
args, unknown = parser.parse_known_args()
|
||||
args, unknown = parser.parse_known_args(main_args.command)
|
||||
# we need to inherit verbose since the install command checks for it
|
||||
args.verbose = main_args.verbose
|
||||
|
||||
# Now that we know what command this is and what its args are, determine
|
||||
# whether we can continue with a bad environment and raise if not.
|
||||
|
@@ -30,6 +30,7 @@
|
||||
import spack.fetch_strategy
|
||||
import spack.mirror
|
||||
import spack.oci.image
|
||||
import spack.paths
|
||||
import spack.spec
|
||||
import spack.util.path
|
||||
import spack.util.spack_json as sjson
|
||||
@@ -51,7 +52,11 @@ def _url_or_path_to_url(url_or_path: str) -> str:
|
||||
return url_or_path
|
||||
|
||||
# Otherwise we interpret it as path, and we should promote it to file:// URL.
|
||||
return url_util.path_to_file_url(spack.util.path.canonicalize_path(url_or_path))
|
||||
return url_util.path_to_file_url(
|
||||
spack.util.path.canonicalize_path(
|
||||
url_or_path, replacements=spack.paths.path_replacements()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class Mirror:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user