Commit Graph

7788 Commits

Author SHA1 Message Date
John W. Parent
b12a64d687
msmpi package: fix build (#50263)
Restores ability to build MSMPI from source.

* Modernizes the MSMPI package
* Strips out MSMPI build system that is long deprecated
* Adds patches to re-introduce missing functionality from said build system
* Adds builds + support for dependencies no longer fetched by build system
2025-05-16 22:03:33 +00:00
Massimiliano Culpo
70f4eef020
test_migrate_diff: mark xfail on Windows for now (#50513)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-16 18:35:42 +02:00
Harmen Stoppels
7a0c5671dc
spack repo migrate: support v1 -> v2 migration for package api (#50507) 2025-05-16 17:18:33 +02:00
pauleonix
4d55fe6284
cuda: add v12.9 and new Blackwell targets (#50284)
* cuda: Add 12.9 and new Blackwell targets

Including family-specific architecture features like sm_100f

* tau, caliper: Add cuda v12.9 conflict

Legacy nvtx was dropped.

* petsc: "libnvToolsExt.a" -> "libnvtx3interop.a" for cuda@12.9: and petsc@:3.23.1

* legion: Add upper bound to cuda version range

Avoid build failure due to CUDA driver API incompatibility.
See https://github.com/StanfordLegion/legion/issues/1864

---------

Co-authored-by: Satish Balay <balay@mcs.anl.gov>
2025-05-16 15:17:50 +02:00
Tamara Dahlgren
9738f1c026
test/cmd/compiler.py: use mock packages (#50362)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-16 11:53:36 +02:00
Harmen Stoppels
e7e37899f4
Auto-import spack.build_systems._package_api_v1 (#50496)
When loading packages from a v1.0 repository, inject a line

from spack.build_systems._package_api import *

This allows removal of certain names in `spack.package` as part of api
v2 without breaking backward compatibility in Spack.
2025-05-16 11:07:06 +02:00
Tamara Dahlgren
56df6b414d
tests/compilers/libraries.py: use mock packages (#50442) 2025-05-16 07:49:07 +02:00
Tamara Dahlgren
37abfc7541
test_builtin_repo: add a marker to skip the test if builtin is not available (#50476) 2025-05-15 19:50:42 +02:00
Harmen Stoppels
f96def28cb
spack repo migrate: add missing imports (#50491) 2025-05-15 18:16:23 +02:00
Tamara Dahlgren
0d586695a0
tests/cmd/external.py: use mock packages (#50363)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-15 16:59:35 +02:00
Tamara Dahlgren
f1ba23316b
test/compilers/conversion.py: use mock packages (#50391) 2025-05-15 12:14:15 +02:00
Massimiliano Culpo
3891305005
Remove a unit test, replace with an audit (#50484)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-15 11:45:28 +02:00
Tamara Dahlgren
5c5b0d80d2
tests/bindist: test_{relative|default}_rpaths* ignore arch target (#50357) 2025-05-14 17:41:50 -07:00
Massimiliano Culpo
f8538a1b1c
Parse % as ^ in specs (#49808)
This PR modifies the parser, so that `%` is parsed as a `DEPENDENCY`, and all
node properties that follow are associated to the name after the `%`. e.g.,
in `foo %gcc +binutils` the `+binutils` refers to `gcc` and not to `foo`.

`%` is still parsed as a build-type dependency, at the moment.

Environments, config files and `package.py` files from before Spack v1.0 may have
spec strings with package variants, targets, etc. *after* a build dependency, and these
will need to be updated. You can use the `spack style --spec-strings` command to do this.

To see what strings will be parsed differently under Spack v1.0, run:

```
spack style --spec-strings FILES
```

where `FILES` is a list of filenames that may contain old specs. To update these spec
strings so that they parse correctly under both Spack 1.0 and Spack 0.x, you can run:

```
spack style --fix --spec-strings FILES
```

In the example above, `foo %gcc +binutils` would be rewritten as `foo +binutils %gcc`,
which parses the same in any Spack version.

In addition, this PR fixes several issues with `%` dependencies:

- [x] Ensure we can still constrain compilers on reuse
- [x] Ensure we can reuse a compiler by hash
- [x] Add tests

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-14 16:17:34 -06:00
Harmen Stoppels
1e9be97a25
Update sys.path references (#50466) 2025-05-14 10:25:00 +00:00
Tamara Dahlgren
719fd6fb43
test_load_json_specfiles: skip virtual reconstruction (#50361) 2025-05-14 02:32:47 -06:00
Harmen Stoppels
abcc641373
Fix spack.repo.is_package_module (#50464) 2025-05-14 10:22:28 +02:00
G-Ragghianti
abcef565a8
spack env activate: respect --without-view when --temp (#50438) 2025-05-14 09:58:38 +02:00
Harmen Stoppels
00d65b75a1
remove std_cmake_args, std_pip_args, std_meson_args (#50462)
The "magic" globals `std_cmake_args`, `std_pip_args` and `std_meson_args` were deprecated in Spack 0.23 and removed in this commit, because they are no longer static and don't make sense to be defined for packages that do not depend on cmake, pip or meson.

Additionally, removing them ensures that `build_environment.py` no longer depends on builders, which will soon be moved out of `spack` into the `spack_repo` package.

The audit that scans whether these globals are used is not removed.
2025-05-14 09:51:42 +02:00
Tamara Dahlgren
ae9cffe55f
test/bootstrap.py: test_bootstrap_search_for_compilers_with* use mock packages path (#50441) 2025-05-13 14:31:13 +02:00
Harmen Stoppels
c5eb82fcb0
pkg.spec.package is pkg after deserialization (#50449) 2025-05-13 12:08:13 +02:00
Massimiliano Culpo
a938167a22
Add a prefix when we import vendored modules (#50443)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2025-05-13 07:20:40 +02:00
Massimiliano Culpo
acd47147a5
solver: support concrete multivalued variants (#50325)
The solves now supports key:=val syntax for multivalued variants in specs originating from input, externals, requirements, directives and when conditions

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-09 23:08:21 +02:00
Harmen Stoppels
3ed6736b2c
compiler.py: be more defensive (#50403) 2025-05-09 16:58:52 +00:00
Massimiliano Culpo
842954f6a4
solver: treat external nodes as concrete for optimization purposes (#50165)
This PR is a step towards treating externals as concrete specs. Specifically, it moves the optimization weights of external nodes into the group of "reused" specs, and doesn't count externals as specs to be built. 

It still keeps the one to many mapping between an external spec in `packages.yaml` and the corresponding specs in the DB. To make it such that an hashed external is preferred to a non-hashed one, the version weights of externals are demoted at lowest priority.

**Change in behavior**:
- Having the possibility, Spack will now prefer to mix compilers in a DAG, and use the latest version possible for each node, rather than using a single compiler and employ old versions of some nodes because of conflicts
- In general, using externals by default is now triggered by putting their weights in the "reused" group. This means that any penalty they might induce will never have the same priority as something that needs to be built. This behavior reflects reality, but changes some default choices from the previous state.

Modifications:
- External nodes weights are now moved to the group of "reused" specs
- Runtimes are treated as concrete as well (to avoid that e.g.`gcc` is not selected because it "builds" the runtime package)
- Shuffle version weights, so that externals are least preferred (counterbalanced by the fact that they are in the "reused" groups)
- Split provider weights on edges from version badness on edges

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-05-09 17:41:16 +02:00
Tamara Dahlgren
a505fb1f37
unit tests: switch TestSpecList to use mock packages (#50353) 2025-05-09 07:45:49 +02:00
Scott Wittenburg
03cb30cb96
binary_distribution: Do not look in sub-mirrors when indexing (#50389)
When indexing top level specs, eg, in s3://spack-binaries/develop,
do not sync manifests from all the stacks.  Instead, add the path
to the spec manifests to the url to sync, so that only items in
s3://spack-binaries/develop/v3/manifests/spec are copied to the
local system.
2025-05-08 17:25:35 -06:00
Scott Wittenburg
f6da037129
binary_distribution: Handle fetch error during rebuild-index (#50387)
Allow rebuild-index to continue if fetching some specs fails
for any reason, and issue a warning indicating which manifest
is associated with the failed fetch.
2025-05-08 13:54:43 -06:00
jgraciahlrs
1a379215da
Allow usage of config variables and env variables with include_concrete (#45871)
* Allow usage of spack config vars in concrete env path
* Update docs on usage of spack config vars in concrete env path
2025-05-08 14:23:02 -05:00
Harmen Stoppels
b0b316c646
builtin: add a few missing __init__.py (#50374) 2025-05-08 18:45:09 +02:00
Harmen Stoppels
a95fa26857
docs/comments: fix typo with wildcard import (#50379) 2025-05-08 18:37:45 +02:00
Harmen Stoppels
98c08ce5c6
repo.py: enable search paths when spack.repo.PATH is assigned (#50370)
Fixes a bug where `custom_repo.get_pkg_class("foo")` failed executing `import spack_repo.builtin` even if the builtin repo was configured globally.

Instead of assignment of `spack.repo.PATH`, the `spack.repo.enable_repo` function now assigns and enables the repo, meaning that also Python module search paths are modified.
2025-05-08 13:42:20 +02:00
Tamara Dahlgren
59339be48f
test/cmd/find.py: switch to use mock_packages (#50358) 2025-05-08 08:33:56 +02:00
Harmen Stoppels
21d8c09c5e
builtin: fix various type/correctness issues (#50340) 2025-05-07 15:45:15 +02:00
Tamara Dahlgren
0b4477c0df
test/cmd/unit_test: have test_list_with* ignore missing repo warning (#50332) 2025-05-07 09:06:34 +02:00
Tamara Dahlgren
eff4c14a09
test/providers: switch to mock packages (#50333) 2025-05-07 09:04:06 +02:00
Tamara Dahlgren
f485a622c8
test/cmd/maintainers.py: cleanup of mock_packages use (#50334) 2025-05-07 09:03:00 +02:00
Tamara Dahlgren
f151bc65f7
test/env: switch to mock packages (#50335) 2025-05-07 09:02:10 +02:00
Tamara Dahlgren
99d849b2e6
test/spec_semantics: add mock_packages to test_intersects_and_satisfies (#50336) 2025-05-07 08:59:16 +02:00
Tamara Dahlgren
c88e7bc492
test/ci.py: remove redundant mock_packages fixture use (#50331) 2025-05-07 08:09:14 +02:00
Tamara Dahlgren
931d034da4
test/patch.py: switch tests to use mock_packages (#50337) 2025-05-07 08:07:11 +02:00
Scott Wittenburg
2c05ce3607
binary_distribution: content addressable tarballs (#48713)
binary_distribution: content addressable url buildcache

Change how binary mirrors are laid out, adopting content addressing for every
piece of data spack stores in a binary mirror. Items (e.g. tarballs, specfiles, public
keys, indices, etc) are now discoverable via manifest files which give the size,
checksum, compression type, etc of the the stored item. The information in the
manifest, in turn, is used to find the actual data, which is stored by its content
address in the blobs directory. Additionally, signing is now applied to the manifest
files, rather than to the spec files themselves.
2025-05-06 12:32:15 -06:00
Harmen Stoppels
b932c14008
builtin: use api v2.0 and update dir structure (#49275)
* Bump the package API of the `builtin` repo to `v2.0`
* Move `var/spack/repos/builtin` -> `var/spack/repos/spack_repo/builtin`
* Move test repos `var/spack/repos/{builtin.mock,tutorial,...}` -> `var/spack/test_repos/`
* Update package dir names to v2 format (`-` -> `_` etc)
* Change absolute imports `from spack.pkg.builtin.my_pkg ...` to relative imports `from ..my_pkg.package ...`

Users who have a repo on top of builtin should change imports from

```python
from spack.pkg.builtin.my_pkg import MyPkg
```

to

```python
from spack_repo.builtin.packages.my_pkg.package import MyPkg
```

and can configure their editors with

```
PYTHONPATH=$spack/lib/spack:$spack/var/spack/repos
```

[skip-verify-checksums]
2025-05-06 12:05:44 +02:00
Tamara Dahlgren
3de68ef976
unit tests: switch test/cmd/config.py to mock packages (#50313) 2025-05-06 08:14:32 +02:00
Tamara Dahlgren
5c7fe24bec
unit tests: change test_config_audits to use mock_packages, add mock openssl (#50308) 2025-05-06 08:10:11 +02:00
Tamara Dahlgren
ecb122f4c1
unit tests: switch test/cmd/versions to mock packages (#50315) 2025-05-06 08:08:38 +02:00
Tamara Dahlgren
6219780691
unit tests: test_concretization_cache_roundtrip use mock_packages (#50314) 2025-05-06 08:06:44 +02:00
Tamara Dahlgren
8ec1369d2b
unit tests: use mock_packages for 'spack [info|list|style]' tests (#50309) 2025-05-06 07:35:26 +02:00
Harmen Stoppels
1527e9703d
builder.py: check is_package_module for v2 support (#50298) 2025-05-05 14:08:58 +02:00
Harmen Stoppels
2b4f2daa73
package API v2.0: new repo layout (#49256)
This implements Package API v2.0, and is an opt-in feature for repos. It can be enabled with

```yaml
repo:
  ...
  api: v2.0
```

It differs from the current default v1.0 as follows:

1. Package names can only contain `-` as a separator.
2. Package names can only be lowercase.
3. Package directory names are valid Python module names.
4. The repo namespace and its directory name are the same.
5. The `packages` subdir, which is configurable, should be a directory
   name that is also a valid Python module name.
6. There is a one to one mapping between Spack package names and Python
   module names.
7. Import statements `import spack.pkg.namespace.package_module` in
   `package.py` files need to specify the canonical package module.

To go from Spack package name to Python module name:
- Replace `-` by `_`
- Add a leading `_` if the package name starts with a digit

To go from Python module name to Spack package name:
- Strip leading `_`
- Replace `_` by `-`.
2025-05-05 10:52:16 +02:00