Commit Graph

36081 Commits

Author SHA1 Message Date
Harmen Stoppels
9a6e51ccf0 Define Package API version (#49274)
Defines `spack.package_api_version` and `spack.min_package_api_version`
as tuples (major, minor).

This defines resp. the current Package API version implemented by this version
of Spack and the minimal Package API version it is backwards compatible with.

Repositories can optionally define:
```yaml
repo:
    namespace: my_repo
    api: v1.2
```
which indicates they are compatible with versions of Spack that implement
Package API `>= 1.2` and `< 2.0`. When the `api` key is omitted, the default
`v1.0` is assumed.
2025-03-05 16:24:20 +01:00
Harmen Stoppels
dd3ee5ffef Set version to 0.22.6.dev0 2025-03-05 16:17:56 +01:00
Gregory Becker
8c37ed4534 Set version to 0.22.5 2025-02-21 12:20:45 -08:00
Harmen Stoppels
1f55b59171 Set version to 0.22.4 2025-02-19 11:13:42 +01:00
Massimiliano Culpo
6a46a1c27d Temporarily pin Ubuntu to v22.04, where we use kcov (#48152)
Ubuntu doesn't package kcov in v24.04 Since GitHub
started upgrading their runner images, this makes
our CI fail, see e.g.

https://github.com/spack/spack/actions/runs/12366970840/job/34518012887?pr=47854

This is a temporary workaround, while we prepare a
more stable fix.

* Don't run too many unit tests
2025-02-19 11:13:42 +01:00
Harmen Stoppels
c78545d5f1 fix year dependent license verification check 2025-02-19 11:13:42 +01:00
Harmen Stoppels
05dcd1d2b7 env: continue to mark non-roots as implicitly installed on partial env installs (#47183)
Fixes a change in behavior/bug in
70412612c7, where partial environment
installs would mark the selected spec as explicitly installed, even if
it was not a root of the environment.

The desired behavior is that roots by definition are the to be
explicitly installed specs. The specs on the `spack -e ... install x`
command line are just filters for partial installs, so leave them
implicitly installed if they aren't roots.
2025-02-19 11:13:42 +01:00
Harmen Stoppels
67e5b4fecf Set version to 0.22.4.dev0 2025-02-19 11:13:42 +01:00
Harmen Stoppels
ba6cb62df8 Set version to v0.22.3 2024-11-18 12:47:11 +01:00
Harmen Stoppels
e1437349d1 getting_started.rst: fix list of spack deps (#47557) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
c1eb3f965b libc.py: detect glibc also in chinese locale (#47434) 2024-11-18 12:47:11 +01:00
Massimiliano Culpo
e0d246210f Fix pickle round-trip of specs propagating variants (#47351)
This changes `Spec` serialization to include information about propagation for abstract specs.
This was previously not included in the JSON representation for abstract specs, and couldn't be
stored.

Now, there is a separate `propagate` dictionary alongside the `parameters` dictionary. This isn't
beautiful, but when we bump the spec version for Spack `v0.24`, we can clean up this and other
aspects of the schema.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
88b47d2714 spack_yaml: add anchorify function (#44995)
This adds spack.util.spack_yaml.anchorify, which takes a non-cyclic
dict/list structure, and replaces identical values with (back)
references to the first instance, so that yaml serialization will use
anchors.

`repr` is used to identify sub-dags, which in principle is quadratic
complexity in depth of the graph, but in practice the depth is O(1) so
this should not matter.

Then this is used in CI to reduce the size of generated YAML files to
30% of their original size.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
342520175d database.py: remove process unsafe update_explicit (#47358)
Fixes an issue reported where `spack env depfile` + `make -j` would
non-deterministically refuse to mark all environment roots explicit.

`update_explicit` had the pattern

```python
rec = self._data[key]
with self.write_transaction():
    rec.explicit = explicit
```

but `write_transaction` may reinitialize `self._data`, meaning that
mutating `rec` won't mutate `self._data`, and the changes won't be
persisted.

Instead, use `mark` which has a correct implementation.

Also avoids the essentially incorrect early return in `update_explicit`
which is a pattern I don't think belongs in database.py: it branches on
possibly stale data to realize there is nothing to change, but in reality
it requires a write transaction to know that for a fact, but that would
defeat the purpose. So, leave this optimization to the call site.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
8a55299214 packaging_guide.rst: explain forward and backward compat before the less common cases (#47402)
The idea is to go from most to least used: backward compat -> forward compat -> pinning on major or major.minor version -> pinning specific, concrete versions.

Further, the following

```python
   # backward compatibility with Python
   depends_on("python@3.8:")
   depends_on("python@3.9:", when="@1.2:")
   depends_on("python@3.10:", when="@1.4:")

   # forward compatibility with Python
   depends_on("python@:3.12", when="@:1.10")
   depends_on("python@:3.13", when="@:1.12")
   depends_on("python@:3.14")
```

is better than disjoint when ranges causing repetition of the rules on dependencies, and requiring frequent editing of existing lines after new releases are done:

```python
   depends_on("python@3.8:3.12", when="@:1.1")
   depends_on("python@3.9:3.12", when="@1.2:1.3")
   depends_on("python@3.10:3.12", when="@1.4:1.10")
   depends_on("python@3.10:3.13", when="@1.11:1.12")
   depends_on("python@3.10:3.14", when="@1.13:")
2024-11-18 12:47:11 +01:00
Wouter Deconinck
174308ca3d ffmpeg: update patch hashes for addition of the X-Git-Tag (#45574) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
506c176d25 remove xfail marked hanging foreground/background tests 2024-11-18 12:47:11 +01:00
Adam J. Stewart
88171ff353 Docs: remove reference to pyspack (#47346) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
fb8f2d8301 autopush: run after install manifest is written 2024-11-18 12:47:11 +01:00
Todd Gamblin
27beb100e1 mypy: work around typing issues with functools.partial (#47160) 2024-11-18 12:47:11 +01:00
Alex Hedges
02613d778d Remove trailing spaces in default YAML files (#47328)
caught by `prettier`
2024-11-18 12:47:11 +01:00
Alex Hedges
a6065334ad Fix malformed RST link in documentation (#47309) 2024-11-18 12:47:11 +01:00
Alex Hedges
243ee7203a Fix errors found by running spack audit externals (#47308)
The problem was that `+` is part of the regex grammar, so it needs to be
escaped.
2024-11-18 12:47:11 +01:00
Alex Hedges
271106e5dd Fix typo in default concretizer.yaml (#47307)
This was caught by `codespell` when I copied the config file into an
internal repository.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
9fb9156e82 bootstrap: do not consider source when metadata file missing (#47278) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
d88cfbd839 compilers.yaml: require list of strings for modules (#47197) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
4127a93a91 ensure write_fd.close() isn't called when sys.std* cannot be redirected 2024-11-18 12:47:11 +01:00
Harmen Stoppels
5df2189e43 Avoid a socket to communicate effectively a bit 2024-11-18 12:47:11 +01:00
Harmen Stoppels
667c1960d0 Replace MultiProcessFd with Connection objects
Connection objects are Python version, platform and multiprocessing
start method independent, so better to use those than a mix of plain
file descriptors and inadequate guesses in the child process whether it
was forked or not.

This also allows us to delete the now redundant MultiProcessFd class,
hopefully making things a bit easier to follow.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
4449058257 fix use of traceback.format_exception (#47080)
Co-authored-by: Peter Scheibel <scheibel1@llnl.gov>
2024-11-18 12:47:11 +01:00
Todd Gamblin
1b03f1d5bc Better docs and typing for _setup_pkg_and_run (#46709)
There was a bit of mystery surrounding the arguments for `_setup_pkg_and_run`. It passes
two file descriptors for handling the `gmake`'s job server in child processes, but they are
unsed in the method.

It turns out that there are good reasons to do this -- depending on the multiprocessing
backend, these file descriptors may be closed in the child if they're not passed
directly to it.

- [x] Document all args to `_setup_pkg_and_run`.
- [x] Document all arguments to `_setup_pkg_and_run`.
- [x] Add type hints for `_setup_pkg_and_run`.
- [x] Refactor exception handling in `_setup_pkg_and_run` so it's easier to add type
      hints. `exc_info()` was problematic because it *can* return `None` (just not
      in the context where it's used).  `mypy` was too dumb to notice this.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-18 12:47:11 +01:00
Harmen Stoppels
cf4e9cb3b3 installer.py: handle external roots the same (#44917)
There was logic not to enqueue build requests for externals if they occur as
roots. That's unnecessary.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
d189b12050 installer: improve init signature and explicits (#44374)
Change the installer to take `([pkg], args)` in the constructor instead
of `[(pkg, args)]`. The reason is that certain arguments are global
settings, and the new API ensures that those arguments cannot be
different across different "build requests".

The `explicit` install arg is now a list of hashes, and the installer is
no longer responsible for determining what package is installed
explicitly. This way environment installs can simply pass the list of
environment roots, without them necessarily being explicit build
requests. For example an env with two roots [a, b], where b depends on
a, would not always cause spack install to mark b as explicit.

Notice that `overwrite` already took a list of hashes, this makes
`explicit` consistent.

`package.do_install(explicit=True)` continues to take a boolean.
2024-11-18 12:47:11 +01:00
Massimiliano Culpo
5134504fd8 Fix broken spack find -u (#47102)
fixes #47101

The bug was introduced in #33495, where `spack find was not updated,
and wasn't caught by unit tests.

Now a Database can accept a custom predicate to select the installation
records. A unit test is added to prevent regressions. The weird convention
of having `any` as a default value has been replaced by the more commonly
used `None`.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-11-18 12:47:11 +01:00
Harmen Stoppels
ae5018ee09 python: drop build-tools tag (#46980)
Remove the `build-tools` tag of python, otherwise these types of
concretizations are possible:

```
py-root
  ^py-pip
    ^python@3.12
  ^python@3.13
```

So, a package would be configured with py-pip using python 3.12, but
installed for 3.13, which does not work.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
106ebeb502 Show underlying errors on fetch failure (#45714)
- unwrap/flatten nested exceptions
- improve tests
- unify curl lookup
2024-11-18 12:47:11 +01:00
Harmen Stoppels
ba89754ee1 buildcache: recognize . and .. as paths instead of names (#47105) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
e733eb0fd9 docs: do not promote build_systems/* at all (#47111) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
07b344bf10 docs: tune ranking further (#47110)
promote hand-written docs, demote generated "docs" for sources, modules, packages.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
a71c65399e docs search: rank api lowest and generated commands low (#47107) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
d8b73331f6 bootstrap: remove all system gnupg/patchelf executables (#47165) 2024-11-18 12:47:11 +01:00
Peter Scheibel
4741ea683c avoid double closing of fd in sub-processes (#47035)
Both `multiprocessing.connection.Connection.__del__` and `io.IOBase.__del__` called `os.close` on the same file descriptor. As of Python 3.13, this is an explicit warning. Ensure we close once by usef `os.fdopen(..., closefd=False)`
2024-11-18 12:47:11 +01:00
Harmen Stoppels
f33c18290b tests: fix wrong install name (#46711) 2024-11-18 12:47:11 +01:00
Massimiliano Culpo
5ea67e8882 archspec: update to v0.2.5 (#46958)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-11-18 12:47:11 +01:00
Massimiliano Culpo
8ade071253 Bump archspec 0.2.5-dev (#46503)
Use commit bceb39528ac49dd0c876b2e9bf3e7482e9c2be4a
2024-11-18 12:47:11 +01:00
Tobias Ribizel
dca09e6e0f env depfile: generate Makefile with absolute script path (#46966)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2024-11-18 12:47:11 +01:00
Harmen Stoppels
2776402c90 Update release documentation (#46991) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
3961a86f86 support python 3.13 bootstrapping from sources (#46983) 2024-11-18 12:47:11 +01:00
Harmen Stoppels
39e594d096 clingo: fix build with Python 3.13+ (#46775)
Python 3.9 deprecated `PyEval_InitThreads` and kept it as a no-op, and
Python 3.13 deleted the function.

The patch removes calls to it.
2024-11-18 12:47:11 +01:00
Harmen Stoppels
7a91bed5c9 Set version to v0.22.3.dev0 2024-11-18 12:47:11 +01:00