Compare commits

...

175 Commits

Author SHA1 Message Date
Gregory Becker
ba62db9add foo 2024-07-17 09:41:14 -07:00
Gregory Becker
aef5c35065 bugfix 2024-07-16 17:31:45 -07:00
Gregory Becker
7ee62d8202 move gpg back into Spack, fix style 2024-07-16 17:30:40 -07:00
Gregory Becker
1ff78a7959 isolate util/file_cache 2024-02-20 14:28:07 -08:00
Gregory Becker
0b92a19620 isolate util/s3 2024-02-20 10:56:40 -08:00
Douglas Jacobsen
ee36214f83 Remove unneeded build_web_keywords 2024-02-14 15:35:19 -07:00
Gregory Becker
4516b742dd move package_hash from util to main library 2024-02-14 13:41:07 -08:00
Gregory Becker
6e24ea55ea isolate util/gpg 2024-02-14 13:16:03 -08:00
Douglas Jacobsen
bc06e2bc17 Isolate util/web 2023-12-01 14:01:15 -07:00
Douglas Jacobsen
330a5c0010 Isolate util/file_permissions 2023-12-01 13:37:13 -07:00
Douglas Jacobsen
1f0a8755c7 Isolate util/path 2023-12-01 13:37:11 -07:00
Douglas Jacobsen
425d3ba8a6 Isolate util/spack_json and util/spack_yaml 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
2972dea418 Isolate util/compression 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
953209fe2d Isolate util/file_permissions 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
1d07e4cb8d Isolate util/lock and util/naming 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
3fd543328b Isolate util/gpg 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
30cafc553a Isolate util/executable 2023-12-01 13:36:04 -07:00
Douglas Jacobsen
3a6ad72ac1 Isolate util/editor 2023-12-01 13:36:01 -07:00
Douglas Jacobsen
736c46e22d Isolate util/cpus.py 2023-12-01 13:35:11 -07:00
Dave Keeshan
a543fd79f1 verible: add new package (#41270)
* Add initial version of verible to spack
* Update to use explict url path for each release, as the release tagh includes extra data, also added the bottom most point of gcc, gcc9
2023-12-01 10:48:52 -08:00
Adam J. Stewart
ab50aa61db py-keras: add v3.0.0 (#41356)
* py-keras: add v3.0.0

* Older keras actually requires protobuf

* Correct url_for_version

* Capitalization is important

* Keep pil and pydot deps
2023-12-01 18:23:58 +00:00
Richard Berger
d06a102e69 Various FleCSI updates (#41068)
* flecsi: remove deprecated versions
* flecsi: add explicit conflict for backend=hpx +hdf5
* flecsi: propagate +openmp to kokkos and legion
* flecsi: remove doc variant prior to @2.2
   It wouldn't do anything meaningful and won't install the documentation.

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2023-12-01 09:41:33 -08:00
Rohit Goswami
b0f0d2f1fb dftbplus: Update and add upstream maintainer (#33243)
* dftbp: Update and add upstream maintainer
* dftbp: Trust in the hybrid cmake builds
* dftbp: Handle scalapack better
* dftbp: Refactor as per review
* dftbp: Build shared for python
* dftbp: Address review comments
* dftbp: Add another maintainer
* dftp: Fix typo
* dftbp: Arpack for serial builds only
* dftbp: Update option docs
* dftbp: Update documentation for elsi
* dftbp: Add comment for context
* dftbp: Tighter bounds on python
* dftbp: Add negf only when shared
* dftbp: Fix typo
* dftbp: Update sha256
* dftpb: Add when directive for cmake and ninja
* dftbp: Enforce comment

---------

Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: awvwgk <awvwgk@users.noreply.github.com>
Co-authored-by: iamashwin99 <iamashwin99@users.noreply.github.com>
Co-authored-by: Ashwin Kumar Karnad <46030335+iamashwin99@users.noreply.github.com>
Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Co-authored-by: tldahlgren <tldahlgren@users.noreply.github.com>
2023-12-01 09:34:11 -08:00
Victoria Cherkas
6029b600f0 eccodes: add v2.32.0, v2.31.0 (#40770)
* eccodes new versions and dependencies
* Suggested changes for multiple variant defaults
* Update var/spack/repos/builtin/packages/eccodes/package.py

---------

Co-authored-by: Sergey Kosukhin <skosukhin@gmail.com>
2023-12-01 09:25:31 -08:00
dependabot[bot]
e6107e336c build(deps): bump docutils from 0.18.1 to 0.20.1 in /lib/spack/docs (#38174)
Bumps [docutils](https://docutils.sourceforge.io/) from 0.18.1 to 0.20.1.

---
updated-dependencies:
- dependency-name: docutils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 17:16:34 +01:00
Lydéric Debusschère
9ef57c3c86 py-cma: new package (#41326)
* py-pycma: new package

* rename py-pycma in py-cma; py-cma: use pypi instead of github sources

---------

Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 08:54:02 -06:00
Lydéric Debusschère
3b021bb4ac py-mahotas: new package (#41329)
* py-mahotas: new package

* py-mahotas: relax version constraint on numpy

---------

Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 08:52:37 -06:00
Richard Berger
42bac83c2e LAMMPS updates (#40879)
* lammps: add new stable version 20230802.1

* lammps: add missing potential download for +mesont

* lammps: fix python package install

* Update var/spack/repos/builtin/packages/lammps/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* lammps: py-numpy and py-mpi4py should be build and run deps

* lammps: add new 20231121 release

- MPIIO package has been removed -> disable mpiio variant
- LAMMPS_EXCEPTIONS is now always on -> disable exceptions variant
- CMake 3.16+ is now required
- Kokkos 4.1.0 is now supported

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-12-01 07:13:56 -07:00
Lydéric Debusschère
7e38e9e515 py-xmlplain: new package (#41324)
Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 08:02:24 -06:00
Lydéric Debusschère
cf5ffedc23 py-requests-file: new package (#41328)
Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 08:00:23 -06:00
Lydéric Debusschère
3a9aea753d [add] py-autodocsumm: new package (#41309)
Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 07:53:57 -06:00
Lydéric Debusschère
c61da8381c py-sphinx-jinja2-compat: new package (#41310)
* [add] py-sphinx-jinja2-compat: new package

* py-whey-pth: new package, dependence of py-sphinx-jinja2-compat

---------

Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 07:53:02 -06:00
Lydéric Debusschère
8de814eddf py-sphinx-removed-in: new package (#41325)
* py-sphinx-removed-in: new package

* py-sphinx-removed-in: fix dependence

---------

Co-authored-by: LydDeb <lyderic.debusschere@eolen.com>
2023-12-01 07:43:40 -06:00
Satish Balay
c9341a2532 petsc, py-petsc4py: add v3.20.2 (#41366) 2023-12-01 07:42:48 -06:00
Manuela Kuhn
8b202b3fb2 py-urllib3: add 2.1.0 and 2.0.7 (#41358) 2023-12-01 07:39:18 -06:00
Dom Heinzeller
2ecc260e0e Update py-cylc-flow (add version 8.2.3) (#41209)
* Add missing runtime dependency on py-colorama to py-ansimarkup

* Add py-metomi-isodatetime@3.1.0

* New package py-graphql-relay

* Update py-cylc-flowi, add version 8.2.3

* Fix merge conflict

* Revert mistake in var/spack/repos/builtin/packages/py-cylc-flow/package.py

* Update py-metomi-isodatetime dependencies for py-cylc-flow

* Add 'climbfuji' to list of maintainers for py-cylc-flow
2023-12-01 07:33:34 -06:00
Christopher Christofi
6130fe8f57 py-beartype: new package with versions 0.15.0 and 0.16.2 (#39759)
* py-beartype: new package with version 0.15.0

* Update var/spack/repos/builtin/packages/py-beartype/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* py-beartype: depend on python 3.8 or higher

* py-beartype: add new version 0.16.2

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-12-01 07:29:30 -06:00
Adam J. Stewart
d3aa7a620e py-mpi4py: fix build with Apple Clang (#41362)
* py-mpi4py: fix build with Apple Clang

* [@spackbot] updating style on behalf of adamjstewart

---------

Co-authored-by: adamjstewart <adamjstewart@users.noreply.github.com>
2023-12-01 05:33:14 -06:00
dependabot[bot]
2794e14870 build(deps): bump pygments from 2.17.1 to 2.17.2 in /lib/spack/docs (#41212)
Bumps [pygments](https://github.com/pygments/pygments) from 2.17.1 to 2.17.2.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/2.17.2/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.17.1...2.17.2)

---
updated-dependencies:
- dependency-name: pygments
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 12:29:42 +01:00
dependabot[bot]
cc1e990c7e build(deps): bump sphinx-rtd-theme in /lib/spack/docs (#41305)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.3.0 to 2.0.0.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.3.0...2.0.0)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 12:29:22 +01:00
dependabot[bot]
59e6b0b100 build(deps): bump mypy from 1.7.0 to 1.7.1 in /lib/spack/docs (#41243)
Bumps [mypy](https://github.com/python/mypy) from 1.7.0 to 1.7.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 09:22:23 +01:00
dependabot[bot]
ec53d02814 build(deps): bump docker/metadata-action from 5.0.0 to 5.2.0 (#41371)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.0.0 to 5.2.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](96383f4557...e6428a5c4e)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 09:21:56 +01:00
dependabot[bot]
389c77cf83 build(deps): bump mypy from 1.6.1 to 1.7.1 in /.github/workflows/style (#41242)
Bumps [mypy](https://github.com/python/mypy) from 1.6.1 to 1.7.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.6.1...v1.7.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 09:20:56 +01:00
Vicente Bolea
17c87b4c29 vtk-m: bump vtk-m 2.1.0 (#41351)
* vtk-m: bump vtk-m 2.1.0

* Update package.py

* Update package.py
2023-11-30 20:18:15 -08:00
Thomas Helfer
91453c5ba0 Add support for new versions of TFEL and MGIS (#41357)
* Add new versions to TFEL and MGIS
2023-11-30 19:47:57 -07:00
Robert Cohn
a587a10c86 [intel-mpi] deprecation (#41322) 2023-11-30 19:52:42 -05:00
Derek Ryan Strong
cfe77fcd90 r: add license and missing versions and fix rmath build directory (#41260)
* Add R license and missing versions
* Fix rmath build directory
2023-11-30 16:18:02 -08:00
Matthieu Dorier
6cf36a1817 mochi-margo: added version 0.15.0 (#41319) 2023-11-30 15:32:24 -08:00
Matthieu Dorier
ee40cfa830 mochi-thallium: adding a few new versions (#41323)
* mochi-thallium: added a few newer versions
* mochi-thallium: added constraint on the version of margo required
* removed thallium 0.12 which needs updating
* mochi-thallium: fixed hash for version 0.12.0
* removed thallium 0.12 which needs updating (again)
2023-11-30 15:19:32 -08:00
Harmen Stoppels
04f64d4ac6 tests: use temporary_store (#41369) 2023-11-30 15:11:35 -08:00
jmlapre
779fef7d41 trilinos: new pytrilinos2 variant (#40615) 2023-11-30 14:08:58 -07:00
Richard Berger
5be3ca396b Singularity-EOS update (#41333)
* singularity-eos: deprecate v1.6 versions and remove unused code
* singularity-eos: add v1.8.0
2023-11-30 12:55:25 -08:00
Dave Keeshan
e420441bc2 Fix flex for build and link, limit gcc to 7 or greater (#41335) 2023-11-30 12:51:48 -08:00
Dave Keeshan
a039dc16fa Move compiler renaming to filter_compiler_wrappers (#41336) 2023-11-30 12:48:59 -08:00
Christopher Christofi
b31c89b110 perl-carp-assert: add new package with version 0.22 (#41347)
* perl-carp-assert: add new package with version 0.22
* fix style
2023-11-30 12:46:24 -08:00
Christopher Christofi
bc4f3d6cbd perl-parse-yapp: add new package with version 1.21 (#41348) 2023-11-30 12:37:26 -08:00
Matthias Wolf
40209506b7 acfl: truncate version version number (#41354)
When using `spack external find acfl`, we get the full version string
with 4 components in `packages.yaml`.  This PR truncates the version
nubmer when finding the `armpl` component to be able to run without
intervention.
2023-11-30 12:32:10 -08:00
Massimiliano Culpo
6ff07c7753 Fix issue with latest mypy (#41363) 2023-11-30 20:31:03 +01:00
Adam J. Stewart
d874c6d79c py-tensorflow-estimator: add new versions (#41364) 2023-11-30 10:54:11 -08:00
Adam J. Stewart
927e739e0a GDAL: add v3.8.1 (#41365) 2023-11-30 10:51:42 -08:00
Tom Scogland
dd607d11d5 developer tools stack try 2 (#40921)
* developer tools stack try 2

This version is actually in use locally and has largely stabilized, at
least on x86.  Some packages are still a challenge on ppc64le, but maybe
worth keeping this working as a set.

* add packages, try to get container with newer gcc

* remove reuse: true

* try to get cmake to build on medium, 25 minutes is too long

* add lsd package and add to dev tools stack

* clean up fzf dependency and sorting

* Update share/spack/gitlab/cloud_pipelines/stacks/developer_tools/spack.yaml

* cuda: add 12.3.0 (#40827)

* Switch to dashes

* yet more underscores

---------

Co-authored-by: Paul R. C. Kent <kentpr@ornl.gov>
2023-11-30 18:32:21 +00:00
Harmen Stoppels
d436e97fc6 reuse concretization: allow externals from remote when locally configured (#35975)
This looks to me like the best compromise regarding externals in a
build cache. I wouldn't want `spack install` on my machine to install
specs that were marked external on another. At the same time there are
centers that control the target systems on which spack is used, and
would want to use external in buildcaches.

As a solution, reuse concretization will now consider those externals
used in buildcaches that match a locally configured external in
packages.yaml.

So for example person A installs and pushes specs with this config:

```yaml
packages:
  ncurses:
    externals:
    - spec: ncurses@6.0.12345 +feature
      prefix: /usr
```

and person B concretizes and installs using that buildcache with the
following config:

```yaml
packages:
  ncurses:
    externals:
    - spec: ncurses@6
    prefix: /usr
```

the spec will be reused (or rather, will be considered for reuse...)
2023-11-30 09:38:05 -08:00
Harmen Stoppels
f3983d60c2 tests: add missing mutable db (#41359) 2023-11-30 18:37:35 +01:00
Harmen Stoppels
40e705d39e tests: fix side effects of default_config fixture (#41361)
* tests: default_config drop scope

* use default_config elsewhere

* use parse_install_tree for missing defaults in default config
2023-11-30 18:19:10 +01:00
Harmen Stoppels
d92457467a test_variant_propagation_with_unify_false: missing fixture (#41345) 2023-11-30 17:27:53 +01:00
Harmen Stoppels
4c2734fe14 --scope: lazy defaults (#41353) 2023-11-30 15:35:21 +01:00
Taillefumier Mathieu
34d791189d Update SIRIUS version for CP2K master (#41264)
* Update SIRIUS version for CP2K master

* Update var/spack/repos/builtin/packages/cp2k/package.py

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>

---------

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
2023-11-30 04:08:22 -07:00
Vinícius
eec9eced1b simgrid: add v3.34 and v3.35 (#41340) 2023-11-30 11:23:57 +01:00
Christopher Christofi
3bc8a7aa5f use double quotes where spack style finds errors (#41349) 2023-11-30 09:46:02 +01:00
Massimiliano Culpo
3b045c289d Fix a typo in an integrity constraint (#41334) 2023-11-30 09:44:51 +01:00
Harmen Stoppels
4b93c57d44 argparse: make scope choices lazy s.t. validation in tests works (#41344) 2023-11-30 08:37:11 +01:00
Harmen Stoppels
377e7de0d2 tests: fix issue with os.environ binding (#41342) 2023-11-30 07:18:41 +01:00
Greg Sjaardema
0a9c84dd25 SEACAS: new release (#41273)
Replace last release due to build issues on windows. Tag was applied incorrectly
2023-11-29 21:38:05 -07:00
Chris White
2ececcd03e MFEM: add mpi link dir (#41337)
Also fix netcdf-c zlib reference
2023-11-29 21:32:50 -07:00
Adam J. Stewart
f4f67adf49 py-numba: add v0.58.1 (#41262)
* py-numba: add v0.58.1

* Passing tests
2023-11-30 00:17:34 +01:00
Adam J. Stewart
220898b4de py-pygeos: add v0.14 (#41248)
* py-pygeos: add v0.14

* Python is also a link dep
2023-11-30 00:15:07 +01:00
Luc Berger
450f938056 kokkos: add v4.2.00 (#41203)
* Kokkos: adding version 4.2.00 to the package
* Kokkos: adding AMD GPU arch
* kokkos@4.2.00 +sycl: patch numeric traits unit test

---------

Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2023-11-29 22:47:15 +00:00
Massimiliano Culpo
889b729e52 Refactor a test to not use the "working_env" fixture (#41308)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2023-11-29 22:14:57 +01:00
Sergio Alexis Paz
3987604b89 Add gipaw when building quantum-espresso with cmake (#41142)
* gipaw.x installed by cmake if version >= 5c4a4ce.

gipaw.x will only be installed with cmake if the qe-gipaw version
is >= 5c4a4ce. Currently, QE source uses the older f5823521 one.
Here a patch to the submodule_commit_hash_records to use a newer
qe-gipaw version.
2023-11-29 12:16:27 -08:00
Andrey Perestoronin
b6f8cb821c intel-oneapi-ccl 2021.11.1: added new version to packages (#41300)
* added new packages

* align release with ccl patch

* revert version on compiler classics
2023-11-29 10:09:32 -07:00
Mikael Simberg
72216b503f dla-future: Add conflicts for compilation issues pre-0.3.1 (#41317)
* dla-future: Add conflict for pedantic warnings turning into errors

* dla-future: Add conflicts for nvcc/fmt/Umpire compilation issues
2023-11-29 15:10:27 +01:00
Harmen Stoppels
c06f353f55 Simplify _create_mock_configuration_scopes (#41318) 2023-11-29 14:06:41 +01:00
Mikael Simberg
367ca3f0ec fmt: Add git attribute (#41293) 2023-11-29 12:50:28 +01:00
Harmen Stoppels
2c4bc287b8 cuda: fix compiler conflicts (#41304) 2023-11-29 12:14:39 +01:00
Harmen Stoppels
fcb3d62093 unit tests: use --verbose to see order on macos (#41314) 2023-11-29 11:29:17 +01:00
John W. Parent
306377684b CMake: add v3.27.9 (#41301) 2023-11-29 02:19:29 -07:00
Massimiliano Culpo
29b75a7ace Fix an issue with deconcretization/reconcretization of environments (#41294) 2023-11-29 09:09:16 +01:00
Paul R. C. Kent
4b41b11c30 cuda: add 12.3.0 (#40827) 2023-11-28 13:28:28 -08:00
afzpatel
92e0d42b64 update hipblas rocalution, rocsolver, rocsparse to new syntax (#40135)
* initial commit to update hipblas rocalution, rocsolver, rocsparse to new syntax
* add rocblas test changes and fixes for hipblas and rocsolver tests
* fix styling
* remove updates for rocblas
2023-11-28 12:49:07 -08:00
afzpatel
1ebd37d20c fix hip tests and bump hip-examples to 5.6.1 (#40928)
* Initial commit to fix hip tests and bump hip-examples to 5.6.1
* fix styling
* add installation of hip samples to share folder
2023-11-28 12:17:10 -08:00
Adam J. Stewart
b719c905f1 apple-libuuid: update installation directory (#40416)
* apple-libuuid: update installation directory

Copy design of Apple GL
2023-11-28 10:13:55 -08:00
eugeneswalker
430b2dff5c e4s ci: disable gpu test stack (#41296) 2023-11-28 18:02:00 +01:00
Tom Payerle
ef8e6a969c vtk: Restrict application of patch xdmf2-hdf51.13.2.patch (#40266)
The changes in patch xdmf2-hdf51.13.2.patch have effectively
been added to vtk@9.2.3 (commit e81a2fe)

So restrict application of patch fo @9:9.2
2023-11-28 11:27:58 -05:00
Massimiliano Culpo
0e65e84768 ASP-based solver: use a unique ID counter (#41290)
* solver: use a unique counter for condition, triggers and effects

* Do not reset counters when re-running setup

  What we need is just a unique ID, it doesn't need
  to start from zero every time.
2023-11-28 16:28:54 +01:00
Seth R. Johnson
e0da7154ad celeritas: new version 0.4.0 (#41288) 2023-11-28 14:44:15 +00:00
Juan Miguel Carceller
6f08daf670 root: add a webgui patch (#41289)
* root: add a webgui patch

* Update var/spack/repos/builtin/packages/root/package.py

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

* Add also the versions that don't need the webgui patch

* Fix hash

---------

Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-11-28 07:33:48 -07:00
Tom Scogland
c2d29ca38c libvips requires pkg-config to find glib (#41184) 2023-11-28 14:42:16 +01:00
Raffaele Solcà
f037ef7451 Fix elpa flags (missing optimization) (#41252)
Setting CFLAGS/FCFLAGS overrides the default optimization flags.

This commit brings them back.
2023-11-28 11:31:30 +01:00
dependabot[bot]
f84557a81b build(deps): bump vermin from 1.5.2 to 1.6.0 in /.github/workflows/style (#41285)
Bumps [vermin](https://github.com/netromdk/vermin) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/netromdk/vermin/releases)
- [Commits](https://github.com/netromdk/vermin/compare/v1.5.2...v1.6.0)

---
updated-dependencies:
- dependency-name: vermin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-28 09:38:38 +00:00
Alec Scott
18efd808da GoPackage: add new build system for Go packages (#41164)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-11-28 10:33:46 +01:00
Wouter Deconinck
5299b84319 qt-*: new versions 6.6.1 (#41281)
* qt-*: new versions 6.6.1

* qt-quick3d: fixup
2023-11-28 02:18:54 -07:00
Adam J. Stewart
70fb0b35e5 py-transformers: add v4.35.2 (#41266) 2023-11-28 10:17:52 +01:00
Alec Scott
4f7f3cbbdf smee-client: add new package (#41280) 2023-11-28 08:34:49 +01:00
Jose E. Roman
4205ac74e8 slepc: add v3.20.1 (#41274) 2023-11-27 20:53:45 -06:00
Jack Morrison
72ed14e4a9 libfabric: Add version 1.20.0 (#41277) 2023-11-27 19:04:44 -07:00
Dave Keeshan
ed54359454 Move compiler renaming to filter_compiler_wrappers (#41275) 2023-11-27 18:16:03 -07:00
Dave Keeshan
ea610d3fe2 iverilog-vpi: filter compiler wrappers from a few files (#41244) 2023-11-27 17:44:44 -07:00
John W. Parent
cd33becebc CMake: add version 3.27.8 (#41094) 2023-11-27 15:09:44 -07:00
Jim Edwards
8ccfe9f710 cprnc: add new package (#41237) 2023-11-27 14:02:04 -07:00
Eric Berquist
abc294e3a2 Update SST packages to 13.1.0 (#41220)
* Update SST packages to 13.1.0

* Allow mismatch between sst-core dependency and current macro version

* SST does not work with Python 3.12 yet

* Sanity check install binaries for sst-core

* Elements compiles with OTF2 but not OTF

* Version bounds in specs are inclusive

* Remove not-strictly-necessary file check
2023-11-27 14:55:22 -06:00
Alec Scott
c482534c1d CargoPackage: add new build system for Cargo packages (#41192)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
2023-11-27 20:15:16 +00:00
Robert Cohn
fbec91e491 handle use of an unconfigured compiler (#41213) 2023-11-27 11:57:10 -07:00
Andrey Perestoronin
3d744e7c95 intel-oneapi 2024.0.0: added new version to packages (#41135)
* oneapi 2024.0.0 release

* oneapi v2 directory support and some cleanups

* sycl abi change requires 2024 compilers for packages that use sycl

---------

Co-authored-by: Robert Cohn <robert.s.cohn@intel.com>
2023-11-27 13:13:04 -05:00
Dave Keeshan
b4bafbbf7e verilator: add v5.018 (#41256)
Add all version since 4.108, deprecate previous version, issues with flex,
switch from veripool to github for releases
2023-11-27 10:24:49 -07:00
Juan Miguel Carceller
bd3a1d28bf Simplify a few CMakePackages by removing redundant directives (#41163)
Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
2023-11-27 17:43:39 +01:00
Harmen Stoppels
e0ef78b26e docs: refer to oci build cache from containers.rst (#41269) 2023-11-27 16:36:00 +00:00
Satish Balay
d768e6ea5c Balay/xsdk 1.0.0 updates (#41180)
* superlu-dist: add v8.2.1 for xsdk

* heffte, phist build fixes on tioga

* exago: build fixes on polaris

---------

Co-authored-by: Veselin Dobrev <dobrev@llnl.gov>
2023-11-27 09:57:41 -06:00
Harmen Stoppels
8d0e0d5c77 tests: fix more cases of env variables (#41226) 2023-11-27 16:37:31 +01:00
Anton Kozhevnikov
13b711f620 [sirius] update spack recipe; add v7.5.0 (#41233)
* update spack recipe

* [@spackbot] updating style on behalf of toxa81

* change  from @develop to @7.5.0

* return dependency on boost_filesystem

* return dependency on boost_filesystem

* remove boost filesystem as agreed by @RMeli and  @simonpintarelli

---------

Co-authored-by: toxa81 <toxa81@users.noreply.github.com>
2023-11-27 16:28:19 +01:00
Nisarg Patel
d76a774957 libpsm3: add v11.5.1.1 (#41231) 2023-11-27 15:52:19 +01:00
Brian Vanderwende
ee8e40003b vapor: add new recipe (#40707) 2023-11-27 15:48:04 +01:00
Adam J. Stewart
dc715d9840 py-llvmlite: add new versions (#41247) 2023-11-27 15:43:49 +01:00
Derek Ryan Strong
89173b6d24 fpart: add license and variants (#41257) 2023-11-27 15:25:07 +01:00
stepanvanecek
848d270548 sys-sage: update repo url, rework recipe (#41005)
Co-authored-by: Stepan Vanecek <stepan.vanecek@tum.de>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-11-27 15:21:57 +01:00
fpruvost
ea347b6468 pastix: add v6.3.1 (#41265) 2023-11-27 15:03:04 +01:00
Dave Keeshan
b1b4ef6d1b Add patch so that ccache can compile with the standard gcc@12 version (#41249) 2023-11-27 14:33:30 +01:00
Thomas Madlener
c564b2d969 googletest: Add 1.13.0 and 1.14.0 tags (#41253)
* Add latest tags for googletest

* Implement proper url_for_version

* Fix hashes for older versions
2023-11-27 07:12:49 -05:00
Massimiliano Culpo
343517e794 Improve semantic for packages:all:require (#41239)
An `all` requirement is emitted for a package if all variants referenced are defined by it. Otherwise, the constraint is rejected.
2023-11-27 12:41:16 +01:00
Harmen Stoppels
6fff0d4aed libxsmm: relax arch requirement (#41193)
* libxsmm: relax arch requirement

* libxsmm: add a fixed commit from main
2023-11-27 11:55:33 +01:00
Alberto Invernizzi
34bce3f490 Remove old conflict with gcc@10.3.0 (#41254)
The conflict is captured in CudaPackage and redundant in umpire
2023-11-27 09:29:19 +01:00
Rocco Meli
7cb70e3258 force cp2k cuda/rocm variant on elpa (#41241) 2023-11-27 09:08:50 +01:00
Chris Richardson
df777dbbaa py-fenics-basix: update for main and future 0.8.0 (#40838)
* Update to latest version

* Add dependency

* revert

* address PR comments

* Correct dependencies for 0.7 to 0.8 transition

* Fix cmake line.

* Update nanobind dep

---------

Co-authored-by: Matt Archer <ma595@cam.ac.uk>
Co-authored-by: Jack S. Hale <mail@jackhale.co.uk>
Co-authored-by: Garth N. Wells <gnw20@cam.ac.uk>
2023-11-25 16:42:54 -06:00
Morten Kristensen
f28ccae3df py-vermin: add latest version 1.6.0 (#41261) 2023-11-25 14:42:58 -07:00
svengoldberg
ecdc296ef8 py-heat: add new package (#39394)
* heat: Create new spack package

* t8code: Add maintainer

* t8code: Add variant descriptions

* t8code: Add second maintainer

* t8code: Add another maintainer

* heat: Changes after review

* heat: Fix style test error

* heat: Delete obsolete install_options and re-add package homepage

* heat: Add dependency on py-setuptools

---------

Co-authored-by: Sven Goldberg <sven.goldberg@dlr.de>
2023-11-25 08:56:27 -06:00
Erik Heeren
9b5c85e919 py-sqlalchemy-utils, py-sql-alchemy: version bump (#41081)
* py-sqlalchemy-utils, py-sql-alchemy: version bump

* Update var/spack/repos/builtin/packages/py-sqlalchemy-utils/package.py

Co-authored-by: Manuela Kuhn <36827019+manuelakuhn@users.noreply.github.com>

---------

Co-authored-by: Manuela Kuhn <36827019+manuelakuhn@users.noreply.github.com>
2023-11-25 08:53:00 -06:00
Erik Heeren
ea8dcb73db py-dictdiffer: version bump (#41080)
* py-dictdiffer: version bump

* py-dictdiffer: removed runtime py-setuptools dependency in 0.9.0

* Update var/spack/repos/builtin/packages/py-dictdiffer/package.py

Co-authored-by: Manuela Kuhn <36827019+manuelakuhn@users.noreply.github.com>

---------

Co-authored-by: Manuela Kuhn <36827019+manuelakuhn@users.noreply.github.com>
2023-11-25 08:51:13 -06:00
Moritz Kern
089e117904 Update py-neo (#39213)
* add 0.12.0

* remove whitespace

* update deps

* Update var/spack/repos/builtin/packages/py-neo/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* add dep for python 3.8+

* add dep for python 3.8+ with 0.12.0

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-25 08:40:10 -06:00
Wouter Deconinck
1456d9b727 py-stashcp: new package (#41091)
* py-stashcp: new package

* py-stashcp: depends_on py-urllib3

* py-stashcp: comment as suggested in review

* Update var/spack/repos/builtin/packages/py-stashcp/package.py
2023-11-25 08:31:56 -06:00
Wouter Deconinck
c485709f62 iwyu: new versions up 0.21 (depends_on llvm-17) (#41235) 2023-11-24 10:09:24 -05:00
Michael Kuhn
7db386a018 Fix multi-word aliases (#41126)
PR #40929 reverted the argument parsing to make `spack --verbose
install` work again. It looks like `--verbose` is the only instance
where this kind of argument inheritance is used since all other commands
override arguments with the same name instead. For instance, `spack
--bootstrap clean` does not invoke `spack clean --bootstrap`.

Therefore, fix multi-line aliases again by parsing the resolved
arguments and instead explicitly pass down `args.verbose` to commands.
2023-11-24 15:56:42 +01:00
Massimiliano Culpo
92d076e683 spack graph: fix coloring with environments (#41240)
If we use all specs, we won't color correctly build-only dependencies
2023-11-24 10:08:21 +01:00
joscot-linaro
f70ef51f1a linaro-forge: update for 23.1 (#41236) 2023-11-24 09:15:47 +01:00
Jógvan Magnus Haugaard Olsen
e9d968d95f pfunit: add version 4.7.4 (#41232) 2023-11-24 09:04:37 +01:00
Nathalie Furmento
918d6baed4 starpu: add release 1.4.2 (#41238) 2023-11-24 09:02:51 +01:00
Loris Ercole
624df2a1bb nlcglib: pass cuda_arch setting to kokkos dependency (#39725)
When building with `+cuda`, the specified `cuda_arch` was not passed to kokkos,
leading to a wrong concretization.
2023-11-23 17:49:00 +01:00
Massimiliano Culpo
ee0d3a3be2 ASP-based solver: don't error for type mismatch on preferences (#41138)
This commit discards type mismatches or failures to validate a package preference during concretization. The values discarded are logged as debug level messages. It also adds a config audit to help users spot misconfigurations in packages.yaml preferences.
2023-11-23 11:30:39 +01:00
Mark Abraham
de64ce5541 rdma-core: add new variants for a library without Python dependencies (#41195)
These variants allow packages that use rdma-core as a library to avoid
dependencies on python infrastructure that is not useful to them.
2023-11-23 09:52:57 +01:00
Raffaele Solcà
f556e52bf6 Add dla-future 0.3.1 (#41219) 2023-11-23 09:23:20 +01:00
Todd Gamblin
81e7d39bd2 Update CHANGELOG.md from v0.21.0
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2023-11-22 14:39:05 -08:00
Harmen Stoppels
61055d9ee5 test_which: do not mutate os.environ 2023-11-22 14:22:37 -08:00
afzpatel
c1a8bb2a12 composable-kernel, migraphx: Fix build on CentOS8 (#41206) 2023-11-22 20:43:45 +01:00
Juan Miguel Carceller
7e9ddca0ff gloo: add a patch for building with gcc 12 (#41169) 2023-11-22 20:39:01 +01:00
Jen Herting
7cad4bb8d9 [nettle] depend on spack managed openssl (#40783) 2023-11-22 20:37:36 +01:00
Thomas Madlener
2d71c6bb8e dd4hep: add v1.27.1 (#41202)
* Make sure that geant4 comes with cxxstd that should be OK
2023-11-22 20:29:46 +01:00
Alec Scott
285de8ad4d fzf: add v0.44.1 (#41204) 2023-11-22 20:21:53 +01:00
Manuela Kuhn
89a0ea01a7 pulseaudio: add missing m4 dependency (#41216) 2023-11-22 20:20:59 +01:00
Stephen Sachs
e49f55ba53 aocc: help compiler find include paths and libstdc++.so (#40450)
Add --gcc-toolchain option by default.
Only add these paths if c++ libs and include files are available and the compiler was built with gcc
2023-11-22 09:59:20 -08:00
Thomas Madlener
3c54177c5d edm4hep: add latest tag for 0.10.2 (#41201) 2023-11-22 10:16:39 -07:00
Harmen Stoppels
24a38e6782 setup_platform_environment before package env mods (#41205)
This roughly restores the order of operation from Spack 0.20,
where where `AutotoolsPackage.setup_build_environment` would
override the env variable set in `setup_platform_environment` on
macOS.
2023-11-22 17:32:13 +01:00
Massimiliano Culpo
3cf7f7b800 ASP-based solver: don't emit spurious debug output (#41218)
When improving the error message, we started #showing in the
answer set a lot more symbols - but we forgot to suppress the
debug messages warning about UNKNOWN SYMBOLs
2023-11-22 16:06:46 +01:00
LucaMarradi
d7e756a26b onnxruntime: fix the call to as_string() operator (#41087)
* onnxruntime: fix the call to as_string() operator

* Update var/spack/repos/builtin/packages/py-onnxruntime/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* Update var/spack/repos/builtin/packages/py-onnxruntime/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-onnxruntime/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* py-onnxruntime: rm now-unused stringpiece_1_10.patch

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-22 07:23:52 -06:00
Tom Scogland
721f15bbeb hub: add v2.14.2, update to go module (#41183)
* packages/hub: add new version, update to module

Hub now uses a go module to build, needs different env vars, and we're
on a very, very old version before that.  Deprecate the old ones so we
can clean out that old build once we pass a spack version.

* cleanup suggested by @adamjstewart
2023-11-22 07:22:22 -06:00
Michael Kuhn
efa316aafa perl: add missing gmake dependency (#41210) 2023-11-22 11:17:47 +01:00
Michael Kuhn
6ac23545ec python: add missing gmake dependency (#41211) 2023-11-22 11:17:27 +01:00
Alex Richert
432f5d64e3 Add cxx17_flag to intel.py (#41207)
* Add cxx17_flag to intel.py
2023-11-21 18:08:02 -07:00
Chris Richardson
f2192a48ce Update py-scikit-build-core to version 0.6.1 (#40779)
* Update to latest version

* Fix linebreak

* Make suggested changes

* bumped to 0.6.1

* Update var/spack/repos/builtin/packages/py-scikit-build-core/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

---------

Co-authored-by: Chris Richardson <cnr12@cam.ac.uk>
Co-authored-by: Matt Archer <ma595@cam.ac.uk>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-21 13:17:07 -06:00
Alec Scott
70bed662fc gettext: add v0.22.4 (#41189) 2023-11-21 05:19:16 -07:00
dependabot[bot]
ae38987cb4 build(deps): bump pygments from 2.16.1 to 2.17.1 in /lib/spack/docs (#41191)
Bumps [pygments](https://github.com/pygments/pygments) from 2.16.1 to 2.17.1.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.16.1...2.17.1)

---
updated-dependencies:
- dependency-name: pygments
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 01:12:50 -07:00
Massimiliano Culpo
b361ffbe22 spack style: fix isort on sl:7 (#41133)
Bump the minimum version required for isort. This should fix
an issue reported on Scientific Linux 7, and due to:

https://github.com/PyCQA/isort/issues/1363
2023-11-21 06:24:37 +01:00
Mark W. Krentel
964440a08b elfutils: add version 0.190 (#41187) 2023-11-20 21:10:21 -07:00
Wouter Deconinck
aeb1bec8f3 qt-base: have QtBase provide qmake, ont QtPackage (#41186) 2023-11-20 20:05:11 -07:00
Mark Abraham
cf163eecc5 gromacs: fix newly added variant (#41178)
In practice, one can only compiler for the Intel Data Center Max GPU
via a SYCL build and the oneAPI compiler. This is unlikely to change,
so we can be explicit about that.
2023-11-20 19:49:34 -07:00
Harmen Stoppels
7ec62d117e py-grpcio* do not assume lib / header dir (#41182) 2023-11-20 15:34:29 -06:00
John W. Parent
5154d69629 MSVC preview version breaks clingo build (#41185)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-11-20 21:55:07 +01:00
Alec Scott
d272c49fb6 rust: add v1.73.0 and add support for external openssl certs (#41161)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
2023-11-20 21:35:26 +01:00
334 changed files with 4608 additions and 1401 deletions

View File

@@ -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: |

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -182,6 +182,7 @@ section of the configuration:
padded_length: 128
.. _binary_caches_oci:
-----------------------------------------
OCI / Docker V2 registries as build cache

View File

@@ -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

View File

@@ -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
---------

View File

@@ -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>`

View File

@@ -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:

View File

@@ -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"
]

View File

@@ -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.

View File

@@ -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),
]

View File

@@ -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"
^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -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),
]

View File

@@ -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"))
^^^^^^^^^^^^^^^^^

View File

@@ -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

View File

@@ -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

View File

@@ -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
--------------------

View File

@@ -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

View File

@@ -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

View File

@@ -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)]))

View File

@@ -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.

View File

@@ -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"

View File

@@ -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

View File

@@ -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))

View File

@@ -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:

View File

@@ -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"):

View 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)

View File

@@ -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")

View 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)

View File

@@ -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:

View File

@@ -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(),
]

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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)

View File

@@ -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))

View File

@@ -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"

View File

@@ -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"))

View File

@@ -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

View File

@@ -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)

View File

@@ -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.

View File

@@ -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

View File

@@ -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",
)

View File

@@ -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"
)

View File

@@ -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):

View File

@@ -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"))

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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):

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 '

View File

@@ -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"

View File

@@ -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"

View File

@@ -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):

View File

@@ -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()

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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):

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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)

View File

@@ -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"):

View File

@@ -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:")

View File

@@ -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

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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(),
)

View File

@@ -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()

View File

@@ -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.

View File

@@ -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