Compare commits

...

323 Commits

Author SHA1 Message Date
Gregory Becker
55ac6fb542 prepend compiler bindir to PATH lower priority than wrapper 2023-03-23 14:04:05 -07:00
Matthieu Dorier
68874a72fb [liburing] Adds liburing package (#35762)
* [liburing] Adds liburing package
* Update var/spack/repos/builtin/packages/liburing/package.py
* [liburing] Added conflicts for darwin and windows platforms

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2023-03-09 11:03:32 -08:00
Harshula Jayasuriya
e560beed19 concretizer.yaml: document valid values for granularity (#35961) 2023-03-09 19:51:11 +01:00
Vanessasaurus
de586bb66c Automated deployment to update package flux-core 2023-03-09 (#35956)
Co-authored-by: github-actions <github-actions@users.noreply.github.com>
2023-03-09 10:25:57 -08:00
Michael Kuhn
846cd05c7e scorep: fix dependencies (#35966)
The overlapping dependency version ranges caused the concretizer to pick
version 7.1 even though version 8.0 is available:
```
==> Error: No version for 'cubelib' satisfies '@4.7.1' and '@4.8'
```

Moreover, Score-P 8.0 requires libbfd:
```
configure: error: bfd.h required
```
2023-03-09 10:12:37 -08:00
Alec Scott
1ef313b604 bdftopcf: add v1.1 (#35845) 2023-03-09 11:40:25 -05:00
Rocco Meli
73026f4f4b Deprecate elpa rc2 (#35953) 2023-03-09 09:28:14 -05:00
Alec Scott
08dd6d1a21 fontconfig: add v2.14.2 (#35861) 2023-03-09 09:13:07 -05:00
Mark W. Krentel
e9173a59fd hpctoolkit: adjust dependency and conflict for xz (#35950)
Hpctoolkit doesn't build cleanly with xz 5.2.7 and 5.2.8 due to a
misuse of the symver attribute.  This is now fixed in 5.2.9 and later.
2023-03-09 08:37:21 -05:00
Benjamin Meyers
7401c97037 New packages: py-fireworks, py-flask-paginate (#35939)
* New packages: py-fireworks, py-flask-paginate

* [@spackbot] updating style on behalf of meyersbs
2023-03-09 04:54:26 -05:00
Benjamin Meyers
15433cfaf1 New package py-custodian (#35938)
* New package py-custodian

* [@spackbot] updating style on behalf of meyersbs
2023-03-09 04:50:31 -05:00
Benjamin Meyers
99aa0ef0cd Update py-boltons (#35937) 2023-03-09 04:46:25 -05:00
Alec Scott
28934e5f77 gawk: add v5.2.1 (#35863) 2023-03-08 21:36:43 -05:00
Michael Kuhn
f08598427d git: add 2.39.2 (#35911) 2023-03-08 19:40:16 -05:00
Michael Kuhn
cc4f7c224a libuv-julia: fix mtime again (#35945)
On some systems touch runs out of order,
so set a equal mtimes to the relevant files
2023-03-08 19:02:38 -05:00
Maciej Wójcik
ee5b2936e4 gcc: Patch building of GCC 5.1-12.1 with glibc >= 2.36 (#35798) 2023-03-08 22:29:57 +01:00
Teo
f7a6446d3f Halide: Add 15.0.0 (#35924) 2023-03-08 16:22:16 -05:00
Tamara Dahlgren
624e28ee03 nek5000/nekcem: test_install -> check_install (#35925) 2023-03-08 16:05:29 -05:00
Auriane R
784e5f5789 Add pika 0.13.0 and pika-algorithms 0.1.2 (#35933)
* Add last release of pika-algorithms + version constraint

* Add pika release 0.13.0
2023-03-08 16:05:11 -05:00
Michael Kuhn
180618b25a p7zip: update checksum for 17.05 (#35923)
See https://github.com/p7zip-project/p7zip/issues/220
2023-03-08 16:04:57 -05:00
Emil Briggs
aefcce51fc rmgdft: add version 5.0.5 (#35922)
* Updated for version 5.0.5.
2023-03-08 15:59:09 -05:00
Weiqun Zhang
884a356b1e amrex: add v23.03 (#35765) 2023-03-08 15:45:16 -05:00
Jean-Baptiste Besnard
ee69f2d516 intel-mpi-benchmarks: variant and conflicts fixes (#35670) 2023-03-08 15:33:28 -05:00
renjithravindrankannath
bc5bb06f1f Provide openmp from rocm-open-extras when tensile uses openmp (#35767)
* Provide openmp from rocm-open-extras when tensile uses openmp
* Correcting audit check failure in rocm-openmp-extras dependency
* Fixing style check error
* rocm-openmp-extras required instead of llvm-amdgpu both varient
2023-03-08 09:57:35 -08:00
Peter Scheibel
1b8561f752 add logging to help users debug where external file searches are taking a long time (#35900) 2023-03-08 09:46:13 -08:00
nicolas le goff
7d54c24939 qwt: lift restrictions on qt version and added an opengl variant and VisIt use (#35734) 2023-03-08 18:38:33 +01:00
Robert Underwood
960923287d gdb: version 13.1 and debuginfod support (#35769)
* gdb: version 13.1 and debuginfod
* gdb: update to autotools helpers

---------

Co-authored-by: Robert Underwood <runderwood@anl.gov>
2023-03-08 08:54:47 -08:00
Scott Wittenburg
4a9ffdcfa2 gitlab ci: Provide a knob to control untouched spec pruning (#35274)
When untouched spec pruning is enabled, specs possibly affected
by a change cannot be pruned from a pipeline.

Previously spack looked at all specs matching changed package
names, and traversed dependents of each, all the way to the
environment root, to compute the set of environment specs
possibly affected by a change (and thus, not candidates for
pruning).

With this PR, when untouched spec pruning is enabled, a new
environment variable can control how far towards the root spack
traverses to compute the set of specs possibly affected by a
change.  SPACK_UNTOUCHED_PRUNING_DEPENDENT_DEPTH can be set
to any numeric value before the "spack ci generate" command
is called to control this traversal depth parameter.  Setting
it to "0" traverses only touched specs, setting it to "1"
traverses only touched specs and their direct dependents, and
so on.  Omitting the variable results in the previous behavior
of traversing all the way to the root.  Setting it to a negative
value means no traversal is done, and always yields an empty
set of possibly affected specs (which would result in the max
pruning possible).
2023-03-08 09:38:07 -07:00
Harmen Stoppels
22d4e79037 buildcache create: reproducible tarballs (#35623)
Currently `spack buildcache create` creates compressed tarballs that
differ between each invocation, thanks to:

1. The gzip header containing mtime set to time.time()
2. The generated buildinfo file which has a different mtime every time.

To avoid this, you have to explicitly construct GZipFile yourself, since
the Python API doesn't expose the mtime arg, and we have to manually
create the tarinfo object for the buildinfo metadata file.

Normalize mode: regular files & hardlinks executable by user, dirs, symlinks: set 0o755 permissions in tarfile; other files use 0o644
2023-03-08 15:51:55 +00:00
Sangu Mbekelu
2777ca83eb new py-thop package (#35889)
* "new py-thop package"

* [@spackbot] updating style on behalf of Sangu-Mbekelu

* Update package.py

modified the url and dependencies

---------

Co-authored-by: Sangu Mbekelu <s.mbekelu9@gmail.com>
2023-03-08 09:12:27 -06:00
Erik Heeren
a2423f5736 py-openmesh: new package (#35907)
* py-openmesh: new package

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-08 09:11:34 -06:00
Aaron Black
81765e0278 mfem: add missing cublas for cuda support (#35608) 2023-03-08 09:14:46 -05:00
Erik Heeren
0d4f9b26b8 py-parse-type: new package (#35909) 2023-03-08 07:13:30 -05:00
Gerhard Theurich
87c21a58d1 parallelio: new version (#35553) 2023-03-08 07:13:13 -05:00
Alberto Invernizzi
5900378cff newly released 0.8.3 (#35910) 2023-03-08 07:05:13 -05:00
Massimiliano Culpo
d54611af2c Split satisfies(..., strict=True/False) into two functions (#35681)
This commit formalizes `satisfies(lhs, rhs, strict=True/False)`
and splits it into two functions: `satisfies(lhs, rhs)` and
`intersects(lhs, rhs)`.

- `satisfies(lhs, rhs)` means: all concrete specs matching the
   left hand side also match the right hand side
- `intersects(lhs, rhs)` means: there exist concrete specs
   matching both lhs and rhs.

`intersects` now has the property that it's commutative,
which previously was not guaranteed.

For abstract specs, `intersects(lhs, rhs)` implies that
`constrain(lhs, rhs)` works.

What's *not* done in this PR is ensuring that
`intersects(concrete, abstract)` returns false when the
abstract spec has additional properties not present in the
concrete spec, but `constrain(concrete, abstract)` will
raise an error.

To accomplish this, some semantics have changed, as well
as bugfixes to ArchSpec:
- GitVersion is now interpreted as a more constrained
  version
- Compiler flags are interpreted as strings since their
  order is important
- Abstract specs respect variant type (bool / multivalued)
2023-03-08 13:00:53 +01:00
Benjamin Meyers
39adb65dc7 New package: py-imbalanced-learn (#35895)
* New package: py-imbalanced-learn

* Fix typo

* [@spackbot] updating style on behalf of meyersbs

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-08 07:00:09 -05:00
Rocco Meli
db15e1895f bump elpa (#35908) 2023-03-08 06:59:52 -05:00
Benjamin Meyers
7610926e5e Update and fix py-meldmd (#35783)
* Update/fix py-meldmd; update openmm

* Restrict filter_file based on openmm version

* Updates based on Adam's feedback

* [@spackbot] updating style on behalf of meyersbs

* Break up long filter_file

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-08 06:59:35 -05:00
Benjamin Meyers
703f687ca0 Update py-seaborn to @0.12.2 (#35896) 2023-03-08 06:54:17 -05:00
Annop Wongwathanarat
983a56e729 gromacs: add sve variant on aarch64 (#35614) 2023-03-08 10:25:36 +01:00
Brian Vanderwende
cbd0770497 ESMF should use Spack wrappers directly (#35749) 2023-03-08 10:21:51 +01:00
Tamara Dahlgren
b06648eb64 docs: added platform conflicts example, fix quotes (#35771) 2023-03-08 10:10:01 +01:00
QuellynSnead
80d784c401 singularity-eos: (#35625)
The Cray fortran compiler names fortran modules in uppercase by
default. Compile with the "-ef" flag to produce the lowercase
name that singularity-eos is expecting.
2023-03-08 09:58:34 +01:00
downloadico
5b3ad0adaa pgplot: made dependent packages set environment variables from pgplot (#35803) 2023-03-08 09:48:12 +01:00
Richard Berger
3feadc0a36 lammps: GPU/Kokkos package updates (#35885) 2023-03-08 09:46:05 +01:00
Alec Scott
8ec86e05c4 ico: add v1.0.6 (#35881) 2023-03-08 09:33:22 +01:00
Alec Scott
b34fd98915 ftxui: add v4.0.0 (#35868) 2023-03-08 09:33:08 +01:00
Tim Haines
a93d143f17 boost: add v1.81.0 (#34613) 2023-03-08 09:28:17 +01:00
Alec Scott
d0ced9da94 lucene: add v9.5.0 (#35917) 2023-03-08 09:12:51 +01:00
Harmen Stoppels
c37d6f97dc compiler wrapper: parse Wl and Xlinker properly (#35912)
Two fixes:

1. `-Wl,a,b,c,d` is a comma separated list of linker arguments, we
   incorrectly assume key/value pairs, which runs into issues with for
   example `-Wl,--enable-new-dtags,-rpath,/x`
2. `-Xlinker,xxx` is not a think, so it shouldn't be parsed.
2023-03-08 09:03:31 +01:00
Adam J. Stewart
ec73157a34 py-mypy: add v1.1.1 (#35926) 2023-03-08 08:16:01 +01:00
Alec Scott
e447c365ee help2man: add v1.49.3 (#35877) 2023-03-08 02:01:58 -05:00
Alec Scott
c5c67145d3 iso-codes: add v4.13.0 (#35915) 2023-03-08 01:18:10 -05:00
Alec Scott
a5bc83d635 httpie: add v3.2.1 (#35879)
* httpie: add v3.2.1

* Add additional 3.2.1 dependencies to httpie

* Add version condition to dependency

* Reorder dependencies for efficiency

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-08 01:05:44 -05:00
Alec Scott
1760553b70 lua-luaposix: add v36.1 (#35918) 2023-03-08 00:30:28 -05:00
Alec Scott
62d9bf5fef listres: add v1.0.5 (#35921) 2023-03-07 22:12:35 -05:00
Alec Scott
cb49da1b6f lndir: add v1.0.4 (#35920) 2023-03-07 21:54:19 -05:00
Alec Scott
c79d9ac5bd erlang: add v25.2 (#35856) 2023-03-07 20:29:52 -05:00
Alec Scott
871ca3e805 jchronoss: add v1.2.1 (#35916) 2023-03-07 19:58:21 -05:00
Harmen Stoppels
89176bd3f6 libxc: use gitlab release tarballs for v6.0.0 and greater (#35894)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-03-07 19:57:59 -05:00
Alec Scott
b29a607ceb isl: add v0.25 (#35884) 2023-03-07 18:03:01 -05:00
Alec Scott
0c06ecc711 iceauth: add v1.0.9 (#35880) 2023-03-07 18:02:45 -05:00
Alec Scott
73d1e36da5 imake: add v1.0.9 (#35882) 2023-03-07 18:02:29 -05:00
Erik Heeren
0d57c2ab24 py-numpy-stl: new package (#35892) 2023-03-07 18:02:13 -05:00
Alec Scott
272e69b2fd htslib: add v1.17 (#35883) 2023-03-07 18:01:58 -05:00
Alec Scott
8efde89c0e hivex: add v1.3.23 (#35878) 2023-03-07 18:01:43 -05:00
Alec Scott
c7ec47c658 graphviz: add v7.1.0 (#35876) 2023-03-07 17:56:08 -05:00
Alec Scott
013e82f74f grep: add v3.9 (#35875) 2023-03-07 17:55:46 -05:00
Alec Scott
fff7e6d626 gradle: add v8.0.2 (#35873) 2023-03-07 17:50:06 -05:00
Alec Scott
ac1fe8765a gprolog: add v1.5.0 (#35874) 2023-03-07 17:23:21 -05:00
Alec Scott
acbf46d786 glpk: add v5.0 (#35871) 2023-03-07 17:22:56 -05:00
Alec Scott
a753fa12fb gegl: add v0.4.42 (#35866) 2023-03-07 17:22:35 -05:00
Alec Scott
27b2dc1608 fonttosfnt: add v1.2.2 (#35862) 2023-03-07 17:16:43 -05:00
Alec Scott
d8f8b42bcb fslsfonts: add v1.0.6 (#35869) 2023-03-07 16:58:59 -05:00
Alec Scott
3995428ad2 gatk: add v4.3.0.0 (#35864) 2023-03-07 16:53:15 -05:00
Alec Scott
76d41b7f9f fstobdf: add v1.0.7 (#35870) 2023-03-07 16:36:08 -05:00
Samuel Li
a7501105b1 update SPERR package (#35810)
* update SPERR package
* remove blank line
* update SPERR package
* remove blank line
---------

Co-authored-by: Samuel Li <Sam@Navada>
2023-03-07 12:26:43 -08:00
Adam J. Stewart
da33334488 py-pytorch-lightning: add v1.9.4 (#35791) 2023-03-07 12:08:47 -08:00
Adam J. Stewart
68dfcd10e6 py-pytorch-lightning: torch~distributed not supported in 1.9.0 (#35809) 2023-03-07 12:05:39 -08:00
Alec Scott
4e6a8a40b7 cloog: add v0.18.4 (#35849) 2023-03-07 11:55:00 -08:00
Alec Scott
20f663d089 dnsmasq: add v2.89 (#35851) 2023-03-07 11:54:37 -08:00
Cody Balos
acf61daf99 sundials: add new version (#35796) 2023-03-07 11:52:05 -08:00
Alec Scott
a0233d2560 cmocka: add v1.1.7 (#35848) 2023-03-07 11:49:42 -08:00
Alec Scott
8c989e0aee apr: add v1.7.2, apr-util 1.6.3 (#35832)
* apr: add v1.7.2
* apr-util: add v1.6.3
2023-03-07 11:48:39 -08:00
Alec Scott
2f5e7fb38c awscli: add v1.27.84 (#35836)
* awscli: add v1.27.84

* Add botocore dependency to awscli

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

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

* Add py-botocore@1.29.84 dependency

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-07 13:38:17 -06:00
Alec Scott
b9bc911921 cget: add v0.2.0 (#35846) 2023-03-07 13:10:56 -05:00
Alec Scott
462df718ff bc: add v1.07.1 (#35844) 2023-03-07 13:10:33 -05:00
Alec Scott
b20271a8e8 code-server: add v4.10.1 (#35855) 2023-03-07 12:06:01 -05:00
Alec Scott
a62992b4b1 easybuild: add v4.7.0 (#35853)
* easybuild: add v4.7.0

* Add v0.4.7 to all easybuild dependencies

* Reorder versions newest to oldest

* Fix styling on easybuild dependency loop
2023-03-07 12:05:39 -05:00
Alec Scott
818459e6fc dash: add v0.5.12 (#35850) 2023-03-07 11:48:05 -05:00
Alec Scott
38bd499c09 colordiff: add v1.0.21 (#35847) 2023-03-07 11:47:43 -05:00
Alec Scott
f9de4c2da8 aspell: add v0.60.8 (#35834) 2023-03-07 11:47:21 -05:00
Rocco Meli
335ae31a59 Update biopython, gsd, and griddataformats (#35827)
* update mda dependencies

* apply black

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

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

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

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

* remove numpy upper bound

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

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

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-07 11:47:04 -05:00
Alec Scott
c4e5ee8831 beforelight: add v1.0.6 (#35843) 2023-03-07 11:32:17 -05:00
Alec Scott
73c358819b busybox: add v1.36.0 (#35840) 2023-03-07 11:31:52 -05:00
Alec Scott
6f396aff99 bitmap: add v1.1.0 (#35839) 2023-03-07 11:20:26 -05:00
Alec Scott
047b99fab9 blktrace: add v1.3.0 (#35842) 2023-03-07 10:56:31 -05:00
Alec Scott
a12a290ee1 bmake: add v20230303 (#35841) 2023-03-07 10:56:05 -05:00
Alec Scott
bd6c9085f0 atk: add v2.38.0 (#35833) 2023-03-07 10:55:48 -05:00
Alec Scott
c0a0d60378 appres: add v1.0.6 (#35831) 2023-03-07 10:55:29 -05:00
Alec Scott
bc84ca126e ace: add v7.1.0 (#35829) 2023-03-07 10:55:08 -05:00
Alec Scott
3bb7570e02 alglib: add v3.20.0 (#35830) 2023-03-07 10:44:09 -05:00
Adam J. Stewart
a5b80662ae py-matplotlib: add v3.7.1 (#35822) 2023-03-06 19:02:20 -05:00
John W. Parent
0c5360e3fd Proj: to CMake (#35108)
* update proj

* re-add autotools support

* style

* Setup env in builders

* Drop direct windows conflict for older versions

* Default to CMake

Add new style class definiton

* Proj: setup_run_environment in package not builder

* Proj: move run env changes to pkg, rm cmake arg

* Set PROJ_LIB during build

* Style

* Rm redundant configure arg
2023-03-06 17:23:34 -05:00
Greg Becker
2ff337a2a5 compiler flags: fix multiple compilers with different flags (#35721)
Currently, if two compilers with the same spec differ on the flags, the concretizer will:

1. mix both sets of flags for the spec in the ASP program
2. error noting that the set of flags from the compiler (both of them) doesn't match the set from the lower priority compiler

This PR fixes both -- only flags from the highest priority compiler with a given spec are considered.
2023-03-06 10:29:48 -08:00
Erik Heeren
f3841774f7 py-elasticsearch: new versions (#35764)
* py-elasticsearch: new versions

Also add py-elastic-transport as a new dependency

* py-elasticsearch: py-urllib3 is no longer a dependency

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-06 10:30:31 -06:00
Alec Scott
97c2dd3a5a Add Hugo v0.111.1 (#35824) 2023-03-05 18:33:23 +01:00
Alec Scott
3aae80ca07 curl: add v7.88.1 and deprecate previous versions due to CVEs (#35825)
* curl: add v7.88.1 and deprecate previous versions due to CVEs

* Add self as a maintainer to curl
2023-03-05 18:32:56 +01:00
Alec Scott
973bc92813 libarchive: add v3.6.2 and deprecate previous versions due to CVE-2022-36227 (#35826) 2023-03-05 18:22:41 +01:00
Todd Gamblin
42a02411b4 windows: use sys.platform == "win32" instead of is_windows (#35640)
`mypy` only understands `sys.platform == "win32"`, not indirect assignments of that
value to things like `is_windows`. If we don't use the accepted platform checks, `mypy`
registers many Windows-only symbols as not present on Linux, when it should skip the
checks for platform-specific code.
2023-03-05 07:58:05 -08:00
Erik Heeren
4561536403 py-simpervisor: correct pypi (#35785) 2023-03-04 10:44:03 -06:00
MicK7
6b694749d3 Update python linting packages (#35811)
* add 2.14.2 py-astroid version

* add py-pylint 2.26.2

* fix black

* fix py-dill depends_on

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

* fix py-astroid minor versionning

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

* modify typing_extensions depends_on

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-03 16:06:56 -06:00
MatthewLieber
c0f48b30cf Start using paths found in extra_rpaths in compilers.yaml when building (#35376)
* Start using paths found in extra_rpaths in compilers.yaml when building

* running black and changing maintainer list

* changing import order to pass isort

---------

Co-authored-by: Matthew Lieber <lieber.31@osu.edu>
2023-03-03 13:29:59 -08:00
Massimiliano Culpo
046416479a Polish spack.util.environment (#35812)
Update `spack.util.environment` to remove legacy idioms.
* Remove kwargs from method signature and use a class for traces
* Uppercase a few global variables
* spack.util.environment: add type-hints
* Improve docstrings
* Fixed most style issues reported by pylint
2023-03-03 16:17:27 -05:00
Lucas Frérot
b17113b63d snakemake: added versions 7.19.0-7.22.0 (#35535)
* snakemake: added versions 7.19.0-7.22.0

* snakemake: corrected +reports dependencies
2023-03-03 12:46:29 -06:00
Loïc Pottier
479f5a74a3 py-ipdb: updating versions (#35654)
* py-ipdb: updating versions

Signed-off-by: Loïc Pottier <pottier1@llnl.gov>

* py-ipdb: fixing versions problem and deleting 10.1 which is too old for Python > 3.6

Signed-off-by: Loïc Pottier <pottier1@llnl.gov>

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

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

* py-ipdb: removed useless dependencies

Signed-off-by: Loïc Pottier <pottier1@llnl.gov>

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

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

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

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

* py-ipdb: missing @

Signed-off-by: Loïc Pottier <pottier1@llnl.gov>

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

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

---------

Signed-off-by: Loïc Pottier <pottier1@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-03 05:28:40 -05:00
kwryankrattiger
895886959f CI: Fix timeout for VisIt and ParaView (#35787)
ref. #35400
2023-03-03 09:13:14 +01:00
Jean Luca Bez
0bdb0b07fd update github URL (#35789) 2023-03-03 00:23:23 -05:00
Ishaan Desai
817b59900a Update pyprecice v2.5.0.2 (#35788)
* Update versions 2.5.0.0 and 2.5.0.1

* Applying review changes

* Updating incorrect checksum for v2.4.0.0

* Add for loop to define depends_on for preCICE versions and bindings versions

* Formatting

* Missing comma

* Add pyprecice v2.5.0.2
2023-03-03 00:19:17 -05:00
Erik Heeren
2ddd66ca48 py-jupyter-server-proxy: fix dependency condition (#35784)
Too much copypasta
2023-03-03 00:18:31 -05:00
H. Joe Lee
7ddd796f89 scons: add a new version (#35652)
* scons: add a new version

* scons: address @adamjstewart review
2023-03-02 15:14:59 -06:00
downloadico
1e2ef16b39 Add e3sm scorpio (#35794)
* e3sm-scorpio: add e3sm-scorpio package
   This is the Scorpio package from the e3sm.org site.
* fixed style errors
* removed unneeded dependency on cmake
2023-03-02 15:48:55 -05:00
Adam J. Stewart
77355fd348 py-nbstripout: add new package (#35786) 2023-03-02 10:47:48 -07:00
Adam J. Stewart
1facf99f51 py-rtoml: add new package (#35780) 2023-03-02 09:43:36 -08:00
Robert Underwood
07c8939679 julia: fix for libuv and Julia (#35776)
Use correct `shlib_symbol_version` for Julia 1.8, work around issue where libuv-julia's git checkout has arbitrary mtime, causing make to regenerate configure scripts, sometimes.
2023-03-02 16:36:55 +01:00
Erik Heeren
28f4b5729a py-chart-studio: new package (#35759)
* py-chart-studio: new package

* py-chart-studio: add missing six dependency
2023-03-02 08:40:37 -06:00
M. Eric Irrgang
dd7af323ed Add a py-gmxapi package. (#35738)
* Add a `py-gmxapi` package.

This package provides the Python package for the GROMACS
public API. The Python package is not strongly coupled to
a specific GROMACS _version_, but its compiled extension module
is strongly coupled to a specific GROMACS _installation_.

* Update conflict info.

In order to allow `^gromacs@2022.1` while rejecting `^gromacs@2022`,
we need to compare to `gromacs@2022.0`.

* Apply suggestions from code review

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

* Apply suggestions from code review.

* Simplify build system structure.
* Update dependencies for completeness.

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

Per code review, pretend gmxapi <0.4 doesn't exist, for simplicity.

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

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

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-02 08:37:17 -06:00
Axel Huebl
2ba1f700e6 WarpX: add v23.03 (#35775)
Update `warpx` & `py-warpx` to the latest release.
2023-03-02 04:19:08 -08:00
Adam J. Stewart
739ab89b65 py-kornia: add v0.6.10 (#35554) 2023-03-02 01:08:39 -08:00
Adam J. Stewart
7e5099627f py-pytorch-lightning: add v1.9.3 (#35629) 2023-03-02 00:23:34 -08:00
Brian Van Essen
eb29889f6e Detection of Cray's slingshot detection has relied on the presence of (#35779)
a shared library /lib64/libcxi.so, which seems to also appear on other
non-slingshot systems.  This patch also checks to make sure that there
is a Cray programming enviornment in /opt/cray/pe in addition to the
shared library.
2023-03-01 23:19:20 -08:00
Dmitriy
ae27df4113 Add py-mpi4py as a dependency for henson (#35743)
* Add py-mpi4py as a dependency

* Add maintainers per spackbot's request

* Add type=(build,run) per adamjstewart's suggestion
2023-03-01 22:43:31 -08:00
Adam J. Stewart
ae2c8c02a2 py-torchgeo: kornia backwards-incompatible change (#35570) 2023-03-01 22:13:23 -08:00
Adam J. Stewart
caff9e4292 py-scipy: add v1.10.1 (#35581) 2023-03-01 16:04:23 -08:00
Harmen Stoppels
beb3414b4d py-pygments 2.12; fix py-docutils, again (#35394)
* py-pygments 2.12; fix py-docutils, again

`2.12` is the latest for which our style hack works, beyond that we need
our own package to make a plugin.

Old docutils needs old setuptools

* py-setuptools is always a dep

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

* Update the range

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-01 15:53:41 -08:00
Alex Richert
ed07cee852 Add capitalized symlinks for libesmf.{a,so} (#35774)
* Add capitalized symlinks for libesmf.{a,so}
* Add import of lib suffixes
2023-03-01 15:28:46 -08:00
Rémi Lacroix
7c1a164219 GitHub CLI: Add version 2.23.0 (#35761) 2023-03-01 13:59:28 -08:00
Howard Pritchard
18e0b893f2 papi: more fixes for Intel OneAPI compiler (#34048)
The Intel OneAPI's extreme pickiness continues to bring out
buggy/noncompliant code.

This patch fixes an error in the configure.in embedded 'c' test code
and also in a file with an initialized, but unused, variable.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2023-03-01 13:33:55 -08:00
Garth N. Wells
df5b25764b Update FEniCSx libraries to v0.6 (#35600)
* Updates to release 0.6.

* Dep updates

* Dep version fix

* Another version fix

* Fix typo

* UFL version fix

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

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

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

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

* Some updates following review

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

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

* More updates

* More updates

* build/run updates

* Small fix

* Fix version number.

* specify lower bounds for python dependencies

* address style issues

* address style issues

* address PR comments

* amend setuptools dependency to be of type build only

* amend setuptools dependency to be of type run and build for ffcx and ufl

* add build dependency to ensure import tests pass

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Matthew Archer <ma595@cam.ac.uk>
2023-03-01 13:18:23 -08:00
Tiziano Müller
44705b0a6e cp2k: fix builds on macOS, workaround reported issue with __contains__ (#35584)
Co-authored-by: Robert Cohn <rscohn2@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-03-01 12:01:00 -08:00
Erik Heeren
3bb03ea7d1 py-dbf: new versions and dependency (#35760) 2023-03-01 10:49:27 -08:00
luker
3c411bf135 Fix superlu-dist package for cray fortran (#35728)
The superlu-dist code developers modified the code such that the patch
is no longer needer for `@7.2.0:`  (the patch will actually fail)
2023-03-01 10:49:06 -08:00
Erik Heeren
f2363c1cb5 Py dask mpi (#35679)
* py-dask-mpi: new package with dependencies

* py-hatch-jupyter-builder is not needed after all

* skip_modules seems cleaner

* Update var/spack/repos/builtin/packages/py-jupyter-server-proxy/package.py

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

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-01 11:35:55 -06:00
Adam J. Stewart
7188eeb604 py-fiona: add upper bounds to Python versions (#35658)
* py-fiona: add upper bounds to Python versions

* Add error msg
2023-03-01 09:53:20 -06:00
Adam J. Stewart
583d89e95a Simplify spack help --spec output (#35626) 2023-03-01 16:26:59 +01:00
Mosè Giordano
4a24401ed0 wrf: Fix compilation with GCC 10+ (#35177)
Flags `-fallow-argument-mismatch -fallow-invalid-boz` set in `FFLAGS`/`FCFLAGS`
environment variables don't really have effect in older versions of WRF, we need
to force them in the compiler wrappers.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-03-01 07:14:42 -08:00
Wouter Deconinck
2796794b19 py-particle: new versions 0.16.*, 0.20.*, 0.21.* (#35547)
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-03-01 14:49:37 +01:00
Wouter Deconinck
dd854e86d9 sartre: new package (#32713) 2023-03-01 14:36:16 +01:00
Valentin Volkl
1500246ab7 vc: improvements for testing (#28887) 2023-03-01 14:29:43 +01:00
MatthewLieber
206cd94c0b mvapich2-gdr/mvapich2x: add v2.3.7, update package config (#33066)
Co-authored-by: Nick Contini <contini.26@osu.edu>
2023-03-01 14:24:34 +01:00
Houjun Tang
ff1a425c8d hdf5-vol-async: add v1.5 (#35636) 2023-03-01 14:16:56 +01:00
Wouter Deconinck
ab999d5af9 dd4hep: depends_on root +webgui when +ddeve ^root @6.28: (#35624) 2023-03-01 14:13:50 +01:00
H. Joe Lee
513ff34e66 dpdk: add a new build system and version (#35647) 2023-03-01 14:08:41 +01:00
H. Joe Lee
b59c8e9a43 isa-l_crypto: add a new package (#35651) 2023-03-01 14:06:37 +01:00
H. Joe Lee
9483e34d15 isa-l: add a new package (#35650) 2023-03-01 14:06:22 +01:00
Alex Richert
7e02139cad upp: add v10.0.8 (#35667) 2023-03-01 14:00:27 +01:00
Alex Richert
a08d86c201 grib-util: fix dependency constraints (#35668) 2023-03-01 13:59:45 +01:00
Hans Fangohr
4e70532cd1 OOMMF: set preferred version (#35675)
With the last merge request for OOMMF [1], the intention was to have version
20b0_20220930 as the preferred version, and provide 20b0_20220930-vanilla as an
additional version for the unlikely case anybody needed that.

I made the (wrong) assumption that the `version` listed first in the `package.py` file
would be the preferred version. This merge request is to correct that by
explicitly tagging the preferred version with `preferred=True`.

[1] https://github.com/spack/spack/pull/33072/files
2023-03-01 13:53:59 +01:00
Glenn Johnson
2d2a1c82d4 docbook: resolve conflict in spack env view (#35682)
If the docbook packages
- docbook-xml
- docbook-xsl

are installed in a spack environment view the catalog files will be in
conflict in the view directory. This PR resolves that by adding an
appropriate prefix to each catalog name so that they are unique in the
view. The resulting XML_CATALOG_FILES environment variable will then be
able to point to both of them.
2023-03-01 04:17:46 -08:00
Wouter Deconinck
a47ebe5784 dd4hep: new versions 1.25, 1.25.1 (#35665) 2023-03-01 12:56:03 +01:00
acastanedam
4f97bb118f elk: add v8.3.22 and fix a few issues (#35678) 2023-03-01 12:55:02 +01:00
Harmen Stoppels
d71eca74a3 mbedtls: new versions and deprecations [CVE-2022-46392] (#35715)
* Add new versions and deprecations [CVE-2022-46392]
* remove maintainer, order versions by major no
2023-03-01 03:14:00 -08:00
Tamara Dahlgren
f88dec43df cbench: renamed test_blas_linkage to check_blas_linkage (#35690) 2023-03-01 12:03:23 +01:00
Wouter Deconinck
2e8306d324 py-uproot: new versions 4.3.*, 5.0.* (#35548) 2023-03-01 11:53:38 +01:00
Adam J. Stewart
d64d77e99e py-torchmetrics: add v0.11.2-3 (#35755) 2023-03-01 02:48:35 -08:00
Cyrus Harrison
d7b11af731 ascent: add v0.9.0 (#35211) 2023-03-01 11:48:15 +01:00
Annop Wongwathanarat
68372a4dfe hpcg: add arm compiler (#35710) 2023-03-01 11:46:12 +01:00
Bill Williams
54500a5fca scorep: more precise dependencies for v7/v8 (#35712) 2023-03-01 11:45:07 +01:00
Adam J. Stewart
146464e063 Docs: fix link to PythonPackage docs (#35725) 2023-03-01 11:14:05 +01:00
Massimiliano Culpo
07e251c887 Remove handling of deprecated target names (graviton) (#35537)
* Update target names for Gitlab pipelines

* Remove handling of deprecated names for graviton
2023-03-01 11:03:12 +01:00
Mosè Giordano
f9f51cb930 Add new versions of Julia dependencies (#35622) 2023-03-01 01:52:28 -08:00
nicolas le goff
ad3c22fae9 gts: add missing pkgconfig dependency (#35657) 2023-03-01 10:49:09 +01:00
AMD Toolchain Support
bedcc5449a quantum-espresso: fix building with aocc (#35612)
Co-authored-by: Tooley, Phil <phil.tooley@amd.com>
2023-03-01 10:47:42 +01:00
Henning Glawe
a1a54fa8b7 nfft: add v3.2.4 (#35757) 2023-03-01 01:42:23 -08:00
Edward Hartnett
2a97bcbd5a bacio: add v2.6.0, including handling of shared library builds (#35490) 2023-03-01 10:29:12 +01:00
Mark W. Krentel
99fb4c4a47 hpctoolkit: add version 2023.03.01, add python variant (#35662)
1. add version 2023.03.01
 2. add variant 'python' that supports unwinding python source
 3. clean up some things with the cray variant
 4. require the latest libmonitor
 5. fix sha256 checksum for url patch
 6. delete rocm 5.3 from older versions
2023-03-01 09:44:32 +01:00
Brian Vanderwende
5b52685216 NCO: add v5.1.4 and v5.1.0 (#35753) 2023-03-01 09:27:25 +01:00
Alex Richert
53a924c20f Fix bufr package typo (libufr->libbufr) (#35740) 2023-02-28 15:56:30 -08:00
Annop Wongwathanarat
09ad541e98 armcomputelibrary: add version 23.02 (#35723) 2023-02-28 23:51:05 +01:00
M. Eric Irrgang
b109e16fba Back-port a patch for filesystem logic in gmx executable. (#35672)
* Backport a patch for relocatable `gmx` executable.

* spack style fixes
2023-02-28 14:18:00 -07:00
Mark W. Krentel
043a80ff9e hpcviewer: add version 2023.02 (#35648) 2023-02-28 11:13:30 -08:00
Matthieu Dorier
b7f7af1713 c-raft: add new package (#35735)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-02-28 11:16:02 -07:00
Rémi Lacroix
e5bd319c19 git-lfs: Add version 3.3.0 (#35671) 2023-02-27 23:58:56 -05:00
Tim Haines
90ad65a6e7 Dyninst: add version 12.3.0 (#35630) 2023-02-27 16:13:47 -08:00
Luke Diorio-Toth
779e80b7c1 Package/py pysam macos (#33851)
* cleaned up style, linked to external htslib

* removed htslib/bcfrools/samtools deps, use bundled libs instead

the pysam package includes the necessary libs to link to, so it wasn't even using linked libs when building

* fixed style

* revert to using external htslib

currently uses bundled samtools and bcftools, and there is no way to use external versions for those dependencies

* added libs property to htslibs package

added support for lib64

* added htslib name
2023-02-27 16:25:21 -06:00
Annop Wongwathanarat
502e216ee2 onednn: add variant to use Arm Compute Library on aarch64 (#35643)
* onednn: add variant to use Arm Compute Library on aarch64

* Update cmake version

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

* Shorten macro definition

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

* Update cpu/gpu_runtime variants

* Update acl variant when 1.7+

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

* [@spackbot] updating style on behalf of annop-w

* Add dependencies for new runtimes

* Fix dependency package name to oneapi-level-zero

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-27 13:58:03 -06:00
Wouter Deconinck
d6ff426d48 py-awkward: new version 1.10.*, 2.0.* (#35549)
* py-awkward: new version 1.10.*, 2.0.*

Lots of changes in 2.0.*, see https://github.com/scikit-hep/awkward/releases. This will need some extra testing.

* py-awkward: hatchling

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

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

* py-scikit-build-core: new and improved py-scikit-build

* py-awkward-cpp: new package

* py-awkward: add depends_on py-awkward-cpp

* py-awkward: depends_on py-packaging

* py-awkward-cpp: new versions pinned by py-awkward

* py-scikit-build-core: additional depends_on

* py-awkward: branch master deprecated

* py-pytest-subprocess: new package

* py-pytest: new version 7.2.1

* py-scikit-build-core: add tests dependencies

* [@spackbot] updating style on behalf of wdconinc

* py-scikit-build-core: two more test dependencies

* py-pytest: depends_on py-exceptiongroup

* py-awkward: add pytest support

* py-pytest: suggestions from review

* py-scikit-build-core: suggestions from review

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

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

* py-awkward: depends_on pyyaml when @:1, order old deps last

* [@spackbot] updating style on behalf of wdconinc

* py-awkward: move some opt deps to test, order test deps

* py-awkward: remove test dependencies

---------

Co-authored-by: wdconinc <wdconinc@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-27 13:51:13 -06:00
Michael Kuhn
c4311a250a pango: add 1.50.13 (#35709) 2023-02-27 09:38:17 -08:00
dlkuehn
ceaa304f5f osi: add version 0.108.7 (#35689)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-02-27 09:10:01 -07:00
dlkuehn
038efa4173 clp: add version 1.17.7 (#35688)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-02-27 07:23:00 -08:00
Harmen Stoppels
773fd5ad84 hpctoolkit: fix broken patches (#35711)
The patches don't have a stable checksum.
2023-02-27 10:50:48 +01:00
Seth R. Johnson
9b46e92e13 Celeritas: new versions 0.2.1 and 0.1.5 (#35704)
* celeritas: new versions 0.1.5 and 0.2.1

* celeritas: deprecate old versions
2023-02-27 09:36:28 +00:00
Howard Pritchard
f004311611 OpenMPI: add the 4.1.5 release (#35677)
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2023-02-27 00:57:36 -08:00
Glenn Johnson
a4b949492b r-twosamplemr: add new package and dependencies (#35683) 2023-02-27 07:38:27 +01:00
Larry Knox
6ab792fb03 hdf5-vol-cache: add v1.1 (#35685) 2023-02-27 07:35:30 +01:00
Alex Richert
313c7386c4 go: set GOMAXPROCS to limit number of build processes (#35703) 2023-02-27 07:26:50 +01:00
Adam J. Stewart
b0b4a05d44 py-nbqa: add new package (#35707) 2023-02-27 07:22:48 +01:00
Alberto Invernizzi
4e13b5374f fix dump problem (#35673)
if dump file existed it was not truncating the file, resulting in
a file with unaltered filesize, with the new content at the beginning,
"padded" with the tail of the old content, since the new content was
not enough to overwrite it.
2023-02-24 21:32:33 -08:00
Vinícius
07897900eb ompss-2 dependencies (#35642) 2023-02-24 21:22:17 -08:00
Axel Huebl
d286146c64 WarpX 23.02 (#35633)
Update `warpx` & `py-warpx` to the latest release.
2023-02-23 17:09:28 -08:00
Todd Gamblin
6b27aebeb4 colify.py: get rid of **kwargs (#35641)
`colify` is an old module in Spack that still uses `**kwargs` liberally. 

We should be more explicit. Doing this eliminates the need for many 
checks (can't pass the wrong arg if it isn't allowed) and makes the 
function documentation more clear.
2023-02-23 11:18:54 -08:00
Mosè Giordano
5c7cccd052 p7zip: Add new versions from fork (#35627) 2023-02-23 13:10:28 +01:00
Rémi Lacroix
26c314f04f htop: Add version 3.2.2 (#35621) 2023-02-23 03:22:18 -08:00
Rémi Lacroix
9982d76bb1 ncdu: Add version 1.18.1 (#35620) 2023-02-23 03:21:56 -08:00
Harmen Stoppels
3d41b71664 buildcache push: ensure bool arguments for include_* (#35632)
Fixes a bug introduced in 44ed0de8c0
where the push method of binary_distribution now takes named args
include_root and include_depedencies, to avoid the **kwarg hole.

But the call site wasn't update and we passed a dict of keys/values instead
of arguments, which resulted in a call like this:

```
push(include_root={"include_root": True, "include_dependencies": False})
```

This commit fixes that, and adds a test to see if we push the correct packages.
2023-02-23 01:44:47 +01:00
Wouter Deconinck
e27d3c4f75 collier: new versions 1.2.6, 1.2.7 (#35580)
Additional functionality, per https://collier.hepforge.org/releasehist.html. No mention of build changes.
2023-02-22 13:18:11 -08:00
Adam J. Stewart
5545fd34c0 py-mpi4jax: add new package (#35551)
* py-mpi4jax: add new package
* [@spackbot] updating style on behalf of adamjstewart

---------

Co-authored-by: adamjstewart <adamjstewart@users.noreply.github.com>
2023-02-22 13:12:35 -08:00
luker
6ebf9f65c0 Add CCE support to hipfort (#35609)
* Add CCE support to hipfort
* Update package.py
2023-02-22 10:59:54 -08:00
Harmen Stoppels
3be9af8c13 copy_files_to_artifacts: error -> warning (#35613)
This error shows up a lot, typically it's harmless because an error
happened before the source build even started, in which case we don't
have build logs to copy. So, warn instead of error, cause it distracts
from the actual CI error.
2023-02-22 11:53:42 +00:00
Harmen Stoppels
6e477d547d add cdash arg to source build only (#35565) 2023-02-22 11:08:32 +01:00
Harmen Stoppels
9d6630e245 spack build-env: error when deps are not installed (#35533)
Currently we attempt to setup the build environment even when
dependencies are not installed, which typically results in error while
searching for libraries or executables in a dependency's prefix.

With this change, we get a more user friendly error:

```
$ spack build-env perl
==> Error: Not all dependencies of perl are installed, cannot setup build environment:
 -   qpj6dw5  perl@5.36.0%apple-clang@14.0.0+cpanm+open+shared+threads build_system=generic arch=darwin-ventura-m1
 -   jq2plbe      ^berkeley-db@18.1.40%apple-clang@14.0.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-ventura-m1
...
$ echo $?
1
```
2023-02-22 10:35:44 +01:00
psakievich
b8d15e816b Allow users to specify root env dir (#32836)
* Allow users to specify root env dir

Environments managed by spack have some advantages over anonymous Environments
but they are tucked away inside spack's directory tree. This PR gives
users the ability to specify where the environments should live.

See #32823

This is also taken as an opportunity to ensure that all references are to "managed environments",
rather than "named environments". Prior to this PR some references to the latter persisted.

Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
2023-02-22 00:37:14 +00:00
Cameron Rutherford
0a233ce83a ExaGO 1.5.1 release (#35595)
* Update exago w/ 1.5.1 and small updates to hiop.
* Fix styling.
* Add RAJA back to ExaGO package.
* Update RAJA requirement for ExaGO and HiOp.
* Update last RAJA requirement in HiOp.
2023-02-21 14:56:59 -08:00
G-Ragghianti
27ee08f5bb Package slate: Improved MPI launcher search for smoke tests (#35448)
* Improved MPI launcher search for smoke tests
* Improving mpi launcher search
* Removing redundant logic
2023-02-21 13:10:01 -08:00
Massimiliano Culpo
cb4c60c709 Revert "Disable module generation by default (#35564)" (#35603)
This reverts commit 5b8917188a.
2023-02-21 21:53:07 +01:00
Wouter Deconinck
8e84dcd7ef root: new version 6.28.00 (#35556)
* root: new version 6.28.00
  Full changelog: https://github.com/root-project/root/compare/v6-26-10...v6-28-00
  Based on the CMakeLists.txt file, no major build system changes. Upgraded requirements for cmake added.
* root: variant jemalloc deprecated
* root: rm define gsl_shared because unused
  "`gsl_shared` is unused" per https://github.com/root-project/root/pull/12203 (and has always been unused)
* [@spackbot] updating style on behalf of wdconinc

---------

Co-authored-by: wdconinc <wdconinc@users.noreply.github.com>
2023-02-21 12:20:46 -08:00
MicK7
447ad2a3e3 Add new sphinx rtd theme release 1.2.0 (#35579)
* Add new sphinx rtd theme release 1.2.0

The new release helps with supporting more recent version of docutils

* set docutils officially supported version

* add jquery dependency for sphinx-rtd-theme

* add conflict with jquery version

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

* correct dependency

* fix version dependency

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

* set sphinx version

* fix sha256

* add version for flit-core

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-21 11:53:21 -08:00
Adam J. Stewart
6f65ff4952 py-nbmake: add new versions (#35591) 2023-02-21 11:46:43 -08:00
Adam J. Stewart
16adda3db9 py-jax: add v0.4.3 (#35460)
* py-jax: add v0.4.3

* Minimum version is minimum

* py-jax no longer has cuda variant

* Enable CUDA by default

* Link to discussion of upper bound
2023-02-21 13:14:27 -06:00
Oliver Perks
cddef35ef8 cmake: changed the regex to search for externals (#31688) 2023-02-21 17:29:14 +01:00
Rocco Meli
1636c89aba Add pyedr and panedr (#35576)
* add pyedr

* black

* add panedr

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

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

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

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

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

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-21 09:55:19 -06:00
Alec Scott
9110f5dfb6 ant: add v1.10.13 and deprecate previous versions due to CVE (#35572) 2023-02-21 15:18:07 +01:00
Harmen Stoppels
bc24a8f290 Spec.satisfies should be commutative when strict=False (#35598)
The call:
```
x.satisfies(y[, strict=False])
```
is commutative, and tests non-empty intersection, whereas:
```
x.satsifies(y, strict=True)
```
is not commutative, and tests set-inclusion.

There are 2 fast paths. When strict=False both self and other need to 
be concrete, when strict=True we can optimize when other is concrete.
2023-02-21 14:30:47 +01:00
simon-Leary42
33bf1fd033 nonexistent module concise error message (#35502) 2023-02-21 04:50:56 -08:00
Harmen Stoppels
5b8917188a Disable module generation by default (#35564)
a) It's used by site administrators, so it's niche
b) If it's used by site administrators, they likely need to modify the config anyhow, so the default config only serves as an example to get started
c) it's too arbitrary to enable tcl, but disable lmod
2023-02-21 10:00:37 +01:00
luker
fbd5c5c2cd superlu-dist: extend when to apply a patch (#32985) 2023-02-21 07:41:59 +01:00
Massimiliano Culpo
55e3026152 ccls: add v0.20220729 (#35593) 2023-02-21 07:13:58 +01:00
Massimiliano Culpo
874f76e45e mvapich2: update checksum (#35587)
See #29340

Co-authored-by: Nat Shineman <shineman.5@buckeyemail.osu.edu>
2023-02-21 06:55:11 +01:00
Thomas Madlener
ebc24b7063 dd4hep: extend conflict on CMake (#27125) 2023-02-20 21:33:11 -08:00
Adam J. Stewart
ce9f8143cc Fix view support for optional Python extensions (#35489)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-02-20 11:58:28 -08:00
Harmen Stoppels
c1ff7bbf04 environment views: better, earlier error on clash (#35541)
Spack generally ignores file-file projection clashes in environment
views, but would eventually error when linking the `.spack` directory
for two specs of the same package.

This leads to obscure errors where users have no clue what the issue is
and how to fix it. On top of that, the error comes very late, since it
happens when the .spack dir contents are linked (which happens after
everything else)

This PR improves that by doing a quick check ahead of time if clashes
are going to be anticipated (by simply checking for clashes in the
projection of each spec's .spack metadir). If there are clashes, a
human-readable error is thrown which shows two of the conflicting specs,
and tells users to user unify:true, view:false, or set up custom
projections.
2023-02-20 19:14:27 +01:00
Rocco Meli
aa708c8981 Add pytng (#35575)
* add pytng

* black

* add setuptools

* fix

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

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

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

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-20 11:15:19 -06:00
simonleary-umass-edu
712d358f7e apptainer use the --with-suid configure option (#35513) 2023-02-20 17:39:28 +01:00
Ben Wibking
e8238fe330 Patchel shutil.copystat to avoid PermissionError on Lustre (#27247) 2023-02-20 17:28:03 +01:00
Alec Scott
e8a19aa089 Add Alluxio v2.9.1 and deprecate previous versions due to CVE (#35574) 2023-02-20 07:54:45 -08:00
Alec Scott
4a844a971a httpd: add v2.4.55 and deprecate previous versions due to CVE-2022-31813 (#35571) 2023-02-20 07:35:16 -08:00
Harmen Stoppels
5e337d907b spack ci: remove 120s db timeout since 60s is the default now (#35566) 2023-02-20 14:41:26 +01:00
Harmen Stoppels
208c9585b8 Revert "lib/spack/spack/store.py: Fix #28170 for padding relocation (#33122)" (#35077)
This reverts commit c721aab006.
2023-02-20 13:56:11 +01:00
Alec Scott
1ae4ca611e Add restic v0.15.1 (#35563) 2023-02-20 12:53:10 +01:00
Alec Scott
54eddb2301 Add py-python-lsp-server v1.7.1 (#35561) 2023-02-20 12:52:55 +01:00
Alec Scott
01dafb8047 Add activemq v5.17.3 and deprecate previous version due to CVE (#35573) 2023-02-20 12:49:54 +01:00
Greg Becker
6ef2c33b0e scale mpi dependency is incorrect (#35385) 2023-02-20 02:49:38 -08:00
Paul Kuberry
beddf4dcc4 xyce: add patch for pymi parameter merge and add maintainer (#35421)
* xyce: add maintainer

* xyce: add patch for pymi parameter merge
2023-02-20 11:37:17 +01:00
Alec Scott
e143065448 Add go v1.20.1, 1.19.6 and un-deprecate previous versions without CVEs (#35560) 2023-02-20 11:33:07 +01:00
Patrick Bridges
9d9ea07424 Fix kokkos package.py to filter spack wrappers in launch compiler and cmake configs (#35494)
Kokkos when compiled by spack without +wrapper could potentially capture the spack compiler wrappers, resulting in cmake configs and kokkos_launch_compiler trying to run the spack compiler wrapper after installation.
2023-02-20 01:23:37 -08:00
elenimath
c769582709 Pass tests argument to solver method when concretizing together (#35290)
to make the workaround for #29447 work with `concretizer:unify:true` option
2023-02-20 10:21:24 +01:00
Sebastian Ehlert
1958c2f986 Update xtb 6.6.0 (#35436) 2023-02-20 10:17:32 +01:00
Rocco Meli
3016da79fe Add GNINA and related packages (#35439) 2023-02-20 10:14:00 +01:00
Adam J. Stewart
0500a3cec0 py-torchbenchmark: add new package (#35443) 2023-02-20 10:12:20 +01:00
Emil Briggs
313797e3d4 Update for v5.0.4 release. (#35511) 2023-02-20 09:52:38 +01:00
Wouter Deconinck
ae189cfab8 geant4: new version 11.1.1 (#35528)
Bugfix release only. No changes in build system.
2023-02-20 09:47:13 +01:00
Wouter Deconinck
7c09ab174b acts: new versions 23.1.0, 23.2.0, 23.2.1 (#35540)
* acts: new versions 23.1.0, 23.2.0, 23.2.1

- https://github.com/acts-project/acts/compare/v23.0.0...v23.1.0: no changes needed to package.py
- https://github.com/acts-project/acts/compare/v23.1.0...v23.2.0: no changes needed to package.py
- https://github.com/acts-project/acts/compare/v23.2.0...v23.2.1: no changes needed to package.py

* actsvg: new versions 0.4.27, 0.4.28 (and updated list_url)

* acts: depends_on actsvg@0.4.28: when acts@23.2: +svg

* autodiff: new version 0.6.5-0.6.12 (and list_url fix)

* vecmem: new versions 0.13.0-0.22.0 (and list_url fix)
2023-02-20 09:42:58 +01:00
Wouter Deconinck
c14b6b80cc clhep: new versions 2.4.6.2, 2.4.6.3, 2.4.6.4 (#35542)
Mostly minor changes in random and support for c++20. No build system changes needed.

Ref: https://gitlab.cern.ch/CLHEP/CLHEP/-/compare/CLHEP_2_4_6_2...CLHEP_2_4_6_4
2023-02-20 09:41:43 +01:00
Wouter Deconinck
899d2708a3 lhapdf: new versions 6.5.2, 6.5.3 (#35543)
https://gitlab.com/hepcedar/lhapdf/-/compare/lhapdf-6.5.3...lhapdf-6.5.1: bugfixes only
2023-02-20 09:41:26 +01:00
Wouter Deconinck
5ccc2e1a8e whizard: new version 3.1.0 (#35550)
https://gitlab.tp.nt.uni-siegen.de/whizard/public/-/compare/v3.0.3...v3.1.0, no changes to package.py needed.
2023-02-20 09:40:23 +01:00
Adam J. Stewart
7c01d3ba35 Fix broken links in docs (#35582) 2023-02-20 09:21:18 +01:00
Thomas Bouvier
81f11d5562 py-pyarrow: fix build environment (#35567)
* `py-pyarrow`: fix build environment

* Use `satisfies()` for specs
2023-02-19 12:48:14 -08:00
Adam J. Stewart
747f032ec2 pandoc: disable texlive variant by default (#35569) 2023-02-19 13:22:51 +01:00
Alec Scott
97ea182ee0 hugo: add v0.110.0, v0.108.0, v0.107.0 (#35562) 2023-02-19 00:19:11 +01:00
Harmen Stoppels
011c28a538 openblas: fix prereqs / make race (#35395)
Fix a race in the makefile where the shared lib was built before the
object files were available.

See https://github.com/xianyi/OpenBLAS/issues/3899
2023-02-18 12:27:34 -08:00
Harmen Stoppels
86320eb569 Improve error handling in buildcache downloads (#35568)
The checksum exception was not detailed enough and not reraised when using cache only, resulting in useless error messages.

Now it dumps the file path, expected
hash, computed hash, and the downloaded file summary.
2023-02-18 19:22:48 +01:00
Adam J. Stewart
c42a4ec1ec Ignore black reformat in git blame (#35544) 2023-02-18 01:03:50 -08:00
Harmen Stoppels
fb644de086 clang/apple-clang correct c/c++ standard flags (#35062) 2023-02-17 23:18:01 +01:00
Sinan
352d56d6b0 package_qgis_add_v328 (#35500)
* package_qgis_add_v328

* restore long term release

---------

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2023-02-17 14:58:47 -06:00
G-Ragghianti
b711d5a6a4 Moving official repo and download locations for slate, blaspp, and lapackpp (#35521) 2023-02-17 09:58:48 -08:00
Adam J. Stewart
983c68cc30 py-pyinstrument: add v4.4.0 (#35525) 2023-02-17 04:35:34 -08:00
Wouter Deconinck
7d8d538a71 gaudi: add v36.10 (#35527)
Bugfixes only, https://gitlab.cern.ch/gaudi/Gaudi/-/compare/v36r9...v36r10
2023-02-17 04:27:24 -08:00
Jim Edwards
fa3ced5242 add PIC flag in mpi-serial build (#35524) 2023-02-17 04:27:11 -08:00
Annop Wongwathanarat
73fcda19d2 armcomputelibrary: new package (#35515) 2023-02-17 04:14:23 -08:00
Sebastian Ehlert
65ee062bf6 Fix build for scine-xtb (#35386) 2023-02-17 04:14:08 -08:00
John W. Parent
573f7bf4cd Windows: enforce carriage return for .bat files (#35514)
Batch scripts in general will not function without carriage return line
endings on Windows. We rely on these scripts to support cmd, so we
should not allow these scripts to be converted to lf.

Note: Windows 11 supports lf line endings due to the use of Windows
Terminal. Once support for Windows 10 is dropped, this change can be
reverted.
2023-02-17 04:01:25 -08:00
H. Joe Lee
9f3f4b38e8 fio: add a new version (#35522)
The latest is 3.33.
2023-02-17 04:01:18 -08:00
Harmen Stoppels
476a29e1b6 Increase db timeout 3s -> 60s (#35517)
When running many concurrent spack install processes that need to write
to the db, Spack regularly times out. This is because writing to the DB
after another process has written to it requires deserialization of the
db, mutating it in memory, and serializing it again, which takes some
time. On top of that, I believe there's a 1 second retry when a write
lock cannot be obtained, so I think this means only 3 processes can
really write to the DB at the same time before timing out.
2023-02-17 08:42:41 +01:00
Adam J. Stewart
603569e321 Style: black 23, skip magic trailing comma (#35351)
* Style: black 23, skip magic trailing commas

* isort should use same line length as black

* Fix unused import

* Update version of black used in CI

* Update new packages

* Update new packages
2023-02-16 23:06:12 -06:00
Teo
b935809948 Halide: new variants and bug fixes (#35495)
* Update package.py

Initial new stuff

* Update package.py

* Update package.py

* Update package.py

* fix targets

* non-llvm backends

* ooops

* fix style

* Somehow that was not caught?

Somehow that was not caught?

* style

* Last fix

make capitalization consistent with Halide not LLVM...
2023-02-16 22:58:54 -06:00
Erik Heeren
b278a02406 py-pynrrd: new package (#35505) 2023-02-16 22:52:52 -06:00
Erik Heeren
9ff64b1627 py-cmake-format: new version, new variants (#35485)
* py-cmake-format: new version, new variants

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-16 22:51:40 -06:00
genric
5fc5ef8c58 py-luigi: add v3.2.0 (#35507) 2023-02-16 22:51:04 -06:00
Christopher Christofi
946816d787 py-cufflinks: new package version with 0.17.3 (#35427)
* py-cufflinks: new package version with 0.17.3

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

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

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-16 22:43:35 -06:00
Adam J. Stewart
03fb5c6aa9 py-fiona: python is a link dep (#35516) 2023-02-16 17:56:12 -08:00
AMD Toolchain Support
68f82357c8 added support zen4 support for gromacs (#35503)
Co-authored-by: Umashankar Sivakumar <Umashankar.Sivakumar@amd.com>
2023-02-16 16:38:58 -08:00
Andrew-Dunning-NNL
f073a9d589 dakota: run acceptance tests (#29654)
* dakota: run acceptance tests
* dakota: updated style guide
2023-02-16 16:28:21 -08:00
Massimiliano Culpo
d17cc42a48 fuse-overlayfs: add v1.10 (#35512) 2023-02-16 16:23:06 -08:00
Andrew-Dunning-NNL
0468205751 rdma-core: add static variant (#35308)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-02-16 16:01:19 -08:00
Harmen Stoppels
68b711c1ad view: fix issue with non-contributing specs (#34661)
Specs that did not contribute any files to an env view caused a problem
where zip(specs, files grouped by prefix) got "out of sync", causing the
wrong merge map to be passed to a package's `add_files_to_view`, which
specifically caused an issue where *sometimes* bin/python ended up as a
symlink instead of a copy.

One such example is kokkos + kokkos-nvcc-wrapper, as the latter package
only provides the file bin/nvcc_wrapper, which is also added to view by
kokkos, causing kokkos-nvcc-wrapper to contribute 0 files.

The test feels a bit contrived, but it captures the problem... pkg a is
added first and has 0 files to contribute, pkg b adds a single file, and
we check if pkg b receives a merge map (and a does not).
2023-02-16 10:36:22 -08:00
Alex Richert
69369429b6 esmf: use setup_build_environment instead of edit (#35249) 2023-02-16 19:01:34 +01:00
Erik Schnetter
f360ce7035 openssl: New version 1.1.1t (#35419)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-02-16 09:48:28 -08:00
Harmen Stoppels
96ac4c7f98 simplify cdash filename (#35509) 2023-02-16 18:25:39 +01:00
Massimiliano Culpo
df72ba0d46 pfunit: add v4.6.3, clean up recipe (#35510)
* pfunit: add v4.6.3

* pfunit: use CMakePackage methods to define arguments

* pfunit: deprecate v3.X, make a variant conditional

* pfunit: simplify setting up environment variables

Reading the docs it seems only v3
needs F90_VENDOR to be set

* pfunit: fix option names

The names set before were unused

* pfunit: shared libraries seem not to be supported

See https://github.com/Goddard-Fortran-Ecosystem/pFUnit/issues/308#issuecomment-874725759
2023-02-16 18:10:16 +01:00
Mosè Giordano
b2e6da36ef openblas: Use more stable URL as source (#35428) 2023-02-16 18:02:59 +01:00
Carlos Bederián
832c435588 gromacs: add 2021.7, 2022.5, 2023, and some requirements (#35413) 2023-02-16 17:55:16 +01:00
Mosè Giordano
5079086019 cp2k: explicitly use C99 standard (#34957) 2023-02-16 17:45:06 +01:00
Erik Heeren
bfe06f694c Add py-mlflow and its dependencies (#34463)
* Add py-mlflow and its dependencies
* mlflow: fix syntax error in package.py
* py-mlflow: cleanup
  Process review remarks, add missing dependencies, add skinny variant
* Apply suggestions from code review
* Fix flake8 issues
* More formatting fixes
* Fix py-waitress dependency version
* py-mlflow: platform-specific dependency
* Update var/spack/repos/builtin/packages/py-mlflow/package.py
* Update var/spack/repos/builtin/packages/py-mlflow/package.py
* Process review remarks
* Fix typo in dependency version
* py-shap: fix dependencies
* py-arrow: fix dependencies
* py-slicer: remove py-setuptools explicit version
* py-pyarrow: dataset variant and pass options through environment
  It appears there are some issues when using `pip install` instead of
  `python setup.py` - this setup_build_environment should fix that.
* py-pyarrow: review remark
* Decouple setup_build_environment from install_options
* py-pyarrow: style
* Bump licenses to 2023

---------

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Matthias Wolf <matthias.wolf@epfl.ch>
2023-02-16 08:40:56 -08:00
Joel Falcou
ae022e98d8 EVE 2023.02.15 update (#35493) 2023-02-16 08:26:17 -08:00
Phil Carns
3e1ba67e00 bump mochi-margo to 0.13 (#35499) 2023-02-16 08:21:45 -08:00
Thomas Bouvier
6eea171077 thrift: add v0.17.0 (#35210) 2023-02-16 16:57:25 +01:00
Richard Berger
1734127b7a lammps: refactor variants, add new versions (#34011) 2023-02-16 16:43:36 +01:00
Harmen Stoppels
44ed0de8c0 spack buildcache create: push all deps / cleanup (#34860) 2023-02-16 14:08:49 +00:00
Harmen Stoppels
09eb86e077 spack uninstall: follow run/link edges on --dependents (#34058)
`spack gc` removes build deps of explicitly installed specs, but somehow
if you take one of the specs that `spack gc` would remove, and feed it
to `spack uninstall /<hash>` by hash, it complains about all the
dependents that still rely on it.

This resolves the inconsistency by only following run/link type deps in
spack uninstall.

That way you can finally do `spack uninstall cmake` without having to
remove all packages built with cmake.
2023-02-16 14:26:30 +01:00
Massimiliano Culpo
50691ccdd9 Avoid verifying variants in default package requirements (#35037)
Default package requirements might contain
variants that are not defined in each package,
so we shouldn't verify them when emitting facts
for the ASP solver.

Account for group when enforcing requirements

packages:all : don't emit facts for requirement conditions
that can't apply to current spec
2023-02-16 11:57:26 +01:00
Harmen Stoppels
ce693ff304 buildcache create: avoid prefix copy (#35173) 2023-02-16 11:52:10 +01:00
Harmen Stoppels
18027d07d4 CHANGELOG.md: v0.19.1 (#35429) 2023-02-16 11:34:57 +01:00
Sergey Kosukhin
f31e8adc6b netcdf-c: add patch to enable '@4.9.0:~mpi+parallel-netcdf' (#35462) 2023-02-16 11:02:54 +01:00
rfbgo
a6731b732e Add support for star-ccm-plus v17 (#35056) 2023-02-16 10:53:52 +01:00
Rémi Lacroix
a00b92a69f cp2k: add v2023.1 (#35346) 2023-02-16 10:33:48 +01:00
Sreenivasa Murthy Kolam
90261029d8 ROCm packages: add v5.4.3 release (#35478) 2023-02-16 10:14:31 +01:00
Adam J. Stewart
85966a96b1 py-pytorch-lightning: add v1.9.2 2023-02-15 20:09:15 +01:00
John W. Parent
417d8ef547 XZ package: enable building on Windows (#35095)
* Convert XZ to multi build system
* Add MSBuild builder to XZ to support Windows compatibility
2023-02-15 09:17:32 -08:00
Adam J. Stewart
dd434ec413 Use the maintainers directive in all base classes (#35324)
* Use the `maintainers` directive in all base classes
* Update unit tests
2023-02-15 01:33:29 -08:00
Hector Martinez-Seara
1894b64851 Orca: Added required runtime libraries (#35481)
* Update package.py
  Several libraries are need to be present at run time so that the code can be run in parallel. 
  I have added them as dependencies and to LD_LIBRARY_PATH. Orca comes as a binary so the libraries cannot be added as RPATH at compilation time.
  Also, orca 5.0.3 was compiled against 4.1.1, not 4.1.2.
2023-02-14 16:17:37 -08:00
Dom Heinzeller
9551312e9d Add gsl-lite from JCSDA/NOAA-EMC spack fork (#35468)
* Add gsl-lite from JCSDA/NOAA-EMC spack fork
* Black-format var/spack/repos/builtin/packages/gsl-lite/package.py
* Update maintainers and remove redundant dependency in var/spack/repos/builtin/packages/gsl-lite/package.py
2023-02-14 12:05:39 -08:00
Adam J. Stewart
b282b66579 py-matplotlib: add v3.7.0 (#35471) 2023-02-14 11:47:57 -08:00
Mark W. Krentel
226a9b0e7f libmonitor: add version 2023.02.13 (#35474) 2023-02-14 11:17:20 -08:00
nkgh77
7aeee3339c fftw-api should be used for amdfftw and mkl (#35477)
fftw-api should be used instead of fftw because amdfftw and mkl can be linked.
2023-02-14 11:15:38 -08:00
Sergey Kosukhin
38512d18e9 Remove obsolete autotools patches (#35479)
* netcdf-fortran: remove obsolete Autotools patches
* openmpi: remove obsolete Autotools patches
* parallel-netcdf: remove obsolete Autotools patches
2023-02-14 10:54:37 -08:00
Philipp Edelmann
e75a07d155 fix intel-tbb build with rocmcc (#35472)
rocmcc is a clang compiler. Pass that information on to the TBB build
system.
2023-02-14 09:55:20 -05:00
luker
9b3c4e0696 Update cce.py (#35469)
* Update cce.py

adding c++17 flag for cce

* Update cce.py
2023-02-14 07:37:34 +00:00
Rocco Meli
54f783e656 Add fortls (#35455)
* fortls

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

* review

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

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

* fixes

* review

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-02-13 23:27:29 -08:00
eugeneswalker
34441c9eaa ci: gpu test stack: turn off cuda@11.7 builds (#35467) 2023-02-13 21:54:01 -08:00
Adam J. Stewart
932a9dfc57 py-radiant-mlhub: add new versions (#35470) 2023-02-13 16:43:47 -08:00
Adam J. Stewart
3430c55b0a py-rasterio: add v1.3.6 (#35464) 2023-02-13 12:09:28 -08:00
Erik Schnetter
1a69d436e4 shtools: New version 4.10.1 (#35452) 2023-02-13 10:49:22 -08:00
929 changed files with 9630 additions and 8208 deletions

View File

@@ -1,3 +1,5 @@
# .git-blame-ignore-revs
# Formatted entire codebase with black
# Formatted entire codebase with black 23
603569e321013a1a63a637813c94c2834d0a0023
# Formatted entire codebase with black 22
f52f6e99dbf1131886a80112b8c79dfc414afb7c

1
.gitattributes vendored
View File

@@ -1,3 +1,4 @@
*.py diff=python
*.lp linguist-language=Prolog
lib/spack/external/* linguist-vendored
*.bat text eol=crlf

View File

@@ -44,7 +44,7 @@ jobs:
cache: 'pip'
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip six setuptools types-six black==22.12.0 mypy isort clingo flake8
python3 -m pip install --upgrade pip six setuptools types-six black==23.1.0 mypy isort clingo flake8
- name: Setup git configuration
run: |
# Need this for the git tests to succeed.

View File

@@ -1,3 +1,28 @@
# v0.19.1 (2023-02-07)
### Spack Bugfixes
* `buildcache create`: make "file exists" less verbose (#35019)
* `spack mirror create`: don't change paths to urls (#34992)
* Improve error message for requirements (#33988)
* uninstall: fix accidental cubic complexity (#34005)
* scons: fix signature for `install_args` (#34481)
* Fix `combine_phase_logs` text encoding issues (#34657)
* Use a module-like object to propagate changes in the MRO, when setting build env (#34059)
* PackageBase should not define builder legacy attributes (#33942)
* Forward lookup of the "run_tests" attribute (#34531)
* Bugfix for timers (#33917, #33900)
* Fix path handling in prefix inspections (#35318)
* Fix libtool filter for Fujitsu compilers (#34916)
* Bug fix for duplicate rpath errors on macOS when creating build caches (#34375)
* FileCache: delete the new cache file on exception (#34623)
* Propagate exceptions from Spack python console (#34547)
* Tests: Fix a bug/typo in a `config_values.py` fixture (#33886)
* Various CI fixes (#33953, #34560, #34560, #34828)
* Docs: remove monitors and analyzers, typos (#34358, #33926)
* bump release version for tutorial command (#33859)
# v0.19.0 (2022-11-11)
`v0.19.0` is a major feature release.

View File

@@ -72,6 +72,7 @@ config:
root: $TMP_DIR/install
misc_cache: $$user_cache_path/cache
source_cache: $$user_cache_path/source
environments_root: $TMP_DIR/envs
EOF
cat >"$SPACK_USER_CONFIG_PATH/bootstrap.yaml" <<EOF
bootstrap:

View File

@@ -226,7 +226,7 @@ for %%Z in ("%_pa_new_path%") do if EXIST %%~sZ\NUL (
exit /b 0
:: set module system roots
:_sp_multi_pathadd
:_sp_multi_pathadd
for %%I in (%~2) do (
for %%Z in (%_sp_compatible_sys_types%) do (
:pathadd "%~1" "%%I\%%Z"

View File

@@ -20,9 +20,10 @@ concretizer:
# needed to reach a solution increases noticeably with the number of targets
# considered.
targets:
# Determine whether we want to target specific or generic microarchitectures.
# An example of the first kind might be for instance "skylake" or "bulldozer",
# while generic microarchitectures are for instance "aarch64" or "x86_64_v4".
# Determine whether we want to target specific or generic
# microarchitectures. Valid values are: "microarchitectures" or "generic".
# An example of "microarchitectures" would be "skylake" or "bulldozer",
# while an example of "generic" would be "aarch64" or "x86_64_v4".
granularity: microarchitectures
# If "false" allow targets that are incompatible with the current host (for
# instance concretize with target "icelake" while running on "haswell").
@@ -33,4 +34,4 @@ concretizer:
# environments can always be activated. When "false" perform concretization separately
# on each root spec, allowing different versions and variants of the same package in
# an environment.
unify: true
unify: true

View File

@@ -81,6 +81,10 @@ config:
source_cache: $spack/var/spack/cache
## Directory where spack managed environments are created and stored
# environments_root: $spack/var/spack/environments
# Cache directory for miscellaneous files, like the package index.
# This can be purged with `spack clean --misc-cache`
misc_cache: $user_cache_path/cache
@@ -181,7 +185,7 @@ config:
# when Spack needs to manage its own package metadata and all operations are
# expected to complete within the default time limit. The timeout should
# therefore generally be left untouched.
db_lock_timeout: 3
db_lock_timeout: 60
# How long to wait when attempting to modify a package (e.g. to install it).

View File

@@ -5,3 +5,4 @@ llnl*.rst
_build
.spack-env
spack.lock
_spack_root

View File

@@ -366,7 +366,7 @@ If the ``pyproject.toml`` lists ``mesonpy`` as the ``build-backend``,
it uses the meson build system. Meson uses the default
``pyproject.toml`` keys to list dependencies.
See https://meson-python.readthedocs.io/en/latest/usage/start.html
See https://meson-python.readthedocs.io/en/latest/tutorials/introduction.html
for more information.
"""

View File

@@ -58,9 +58,7 @@ Testing
``WafPackage`` also provides ``test`` and ``installtest`` methods,
which are run after the ``build`` and ``install`` phases, respectively.
By default, these phases do nothing, but you can override them to
run package-specific unit tests. For example, the
`py-py2cairo <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-py2cairo/package.py>`_
package uses:
run package-specific unit tests.
.. code-block:: python

View File

@@ -89,6 +89,7 @@
# Enable todo items
todo_include_todos = True
#
# Disable duplicate cross-reference warnings.
#
@@ -353,9 +354,7 @@ class SpackStyle(DefaultStyle):
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "Spack.tex", "Spack Documentation", "Todd Gamblin", "manual"),
]
latex_documents = [("index", "Spack.tex", "Spack Documentation", "Todd Gamblin", "manual")]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
@@ -402,7 +401,7 @@ class SpackStyle(DefaultStyle):
"Spack",
"One line description of project.",
"Miscellaneous",
),
)
]
# Documents to append as an appendix to all manuals.
@@ -418,6 +417,4 @@ class SpackStyle(DefaultStyle):
# -- Extension configuration -------------------------------------------------
# sphinx.ext.intersphinx
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

View File

@@ -222,7 +222,7 @@ and location. (See the *Configuration settings* section of ``man
ccache`` to learn more about the default settings and how to change
them). Please note that we currently disable ccache's ``hash_dir``
feature to avoid an issue with the stage directory (see
https://github.com/LLNL/spack/pull/3761#issuecomment-294352232).
https://github.com/spack/spack/pull/3761#issuecomment-294352232).
-----------------------
``shared_linking:type``

View File

@@ -118,7 +118,7 @@ make another change, test that change, etc. We use `pytest
<http://pytest.org/>`_ as our tests framework, and these types of
arguments are just passed to the ``pytest`` command underneath. See `the
pytest docs
<http://doc.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests>`_
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
for more details on test selection syntax.
``spack unit-test`` has a few special options that can help you
@@ -147,7 +147,7 @@ you want to know about. For example, to see just the tests in
You can also combine any of these options with a ``pytest`` keyword
search. See the `pytest usage docs
<https://docs.pytest.org/en/stable/usage.html#specifying-tests-selecting-tests>`_:
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
for more details on test selection syntax. For example, to see the names of all tests that have "spec"
or "concretize" somewhere in their names:

View File

@@ -58,9 +58,9 @@ Using Environments
Here we follow a typical use case of creating, concretizing,
installing and loading an environment.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Creating a named Environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Creating a managed Environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
An environment is created by:
@@ -72,7 +72,8 @@ Spack then creates the directory ``var/spack/environments/myenv``.
.. note::
All named environments are stored in the ``var/spack/environments`` folder.
All managed environments by default are stored in the ``var/spack/environments`` folder.
This location can be changed by setting the ``environments_root`` variable in ``config.yaml``.
In the ``var/spack/environments/myenv`` directory, Spack creates the
file ``spack.yaml`` and the hidden directory ``.spack-env``.

View File

@@ -21,7 +21,7 @@ be present on the machine where Spack is run:
:header-rows: 1
These requirements can be easily installed on most modern Linux systems;
on macOS, the Command Line Tools package is required, and a full XCode suite
on macOS, the Command Line Tools package is required, and a full XCode suite
may be necessary for some packages such as Qt and apple-gl. Spack is designed
to run on HPC platforms like Cray. Not all packages should be expected
to work on all platforms.
@@ -1506,7 +1506,7 @@ Spack On Windows
Windows support for Spack is currently under development. While this work is still in an early stage,
it is currently possible to set up Spack and perform a few operations on Windows. This section will guide
you through the steps needed to install Spack and start running it on a fresh Windows machine.
you through the steps needed to install Spack and start running it on a fresh Windows machine.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Step 1: Install prerequisites
@@ -1516,7 +1516,7 @@ To use Spack on Windows, you will need the following packages:
Required:
* Microsoft Visual Studio
* Python
* Python
* Git
Optional:
@@ -1547,8 +1547,8 @@ Intel Fortran
"""""""""""""
For Fortran-based packages on Windows, we strongly recommend Intel's oneAPI Fortran compilers.
The suite is free to download from Intel's website, located at
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html#gs.70t5tw.
The suite is free to download from Intel's website, located at
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html.
The executable of choice for Spack will be Intel's Beta Compiler, ifx, which supports the classic
compiler's (ifort's) frontend and runtime libraries by using LLVM.

File diff suppressed because it is too large Load Diff

93
lib/spack/env/cc vendored
View File

@@ -427,6 +427,48 @@ isystem_include_dirs_list=""
libs_list=""
other_args_list=""
# Global state for keeping track of -Wl,-rpath -Wl,/path
wl_expect_rpath=no
parse_Wl() {
# drop -Wl
shift
while [ $# -ne 0 ]; do
if [ "$wl_expect_rpath" = yes ]; then
rp="$1"
wl_expect_rpath=no
else
rp=""
case "$1" in
-rpath=*)
rp="${1#-rpath=}"
;;
--rpath=*)
rp="${1#--rpath=}"
;;
-rpath|--rpath)
wl_expect_rpath=yes
;;
"$dtags_to_strip")
;;
*)
append other_args_list "-Wl,$1"
;;
esac
fi
if [ -n "$rp" ]; then
if system_dir "$rp"; then
append system_rpath_dirs_list "$rp"
else
append rpath_dirs_list "$rp"
fi
fi
shift
done
# By lack of local variables, always set this to empty string.
rp=""
}
while [ $# -ne 0 ]; do
@@ -526,54 +568,9 @@ while [ $# -ne 0 ]; do
append other_args_list "-l$arg"
;;
-Wl,*)
arg="${1#-Wl,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
case "$arg" in
-rpath=*) rp="${arg#-rpath=}" ;;
--rpath=*) rp="${arg#--rpath=}" ;;
-rpath,*) rp="${arg#-rpath,}" ;;
--rpath,*) rp="${arg#--rpath,}" ;;
-rpath|--rpath)
shift; arg="$1"
case "$arg" in
-Wl,*)
rp="${arg#-Wl,}"
;;
*)
die "-Wl,-rpath was not followed by -Wl,*"
;;
esac
;;
"$dtags_to_strip")
: # We want to remove explicitly this flag
;;
*)
append other_args_list "-Wl,$arg"
;;
esac
;;
-Xlinker,*)
arg="${1#-Xlinker,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
case "$arg" in
-rpath=*) rp="${arg#-rpath=}" ;;
--rpath=*) rp="${arg#--rpath=}" ;;
-rpath|--rpath)
shift; arg="$1"
case "$arg" in
-Xlinker,*)
rp="${arg#-Xlinker,}"
;;
*)
die "-Xlinker,-rpath was not followed by -Xlinker,*"
;;
esac
;;
*)
append other_args_list "-Xlinker,$arg"
;;
esac
IFS=,
parse_Wl $1
unset IFS
;;
-Xlinker)
if [ "$2" = "-rpath" ]; then

View File

@@ -16,7 +16,6 @@
import sys
import tempfile
from contextlib import contextmanager
from sys import platform as _platform
from typing import Callable, List, Match, Optional, Tuple, Union
from llnl.util import tty
@@ -26,9 +25,7 @@
from spack.util.executable import Executable, which
from spack.util.path import path_to_os_path, system_path_filter
is_windows = _platform == "win32"
if not is_windows:
if sys.platform != "win32":
import grp
import pwd
else:
@@ -84,9 +81,77 @@
"visit_directory_tree",
]
if sys.version_info < (3, 7, 4):
# monkeypatch shutil.copystat to fix PermissionError when copying read-only
# files on Lustre when using Python < 3.7.4
def copystat(src, dst, follow_symlinks=True):
"""Copy file metadata
Copy the permission bits, last access time, last modification time, and
flags from `src` to `dst`. On Linux, copystat() also copies the "extended
attributes" where possible. The file contents, owner, and group are
unaffected. `src` and `dst` are path names given as strings.
If the optional flag `follow_symlinks` is not set, symlinks aren't
followed if and only if both `src` and `dst` are symlinks.
"""
def _nop(args, ns=None, follow_symlinks=None):
pass
# follow symlinks (aka don't not follow symlinks)
follow = follow_symlinks or not (os.path.islink(src) and os.path.islink(dst))
if follow:
# use the real function if it exists
def lookup(name):
return getattr(os, name, _nop)
else:
# use the real function only if it exists
# *and* it supports follow_symlinks
def lookup(name):
fn = getattr(os, name, _nop)
if sys.version_info >= (3, 3):
if fn in os.supports_follow_symlinks: # novermin
return fn
return _nop
st = lookup("stat")(src, follow_symlinks=follow)
mode = stat.S_IMODE(st.st_mode)
lookup("utime")(dst, ns=(st.st_atime_ns, st.st_mtime_ns), follow_symlinks=follow)
# We must copy extended attributes before the file is (potentially)
# chmod()'ed read-only, otherwise setxattr() will error with -EACCES.
shutil._copyxattr(src, dst, follow_symlinks=follow)
try:
lookup("chmod")(dst, mode, follow_symlinks=follow)
except NotImplementedError:
# if we got a NotImplementedError, it's because
# * follow_symlinks=False,
# * lchown() is unavailable, and
# * either
# * fchownat() is unavailable or
# * fchownat() doesn't implement AT_SYMLINK_NOFOLLOW.
# (it returned ENOSUP.)
# therefore we're out of options--we simply cannot chown the
# symlink. give up, suppress the error.
# (which is what shutil always did in this circumstance.)
pass
if hasattr(st, "st_flags"):
try:
lookup("chflags")(dst, st.st_flags, follow_symlinks=follow)
except OSError as why:
for err in "EOPNOTSUPP", "ENOTSUP":
if hasattr(errno, err) and why.errno == getattr(errno, err):
break
else:
raise
shutil.copystat = copystat
def getuid():
if is_windows:
if sys.platform == "win32":
import ctypes
if ctypes.windll.shell32.IsUserAnAdmin() == 0:
@@ -99,7 +164,7 @@ def getuid():
@system_path_filter
def rename(src, dst):
# On Windows, os.rename will fail if the destination file already exists
if is_windows:
if sys.platform == "win32":
# Windows path existence checks will sometimes fail on junctions/links/symlinks
# so check for that case
if os.path.exists(dst) or os.path.islink(dst):
@@ -128,7 +193,7 @@ def _get_mime_type():
"""Generate method to call `file` system command to aquire mime type
for a specified path
"""
if is_windows:
if sys.platform == "win32":
# -h option (no-dereference) does not exist in Windows
return file_command("-b", "--mime-type")
else:
@@ -268,7 +333,6 @@ def groupid_to_group(x):
regex = re.escape(regex)
filenames = path_to_os_path(*filenames)
for filename in filenames:
msg = 'FILTER FILE: {0} [replacing "{1}"]'
tty.debug(msg.format(filename, regex))
@@ -484,7 +548,7 @@ def get_owner_uid(path, err_msg=None):
else:
p_stat = os.stat(path)
if _platform != "win32":
if sys.platform != "win32":
owner_uid = p_stat.st_uid
else:
sid = win32security.GetFileSecurity(
@@ -517,7 +581,7 @@ def group_ids(uid=None):
Returns:
(list of int): gids of groups the user is a member of
"""
if is_windows:
if sys.platform == "win32":
tty.warn("Function is not supported on Windows")
return []
@@ -537,7 +601,7 @@ def group_ids(uid=None):
@system_path_filter(arg_slice=slice(1))
def chgrp(path, group, follow_symlinks=True):
"""Implement the bash chgrp function on a single path"""
if is_windows:
if sys.platform == "win32":
raise OSError("Function 'chgrp' is not supported on Windows")
if isinstance(group, str):
@@ -1064,7 +1128,7 @@ def open_if_filename(str_or_file, mode="r"):
@system_path_filter
def touch(path):
"""Creates an empty file at the specified path."""
if is_windows:
if sys.platform == "win32":
perms = os.O_WRONLY | os.O_CREAT
else:
perms = os.O_WRONLY | os.O_CREAT | os.O_NONBLOCK | os.O_NOCTTY
@@ -1126,7 +1190,7 @@ def temp_cwd():
yield tmp_dir
finally:
kwargs = {}
if is_windows:
if sys.platform == "win32":
kwargs["ignore_errors"] = False
kwargs["onerror"] = readonly_file_handler(ignore_errors=True)
shutil.rmtree(tmp_dir, **kwargs)
@@ -1220,7 +1284,6 @@ def traverse_tree(
# target is relative to the link, then that may not resolve properly
# relative to our cwd - see resolve_link_target_relative_to_the_link
if os.path.isdir(source_child) and (follow_links or not os.path.islink(source_child)):
# When follow_nonexisting isn't set, don't descend into dirs
# in source that do not exist in dest
if follow_nonexisting or os.path.exists(dest_child):
@@ -1372,7 +1435,7 @@ def visit_directory_tree(root, visitor, rel_path="", depth=0):
try:
isdir = f.is_dir()
except OSError as e:
if is_windows and hasattr(e, "winerror") and e.winerror == 5 and islink:
if sys.platform == "win32" and hasattr(e, "winerror") and e.winerror == 5 and islink:
# if path is a symlink, determine destination and
# evaluate file vs directory
link_target = resolve_link_target_relative_to_the_link(f)
@@ -1481,11 +1544,11 @@ def readonly_file_handler(ignore_errors=False):
"""
def error_remove_readonly(func, path, exc):
if not is_windows:
if sys.platform != "win32":
raise RuntimeError("This method should only be invoked on Windows")
excvalue = exc[1]
if (
is_windows
sys.platform == "win32"
and func in (os.rmdir, os.remove, os.unlink)
and excvalue.errno == errno.EACCES
):
@@ -1515,7 +1578,7 @@ def remove_linked_tree(path):
# Windows readonly files cannot be removed by Python
# directly.
if is_windows:
if sys.platform == "win32":
kwargs["ignore_errors"] = False
kwargs["onerror"] = readonly_file_handler(ignore_errors=True)
@@ -1662,7 +1725,6 @@ def find(root, files, recursive=True):
@system_path_filter
def _find_recursive(root, search_files):
# The variable here is **on purpose** a defaultdict. The idea is that
# we want to poke the filesystem as little as possible, but still maintain
# stability in the order of the answer. Thus we are recording each library
@@ -2030,7 +2092,7 @@ def names(self):
# on non Windows platform
# Windows valid library extensions are:
# ['.dll', '.lib']
valid_exts = [".dll", ".lib"] if is_windows else [".dylib", ".so", ".a"]
valid_exts = [".dll", ".lib"] if sys.platform == "win32" else [".dylib", ".so", ".a"]
for ext in valid_exts:
i = name.rfind(ext)
if i != -1:
@@ -2178,7 +2240,7 @@ def find_libraries(libraries, root, shared=True, recursive=False, runtime=True):
message = message.format(find_libraries.__name__, type(libraries))
raise TypeError(message)
if is_windows:
if sys.platform == "win32":
static_ext = "lib"
# For linking (runtime=False) you need the .lib files regardless of
# whether you are doing a shared or static link
@@ -2210,7 +2272,7 @@ def find_libraries(libraries, root, shared=True, recursive=False, runtime=True):
# finally search all of root recursively. The search stops when the first
# match is found.
common_lib_dirs = ["lib", "lib64"]
if is_windows:
if sys.platform == "win32":
common_lib_dirs.extend(["bin", "Lib"])
for subdir in common_lib_dirs:
@@ -2345,7 +2407,7 @@ def _link(self, path, dest_dir):
# For py2 compatibility, we have to catch the specific Windows error code
# associate with trying to create a file that already exists (winerror 183)
except OSError as e:
if e.winerror == 183:
if sys.platform == "win32" and e.winerror == 183:
# We have either already symlinked or we are encoutering a naming clash
# either way, we don't want to overwrite existing libraries
already_linked = islink(dest_file)
@@ -2633,3 +2695,28 @@ def temporary_dir(
yield tmp_dir
finally:
remove_directory_contents(tmp_dir)
def filesummary(path, print_bytes=16) -> Tuple[int, bytes]:
"""Create a small summary of the given file. Does not error
when file does not exist.
Args:
print_bytes (int): Number of bytes to print from start/end of file
Returns:
Tuple of size and byte string containing first n .. last n bytes.
Size is 0 if file cannot be read."""
try:
n = print_bytes
with open(path, "rb") as f:
size = os.fstat(f.fileno()).st_size
if size <= 2 * n:
short_contents = f.read(2 * n)
else:
short_contents = f.read(n)
f.seek(-n, 2)
short_contents += b"..." + f.read(n)
return size, short_contents
except OSError:
return 0, b""

View File

@@ -198,7 +198,7 @@ def _memoized_function(*args, **kwargs):
except TypeError as e:
# TypeError is raised when indexing into a dict if the key is unhashable.
raise UnhashableArguments(
"args + kwargs '{}' was not hashable for function '{}'".format(key, func.__name__),
"args + kwargs '{}' was not hashable for function '{}'".format(key, func.__name__)
) from e
return _memoized_function
@@ -237,6 +237,7 @@ def decorator_with_or_without_args(decorator):
@decorator
"""
# See https://stackoverflow.com/questions/653368 for more on this
@functools.wraps(decorator)
def new_dec(*args, **kwargs):
@@ -990,8 +991,7 @@ def enum(**kwargs):
def stable_partition(
input_iterable: Iterable,
predicate_fn: Callable[[Any], bool],
input_iterable: Iterable, predicate_fn: Callable[[Any], bool]
) -> Tuple[List[Any], List[Any]]:
"""Partition the input iterable according to a custom predicate.
@@ -1104,11 +1104,7 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, tb):
if exc_value is not None:
self._handler._receive_forwarded(
self._context,
exc_value,
traceback.format_tb(tb),
)
self._handler._receive_forwarded(self._context, exc_value, traceback.format_tb(tb))
# Suppress any exception from being re-raised:
# https://docs.python.org/3/reference/datamodel.html#object.__exit__.

View File

@@ -75,7 +75,7 @@ def __init__(self, ignore=None):
# so that we have a fast lookup and can run mkdir in order.
self.directories = OrderedDict()
# Files to link. Maps dst_rel to (src_rel, src_root)
# Files to link. Maps dst_rel to (src_root, src_rel)
self.files = OrderedDict()
def before_visit_dir(self, root, rel_path, depth):
@@ -430,6 +430,11 @@ class MergeConflictError(Exception):
pass
class ConflictingSpecsError(MergeConflictError):
def __init__(self, spec_1, spec_2):
super(MergeConflictError, self).__init__(spec_1, spec_2)
class SingleMergeConflictError(MergeConflictError):
def __init__(self, path):
super(MergeConflictError, self).__init__("Package merge blocked by file: %s" % path)

View File

@@ -18,7 +18,7 @@ class Barrier:
Python 2 doesn't have multiprocessing barriers so we implement this.
See http://greenteapress.com/semaphores/downey08semaphores.pdf, p. 41.
See https://greenteapress.com/semaphores/LittleBookOfSemaphores.pdf, p. 41.
"""
def __init__(self, n, timeout=None):

View File

@@ -5,15 +5,13 @@
import errno
import os
import shutil
import sys
import tempfile
from os.path import exists, join
from sys import platform as _platform
from llnl.util import lang
is_windows = _platform == "win32"
if is_windows:
if sys.platform == "win32":
from win32file import CreateHardLink
@@ -23,7 +21,7 @@ def symlink(real_path, link_path):
On Windows, use junctions if os.symlink fails.
"""
if not is_windows:
if sys.platform != "win32":
os.symlink(real_path, link_path)
elif _win32_can_symlink():
# Windows requires target_is_directory=True when the target is a dir.
@@ -99,7 +97,7 @@ def _win32_is_junction(path):
if os.path.islink(path):
return False
if is_windows:
if sys.platform == "win32":
import ctypes.wintypes
GetFileAttributes = ctypes.windll.kernel32.GetFileAttributesW

View File

@@ -108,7 +108,6 @@ class SuppressOutput:
"""Class for disabling output in a scope using 'with' keyword"""
def __init__(self, msg_enabled=True, warn_enabled=True, error_enabled=True):
self._msg_enabled_initial = _msg_enabled
self._warn_enabled_initial = _warn_enabled
self._error_enabled_initial = _error_enabled

View File

@@ -11,6 +11,7 @@
import io
import os
import sys
from typing import IO, Any, List, Optional
from llnl.util.tty import terminal_size
from llnl.util.tty.color import cextra, clen
@@ -97,7 +98,16 @@ def config_uniform_cols(elts, console_width, padding, cols=0):
return config
def colify(elts, **options):
def colify(
elts: List[Any],
cols: int = 0,
output: Optional[IO] = None,
indent: int = 0,
padding: int = 2,
tty: Optional[bool] = None,
method: str = "variable",
console_cols: Optional[int] = None,
):
"""Takes a list of elements as input and finds a good columnization
of them, similar to how gnu ls does. This supports both
uniform-width and variable-width (tighter) columns.
@@ -106,31 +116,21 @@ def colify(elts, **options):
using ``str()``.
Keyword Arguments:
output (typing.IO): A file object to write to. Default is ``sys.stdout``
indent (int): Optionally indent all columns by some number of spaces
padding (int): Spaces between columns. Default is 2
width (int): Width of the output. Default is 80 if tty not detected
cols (int): Force number of columns. Default is to size to terminal, or
output: A file object to write to. Default is ``sys.stdout``
indent: Optionally indent all columns by some number of spaces
padding: Spaces between columns. Default is 2
width: Width of the output. Default is 80 if tty not detected
cols: Force number of columns. Default is to size to terminal, or
single-column if no tty
tty (bool): Whether to attempt to write to a tty. Default is to autodetect a
tty: Whether to attempt to write to a tty. Default is to autodetect a
tty. Set to False to force single-column output
method (str): Method to use to fit columns. Options are variable or uniform.
method: Method to use to fit columns. Options are variable or uniform.
Variable-width columns are tighter, uniform columns are all the same width
and fit less data on the screen
console_cols: number of columns on this console (default: autodetect)
"""
# Get keyword arguments or set defaults
cols = options.pop("cols", 0)
output = options.pop("output", sys.stdout)
indent = options.pop("indent", 0)
padding = options.pop("padding", 2)
tty = options.pop("tty", None)
method = options.pop("method", "variable")
console_cols = options.pop("width", None)
if options:
raise TypeError(
"'%s' is an invalid keyword argument for this function." % next(options.iterkeys())
)
if output is None:
output = sys.stdout
# elts needs to be an array of strings so we can count the elements
elts = [str(elt) for elt in elts]
@@ -153,10 +153,11 @@ def colify(elts, **options):
cols = 1
# Specify the number of character columns to use.
if not console_cols:
if console_cols is None:
console_rows, console_cols = terminal_size()
elif type(console_cols) != int:
elif not isinstance(console_cols, int):
raise ValueError("Number of columns must be an int")
console_cols = max(1, console_cols - indent)
# Choose a method. Variable-width colums vs uniform-width.
@@ -192,7 +193,13 @@ def colify(elts, **options):
return (config.cols, tuple(config.widths))
def colify_table(table, **options):
def colify_table(
table: List[List[Any]],
output: Optional[IO] = None,
indent: int = 0,
padding: int = 2,
console_cols: Optional[int] = None,
):
"""Version of ``colify()`` for data expressed in rows, (list of lists).
Same as regular colify but:
@@ -218,20 +225,38 @@ def transpose():
for row in table:
yield row[i]
if "cols" in options:
raise ValueError("Cannot override columsn in colify_table.")
options["cols"] = columns
# don't reduce to 1 column for non-tty
options["tty"] = True
colify(transpose(), **options)
colify(
transpose(),
cols=columns, # this is always the number of cols in the table
tty=True, # don't reduce to 1 column for non-tty
output=output,
indent=indent,
padding=padding,
console_cols=console_cols,
)
def colified(elts, **options):
def colified(
elts: List[Any],
cols: int = 0,
output: Optional[IO] = None,
indent: int = 0,
padding: int = 2,
tty: Optional[bool] = None,
method: str = "variable",
console_cols: Optional[int] = None,
):
"""Invokes the ``colify()`` function but returns the result as a string
instead of writing it to an output string."""
sio = io.StringIO()
options["output"] = sio
colify(elts, **options)
colify(
elts,
cols=cols,
output=sio,
indent=indent,
padding=padding,
tty=tty,
method=method,
console_cols=console_cols,
)
return sio.getvalue()

View File

@@ -161,10 +161,7 @@ def _is_background(self):
def _get_canon_echo_flags(self):
"""Get current termios canonical and echo settings."""
cfg = termios.tcgetattr(self.stream)
return (
bool(cfg[3] & termios.ICANON),
bool(cfg[3] & termios.ECHO),
)
return (bool(cfg[3] & termios.ICANON), bool(cfg[3] & termios.ECHO))
def _enable_keyboard_input(self):
"""Disable canonical input and echoing on ``self.stream``."""

View File

@@ -77,10 +77,7 @@ def __init__(self, pid, controller_fd, timeout=1, sleep_time=1e-1, debug=False):
def get_canon_echo_attrs(self):
"""Get echo and canon attributes of the terminal of controller_fd."""
cfg = termios.tcgetattr(self.controller_fd)
return (
bool(cfg[3] & termios.ICANON),
bool(cfg[3] & termios.ECHO),
)
return (bool(cfg[3] & termios.ICANON), bool(cfg[3] & termios.ECHO))
def horizontal_line(self, name):
"""Labled horizontal line for debugging."""
@@ -92,11 +89,7 @@ def status(self):
if self.debug:
canon, echo = self.get_canon_echo_attrs()
sys.stderr.write(
"canon: %s, echo: %s\n"
% (
"on" if canon else "off",
"on" if echo else "off",
)
"canon: %s, echo: %s\n" % ("on" if canon else "off", "on" if echo else "off")
)
sys.stderr.write("input: %s\n" % self.input_on())
sys.stderr.write("bg: %s\n" % self.background())

View File

@@ -25,7 +25,7 @@ def architecture_compatible(self, target, constraint):
return (
not target.architecture
or not constraint.architecture
or target.architecture.satisfies(constraint.architecture)
or target.architecture.intersects(constraint.architecture)
)
@memoized
@@ -104,7 +104,7 @@ def compiler_compatible(self, parent, child, **kwargs):
for cversion in child.compiler.versions:
# For a few compilers use specialized comparisons.
# Otherwise match on version match.
if pversion.satisfies(cversion):
if pversion.intersects(cversion):
return True
elif parent.compiler.name == "gcc" and self._gcc_compiler_compare(
pversion, cversion

View File

@@ -321,8 +321,7 @@ def _check_patch_urls(pkgs, error_cls):
errors.append(
error_cls(
"patch URL in package {0} must end with {1}".format(
pkg_cls.name,
full_index_arg,
pkg_cls.name, full_index_arg
),
[patch.url],
)
@@ -722,7 +721,7 @@ def _version_constraints_are_satisfiable_by_some_version_in_repo(pkgs, error_cls
dependency_pkg_cls = None
try:
dependency_pkg_cls = spack.repo.path.get_pkg_class(s.name)
assert any(v.satisfies(s.versions) for v in list(dependency_pkg_cls.versions))
assert any(v.intersects(s.versions) for v in list(dependency_pkg_cls.versions))
except Exception:
summary = (
"{0}: dependency on {1} cannot be satisfied " "by known versions of {1.name}"

View File

@@ -6,6 +6,8 @@
import codecs
import collections
import hashlib
import io
import itertools
import json
import multiprocessing.pool
import os
@@ -20,7 +22,8 @@
import urllib.parse
import urllib.request
import warnings
from contextlib import closing
from contextlib import closing, contextmanager
from gzip import GzipFile
from urllib.error import HTTPError, URLError
import ruamel.yaml as yaml
@@ -40,6 +43,8 @@
import spack.relocate as relocate
import spack.repo
import spack.store
import spack.traverse as traverse
import spack.util.crypto
import spack.util.file_cache as file_cache
import spack.util.gpg
import spack.util.spack_json as sjson
@@ -209,10 +214,7 @@ def _associate_built_specs_with_mirror(self, cache_key, mirror_url):
break
else:
self._mirrors_for_spec[dag_hash].append(
{
"mirror_url": mirror_url,
"spec": indexed_spec,
}
{"mirror_url": mirror_url, "spec": indexed_spec}
)
finally:
shutil.rmtree(tmpdir)
@@ -295,10 +297,7 @@ def update_spec(self, spec, found_list):
break
else:
current_list.append(
{
"mirror_url": new_entry["mirror_url"],
"spec": new_entry["spec"],
}
{"mirror_url": new_entry["mirror_url"], "spec": new_entry["spec"]}
)
def update(self, with_cooldown=False):
@@ -366,8 +365,7 @@ def update(self, with_cooldown=False):
# May need to fetch the index and update the local caches
try:
needs_regen = self._fetch_and_cache_index(
cached_mirror_url,
cache_entry=cache_entry,
cached_mirror_url, cache_entry=cache_entry
)
self._last_fetch_times[cached_mirror_url] = (now, True)
all_methods_failed = False
@@ -559,7 +557,12 @@ class NoChecksumException(spack.error.SpackError):
Raised if file fails checksum verification.
"""
pass
def __init__(self, path, size, contents, algorithm, expected, computed):
super(NoChecksumException, self).__init__(
f"{algorithm} checksum failed for {path}",
f"Expected {expected} but got {computed}. "
f"File size = {size} bytes. Contents = {contents!r}",
)
class NewLayoutException(spack.error.SpackError):
@@ -739,34 +742,31 @@ def get_buildfile_manifest(spec):
return data
def write_buildinfo_file(spec, workdir, rel=False):
"""
Create a cache file containing information
required for the relocation
"""
def prefixes_to_hashes(spec):
return {
str(s.prefix): s.dag_hash()
for s in itertools.chain(
spec.traverse(root=True, deptype="link"), spec.dependencies(deptype="run")
)
}
def get_buildinfo_dict(spec, rel=False):
"""Create metadata for a tarball"""
manifest = get_buildfile_manifest(spec)
prefix_to_hash = dict()
prefix_to_hash[str(spec.package.prefix)] = spec.dag_hash()
deps = spack.build_environment.get_rpath_deps(spec.package)
for d in deps + spec.dependencies(deptype="run"):
prefix_to_hash[str(d.prefix)] = d.dag_hash()
# Create buildinfo data and write it to disk
buildinfo = {}
buildinfo["sbang_install_path"] = spack.hooks.sbang.sbang_install_path()
buildinfo["relative_rpaths"] = rel
buildinfo["buildpath"] = spack.store.layout.root
buildinfo["spackprefix"] = spack.paths.prefix
buildinfo["relative_prefix"] = os.path.relpath(spec.prefix, spack.store.layout.root)
buildinfo["relocate_textfiles"] = manifest["text_to_relocate"]
buildinfo["relocate_binaries"] = manifest["binary_to_relocate"]
buildinfo["relocate_links"] = manifest["link_to_relocate"]
buildinfo["hardlinks_deduped"] = manifest["hardlinks_deduped"]
buildinfo["prefix_to_hash"] = prefix_to_hash
filename = buildinfo_file_name(workdir)
with open(filename, "w") as outfile:
outfile.write(syaml.dump(buildinfo, default_flow_style=True))
return {
"sbang_install_path": spack.hooks.sbang.sbang_install_path(),
"relative_rpaths": rel,
"buildpath": spack.store.layout.root,
"spackprefix": spack.paths.prefix,
"relative_prefix": os.path.relpath(spec.prefix, spack.store.layout.root),
"relocate_textfiles": manifest["text_to_relocate"],
"relocate_binaries": manifest["binary_to_relocate"],
"relocate_links": manifest["link_to_relocate"],
"hardlinks_deduped": manifest["hardlinks_deduped"],
"prefix_to_hash": prefixes_to_hashes(spec),
}
def tarball_directory_name(spec):
@@ -1139,6 +1139,68 @@ def generate_key_index(key_prefix, tmpdir=None):
shutil.rmtree(tmpdir)
@contextmanager
def gzip_compressed_tarfile(path):
"""Create a reproducible, compressed tarfile"""
# Create gzip compressed tarball of the install prefix
# 1) Use explicit empty filename and mtime 0 for gzip header reproducibility.
# If the filename="" is dropped, Python will use fileobj.name instead.
# This should effectively mimick `gzip --no-name`.
# 2) On AMD Ryzen 3700X and an SSD disk, we have the following on compression speed:
# compresslevel=6 gzip default: llvm takes 4mins, roughly 2.1GB
# compresslevel=9 python default: llvm takes 12mins, roughly 2.1GB
# So we follow gzip.
with open(path, "wb") as fileobj, closing(
GzipFile(filename="", mode="wb", compresslevel=6, mtime=0, fileobj=fileobj)
) as gzip_file, tarfile.TarFile(name="", mode="w", fileobj=gzip_file) as tar:
yield tar
def deterministic_tarinfo(tarinfo: tarfile.TarInfo):
# We only add files, symlinks, hardlinks, and directories
# No character devices, block devices and FIFOs should ever enter a tarball.
if tarinfo.isdev():
return None
# For distribution, it makes no sense to user/group data; since (a) they don't exist
# on other machines, and (b) they lead to surprises as `tar x` run as root will change
# ownership if it can. We want to extract as the current user. By setting owner to root,
# root will extract as root, and non-privileged user will extract as themselves.
tarinfo.uid = 0
tarinfo.gid = 0
tarinfo.uname = ""
tarinfo.gname = ""
# Reset mtime to epoch time, our prefixes are not truly immutable, so files may get
# touched; as long as the content does not change, this ensures we get stable tarballs.
tarinfo.mtime = 0
# Normalize mode
if tarinfo.isfile() or tarinfo.islnk():
# If user can execute, use 0o755; else 0o644
# This is to avoid potentially unsafe world writable & exeutable files that may get
# extracted when Python or tar is run with privileges
tarinfo.mode = 0o644 if tarinfo.mode & 0o100 == 0 else 0o755
else: # symbolic link and directories
tarinfo.mode = 0o755
return tarinfo
def tar_add_metadata(tar: tarfile.TarFile, path: str, data: dict):
# Serialize buildinfo for the tarball
bstring = syaml.dump(data, default_flow_style=True).encode("utf-8")
tarinfo = tarfile.TarInfo(name=path)
tarinfo.size = len(bstring)
tar.addfile(deterministic_tarinfo(tarinfo), io.BytesIO(bstring))
def _do_create_tarball(tarfile_path, binaries_dir, pkg_dir, buildinfo):
with gzip_compressed_tarfile(tarfile_path) as tar:
tar.add(name=binaries_dir, arcname=pkg_dir, filter=deterministic_tarinfo)
tar_add_metadata(tar, buildinfo_file_name(pkg_dir), buildinfo)
def _build_tarball(
spec,
out_url,
@@ -1198,50 +1260,45 @@ def _build_tarball(
):
raise NoOverwriteException(url_util.format(remote_specfile_path))
# make a copy of the install directory to work with
workdir = os.path.join(tmpdir, os.path.basename(spec.prefix))
# install_tree copies hardlinks
# create a temporary tarfile from prefix and exract it to workdir
# tarfile preserves hardlinks
temp_tarfile_name = tarball_name(spec, ".tar")
temp_tarfile_path = os.path.join(tarfile_dir, temp_tarfile_name)
with closing(tarfile.open(temp_tarfile_path, "w")) as tar:
tar.add(name="%s" % spec.prefix, arcname=".")
with closing(tarfile.open(temp_tarfile_path, "r")) as tar:
tar.extractall(workdir)
os.remove(temp_tarfile_path)
pkg_dir = os.path.basename(spec.prefix.rstrip(os.path.sep))
workdir = os.path.join(tmpdir, pkg_dir)
# TODO: We generally don't want to mutate any files, but when using relative
# mode, Spack unfortunately *does* mutate rpaths and links ahead of time.
# For now, we only make a full copy of the spec prefix when in relative mode.
if relative:
# tarfile is used because it preserves hardlink etc best.
binaries_dir = workdir
temp_tarfile_name = tarball_name(spec, ".tar")
temp_tarfile_path = os.path.join(tarfile_dir, temp_tarfile_name)
with closing(tarfile.open(temp_tarfile_path, "w")) as tar:
tar.add(name="%s" % spec.prefix, arcname=".")
with closing(tarfile.open(temp_tarfile_path, "r")) as tar:
tar.extractall(workdir)
os.remove(temp_tarfile_path)
else:
binaries_dir = spec.prefix
# create info for later relocation and create tar
write_buildinfo_file(spec, workdir, relative)
buildinfo = get_buildinfo_dict(spec, relative)
# optionally make the paths in the binaries relative to each other
# in the spack install tree before creating tarball
if relative:
try:
make_package_relative(workdir, spec, allow_root)
except Exception as e:
shutil.rmtree(workdir)
shutil.rmtree(tarfile_dir)
shutil.rmtree(tmpdir)
tty.die(e)
else:
try:
check_package_relocatable(workdir, spec, allow_root)
except Exception as e:
shutil.rmtree(workdir)
shutil.rmtree(tarfile_dir)
shutil.rmtree(tmpdir)
tty.die(e)
try:
if relative:
make_package_relative(workdir, spec, buildinfo, allow_root)
elif not allow_root:
ensure_package_relocatable(buildinfo, binaries_dir)
except Exception as e:
shutil.rmtree(tmpdir)
tty.die(e)
_do_create_tarball(tarfile_path, binaries_dir, pkg_dir, buildinfo)
# create gzip compressed tarball of the install prefix
# On AMD Ryzen 3700X and an SSD disk, we have the following on compression speed:
# compresslevel=6 gzip default: llvm takes 4mins, roughly 2.1GB
# compresslevel=9 python default: llvm takes 12mins, roughly 2.1GB
# So we follow gzip.
with closing(tarfile.open(tarfile_path, "w:gz", compresslevel=6)) as tar:
tar.add(name="%s" % workdir, arcname="%s" % os.path.basename(spec.prefix))
# remove copy of install directory
shutil.rmtree(workdir)
if relative:
shutil.rmtree(workdir)
# get the sha256 checksum of the tarball
checksum = checksum_tarball(tarfile_path)
@@ -1300,57 +1357,48 @@ def _build_tarball(
return None
def nodes_to_be_packaged(specs, include_root=True, include_dependencies=True):
def nodes_to_be_packaged(specs, root=True, dependencies=True):
"""Return the list of nodes to be packaged, given a list of specs.
Args:
specs (List[spack.spec.Spec]): list of root specs to be processed
include_root (bool): include the root of each spec in the nodes
include_dependencies (bool): include the dependencies of each
root (bool): include the root of each spec in the nodes
dependencies (bool): include the dependencies of each
spec in the nodes
"""
if not include_root and not include_dependencies:
return set()
if not root and not dependencies:
return []
elif dependencies:
nodes = traverse.traverse_nodes(specs, root=root, deptype="all")
else:
nodes = set(specs)
def skip_node(current_node):
if current_node.external or current_node.virtual:
return True
return spack.store.db.query_one(current_node) is None
# Limit to installed non-externals.
packageable = lambda n: not n.external and n.installed
expanded_set = set()
for current_spec in specs:
if not include_dependencies:
nodes = [current_spec]
else:
nodes = [
n
for n in current_spec.traverse(
order="post", root=include_root, deptype=("link", "run")
)
]
for node in nodes:
if not skip_node(node):
expanded_set.add(node)
return expanded_set
# Mass install check
with spack.store.db.read_transaction():
return list(filter(packageable, nodes))
def push(specs, push_url, specs_kwargs=None, **kwargs):
def push(specs, push_url, include_root: bool = True, include_dependencies: bool = True, **kwargs):
"""Create a binary package for each of the specs passed as input and push them
to a given push URL.
Args:
specs (List[spack.spec.Spec]): installed specs to be packaged
push_url (str): url where to push the binary package
specs_kwargs (dict): dictionary with two possible boolean keys, "include_root"
and "include_dependencies", which determine which part of each spec is
packaged and pushed to the mirror
include_root (bool): include the root of each spec in the nodes
include_dependencies (bool): include the dependencies of each
spec in the nodes
**kwargs: TODO
"""
specs_kwargs = specs_kwargs or {"include_root": True, "include_dependencies": True}
nodes = nodes_to_be_packaged(specs, **specs_kwargs)
# Be explicit about the arugment type
if type(include_root) != bool or type(include_dependencies) != bool:
raise ValueError("Expected include_root/include_dependencies to be True/False")
nodes = nodes_to_be_packaged(specs, root=include_root, dependencies=include_dependencies)
# TODO: This seems to be an easy target for task
# TODO: distribution using a parallel pool
@@ -1537,13 +1585,12 @@ def download_tarball(spec, unsigned=False, mirrors_for_spec=None):
return None
def make_package_relative(workdir, spec, allow_root):
def make_package_relative(workdir, spec, buildinfo, allow_root):
"""
Change paths in binaries to relative paths. Change absolute symlinks
to relative symlinks.
"""
prefix = spec.prefix
buildinfo = read_buildinfo_file(workdir)
old_layout_root = buildinfo["buildpath"]
orig_path_names = list()
cur_path_names = list()
@@ -1567,16 +1614,10 @@ def make_package_relative(workdir, spec, allow_root):
relocate.make_link_relative(cur_path_names, orig_path_names)
def check_package_relocatable(workdir, spec, allow_root):
"""
Check if package binaries are relocatable.
Change links to placeholder links.
"""
buildinfo = read_buildinfo_file(workdir)
cur_path_names = list()
for filename in buildinfo["relocate_binaries"]:
cur_path_names.append(os.path.join(workdir, filename))
allow_root or relocate.ensure_binaries_are_relocatable(cur_path_names)
def ensure_package_relocatable(buildinfo, binaries_dir):
"""Check if package binaries are relocatable."""
binaries = [os.path.join(binaries_dir, f) for f in buildinfo["relocate_binaries"]]
relocate.ensure_binaries_are_relocatable(binaries)
def dedupe_hardlinks_if_necessary(root, buildinfo):
@@ -1779,14 +1820,15 @@ def _extract_inner_tarball(spec, filename, extract_to, unsigned, remote_checksum
raise UnsignedPackageException(
"To install unsigned packages, use the --no-check-signature option."
)
# get the sha256 checksum of the tarball
# compute the sha256 checksum of the tarball
local_checksum = checksum_tarball(tarfile_path)
expected = remote_checksum["hash"]
# if the checksums don't match don't install
if local_checksum != remote_checksum["hash"]:
raise NoChecksumException(
"Package tarball failed checksum verification.\n" "It cannot be installed."
)
if local_checksum != expected:
size, contents = fsys.filesummary(tarfile_path)
raise NoChecksumException(tarfile_path, size, contents, "sha256", expected, local_checksum)
return tarfile_path
@@ -1844,12 +1886,14 @@ def extract_tarball(spec, download_result, allow_root=False, unsigned=False, for
# compute the sha256 checksum of the tarball
local_checksum = checksum_tarball(tarfile_path)
expected = bchecksum["hash"]
# if the checksums don't match don't install
if local_checksum != bchecksum["hash"]:
if local_checksum != expected:
size, contents = fsys.filesummary(tarfile_path)
_delete_staged_downloads(download_result)
raise NoChecksumException(
"Package tarball failed checksum verification.\n" "It cannot be installed."
tarfile_path, size, contents, "sha256", expected, local_checksum
)
new_relative_prefix = str(os.path.relpath(spec.prefix, spack.store.layout.root))
@@ -1940,8 +1984,11 @@ def install_root_node(spec, allow_root, unsigned=False, force=False, sha256=None
tarball_path = download_result["tarball_stage"].save_filename
msg = msg.format(tarball_path, sha256)
if not checker.check(tarball_path):
size, contents = fsys.filesummary(tarball_path)
_delete_staged_downloads(download_result)
raise spack.binary_distribution.NoChecksumException(msg)
raise NoChecksumException(
tarball_path, size, contents, checker.hash_name, sha256, checker.sum
)
tty.debug("Verified SHA256 checksum of the build cache")
# don't print long padded paths while extracting/relocating binaries
@@ -2015,12 +2062,7 @@ def try_direct_fetch(spec, mirrors=None):
fetched_spec = Spec.from_json(specfile_contents)
fetched_spec._mark_concrete()
found_specs.append(
{
"mirror_url": mirror.fetch_url,
"spec": fetched_spec,
}
)
found_specs.append({"mirror_url": mirror.fetch_url, "spec": fetched_spec})
return found_specs
@@ -2322,11 +2364,7 @@ def download_single_spec(concrete_spec, destination, mirror_url=None):
local_tarball_path = os.path.join(destination, tarball_dir_name)
files_to_fetch = [
{
"url": [tarball_path_name],
"path": local_tarball_path,
"required": True,
},
{"url": [tarball_path_name], "path": local_tarball_path, "required": True},
{
"url": [
tarball_name(concrete_spec, ".spec.json.sig"),
@@ -2447,12 +2485,7 @@ def conditional_fetch(self):
response.headers.get("Etag", None) or response.headers.get("etag", None)
)
return FetchIndexResult(
etag=etag,
hash=computed_hash,
data=result,
fresh=False,
)
return FetchIndexResult(etag=etag, hash=computed_hash, data=result, fresh=False)
class EtagIndexFetcher:

View File

@@ -5,11 +5,7 @@
"""Function and classes needed to bootstrap Spack itself."""
from .config import ensure_bootstrap_configuration, is_bootstrapping
from .core import (
all_core_root_specs,
ensure_core_dependencies,
ensure_patchelf_in_path_or_raise,
)
from .core import all_core_root_specs, ensure_core_dependencies, ensure_patchelf_in_path_or_raise
from .environment import BootstrapEnvironment, ensure_environment_dependencies
from .status import status_message

View File

@@ -59,10 +59,7 @@ def _try_import_from_store(module, query_spec, query_info=None):
# to be picked up and used, possibly depending on something in the store, first
# allows the bootstrap version to work when an incompatible version is in
# sys.path
orders = [
module_paths + sys.path,
sys.path + module_paths,
]
orders = [module_paths + sys.path, sys.path + module_paths]
for path in orders:
sys.path = path
try:

View File

@@ -53,12 +53,7 @@
import spack.util.url
import spack.version
from ._common import (
_executables_in_store,
_python_import,
_root_spec,
_try_import_from_store,
)
from ._common import _executables_in_store, _python_import, _root_spec, _try_import_from_store
from .config import spack_python_interpreter, spec_for_current_python
#: Name of the file containing metadata about the bootstrapping source
@@ -213,7 +208,7 @@ def _install_and_test(self, abstract_spec, bincache_platform, bincache_data, tes
# This will be None for things that don't depend on python
python_spec = item.get("python", None)
# Skip specs which are not compatible
if not abstract_spec.satisfies(candidate_spec):
if not abstract_spec.intersects(candidate_spec):
continue
if python_spec is not None and python_spec not in abstract_spec:

View File

@@ -171,7 +171,7 @@ def mypy_root_spec():
def black_root_spec():
"""Return the root spec used to bootstrap black"""
return _root_spec("py-black@:22.12.0")
return _root_spec("py-black@:23.1.0")
def flake8_root_spec():

View File

@@ -69,13 +69,13 @@
from spack.installer import InstallError
from spack.util.cpus import cpus_available
from spack.util.environment import (
SYSTEM_DIRS,
EnvironmentModifications,
env_flag,
filter_system_paths,
get_path,
inspect_path,
is_system_path,
system_dirs,
validate,
)
from spack.util.executable import Executable
@@ -397,7 +397,7 @@ def set_compiler_environment_variables(pkg, env):
env.set("SPACK_COMPILER_SPEC", str(spec.compiler))
env.set("SPACK_SYSTEM_DIRS", ":".join(system_dirs))
env.set("SPACK_SYSTEM_DIRS", ":".join(SYSTEM_DIRS))
compiler.setup_custom_environment(pkg, env)
@@ -423,6 +423,14 @@ def set_wrapper_variables(pkg, env):
compiler = pkg.compiler
env.extend(spack.schema.environment.parse(compiler.environment))
# Before setting up PATH to Spack compiler wrappers, make sure compiler is in PATH
# This ensures that non-wrapped executables from the compiler bin directory are available
bindirs = dedupe(
[os.path.dirname(c) for c in [compiler.cc, compiler.cxx, compiler.fc, compiler.f77]]
)
for bindir in bindirs:
env.prepend_path("PATH", bindir)
if compiler.extra_rpaths:
extra_rpaths = ":".join(compiler.extra_rpaths)
env.set("SPACK_COMPILER_EXTRA_RPATHS", extra_rpaths)
@@ -485,7 +493,13 @@ def update_compiler_args_for_dep(dep):
query = pkg.spec[dep.name]
dep_link_dirs = list()
try:
# In some circumstances (particularly for externals) finding
# libraries packages can be time consuming, so indicate that
# we are performing this operation (and also report when it
# finishes).
tty.debug("Collecting libraries for {0}".format(dep.name))
dep_link_dirs.extend(query.libs.directories)
tty.debug("Libraries for {0} have been collected.".format(dep.name))
except NoLibrariesError:
tty.debug("No libraries found for {0}".format(dep.name))
@@ -772,7 +786,9 @@ def setup_package(pkg, dirty, 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(modifications_from_dependencies(pkg.spec, context, custom_mods_only=False))
tty.debug("setup_package: collected all modifications from dependencies")
# architecture specific setup
platform = spack.platforms.by_name(pkg.spec.architecture.platform)
@@ -780,6 +796,7 @@ def setup_package(pkg, dirty, context="build"):
platform.setup_platform_environment(pkg, env_mods)
if context == "build":
tty.debug("setup_package: setup build environment for root")
builder = spack.builder.create(pkg)
builder.setup_build_environment(env_mods)
@@ -790,6 +807,7 @@ def setup_package(pkg, dirty, context="build"):
" includes and omit it when invoked with '--cflags'."
)
elif context == "test":
tty.debug("setup_package: setup test environment for root")
env_mods.extend(
inspect_path(
pkg.spec.prefix,
@@ -806,6 +824,7 @@ def setup_package(pkg, dirty, context="build"):
# Load modules on an already clean environment, just before applying Spack's
# own environment modifications. This ensures Spack controls CC/CXX/... variables.
if need_compiler:
tty.debug("setup_package: loading compiler modules")
for mod in pkg.compiler.modules:
load_module(mod)
@@ -943,6 +962,7 @@ def default_modifications_for_dep(dep):
_make_runnable(dep, env)
def add_modifications_for_dep(dep):
tty.debug("Adding env modifications for {0}".format(dep.name))
# Some callers of this function only want the custom modifications.
# For callers that want both custom and default modifications, we want
# to perform the default modifications here (this groups custom
@@ -968,6 +988,7 @@ def add_modifications_for_dep(dep):
builder.setup_dependent_build_environment(env, spec)
else:
dpkg.setup_dependent_run_environment(env, spec)
tty.debug("Added env modifications for {0}".format(dep.name))
# Note that we want to perform environment modifications in a fixed order.
# The Spec.traverse method provides this: i.e. in addition to
@@ -1016,7 +1037,6 @@ def get_cmake_prefix_path(pkg):
def _setup_pkg_and_run(
serialized_pkg, function, kwargs, child_pipe, input_multiprocess_fd, jsfd1, jsfd2
):
context = kwargs.get("context", "build")
try:

View File

@@ -110,11 +110,7 @@ class AutotoolsBuilder(BaseBuilder):
phases = ("autoreconf", "configure", "build", "install")
#: Names associated with package methods in the old build-system format
legacy_methods = (
"configure_args",
"check",
"installcheck",
)
legacy_methods = ("configure_args", "check", "installcheck")
#: Names associated with package attributes in the old build-system format
legacy_attributes = (

View File

@@ -31,7 +31,6 @@ def cmake_cache_option(name, boolean_value, comment=""):
class CachedCMakeBuilder(CMakeBuilder):
#: Phases of a Cached CMake package
#: Note: the initconfig phase is used for developer builds as a final phase to stop on
phases: Tuple[str, ...] = ("initconfig", "cmake", "build", "install")

View File

@@ -252,10 +252,7 @@ def std_args(pkg, generator=None):
if platform.mac_ver()[0]:
args.extend(
[
define("CMAKE_FIND_FRAMEWORK", "LAST"),
define("CMAKE_FIND_APPBUNDLE", "LAST"),
]
[define("CMAKE_FIND_FRAMEWORK", "LAST"), define("CMAKE_FIND_APPBUNDLE", "LAST")]
)
# Set up CMake rpath

View File

@@ -38,10 +38,7 @@ class GenericBuilder(BaseBuilder):
legacy_methods: Tuple[str, ...] = ()
#: Names associated with package attributes in the old build-system format
legacy_attributes: Tuple[str, ...] = (
"archive_files",
"install_time_test_callbacks",
)
legacy_attributes: Tuple[str, ...] = ("archive_files", "install_time_test_callbacks")
#: Callback names for post-install phase tests
install_time_test_callbacks = []

View File

@@ -857,10 +857,7 @@ def scalapack_libs(self):
raise_lib_error("Cannot find a BLACS library for the given MPI.")
int_suff = "_" + self.intel64_int_suffix
scalapack_libnames = [
"libmkl_scalapack" + int_suff,
blacs_lib + int_suff,
]
scalapack_libnames = ["libmkl_scalapack" + int_suff, blacs_lib + int_suff]
sca_libs = find_libraries(
scalapack_libnames, root=self.component_lib_dir("mkl"), shared=("+shared" in self.spec)
)
@@ -1161,9 +1158,7 @@ def _determine_license_type(self):
#
# Ideally, we just tell the installer to look around on the system.
# Thankfully, we neither need to care nor emulate where it looks:
license_type = {
"ACTIVATION_TYPE": "exist_lic",
}
license_type = {"ACTIVATION_TYPE": "exist_lic"}
# However (and only), if the spack-internal Intel license file has been
# populated beyond its templated explanatory comments, proffer it to

View File

@@ -68,10 +68,7 @@ def unpack(self, pkg, spec, prefix):
@staticmethod
def _generate_tree_line(name, prefix):
return """{{ name = "{name}", root = "{prefix}" }};""".format(
name=name,
prefix=prefix,
)
return """{{ name = "{name}", root = "{prefix}" }};""".format(name=name, prefix=prefix)
def generate_luarocks_config(self, pkg, spec, prefix):
spec = self.pkg.spec

View File

@@ -37,11 +37,7 @@ class IntelOneApiPackage(Package):
conflicts(c, msg="This package in only available for x86_64 and Linux")
# Add variant to toggle environment modifications from vars.sh
variant(
"envmods",
default=True,
description="Toggles environment modifications",
)
variant("envmods", default=True, description="Toggles environment modifications")
@staticmethod
def update_description(cls):

View File

@@ -21,7 +21,7 @@
import spack.package_base
import spack.spec
import spack.store
from spack.directives import build_system, depends_on, extends
from spack.directives import build_system, depends_on, extends, maintainers
from spack.error import NoHeadersError, NoLibrariesError, SpecError
from spack.version import Version
@@ -29,7 +29,7 @@
class PythonExtension(spack.package_base.PackageBase):
maintainers = ["adamjstewart"]
maintainers("adamjstewart", "pradyunsg")
@property
def import_modules(self):
@@ -113,6 +113,9 @@ def view_file_conflicts(self, view, merge_map):
return conflicts
def add_files_to_view(self, view, merge_map, skip_if_exists=True):
if not self.extendee_spec:
return super().add_files_to_view(view, merge_map, skip_if_exists)
bin_dir = self.spec.prefix.bin
python_prefix = self.extendee_spec.prefix
python_is_external = self.extendee_spec.external
@@ -184,8 +187,6 @@ class PythonPackage(PythonExtension):
#: Package name, version, and extension on PyPI
pypi: Optional[str] = None
maintainers = ["adamjstewart", "pradyunsg"]
# To be used in UI queries that require to know which
# build-system class we are using
build_system_class = "PythonPackage"

View File

@@ -7,7 +7,7 @@
import llnl.util.lang as lang
from spack.directives import extends
from spack.directives import extends, maintainers
from .generic import GenericBuilder, Package
@@ -71,7 +71,7 @@ class RPackage(Package):
GenericBuilder = RBuilder
maintainers = ["glennpj"]
maintainers("glennpj")
#: This attribute is used in UI queries that need to know the build
#: system base class

View File

@@ -11,7 +11,7 @@
import spack.builder
from spack.build_environment import SPACK_NO_PARALLEL_MAKE, determine_number_of_jobs
from spack.directives import build_system, extends
from spack.directives import build_system, extends, maintainers
from spack.package_base import PackageBase
from spack.util.environment import env_flag
from spack.util.executable import Executable, ProcessError
@@ -23,7 +23,7 @@ class RacketPackage(PackageBase):
"""
#: Package name, version, and extension on PyPI
maintainers = ["elfprince13"]
maintainers("elfprince13")
# To be used in UI queries that require to know which
# build-system class we are using
build_system_class = "RacketPackage"

View File

@@ -7,7 +7,7 @@
import spack.builder
import spack.package_base
from spack.directives import build_system, extends
from spack.directives import build_system, extends, maintainers
from ._checks import BaseBuilder
@@ -15,7 +15,7 @@
class RubyPackage(spack.package_base.PackageBase):
"""Specialized class for building Ruby gems."""
maintainers = ["Kerilk"]
maintainers("Kerilk")
#: This attribute is used in UI queries that need to know the build
#: system base class

View File

@@ -61,10 +61,7 @@ def import_modules(self):
list: list of strings of module names
"""
modules = []
root = os.path.join(
self.prefix,
self.spec["python"].package.platlib,
)
root = os.path.join(self.prefix, self.spec["python"].package.platlib)
# Some Python libraries are packages: collections of modules
# distributed in directories containing __init__.py files

View File

@@ -42,9 +42,7 @@
from spack.reporters import CDash, CDashConfiguration
from spack.reporters.cdash import build_stamp as cdash_build_stamp
JOB_RETRY_CONDITIONS = [
"always",
]
JOB_RETRY_CONDITIONS = ["always"]
TEMP_STORAGE_MIRROR_NAME = "ci_temporary_mirror"
SPACK_RESERVED_TAGS = ["public", "protected", "notary"]
@@ -129,10 +127,7 @@ def _remove_reserved_tags(tags):
def _get_spec_string(spec):
format_elements = [
"{name}{@version}",
"{%compiler}",
]
format_elements = ["{name}{@version}", "{%compiler}"]
if spec.architecture:
format_elements.append(" {arch=architecture}")
@@ -328,12 +323,7 @@ def _compute_spec_deps(spec_list, check_index_only=False, mirrors_to_check=None)
dependencies = []
def append_dep(s, d):
dependencies.append(
{
"spec": s,
"depends": d,
}
)
dependencies.append({"spec": s, "depends": d})
for spec in spec_list:
for s in spec.traverse(deptype=all):
@@ -346,10 +336,7 @@ def append_dep(s, d):
)
skey = _spec_deps_key(s)
spec_labels[skey] = {
"spec": s,
"needs_rebuild": not up_to_date_mirrors,
}
spec_labels[skey] = {"spec": s, "needs_rebuild": not up_to_date_mirrors}
for d in s.dependencies(deptype=all):
dkey = _spec_deps_key(d)
@@ -368,16 +355,13 @@ def append_dep(s, d):
}
)
deps_json_obj = {
"specs": specs,
"dependencies": dependencies,
}
deps_json_obj = {"specs": specs, "dependencies": dependencies}
return deps_json_obj
def _spec_matches(spec, match_string):
return spec.satisfies(match_string)
return spec.intersects(match_string)
def _remove_attributes(src_dict, dest_dict):
@@ -410,14 +394,7 @@ def _copy_attributes(attrs_list, src_dict, dest_dict):
def _find_matching_config(spec, gitlab_ci):
runner_attributes = {}
overridable_attrs = [
"image",
"tags",
"variables",
"before_script",
"script",
"after_script",
]
overridable_attrs = ["image", "tags", "variables", "before_script", "script", "after_script"]
_copy_attributes(overridable_attrs, gitlab_ci, runner_attributes)
@@ -513,16 +490,28 @@ def compute_affected_packages(rev1="HEAD^", rev2="HEAD"):
return spack.repo.get_all_package_diffs("ARC", rev1=rev1, rev2=rev2)
def get_spec_filter_list(env, affected_pkgs):
def get_spec_filter_list(env, affected_pkgs, dependent_traverse_depth=None):
"""Given a list of package names and an active/concretized
environment, return the set of all concrete specs from the
environment that could have been affected by changing the
list of packages.
If a ``dependent_traverse_depth`` is given, it is used to limit
upward (in the parent direction) traversal of specs of touched
packages. E.g. if 1 is provided, then only direct dependents
of touched package specs are traversed to produce specs that
could have been affected by changing the package, while if 0 is
provided, only the changed specs themselves are traversed. If ``None``
is given, upward traversal of touched package specs is done all
the way to the environment roots. Providing a negative number
results in no traversals at all, yielding an empty set.
Arguments:
env (spack.environment.Environment): Active concrete environment
affected_pkgs (List[str]): Affected package names
dependent_traverse_depth: Optional integer to limit dependent
traversal, or None to disable the limit.
Returns:
@@ -539,10 +528,11 @@ def get_spec_filter_list(env, affected_pkgs):
visited = set()
dag_hash = lambda s: s.dag_hash()
for match in env_matches:
for parent in match.traverse(direction="parents", key=dag_hash):
affected_specs.update(
parent.traverse(direction="children", visited=visited, key=dag_hash)
)
for dep_level, parent in match.traverse(direction="parents", key=dag_hash, depth=True):
if dependent_traverse_depth is None or dep_level <= dependent_traverse_depth:
affected_specs.update(
parent.traverse(direction="children", visited=visited, key=dag_hash)
)
return affected_specs
@@ -603,6 +593,18 @@ def generate_gitlab_ci_yaml(
cdash_handler = CDashHandler(yaml_root.get("cdash")) if "cdash" in yaml_root else None
build_group = cdash_handler.build_group if cdash_handler else None
dependent_depth = os.environ.get("SPACK_PRUNE_UNTOUCHED_DEPENDENT_DEPTH", None)
if dependent_depth is not None:
try:
dependent_depth = int(dependent_depth)
except (TypeError, ValueError):
tty.warn(
"Unrecognized value ({0}) ".format(dependent_depth),
"provide forSPACK_PRUNE_UNTOUCHED_DEPENDENT_DEPTH, ",
"ignoring it.",
)
dependent_depth = None
prune_untouched_packages = False
spack_prune_untouched = os.environ.get("SPACK_PRUNE_UNTOUCHED", None)
if spack_prune_untouched is not None and spack_prune_untouched.lower() == "true":
@@ -618,7 +620,9 @@ def generate_gitlab_ci_yaml(
tty.debug("affected pkgs:")
for p in affected_pkgs:
tty.debug(" {0}".format(p))
affected_specs = get_spec_filter_list(env, affected_pkgs)
affected_specs = get_spec_filter_list(
env, affected_pkgs, dependent_traverse_depth=dependent_depth
)
tty.debug("all affected specs:")
for s in affected_specs:
tty.debug(" {0}/{1}".format(s.name, s.dag_hash()[:7]))
@@ -685,28 +689,14 @@ def generate_gitlab_ci_yaml(
except AttributeError:
phase_name = phase
strip_compilers = False
phases.append(
{
"name": phase_name,
"strip-compilers": strip_compilers,
}
)
phases.append({"name": phase_name, "strip-compilers": strip_compilers})
for bs in env.spec_lists[phase_name]:
bootstrap_specs.append(
{
"spec": bs,
"phase-name": phase_name,
"strip-compilers": strip_compilers,
}
{"spec": bs, "phase-name": phase_name, "strip-compilers": strip_compilers}
)
phases.append(
{
"name": "specs",
"strip-compilers": False,
}
)
phases.append({"name": "specs", "strip-compilers": False})
# If a remote mirror override (alternate buildcache destination) was
# specified, add it here in case it has already built hashes we might
@@ -975,7 +965,7 @@ def generate_gitlab_ci_yaml(
bs_arch = c_spec.architecture
bs_arch_family = bs_arch.target.microarchitecture.family
if (
c_spec.satisfies(compiler_pkg_spec)
c_spec.intersects(compiler_pkg_spec)
and bs_arch_family == spec_arch_family
):
# We found the bootstrap compiler this release spec
@@ -1109,15 +1099,9 @@ def generate_gitlab_ci_yaml(
"variables": variables,
"script": job_script,
"tags": tags,
"artifacts": {
"paths": artifact_paths,
"when": "always",
},
"artifacts": {"paths": artifact_paths, "when": "always"},
"needs": sorted(job_dependencies, key=lambda d: d["job"]),
"retry": {
"max": 2,
"when": JOB_RETRY_CONDITIONS,
},
"retry": {"max": 2, "when": JOB_RETRY_CONDITIONS},
"interruptible": True,
}
@@ -1135,10 +1119,7 @@ def generate_gitlab_ci_yaml(
if image_name:
job_object["image"] = image_name
if image_entry is not None:
job_object["image"] = {
"name": image_name,
"entrypoint": image_entry,
}
job_object["image"] = {"name": image_name, "entrypoint": image_entry}
output_object[job_name] = job_object
job_id += 1
@@ -1181,11 +1162,7 @@ def generate_gitlab_ci_yaml(
service_job_retries = {
"max": 2,
"when": [
"runner_system_failure",
"stuck_or_timeout_failure",
"script_failure",
],
"when": ["runner_system_failure", "stuck_or_timeout_failure", "script_failure"],
}
if job_id > 0:
@@ -1357,9 +1334,7 @@ def generate_gitlab_ci_yaml(
_copy_attributes(default_attrs, service_job_config, noop_job)
if "script" not in noop_job:
noop_job["script"] = [
'echo "All specs already up to date, nothing to rebuild."',
]
noop_job["script"] = ['echo "All specs already up to date, nothing to rebuild."']
noop_job["retry"] = service_job_retries
@@ -1489,9 +1464,8 @@ def _push_mirror_contents(env, specfile_path, sign_binaries, mirror_url):
hashes = env.all_hashes() if env else None
matches = spack.store.specfile_matches(specfile_path, hashes=hashes)
push_url = spack.mirror.Mirror.from_url(mirror_url).push_url
spec_kwargs = {"include_root": True, "include_dependencies": False}
kwargs = {"force": True, "allow_root": True, "unsigned": unsigned}
bindist.push(matches, push_url, spec_kwargs, **kwargs)
bindist.push(matches, push_url, include_root=True, include_dependencies=False, **kwargs)
def push_mirror_contents(env, specfile_path, mirror_url, sign_binaries):
@@ -1554,10 +1528,7 @@ def copy_files_to_artifacts(src, artifacts_dir):
try:
fs.copy(src, artifacts_dir)
except Exception as err:
msg = ("Unable to copy files ({0}) to artifacts {1} due to " "exception: {2}").format(
src, artifacts_dir, str(err)
)
tty.error(msg)
tty.warn(f"Unable to copy files ({src}) to artifacts {artifacts_dir} due to: {err}")
def copy_stage_logs_to_artifacts(job_spec, job_log_dir):
@@ -1620,9 +1591,7 @@ def download_and_extract_artifacts(url, work_dir):
"""
tty.msg("Fetching artifacts from: {0}\n".format(url))
headers = {
"Content-Type": "application/zip",
}
headers = {"Content-Type": "application/zip"}
token = os.environ.get("GITLAB_PRIVATE_TOKEN", None)
if token:
@@ -2081,10 +2050,7 @@ 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"}
)
except Exception as err:
# If there is an S3 error (e.g., access denied or connection
@@ -2162,14 +2128,7 @@ def run_standalone_tests(**kwargs):
tty.error("Reproduction directory is required for stand-alone tests")
return
test_args = [
"spack",
"--color=always",
"--backtrace",
"--verbose",
"test",
"run",
]
test_args = ["spack", "--color=always", "--backtrace", "--verbose", "test", "run"]
if fail_fast:
test_args.append("--fail-fast")
@@ -2319,19 +2278,9 @@ def populate_buildgroup(self, job_names):
opener = build_opener(HTTPHandler)
parent_group_id = self.create_buildgroup(
opener,
headers,
url,
self.build_group,
"Daily",
)
parent_group_id = self.create_buildgroup(opener, headers, url, self.build_group, "Daily")
group_id = self.create_buildgroup(
opener,
headers,
url,
"Latest {0}".format(self.build_group),
"Latest",
opener, headers, url, "Latest {0}".format(self.build_group), "Latest"
)
if not parent_group_id or not group_id:
@@ -2341,13 +2290,9 @@ def populate_buildgroup(self, job_names):
data = {
"dynamiclist": [
{
"match": name,
"parentgroupid": parent_group_id,
"site": self.site,
}
{"match": name, "parentgroupid": parent_group_id, "site": self.site}
for name in job_names
],
]
}
enc_data = json.dumps(data).encode("utf-8")

View File

@@ -43,7 +43,6 @@ def matches(obj, proto):
return all((key in obj and matches(obj[key], val)) for key, val in proto.items())
if isinstance(obj, collections.abc.Sequence) and not isinstance(obj, str):
if not (isinstance(proto, collections.abc.Sequence) and not isinstance(proto, str)):
return False

View File

@@ -161,9 +161,7 @@ class _UnquotedFlags(object):
"""
flags_arg_pattern = re.compile(
r'^({0})=([^\'"].*)$'.format(
"|".join(spack.spec.FlagMap.valid_compiler_flags()),
)
r'^({0})=([^\'"].*)$'.format("|".join(spack.spec.FlagMap.valid_compiler_flags()))
)
def __init__(self, all_unquoted_flag_pairs: List[Tuple[Match[str], str]]):
@@ -227,7 +225,6 @@ def parse_specs(args, **kwargs):
return specs
except spack.error.SpecError as e:
msg = e.message
if e.long_message:
msg += e.long_message

View File

@@ -53,7 +53,6 @@ def packages(parser, args):
def packages_https(parser, args):
# Since packages takes a long time, --all is required without name
if not args.check_all and not args.name:
tty.die("Please specify one or more packages to audit, or --all.")

View File

@@ -5,7 +5,7 @@
import spack.cmd.common.env_utility as env_utility
description = (
"run a command in a spec's install environment, " "or dump its environment to screen or file"
"run a command in a spec's install environment, or dump its environment to screen or file"
)
section = "build"
level = "long"

View File

@@ -103,9 +103,7 @@ def setup_parser(subparser):
help="Regenerate buildcache index after building package(s)",
)
create.add_argument(
"--spec-file",
default=None,
help="Create buildcache entry for spec from json or yaml file",
"--spec-file", default=None, help="Create buildcache entry for spec from json or yaml file"
)
create.add_argument(
"--only",
@@ -402,7 +400,7 @@ def _matching_specs(specs, spec_file):
return spack.store.find(constraints, hashes=hashes)
if env:
return [env.specs_by_hash[h] for h in env.concretized_order]
return [concrete for _, concrete in env.concretized_specs()]
tty.die(
"build cache file creation requires at least one"
@@ -461,10 +459,6 @@ def create_fn(args):
msg = "Pushing binary packages to {0}/build_cache".format(url)
tty.msg(msg)
specs_kwargs = {
"include_root": "package" in args.things_to_install,
"include_dependencies": "dependencies" in args.things_to_install,
}
kwargs = {
"key": args.key,
"force": args.force,
@@ -473,7 +467,13 @@ def create_fn(args):
"allow_root": args.allow_root,
"regenerate_index": args.rebuild_index,
}
bindist.push(matches, url, specs_kwargs, **kwargs)
bindist.push(
matches,
url,
include_root="package" in args.things_to_install,
include_dependencies="dependencies" in args.things_to_install,
**kwargs,
)
def install_fn(args):
@@ -498,11 +498,11 @@ def list_fn(args):
if not args.allarch:
arch = spack.spec.Spec.default_arch()
specs = [s for s in specs if s.satisfies(arch)]
specs = [s for s in specs if s.intersects(arch)]
if args.specs:
constraints = set(args.specs)
specs = [s for s in specs if any(s.satisfies(c) for c in constraints)]
specs = [s for s in specs if any(s.intersects(c) for c in constraints)]
if sys.stdout.isatty():
builds = len(specs)
tty.msg("%s." % plural(builds, "cached build"))

View File

@@ -20,9 +20,7 @@ def setup_parser(subparser):
help="name of the list to remove specs from",
)
subparser.add_argument(
"--match-spec",
dest="match_spec",
help="if name is ambiguous, supply a spec to match",
"--match-spec", dest="match_spec", help="if name is ambiguous, supply a spec to match"
)
subparser.add_argument(
"-a",

View File

@@ -530,39 +530,28 @@ def ci_rebuild(args):
if not verify_binaries:
install_args.append("--no-check-signature")
if cdash_handler:
# Add additional arguments to `spack install` for CDash reporting.
install_args.extend(cdash_handler.args())
slash_hash = "/{}".format(job_spec.dag_hash())
# Arguments when installing dependencies from cache
deps_install_args = install_args
# Arguments when installing the root from sources
root_install_args = install_args + [
"--keep-stage",
"--only=package",
"--use-buildcache=package:never,dependencies:only",
slash_hash,
]
if cdash_handler:
# Add additional arguments to `spack install` for CDash reporting.
root_install_args.extend(cdash_handler.args())
root_install_args.append(slash_hash)
# ["x", "y"] -> "'x' 'y'"
args_to_string = lambda args: " ".join("'{}'".format(arg) for arg in args)
commands = [
# apparently there's a race when spack bootstraps? do it up front once
[
SPACK_COMMAND,
"-e",
env.path,
"bootstrap",
"now",
],
[
SPACK_COMMAND,
"-e",
env.path,
"config",
"add",
"config:db_lock_timeout:120", # 2 minutes for processes to fight for a db lock
],
[SPACK_COMMAND, "-e", env.path, "bootstrap", "now"],
[
SPACK_COMMAND,
"-e",

View File

@@ -13,11 +13,7 @@
import llnl.util.filesystem as fs
import llnl.util.tty as tty
from llnl.util.argparsewriter import (
ArgparseCompletionWriter,
ArgparseRstWriter,
ArgparseWriter,
)
from llnl.util.argparsewriter import ArgparseCompletionWriter, ArgparseRstWriter, ArgparseWriter
from llnl.util.tty.colify import colify
import spack.cmd
@@ -42,7 +38,7 @@
"format": "bash",
"header": os.path.join(spack.paths.share_path, "bash", "spack-completion.in"),
"update": os.path.join(spack.paths.share_path, "spack-completion.bash"),
},
}
}

View File

@@ -12,7 +12,11 @@
import spack.build_environment as build_environment
import spack.cmd
import spack.cmd.common.arguments as arguments
import spack.error
import spack.paths
import spack.spec
import spack.store
from spack import traverse
from spack.util.environment import dump_environment, pickle_environment
@@ -38,6 +42,41 @@ def setup_parser(subparser):
)
class AreDepsInstalledVisitor:
def __init__(self, context="build"):
if context not in ("build", "test"):
raise ValueError("context can only be build or test")
if context == "build":
self.direct_deps = ("build", "link", "run")
else:
self.direct_deps = ("build", "test", "link", "run")
self.has_uninstalled_deps = False
def accept(self, item):
# The root may be installed or uninstalled.
if item.depth == 0:
return True
# Early exit after we've seen an uninstalled dep.
if self.has_uninstalled_deps:
return False
spec = item.edge.spec
if not spec.external and not spec.installed:
self.has_uninstalled_deps = True
return False
return True
def neighbors(self, item):
# Direct deps: follow build & test edges.
# Transitive deps: follow link / run.
deptypes = self.direct_deps if item.depth == 0 else ("link", "run")
return item.edge.spec.edges_to_dependencies(deptype=deptypes)
def emulate_env_utility(cmd_name, context, args):
if not args.spec:
tty.die("spack %s requires a spec." % cmd_name)
@@ -65,6 +104,27 @@ def emulate_env_utility(cmd_name, context, args):
spec = spack.cmd.matching_spec_from_env(spec)
# Require that dependencies are installed.
visitor = AreDepsInstalledVisitor(context=context)
# Mass install check needs read transaction.
with spack.store.db.read_transaction():
traverse.traverse_breadth_first_with_visitor([spec], traverse.CoverNodesVisitor(visitor))
if visitor.has_uninstalled_deps:
raise spack.error.SpackError(
f"Not all dependencies of {spec.name} are installed. "
f"Cannot setup {context} environment:",
spec.tree(
status_fn=spack.spec.Spec.install_status,
hashlen=7,
hashes=True,
# This shows more than necessary, but we cannot dynamically change deptypes
# in Spec.tree(...).
deptypes="all" if context == "build" else ("build", "test", "link", "run"),
),
)
build_environment.setup_package(spec.package, args.dirty, context)
if args.dump:

View File

@@ -408,13 +408,7 @@ def config_prefer_upstream(args):
pkgs = {}
for spec in pref_specs:
# Collect all the upstream compilers and versions for this package.
pkg = pkgs.get(
spec.name,
{
"version": [],
"compiler": [],
},
)
pkg = pkgs.get(spec.name, {"version": [], "compiler": []})
pkgs[spec.name] = pkg
# We have no existing variant if this is our first added version.

View File

@@ -16,19 +16,10 @@
import spack.stage
import spack.util.web
from spack.spec import Spec
from spack.url import (
UndetectableNameError,
UndetectableVersionError,
parse_name,
parse_version,
)
from spack.url import UndetectableNameError, UndetectableVersionError, parse_name, parse_version
from spack.util.editor import editor
from spack.util.executable import ProcessError, which
from spack.util.naming import (
mod_to_class,
simplify_name,
valid_fully_qualified_module_name,
)
from spack.util.naming import mod_to_class, simplify_name, valid_fully_qualified_module_name
description = "create a new package file"
section = "packaging"

View File

@@ -96,8 +96,5 @@ def report(args):
def debug(parser, args):
action = {
"create-db-tarball": create_db_tarball,
"report": report,
}
action = {"create-db-tarball": create_db_tarball, "report": report}
action[args.debug_command](args)

View File

@@ -33,12 +33,7 @@
level = "long"
# Arguments for display_specs when we find ambiguity
display_args = {
"long": True,
"show_flags": True,
"variants": True,
"indent": 4,
}
display_args = {"long": True, "show_flags": True, "variants": True, "indent": 4}
def setup_parser(sp):

View File

@@ -80,22 +80,12 @@ def compare_specs(a, b, to_string=False, color=None):
# specs and to descend into dependency hashes so we include all facts.
a_facts = set(
shift(func)
for func in setup.spec_clauses(
a,
body=True,
expand_hashes=True,
concrete_build_deps=True,
)
for func in setup.spec_clauses(a, body=True, expand_hashes=True, concrete_build_deps=True)
if func.name == "attr"
)
b_facts = set(
shift(func)
for func in setup.spec_clauses(
b,
body=True,
expand_hashes=True,
concrete_build_deps=True,
)
for func in setup.spec_clauses(b, body=True, expand_hashes=True, concrete_build_deps=True)
if func.name == "attr"
)

View File

@@ -148,8 +148,7 @@ def env_activate(args):
if not args.shell:
spack.cmd.common.shell_init_instructions(
"spack env activate",
" eval `spack env activate {sh_arg} [...]`",
"spack env activate", " eval `spack env activate {sh_arg} [...]`"
)
return 1
@@ -166,7 +165,7 @@ def env_activate(args):
short_name = os.path.basename(env_path)
ev.Environment(env).write(regenerate=False)
# Named environment
# Managed environment
elif ev.exists(env_name_or_dir) and not args.dir:
env_path = ev.root(env_name_or_dir)
short_name = env_name_or_dir
@@ -238,8 +237,7 @@ def env_deactivate_setup_parser(subparser):
def env_deactivate(args):
if not args.shell:
spack.cmd.common.shell_init_instructions(
"spack env deactivate",
" eval `spack env deactivate {sh_arg}`",
"spack env deactivate", " eval `spack env deactivate {sh_arg}`"
)
return 1

View File

@@ -38,11 +38,7 @@ def setup_parser(subparser):
default=False,
help="packages with detected externals won't be built with Spack",
)
find_parser.add_argument(
"--exclude",
action="append",
help="packages to exclude from search",
)
find_parser.add_argument("--exclude", action="append", help="packages to exclude from search")
find_parser.add_argument(
"-p",
"--path",
@@ -187,7 +183,6 @@ def external_read_cray_manifest(args):
def _collect_and_consume_cray_manifest_files(
manifest_file=None, manifest_directory=None, dry_run=False, fail_on_error=False
):
manifest_files = []
if manifest_file:
manifest_files.append(manifest_file)

View File

@@ -25,10 +25,7 @@ def setup_parser(subparser):
help="fetch only missing (not yet installed) dependencies",
)
subparser.add_argument(
"-D",
"--dependencies",
action="store_true",
help="also fetch all dependencies",
"-D", "--dependencies", action="store_true", help="also fetch all dependencies"
)
arguments.add_common_arguments(subparser, ["specs"])
subparser.epilog = (

View File

@@ -9,13 +9,7 @@
import spack.config
import spack.environment as ev
import spack.store
from spack.graph import (
DAGWithDependencyTypes,
SimpleDAG,
graph_ascii,
graph_dot,
static_graph_dot,
)
from spack.graph import DAGWithDependencyTypes, SimpleDAG, graph_ascii, graph_dot, static_graph_dot
description = "generate graphs of package dependency relationships"
section = "basic"

View File

@@ -39,19 +39,14 @@
compiler flags:
@g{cflags="flags"} cppflags, cflags, cxxflags,
fflags, ldflags, ldlibs
@g{cflags=="flags"} propagate flags to package dependencies
cppflags, cflags, cxxflags, fflags,
ldflags, ldlibs
@g{==} propagate flags to package dependencies
variants:
@B{+variant} enable <variant>
@B{++variant} propagate enable <variant>
@r{-variant} or @r{~variant} disable <variant>
@r{--variant} or @r{~~variant} propagate disable <variant>
@B{variant=value} set non-boolean <variant> to <value>
@B{variant==value} propagate non-boolean <variant> to <value>
@B{variant=value1,value2,value3} set multi-value <variant> values
@B{variant==value1,value2,value3} propagate multi-value <variant> values
@B{++}, @r{--}, @r{~~}, @B{==} propagate variants to package dependencies
architecture variants:
@m{platform=platform} linux, darwin, cray, etc.
@@ -87,9 +82,7 @@
"""
guides = {
"spec": spec_guide,
}
guides = {"spec": spec_guide}
def setup_parser(subparser):

View File

@@ -283,7 +283,7 @@ def print_tests(pkg):
c_names = ("gcc", "intel", "intel-parallel-studio", "pgi")
if pkg.name in c_names:
v_names.extend(["c", "cxx", "fortran"])
if pkg.spec.satisfies("llvm+clang"):
if pkg.spec.intersects("llvm+clang"):
v_names.extend(["c", "cxx"])
# TODO Refactor END

View File

@@ -496,9 +496,7 @@ def reporter_factory(specs):
return None
context_manager = spack.report.build_context_manager(
reporter=args.reporter(),
filename=report_filename(args, specs=specs),
specs=specs,
reporter=args.reporter(), filename=report_filename(args, specs=specs), specs=specs
)
return context_manager

View File

@@ -58,10 +58,7 @@
#: licensed files that can have LGPL language in them
#: so far, just this command -- so it can find LGPL things elsewhere
lgpl_exceptions = [
r"lib/spack/spack/cmd/license.py",
r"lib/spack/spack/test/cmd/license.py",
]
lgpl_exceptions = [r"lib/spack/spack/cmd/license.py", r"lib/spack/spack/test/cmd/license.py"]
def _all_spack_files(root=spack.paths.prefix):
@@ -129,7 +126,6 @@ def error_messages(self):
def _check_license(lines, path):
found = []
for line in lines:

View File

@@ -98,8 +98,7 @@ def load(parser, args):
if not args.shell:
specs_str = " ".join(args.constraint) or "SPECS"
spack.cmd.common.shell_init_instructions(
"spack load",
" eval `spack load {sh_arg} %s`" % specs_str,
"spack load", " eval `spack load {sh_arg} %s`" % specs_str
)
return 1

View File

@@ -95,7 +95,7 @@ def location(parser, args):
spack.cmd.require_active_env("location -e")
path = ev.active_environment().path
else:
# Get named environment path
# Get path of requested environment
if not ev.exists(args.location_env):
tty.die("no such environment: '%s'" % args.location_env)
path = ev.root(args.location_env)

View File

@@ -27,12 +27,7 @@
"""
# Arguments for display_specs when we find ambiguity
display_args = {
"long": True,
"show_flags": False,
"variants": False,
"indent": 4,
}
display_args = {"long": True, "show_flags": False, "variants": False, "indent": 4}
def setup_parser(subparser):

View File

@@ -335,7 +335,7 @@ def not_excluded_fn(args):
exclude_specs.extend(spack.cmd.parse_specs(str(args.exclude_specs).split()))
def not_excluded(x):
return not any(x.satisfies(y, strict=True) for y in exclude_specs)
return not any(x.satisfies(y) for y in exclude_specs)
return not_excluded
@@ -445,9 +445,7 @@ def mirror_create(args):
mirror_specs = concrete_specs_from_user(args)
create_mirror_for_individual_specs(
mirror_specs,
path=path,
skip_unstable_versions=args.skip_unstable_versions,
mirror_specs, path=path, skip_unstable_versions=args.skip_unstable_versions
)
@@ -467,9 +465,7 @@ def create_mirror_for_all_specs(path, skip_unstable_versions, selection_fn):
def create_mirror_for_all_specs_inside_environment(path, skip_unstable_versions, selection_fn):
mirror_specs = concrete_specs_from_environment(selection_fn=selection_fn)
create_mirror_for_individual_specs(
mirror_specs,
path=path,
skip_unstable_versions=skip_unstable_versions,
mirror_specs, path=path, skip_unstable_versions=skip_unstable_versions
)

View File

@@ -180,10 +180,7 @@ def loads(module_type, specs, args, out=None):
for spec in specs
)
module_commands = {
"tcl": "module load ",
"lmod": "module load ",
}
module_commands = {"tcl": "module load ", "lmod": "module load "}
d = {"command": "" if not args.shell else module_commands[module_type], "prefix": args.prefix}
@@ -368,18 +365,14 @@ def refresh(module_type, specs, args):
def modules_cmd(parser, args, module_type, callbacks=callbacks):
# Qualifiers to be used when querying the db for specs
constraint_qualifiers = {
"refresh": {"installed": True, "known": True},
}
constraint_qualifiers = {"refresh": {"installed": True, "known": True}}
query_args = constraint_qualifiers.get(args.subparser_name, {})
# Get the specs that match the query from the DB
specs = args.specs(**query_args)
try:
callbacks[args.subparser_name](module_type, specs, args)
except MultipleSpecsMatch:

View File

@@ -182,11 +182,7 @@ def solve(parser, args):
# set up solver parameters
# Note: reuse and other concretizer prefs are passed as configuration
result = solver.solve(
specs,
out=output,
timers=args.timers,
stats=args.stats,
setup_only=setup_only,
specs, out=output, timers=args.timers, stats=args.stats, setup_only=setup_only
)
if not setup_only:
_process_result(result, show, required_format, kwargs)

View File

@@ -110,7 +110,7 @@ def spec(parser, args):
else:
tty.die("spack spec requires at least one spec or an active environment")
for (input, output) in specs:
for input, output in specs:
# With -y, just print YAML to output.
if args.format:
if args.format == "yaml":

View File

@@ -30,20 +30,13 @@ def grouper(iterable, n, fillvalue=None):
#: List of directories to exclude from checks -- relative to spack root
exclude_directories = [
os.path.relpath(spack.paths.external_path, spack.paths.prefix),
]
exclude_directories = [os.path.relpath(spack.paths.external_path, spack.paths.prefix)]
#: Order in which tools should be run. flake8 is last so that it can
#: double-check the results of other tools (if, e.g., --fix was provided)
#: The list maps an executable name to a method to ensure the tool is
#: bootstrapped or present in the environment.
tool_names = [
"isort",
"black",
"flake8",
"mypy",
]
tool_names = ["isort", "black", "flake8", "mypy"]
#: tools we run in spack style
tools = {}
@@ -52,7 +45,7 @@ def grouper(iterable, n, fillvalue=None):
mypy_ignores = [
# same as `disable_error_code = "annotation-unchecked"` in pyproject.toml, which
# doesn't exist in mypy 0.971 for Python 3.6
"[annotation-unchecked]",
"[annotation-unchecked]"
]
@@ -150,10 +143,7 @@ def setup_parser(subparser):
help="branch to compare against to determine changed files (default: develop)",
)
subparser.add_argument(
"-a",
"--all",
action="store_true",
help="check all files, not just changed files",
"-a", "--all", action="store_true", help="check all files, not just changed files"
)
subparser.add_argument(
"-r",
@@ -178,10 +168,7 @@ def setup_parser(subparser):
help="format automatically if possible (e.g., with isort, black)",
)
subparser.add_argument(
"--root",
action="store",
default=None,
help="style check a different spack instance",
"--root", action="store", default=None, help="style check a different spack instance"
)
tool_group = subparser.add_mutually_exclusive_group()
@@ -211,6 +198,7 @@ def rewrite_and_print_output(
output, args, re_obj=re.compile(r"^(.+):([0-9]+):"), replacement=r"{0}:{1}:"
):
"""rewrite ouput with <file>:<line>: format to respect path args"""
# print results relative to current working directory
def translate(match):
return replacement.format(cwd_relative(match.group(1), args), *list(match.groups()[1:]))
@@ -281,24 +269,10 @@ def run_mypy(mypy_cmd, file_list, args):
os.path.join(spack.paths.prefix, "pyproject.toml"),
"--show-error-codes",
]
mypy_arg_sets = [
common_mypy_args
+ [
"--package",
"spack",
"--package",
"llnl",
]
]
mypy_arg_sets = [common_mypy_args + ["--package", "spack", "--package", "llnl"]]
if "SPACK_MYPY_CHECK_PACKAGES" in os.environ:
mypy_arg_sets.append(
common_mypy_args
+ [
"--package",
"packages",
"--disable-error-code",
"no-redef",
]
common_mypy_args + ["--package", "packages", "--disable-error-code", "no-redef"]
)
returncode = 0

View File

@@ -33,9 +33,7 @@ def setup_parser(subparser):
# Run
run_parser = sp.add_parser(
"run",
description=test_run.__doc__,
help=spack.cmd.first_line(test_run.__doc__),
"run", description=test_run.__doc__, help=spack.cmd.first_line(test_run.__doc__)
)
alias_help_msg = "Provide an alias for this test-suite"
@@ -80,9 +78,7 @@ def setup_parser(subparser):
# List
list_parser = sp.add_parser(
"list",
description=test_list.__doc__,
help=spack.cmd.first_line(test_list.__doc__),
"list", description=test_list.__doc__, help=spack.cmd.first_line(test_list.__doc__)
)
list_parser.add_argument(
"-a",
@@ -96,9 +92,7 @@ def setup_parser(subparser):
# Find
find_parser = sp.add_parser(
"find",
description=test_find.__doc__,
help=spack.cmd.first_line(test_find.__doc__),
"find", description=test_find.__doc__, help=spack.cmd.first_line(test_find.__doc__)
)
find_parser.add_argument(
"filter",
@@ -108,9 +102,7 @@ def setup_parser(subparser):
# Status
status_parser = sp.add_parser(
"status",
description=test_status.__doc__,
help=spack.cmd.first_line(test_status.__doc__),
"status", description=test_status.__doc__, help=spack.cmd.first_line(test_status.__doc__)
)
status_parser.add_argument(
"names", nargs=argparse.REMAINDER, help="Test suites for which to print status"
@@ -147,9 +139,7 @@ def setup_parser(subparser):
# Remove
remove_parser = sp.add_parser(
"remove",
description=test_remove.__doc__,
help=spack.cmd.first_line(test_remove.__doc__),
"remove", description=test_remove.__doc__, help=spack.cmd.first_line(test_remove.__doc__)
)
arguments.add_common_arguments(remove_parser, ["yes_to_all"])
remove_parser.add_argument(
@@ -189,11 +179,7 @@ def test_run(args):
specs = spack.cmd.parse_specs(args.specs) if args.specs else [None]
specs_to_test = []
for spec in specs:
matching = spack.store.db.query_local(
spec,
hashes=hashes,
explicit=explicit,
)
matching = spack.store.db.query_local(spec, hashes=hashes, explicit=explicit)
if spec and not matching:
tty.warn("No {0}installed packages match spec {1}".format(explicit_str, spec))
"""
@@ -228,14 +214,7 @@ def test_run(args):
def report_filename(args, test_suite):
if args.log_file:
if os.path.isabs(args.log_file):
return args.log_file
else:
log_dir = os.getcwd()
return os.path.join(log_dir, args.log_file)
else:
return os.path.join(os.getcwd(), "test-%s" % test_suite.name)
return os.path.abspath(args.log_file or "test-{}".format(test_suite.name))
def create_reporter(args, specs_to_test, test_suite):

View File

@@ -5,7 +5,7 @@
import spack.cmd.common.env_utility as env_utility
description = (
"run a command in a spec's test environment, " "or dump its environment to screen or file"
"run a command in a spec's test environment, or dump its environment to screen or file"
)
section = "admin"
level = "long"

View File

@@ -31,12 +31,7 @@
"""
# Arguments for display_specs when we find ambiguity
display_args = {
"long": True,
"show_flags": False,
"variants": False,
"indent": 4,
}
display_args = {"long": True, "show_flags": False, "variants": False, "indent": 4}
def setup_parser(subparser):
@@ -133,7 +128,7 @@ def find_matching_specs(env, specs, allow_multiple_matches=False, force=False, o
return specs_from_cli
def installed_dependents(specs, env):
def installed_runtime_dependents(specs, env):
"""Map each spec to a list of its installed dependents.
Args:
@@ -160,10 +155,10 @@ def installed_dependents(specs, env):
for spec in specs:
for dpt in traverse.traverse_nodes(
spec.dependents(deptype="all"),
spec.dependents(deptype=("link", "run")),
direction="parents",
visited=visited,
deptype="all",
deptype=("link", "run"),
root=True,
key=lambda s: s.dag_hash(),
):
@@ -236,12 +231,7 @@ def do_uninstall(specs, force=False):
hashes_to_remove = set(s.dag_hash() for s in specs)
for s in traverse.traverse_nodes(
specs,
order="topo",
direction="children",
root=True,
cover="nodes",
deptype="all",
specs, order="topo", direction="children", root=True, cover="nodes", deptype="all"
):
if s.dag_hash() in hashes_to_remove:
spack.package_base.PackageBase.uninstall_by_spec(s, force=force)
@@ -265,7 +255,7 @@ def get_uninstall_list(args, specs, env):
# args.all takes care of the case where '-a' is given in the cli
base_uninstall_specs = set(find_matching_specs(env, specs, args.all, args.force))
active_dpts, outside_dpts = installed_dependents(base_uninstall_specs, env)
active_dpts, outside_dpts = installed_runtime_dependents(base_uninstall_specs, env)
# It will be useful to track the unified set of specs with dependents, as
# well as to separately track specs in the current env with dependents
spec_to_dpts = {}

View File

@@ -26,7 +26,6 @@
description = "run spack's unit tests (wrapper around pytest)"
section = "developer"
level = "long"
is_windows = sys.platform == "win32"
def setup_parser(subparser):
@@ -212,7 +211,7 @@ def unit_test(parser, args, unknown_args):
# mock configuration used by unit tests
# Note: skip on windows here because for the moment,
# clingo is wholly unsupported from bootstrap
if not is_windows:
if sys.platform != "win32":
with spack.bootstrap.ensure_bootstrap_configuration():
spack.bootstrap.ensure_core_dependencies()
if pytest is None:

View File

@@ -77,8 +77,7 @@ def unload(parser, args):
specs_str = " ".join(args.specs) or "SPECS"
spack.cmd.common.shell_init_instructions(
"spack unload",
" eval `spack unload {sh_arg}` %s" % specs_str,
"spack unload", " eval `spack unload {sh_arg}` %s" % specs_str
)
return 1

View File

@@ -106,12 +106,7 @@ def setup_parser(subparser):
def url(parser, args):
action = {
"parse": url_parse,
"list": url_list,
"summary": url_summary,
"stats": url_stats,
}
action = {"parse": url_parse, "list": url_list, "summary": url_summary, "stats": url_stats}
action[args.subcommand](args)

View File

@@ -28,8 +28,6 @@
__all__ = ["Compiler"]
is_windows = sys.platform == "win32"
@llnl.util.lang.memoized
def _get_compiler_version_output(compiler_path, version_arg, ignore_errors=()):
@@ -598,7 +596,7 @@ def search_regexps(cls, language):
suffixes = [""]
# Windows compilers generally have an extension of some sort
# as do most files on Windows, handle that case here
if is_windows:
if sys.platform == "win32":
ext = r"\.(?:exe|bat)"
cls_suf = [suf + ext for suf in cls.suffixes]
ext_suf = [ext]

View File

@@ -84,7 +84,7 @@ def _to_dict(compiler):
d = {}
d["spec"] = str(compiler.spec)
d["paths"] = dict((attr, getattr(compiler, attr, None)) for attr in _path_instance_vars)
d["flags"] = dict((fname, fvals) for fname, fvals in compiler.flags)
d["flags"] = dict((fname, " ".join(fvals)) for fname, fvals in compiler.flags.items())
d["flags"].update(
dict(
(attr, getattr(compiler, attr, None))
@@ -619,11 +619,9 @@ def _default(search_paths):
command_arguments = []
files_to_be_tested = fs.files_in(*search_paths)
for compiler_name in spack.compilers.supported_compilers():
compiler_cls = class_for_compiler_name(compiler_name)
for language in ("cc", "cxx", "f77", "fc"):
# Select only the files matching a regexp
for (file, full_path), regexp in itertools.product(
files_to_be_tested, compiler_cls.search_regexps(language)

View File

@@ -36,36 +36,89 @@ def extract_version_from_output(cls, output):
ver = match.group(match.lastindex)
return ver
# C++ flags based on CMake Modules/Compiler/AppleClang-CXX.cmake
@property
def cxx11_flag(self):
# Adapted from CMake's AppleClang-CXX rules
# Spack's AppleClang detection only valid from Xcode >= 4.6
if self.real_version < spack.version.ver("4.0.0"):
if self.real_version < spack.version.ver("4.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C++11 standard", "cxx11_flag", "Xcode < 4.0.0"
self, "the C++11 standard", "cxx11_flag", "Xcode < 4.0"
)
return "-std=c++11"
@property
def cxx14_flag(self):
# Adapted from CMake's rules for AppleClang
if self.real_version < spack.version.ver("5.1.0"):
if self.real_version < spack.version.ver("5.1"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C++14 standard", "cxx14_flag", "Xcode < 5.1.0"
self, "the C++14 standard", "cxx14_flag", "Xcode < 5.1"
)
elif self.real_version < spack.version.ver("6.1.0"):
elif self.real_version < spack.version.ver("6.1"):
return "-std=c++1y"
return "-std=c++14"
@property
def cxx17_flag(self):
# Adapted from CMake's rules for AppleClang
if self.real_version < spack.version.ver("6.1.0"):
if self.real_version < spack.version.ver("6.1"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C++17 standard", "cxx17_flag", "Xcode < 6.1.0"
self, "the C++17 standard", "cxx17_flag", "Xcode < 6.1"
)
return "-std=c++1z"
elif self.real_version < spack.version.ver("10.0"):
return "-std=c++1z"
return "-std=c++17"
@property
def cxx20_flag(self):
if self.real_version < spack.version.ver("10.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C++20 standard", "cxx20_flag", "Xcode < 10.0"
)
elif self.real_version < spack.version.ver("13.0"):
return "-std=c++2a"
return "-std=c++20"
@property
def cxx23_flag(self):
if self.real_version < spack.version.ver("13.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C++23 standard", "cxx23_flag", "Xcode < 13.0"
)
return "-std=c++2b"
# C flags based on CMake Modules/Compiler/AppleClang-C.cmake
@property
def c99_flag(self):
if self.real_version < spack.version.ver("4.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C99 standard", "c99_flag", "< 4.0"
)
return "-std=c99"
@property
def c11_flag(self):
if self.real_version < spack.version.ver("4.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C11 standard", "c11_flag", "< 4.0"
)
return "-std=c11"
@property
def c17_flag(self):
if self.real_version < spack.version.ver("11.0"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C17 standard", "c17_flag", "< 11.0"
)
return "-std=c17"
@property
def c23_flag(self):
if self.real_version < spack.version.ver("11.0.3"):
raise spack.compiler.UnsupportedCompilerFlag(
self, "the C23 standard", "c23_flag", "< 11.0.3"
)
return "-std=c2x"
def setup_custom_environment(self, pkg, env):
"""Set the DEVELOPER_DIR environment for the Xcode toolchain.
@@ -154,10 +207,7 @@ def setup_custom_environment(self, pkg, env):
),
)
real_dirs = [
"Toolchains/XcodeDefault.xctoolchain/usr/bin",
"usr/bin",
]
real_dirs = ["Toolchains/XcodeDefault.xctoolchain/usr/bin", "usr/bin"]
bins = ["c++", "c89", "c99", "cc", "clang", "clang++", "cpp"]

View File

@@ -89,6 +89,11 @@ def cxx14_flag(self):
return "-std=c++14"
return "-h std=c++14"
@property
def cxx17_flag(self):
if self.is_clang_based:
return "-std=c++17"
@property
def c99_flag(self):
if self.is_clang_based:

View File

@@ -128,10 +128,23 @@ def c99_flag(self):
@property
def c11_flag(self):
if self.real_version < ver("6.1.0"):
raise UnsupportedCompilerFlag(self, "the C11 standard", "c11_flag", "< 6.1.0")
else:
return "-std=c11"
if self.real_version < ver("3.0"):
raise UnsupportedCompilerFlag(self, "the C11 standard", "c11_flag", "< 3.0")
if self.real_version < ver("3.1"):
return "-std=c1x"
return "-std=c11"
@property
def c17_flag(self):
if self.real_version < ver("6.0"):
raise UnsupportedCompilerFlag(self, "the C17 standard", "c17_flag", "< 6.0")
return "-std=c17"
@property
def c23_flag(self):
if self.real_version < ver("9.0"):
raise UnsupportedCompilerFlag(self, "the C23 standard", "c23_flag", "< 9.0")
return "-std=c2x"
@property
def cc_pic_flag(self):

View File

@@ -134,7 +134,7 @@ def _valid_virtuals_and_externals(self, spec):
externals = spec_externals(cspec)
for ext in externals:
if ext.satisfies(spec):
if ext.intersects(spec):
usable.append(ext)
# If nothing is in the usable list now, it's because we aren't
@@ -200,7 +200,7 @@ def concretize_version(self, spec):
# List of versions we could consider, in sorted order
pkg_versions = spec.package_class.versions
usable = [v for v in pkg_versions if any(v.satisfies(sv) for sv in spec.versions)]
usable = [v for v in pkg_versions if any(v.intersects(sv) for sv in spec.versions)]
yaml_prefs = PackagePrefs(spec.name, "version")
@@ -344,7 +344,7 @@ def concretize_architecture(self, spec):
new_target_arch = spack.spec.ArchSpec((None, None, str(new_target)))
curr_target_arch = spack.spec.ArchSpec((None, None, str(curr_target)))
if not new_target_arch.satisfies(curr_target_arch):
if not new_target_arch.intersects(curr_target_arch):
# new_target is an incorrect guess based on preferences
# and/or default
valid_target_ranges = str(curr_target).split(",")
@@ -743,9 +743,7 @@ def _concretize_specs_together_new(*abstract_specs, **kwargs):
import spack.solver.asp
solver = spack.solver.asp.Solver()
solver.tests = kwargs.get("tests", False)
result = solver.solve(abstract_specs)
result = solver.solve(abstract_specs, tests=kwargs.get("tests", False))
result.raise_if_unsat()
return [s.copy() for s in result.specs]

View File

@@ -793,7 +793,7 @@ def _config():
configuration_paths = [
# Default configuration scope is the lowest-level scope. These are
# versioned with Spack and can be overridden by systems, sites or users
configuration_defaults_path,
configuration_defaults_path
]
disable_local_config = "SPACK_DISABLE_LOCAL_CONFIG" in os.environ
@@ -801,15 +801,11 @@ def _config():
# System configuration is per machine.
# This is disabled if user asks for no local configuration.
if not disable_local_config:
configuration_paths.append(
("system", spack.paths.system_config_path),
)
configuration_paths.append(("system", spack.paths.system_config_path))
# Site configuration is per spack instance, for sites or projects
# No site-level configs should be checked into spack by default.
configuration_paths.append(
("site", os.path.join(spack.paths.etc_path)),
)
configuration_paths.append(("site", os.path.join(spack.paths.etc_path)))
# User configuration can override both spack defaults and site config
# This is disabled if user asks for no local configuration.

View File

@@ -18,10 +18,7 @@
#: packages here.
default_path = "/opt/cray/pe/cpe-descriptive-manifest/"
compiler_name_translation = {
"nvidia": "nvhpc",
"rocm": "rocmcc",
}
compiler_name_translation = {"nvidia": "nvhpc", "rocm": "rocmcc"}
def translated_compiler_name(manifest_compiler_name):

View File

@@ -46,10 +46,7 @@
import spack.store
import spack.util.lock as lk
import spack.util.spack_json as sjson
from spack.directory_layout import (
DirectoryLayoutError,
InconsistentInstallDirectoryError,
)
from spack.directory_layout import DirectoryLayoutError, InconsistentInstallDirectoryError
from spack.error import SpackError
from spack.util.crypto import bit_length
from spack.version import Version
@@ -108,10 +105,7 @@
def reader(version):
reader_cls = {
Version("5"): spack.spec.SpecfileV1,
Version("6"): spack.spec.SpecfileV3,
}
reader_cls = {Version("5"): spack.spec.SpecfileV1, Version("6"): spack.spec.SpecfileV3}
return reader_cls[version]
@@ -1531,7 +1525,7 @@ def _query(
if not (start_date < inst_date < end_date):
continue
if query_spec is any or rec.spec.satisfies(query_spec, strict=True):
if query_spec is any or rec.spec.satisfies(query_spec):
results.append(rec.spec)
return results

View File

@@ -29,7 +29,6 @@
import spack.util.spack_yaml
import spack.util.windows_registry
is_windows = sys.platform == "win32"
#: Information on a package that has been detected
DetectedPackage = collections.namedtuple("DetectedPackage", ["spec", "prefix"])
@@ -184,7 +183,7 @@ def library_prefix(library_dir):
elif "lib" in lowered_components:
idx = lowered_components.index("lib")
return os.sep.join(components[:idx])
elif is_windows and "bin" in lowered_components:
elif sys.platform == "win32" and "bin" in lowered_components:
idx = lowered_components.index("bin")
return os.sep.join(components[:idx])
else:
@@ -260,13 +259,13 @@ def find_windows_compiler_bundled_packages():
class WindowsKitExternalPaths(object):
if is_windows:
if sys.platform == "win32":
plat_major_ver = str(winOs.windows_version()[0])
@staticmethod
def find_windows_kit_roots():
"""Return Windows kit root, typically %programfiles%\\Windows Kits\\10|11\\"""
if not is_windows:
if sys.platform != "win32":
return []
program_files = os.environ["PROGRAMFILES(x86)"]
kit_base = os.path.join(
@@ -359,7 +358,7 @@ def compute_windows_program_path_for_package(pkg):
pkg (spack.package_base.PackageBase): package for which
Program Files location is to be computed
"""
if not is_windows:
if sys.platform != "win32":
return []
# note windows paths are fine here as this method should only ever be invoked
# to interact with Windows
@@ -377,8 +376,9 @@ def compute_windows_user_path_for_package(pkg):
install location, return list of potential locations based
on common heuristics. For more info on Windows user specific
installs see:
https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=netframework-4.8"""
if not is_windows:
https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=netframework-4.8
"""
if sys.platform != "win32":
return []
# Current user directory

View File

@@ -31,8 +31,6 @@
path_to_dict,
)
is_windows = sys.platform == "win32"
def common_windows_package_paths():
paths = WindowsCompilerExternalPaths.find_windows_compiler_bundled_packages()
@@ -57,7 +55,7 @@ def executables_in_path(path_hints):
path_hints (list): list of paths to be searched. If None the list will be
constructed based on the PATH environment variable.
"""
if is_windows:
if sys.platform == "win32":
path_hints.extend(common_windows_package_paths())
search_paths = llnl.util.filesystem.search_paths_for_executables(*path_hints)
return path_to_dict(search_paths)
@@ -149,7 +147,7 @@ def by_library(packages_to_check, path_hints=None):
path_to_lib_name = (
libraries_in_ld_and_system_library_path(path_hints=path_hints)
if not is_windows
if sys.platform != "win32"
else libraries_in_windows_paths(path_hints)
)

View File

@@ -21,7 +21,6 @@
import spack.util.spack_json as sjson
from spack.error import SpackError
is_windows = sys.platform == "win32"
# Note: Posixpath is used here as opposed to
# os.path.join due to spack.spec.Spec.format
# requiring forward slash path seperators at this stage
@@ -346,7 +345,7 @@ def remove_install_directory(self, spec, deprecated=False):
# Windows readonly files cannot be removed by Python
# directly, change permissions before attempting to remove
if is_windows:
if sys.platform == "win32":
kwargs = {
"ignore_errors": False,
"onerror": fs.readonly_file_handler(ignore_errors=False),

View File

@@ -18,7 +18,9 @@
import llnl.util.filesystem as fs
import llnl.util.tty as tty
import llnl.util.tty.color as clr
from llnl.util.lang import dedupe
from llnl.util.link_tree import ConflictingSpecsError
from llnl.util.symlink import symlink
import spack.compilers
@@ -45,11 +47,7 @@
import spack.util.spack_json as sjson
import spack.util.spack_yaml as syaml
import spack.util.url
from spack.filesystem_view import (
SimpleFilesystemView,
inverse_view_func_parser,
view_func_parser,
)
from spack.filesystem_view import SimpleFilesystemView, inverse_view_func_parser, view_func_parser
from spack.installer import PackageInstaller
from spack.spec import Spec
from spack.spec_list import InvalidSpecConstraintError, SpecList
@@ -64,8 +62,8 @@
_active_environment = None
#: path where environments are stored in the spack tree
env_path = os.path.join(spack.paths.var_path, "environments")
#: default path where environments are stored in the spack tree
default_env_path = os.path.join(spack.paths.var_path, "environments")
#: Name of the input yaml file for an environment
@@ -80,6 +78,26 @@
env_subdir_name = ".spack-env"
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)
)
def check_disallowed_env_config_mods(scopes):
for scope in scopes:
with spack.config.use_configuration(scope):
if spack.config.get("config:environments_root"):
raise SpackEnvironmentError(
"Spack environments are prohibited from modifying 'config:environments_root' "
"because it can make the definition of the environment ill-posed. Please "
"remove from your environment and place it in a permanent scope such as "
"defaults, system, site, etc."
)
return scopes
def default_manifest_yaml():
"""default spack.yaml file to put in new environments"""
return """\
@@ -216,7 +234,7 @@ def active_environment():
def _root(name):
"""Non-validating version of root(), to be used internally."""
return os.path.join(env_path, name)
return os.path.join(env_root_path(), name)
def root(name):
@@ -251,10 +269,12 @@ def read(name):
def create(name, init_file=None, with_view=None, keep_relative=False):
"""Create a named environment in Spack."""
"""Create a managed environment in Spack."""
if not os.path.isdir(env_root_path()):
fs.mkdirp(env_root_path())
validate_env_name(name)
if exists(name):
raise SpackEnvironmentError("'%s': environment already exists" % name)
raise SpackEnvironmentError("'%s': environment already exists at %s" % (name, root(name)))
return Environment(root(name), init_file, with_view, keep_relative)
@@ -268,10 +288,10 @@ def all_environment_names():
"""List the names of environments that currently exist."""
# just return empty if the env path does not exist. A read-only
# operation like list should not try to create a directory.
if not os.path.exists(env_path):
if not os.path.exists(env_root_path()):
return []
candidates = sorted(os.listdir(env_path))
candidates = sorted(os.listdir(env_root_path()))
names = []
for candidate in candidates:
yaml_path = os.path.join(_root(candidate), manifest_name)
@@ -281,7 +301,7 @@ def all_environment_names():
def all_environments():
"""Generator for all named Environments."""
"""Generator for all managed Environments."""
for name in all_environment_names():
yield read(name)
@@ -304,12 +324,7 @@ def _write_yaml(data, str_or_file):
def _eval_conditional(string):
"""Evaluate conditional definitions using restricted variable scope."""
valid_variables = spack.util.environment.get_host_environment()
valid_variables.update(
{
"re": re,
"env": os.environ,
}
)
valid_variables.update({"re": re, "env": os.environ})
return eval(string, valid_variables)
@@ -334,7 +349,8 @@ def _is_dev_spec_and_has_changed(spec):
def _spec_needs_overwrite(spec, changed_dev_specs):
"""Check whether the current spec needs to be overwritten because either it has
changed itself or one of its dependencies have changed"""
changed itself or one of its dependencies have changed
"""
# if it's not installed, we don't need to overwrite it
if not spec.installed:
return False
@@ -612,7 +628,24 @@ def regenerate(self, concretized_root_specs):
os.unlink(tmp_symlink_name)
except (IOError, OSError):
pass
raise e
# Give an informative error message for the typical error case: two specs, same package
# project to same prefix.
if isinstance(e, ConflictingSpecsError):
spec_a = e.args[0].format(color=clr.get_color_when())
spec_b = e.args[1].format(color=clr.get_color_when())
raise SpackEnvironmentViewError(
f"The environment view in {self.root} could not be created, "
"because the following two specs project to the same prefix:\n"
f" {spec_a}, and\n"
f" {spec_b}.\n"
" To resolve this issue:\n"
" a. use `concretization:unify:true` to ensure there is only one "
"package per spec in the environment, or\n"
" b. disable views with `view:false`, or\n"
" c. create custom view projections."
) from e
raise
# Remove the old root when it's in the same folder as the new root. This guards
# against removal of an arbitrary path when the original symlink in self.root
@@ -849,14 +882,14 @@ def clear(self, re_read=False):
@property
def internal(self):
"""Whether this environment is managed by Spack."""
return self.path.startswith(env_path)
return self.path.startswith(env_root_path())
@property
def name(self):
"""Human-readable representation of the environment.
This is the path for directory environments, and just the name
for named environments.
for managed environments.
"""
if self.internal:
return os.path.basename(self.path)
@@ -973,9 +1006,7 @@ def included_config_scopes(self):
config_path = os.path.join(config_path, basename)
else:
staged_path = spack.config.fetch_remote_configs(
config_path,
self.config_stage_dir,
skip_existing=True,
config_path, self.config_stage_dir, skip_existing=True
)
if not staged_path:
raise SpackEnvironmentError(
@@ -1036,7 +1067,9 @@ def env_file_config_scope(self):
def config_scopes(self):
"""A list of all configuration scopes for this environment."""
return self.included_config_scopes() + [self.env_file_config_scope()]
return check_disallowed_env_config_mods(
self.included_config_scopes() + [self.env_file_config_scope()]
)
def destroy(self):
"""Remove this environment from Spack entirely."""
@@ -2281,7 +2314,7 @@ def _concretize_from_constraints(spec_constraints, tests=False):
invalid_deps = [
c
for c in spec_constraints
if any(c.satisfies(invd, strict=True) for invd in invalid_deps_string)
if any(c.satisfies(invd) for invd in invalid_deps_string)
]
if len(invalid_deps) != len(invalid_deps_string):
raise e

View File

@@ -28,20 +28,13 @@
import os.path
import re
import shutil
import sys
import urllib.parse
from typing import List, Optional
import llnl.util
import llnl.util.filesystem as fs
import llnl.util.tty as tty
from llnl.util.filesystem import (
get_single_file,
mkdirp,
temp_cwd,
temp_rename,
working_dir,
)
from llnl.util.filesystem import get_single_file, mkdirp, temp_cwd, temp_rename, working_dir
from llnl.util.symlink import symlink
import spack.config
@@ -59,7 +52,6 @@
#: List of all fetch strategies, created by FetchStrategy metaclass.
all_strategies = []
is_windows = sys.platform == "win32"
CONTENT_TYPE_MISMATCH_WARNING_TEMPLATE = (
"The contents of {subject} look like {content_type}. Either the URL"
@@ -95,22 +87,6 @@ def _ensure_one_stage_entry(stage_path):
return os.path.join(stage_path, stage_entries[0])
def _filesummary(path, print_bytes=16):
try:
n = print_bytes
with open(path, "rb") as f:
size = os.fstat(f.fileno()).st_size
if size <= 2 * n:
short_contents = f.read(2 * n)
else:
short_contents = f.read(n)
f.seek(-n, 2)
short_contents += b"..." + f.read(n)
return size, short_contents
except OSError:
return 0, b""
def fetcher(cls):
"""Decorator used to register fetch strategies."""
all_strategies.append(cls)
@@ -519,7 +495,7 @@ def check(self):
# On failure, provide some information about the file size and
# contents, so that we can quickly see what the issue is (redirect
# was not followed, empty file, text instead of binary, ...)
size, contents = _filesummary(self.archive_file)
size, contents = fs.filesummary(self.archive_file)
raise ChecksumError(
f"{checker.hash_name} checksum failed for {self.archive_file}",
f"Expected {self.digest} but got {checker.sum}. "
@@ -1525,7 +1501,7 @@ def _from_merged_attrs(fetcher, pkg, version):
return fetcher(**attrs)
def for_package_version(pkg, version):
def for_package_version(pkg, version=None):
"""Determine a fetch strategy based on the arguments supplied to
version() in the package description."""
@@ -1536,8 +1512,18 @@ def for_package_version(pkg, version):
check_pkg_attributes(pkg)
if not isinstance(version, spack.version.VersionBase):
version = spack.version.Version(version)
if version is not None:
assert not pkg.spec.concrete, "concrete specs should not pass the 'version=' argument"
# Specs are initialized with the universe range, if no version information is given,
# so here we make sure we always match the version passed as argument
if not isinstance(version, spack.version.VersionBase):
version = spack.version.Version(version)
version_list = spack.version.VersionList()
version_list.add(version)
pkg.spec.versions = version_list
else:
version = pkg.version
# if it's a commit, we must use a GitFetchStrategy
if isinstance(version, spack.version.GitVersion):
@@ -1555,11 +1541,7 @@ def for_package_version(pkg, version):
# performance hit for branches on older versions of git.
# Branches cannot be cached, so we tell the fetcher not to cache tags/branches
ref_type = "commit" if version.is_commit else "tag"
kwargs = {
"git": pkg.git,
ref_type: version.ref,
"no_cache": True,
}
kwargs = {"git": pkg.git, ref_type: version.ref, "no_cache": True}
kwargs["submodules"] = getattr(pkg, "submodules", False)

View File

@@ -20,6 +20,7 @@
)
from llnl.util.lang import index_by, match_predicate
from llnl.util.link_tree import (
ConflictingSpecsError,
DestinationMergeVisitor,
LinkTree,
MergeConflictSummary,
@@ -638,6 +639,22 @@ class SimpleFilesystemView(FilesystemView):
def __init__(self, root, layout, **kwargs):
super(SimpleFilesystemView, self).__init__(root, layout, **kwargs)
def _sanity_check_view_projection(self, specs):
"""A very common issue is that we end up with two specs of the same
package, that project to the same prefix. We want to catch that as
early as possible and give a sensible error to the user. Here we use
the metadata dir (.spack) projection as a quick test to see whether
two specs in the view are going to clash. The metadata dir is used
because it's always added by Spack with identical files, so a
guaranteed clash that's easily verified."""
seen = dict()
for current_spec in specs:
metadata_dir = self.relative_metadata_dir_for_spec(current_spec)
conflicting_spec = seen.get(metadata_dir)
if conflicting_spec:
raise ConflictingSpecsError(current_spec, conflicting_spec)
seen[metadata_dir] = current_spec
def add_specs(self, *specs, **kwargs):
assert all((s.concrete for s in specs))
if len(specs) == 0:
@@ -652,6 +669,8 @@ def add_specs(self, *specs, **kwargs):
if kwargs.get("exclude", None):
specs = set(filter_exclude(specs, kwargs["exclude"]))
self._sanity_check_view_projection(specs)
# Ignore spack meta data folder.
def skip_list(file):
return os.path.basename(file) == spack.store.layout.metadata_dir
@@ -686,32 +705,45 @@ def skip_list(file):
for dst in visitor.directories:
os.mkdir(os.path.join(self._root, dst))
# Then group the files to be linked by spec...
# For compatibility, we have to create a merge_map dict mapping
# full_src => full_dst
files_per_spec = itertools.groupby(visitor.files.items(), key=lambda item: item[1][0])
for (spec, (src_root, rel_paths)) in zip(specs, files_per_spec):
merge_map = dict()
for dst_rel, (_, src_rel) in rel_paths:
full_src = os.path.join(src_root, src_rel)
full_dst = os.path.join(self._root, dst_rel)
merge_map[full_src] = full_dst
# Link the files using a "merge map": full src => full dst
merge_map_per_prefix = self._source_merge_visitor_to_merge_map(visitor)
for spec in specs:
merge_map = merge_map_per_prefix.get(spec.package.view_source(), None)
if not merge_map:
# Not every spec may have files to contribute.
continue
spec.package.add_files_to_view(self, merge_map, skip_if_exists=False)
# Finally create the metadata dirs.
self.link_metadata(specs)
def _source_merge_visitor_to_merge_map(self, visitor: SourceMergeVisitor):
# For compatibility with add_files_to_view, we have to create a
# merge_map of the form join(src_root, src_rel) => join(dst_root, dst_rel),
# but our visitor.files format is dst_rel => (src_root, src_rel).
# We exploit that visitor.files is an ordered dict, and files per source
# prefix are contiguous.
source_root = lambda item: item[1][0]
per_source = itertools.groupby(visitor.files.items(), key=source_root)
return {
src_root: {
os.path.join(src_root, src_rel): os.path.join(self._root, dst_rel)
for dst_rel, (_, src_rel) in group
}
for src_root, group in per_source
}
def relative_metadata_dir_for_spec(self, spec):
return os.path.join(
self.get_relative_projection_for_spec(spec), spack.store.layout.metadata_dir, spec.name
)
def link_metadata(self, specs):
metadata_visitor = SourceMergeVisitor()
for spec in specs:
src_prefix = os.path.join(spec.package.view_source(), spack.store.layout.metadata_dir)
proj = os.path.join(
self.get_relative_projection_for_spec(spec),
spack.store.layout.metadata_dir,
spec.name,
)
proj = self.relative_metadata_dir_for_spec(spec)
metadata_visitor.set_projection(proj)
visit_directory_tree(src_prefix, metadata_visitor)

View File

@@ -37,7 +37,6 @@ class SharedLibrariesVisitor(BaseDirectoryVisitor):
exception of an exclude list."""
def __init__(self, exclude_list):
# List of file and directory names to be excluded
self.exclude_list = frozenset(exclude_list)

Some files were not shown because too many files have changed in this diff Show More