Commit Graph

7717 Commits

Author SHA1 Message Date
Todd Gamblin
8d0923f29e
add quotes to type annotation
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-04-09 09:46:20 -07:00
kshea21
4a153a185b
refactors and test fixes 2025-04-09 09:46:18 -07:00
kshea21
2da51eaec7
failing overwrite build deps 2025-04-09 09:44:01 -07:00
kshea21
974d10f32b
added no_op state tracking 2025-04-09 09:41:56 -07:00
kshea21
1a19c09c55
style 2025-04-09 09:41:56 -07:00
kshea21
11572c0caf
multi and single tests 2025-04-09 09:41:56 -07:00
kshea21
5d7ba48b36
style 2025-04-09 09:41:53 -07:00
kshea21
fa088e4975
review changes 2025-04-09 09:40:38 -07:00
kshea21
9d0133a771
process handle back 2025-04-09 09:38:37 -07:00
kshea21
0b1e388a0f
remove process handle 2025-04-09 09:38:35 -07:00
kshea21
60380a4724
untest -> test 2025-04-09 09:37:38 -07:00
kshea21
03a3546f14
style 2025-04-09 09:37:38 -07:00
kshea21
0808fd1a44
Rebasing -p/--concurrent-packages on develop 2025-04-09 09:37:32 -07:00
John W. Parent
d2dd4e96d9
Windows: add env name to prompts (#48819) 2025-04-08 14:16:39 -07:00
Harmen Stoppels
8ffd6c29bf
gcc/oneapi: inject runtime iff language virtual (#49956)
Currently we inject runtimes when a package has a direct build dep on a
compiler, but what matters is whether the package depends on a language.

That way we can avoid recursion of injecting runtimes to runtimes
without a rule in the solver: runtimes don't depend on languages, they
just have a build dep on the same compiler.
2025-04-08 19:51:16 +02:00
Massimiliano Culpo
129338c4c9
Group together all concretization unit test (#49960)
In this way, to run them, we just need to run:

spack unit-test lib/spack/spack/test/concretization

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-08 17:27:17 +02:00
Harmen Stoppels
e7b009e350
asp.py: reduce verbosity of "preferences" comment (#49954) 2025-04-08 15:17:21 +02:00
dependabot[bot]
cfbc92c2f0
build(deps): bump flake8 from 7.1.2 to 7.2.0 in /lib/spack/docs (#49816)
Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.2 to 7.2.0.
- [Commits](https://github.com/pycqa/flake8/compare/7.1.2...7.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 09:49:58 -07:00
Massimiliano Culpo
081e4c463b
compilers: add .stdcxx_libs to the compiler adaptor (#49873)
This property is used by a few recipes, including `cp2k` under
certain configurations

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-07 15:39:13 +02:00
Harmen Stoppels
e5ec08771b
docs: editor support config files (#49935) 2025-04-07 15:35:21 +02:00
Massimiliano Culpo
7e6a216d33
spack test run: add a --timeout argument (#49839)
* TestSuite: add type hints
* spack test run: add a --timeout argument
* pipelines: allow 2 minutes to run tests
* Fix docstrings, increase maximum pipelines time for tests to 5 mins.
* Use SIGTERM first, SIGKILL shortly after
* Add unit-tests for "start_build_process"

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-04 15:48:48 -07:00
Massimiliano Culpo
b2f8cd22c3
Update the "missing attribute in recipe" message (#49874)
Multiple build systems have been part of Spack for a long
time now, and they are rarely the cause of a missing attribute.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-04 10:38:38 -07:00
Harmen Stoppels
3ea92b1983
conditional: fix value type (#49882) 2025-04-04 15:31:44 +02:00
Harmen Stoppels
522fa9dc62
test/variant.py: fix broken test (#49879) 2025-04-04 11:13:50 +02:00
Caetano Melone
65ec330af5
fix: intel compiler alias intel-typo (#49870)
This typo was causing issues when concretizing specs with "%intel"
2025-04-04 08:51:48 +02:00
Harmen Stoppels
6bfe83106d
Concrete multi-valued variants (#49756)
Similar to the range-or-specific-version ambiguity of `@1.2` in the past,
which was solved with `@1.2` vs `@=1.2` we still have the ambiguity of
`name=a,b,c` in multi-valued variants. Do they mean "at least a,b,c" or
"exactly a,b,c"?

This issue comes up in for example `gcc languages=c,cxx`; there's no
way to exclude `fortran`.

The ambiguity is resolved with syntax `:=` to distinguish concrete from
abstract.

The following strings parse as **concrete** variants:

* `name:=a,b,c` => values exactly {a, b, c}
* `name:=a` => values exactly {a}
* `+name` => values exactly {True}
* `~name` => values exactly {False}

The following strings parse as **abstract** variants:

* `name=a,b,c` values at least {a, b, c}
* `name=*` special case for testing existence of a variant; values are at
  least the empty set {}

As a reminder

* `satisfies(lhs, rhs)` means `concretizations(lhs)` ⊆ `concretizations(rhs)`
* `intersects(lhs, rhs)` means `concretizations(lhs)` ∩ `concretizations(rhs)` ≠ ∅

where `concretizations(...)` is the set of sets of variant values in this case.

The satisfies semantics are:

* rhs abstract: rhs values is a subset of lhs values (whether lhs is abstract or concrete)
* lhs concrete, rhs concrete: set equality
* lhs abstract, rhs concrete: false

and intersects should mean

* lhs and rhs abstract: true (the union is a valid concretization under both)
* lhs or rhs abstract: true iff the abstract variant's values are a subset of the concrete one
* lhs concrete, rhs concrete: set equality

Concrete specs with single-valued variants are printed `+foo`, `~foo` and `foo=bar`;
only multi-valued variants are printed with `foo:=bar,baz` to reduce the visual noise.
2025-04-04 04:47:43 +00:00
Massimiliano Culpo
b1ac661ba8
Simplify a few methods in environments (#49682)
Return a single scope from environment.env_config_scope
Return a single scope from environment_path_scope

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-03 18:19:04 +02:00
Greg Becker
63b437ddf9
py-black: add v24.4.0 -> 25.1.0 (#49814)
Signed-off-by: Gregory Becker <becker33@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2025-04-03 16:48:18 +02:00
Harmen Stoppels
751c79872f
variant.py: make Variant.default is str | bool | tuple[str] (#49836)
Warn if variant default is not among those types
2025-04-03 11:07:08 +00:00
Massimiliano Culpo
5c71d36330
compiler-wrapper: set SPACK_COMPILER_EXTRA_RPATHS (#49828)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-03 11:23:08 +02:00
Massimiliano Culpo
62ee56e8a3
docs: remove leftover references to compiler: entries (#49824)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-02 09:33:23 +02:00
Massimiliano Culpo
01471aee6b
solver: don't use tags to compute injected deps (#49723)
This commit reorders ASP setup, so that rules from
possible compilers are collected first.

This allows us to know the dependencies that may be
injected before counting the possible dependencies,
so we can account for them too.

Proceeding this way makes it easier to inject
complex runtimes, like hip.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-04-02 09:32:25 +02:00
Harmen Stoppels
0facab231f
spec.py: more virtuals=... type hints (#49753)
Deal with the "issue" that passing a str instance does not cause a
type check failure, because str is a subset of Sequence[str] and
Iterable[str]. Instead fix it by special casing the str instance.
2025-04-02 00:05:00 -07:00
Greg Becker
ca64050f6a
config:url_fetch_method: allow curl args (#49712)
Signed-off-by: Gregory Becker <becker33@llnl.gov>
2025-04-01 15:23:28 -05:00
John W. Parent
93220f706e
concretizer cache: disable due to broken cleanup (#49470)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2025-04-01 15:38:56 +02:00
Harmen Stoppels
a257747cba
test/spec_semantics.py: more fixes (#49821) 2025-04-01 09:14:26 +02:00
Tamara Dahlgren
748c7e5420
Documentation: remote URL inclusion updates (#49669) 2025-04-01 09:02:50 +02:00
Harmen Stoppels
95927df455
test/spec_semantics.py: split a test into multiple ones, test only necessary bits (#49806) 2025-03-31 17:08:36 +00:00
Tara Drwenski
0f64f1baec
CachedCMakePackage: Improve finding mpiexec for non-slurm machines (#49033)
* Check for LSF, FLux, and Slurm when determing MPI exec

* Make scheduler/MPI exec helper functions methods of CachedCMakeBuilder

* Remove axom workaround for running mpi on machines with flux
2025-03-31 09:11:09 -07:00
Harmen Stoppels
46f7737626
xfail -> skipif platform specific tests on other platforms (#49800) 2025-03-31 16:32:26 +02:00
Adrien Bernede
22c38e5975
Update hip support for Cached CMake Packages (#49635)
* Clearly split old and new hip settings requirements
* Apply generic rocm handling to every project
* make default logic for hip support more robust
* GPU_TARGET is only necessary under certain project specific conditions, it should not be necessary in general
* Update logic to find amdclang++
2025-03-28 18:38:45 -07:00
Massimiliano Culpo
10f309273a
Do not error when trying to convert corrupted compiler entries (#49759)
fixes #49717

If no compiler is listed in the 'packages' section of
the configuration, Spack will currently try to:
1. Look for a legacy compilers.yaml to convert
2. Look for compilers in PATH

in that order. If an entry in compilers.yaml is
corrupted, that should not result in an obscure
error.

Instead, it should just be skipped.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-03-28 13:14:12 -06:00
Harmen Stoppels
35a84f02fa
variant.py: reserved names is a set (#49762) 2025-03-28 08:17:04 -07:00
Harmen Stoppels
4b02ecddf4
variant.py: use spack.error the normal way (#49763)
This module references `spack.error.Something` in the same file, which happens to
work but is incorrect. Use `spack.error` to prevent that in the future.
2025-03-28 14:12:45 +00:00
Todd Gamblin
3444d40ae2
bugfix: pure cxx and fortran deps should display with a compiler. (#49752)
I noticed that `abseil-cpp` was showing in `spack find` with "no compiler", and the only
difference between it and other nodes was that it *only* depends on `cxx` -- others
depend on `c` as well.

It turns out that the `select()` method on `EdgeMap` only takes `Sequence[str]` and doesn't
check whether they're actually just one `str`.  So asking for, e.g., `cxx` is like asking for
`c` or `x` or `x`, as the `str` is treated like a sequence. This causes Spack to miss `cxx`
and `fortran` language virtuals in `DeprecatedCompilerSpec`.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-03-28 10:18:18 +01:00
Harmen Stoppels
3c4f23f64a
Fix import urllib.request (#49699) 2025-03-28 10:15:33 +01:00
Todd Gamblin
52a995a95c
UI: Color external packages differently from installed packages (#49751)
Currently, externals show up in `spack find` and `spack spec` install status as a green
`[e]`, which is hard to distinguish from the green [+] used for installed packages.

- [x] Make externals magenta instead, so they stand out.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-03-28 00:37:56 -07:00
Massimiliano Culpo
a6c22f2690
Update documentation after compiler as deps (#49715) 2025-03-27 11:19:35 +01:00
Massimiliano Culpo
4894668ece
Remove "classic" Intel packages (#45188) 2025-03-27 10:13:33 +01:00
Todd Gamblin
199133fca4
bugfix: concretization shouldn't require concrete packages to be known (#49706)
Concretization setup was checking whether any input spec has a dependency
that's *not* in the set of possible dependencies for all roots in the solve.
There are two reasons to check this:

1. The user could be asking for a dependency that none of the roots has, or
2. The user could be asking for a dependency that doesn't exist.

For abstract roots, (2) implies (1), and the check makes sense.  For concrete
roots, we don't care, because the spec has already been built. If a `package.py`
no longer depends on something it did before, it doesn't matter -- it's already
built. If the dependency no longer exists, we also do not care -- we already
built it and there's an installation for it somewhere. 

When you concretize an environment with a lockfile, *many* of the input specs
are concrete, and we don't need to build them. If a package changes its
dependencies, or if a `package.py` is removed for a concrete input spec, that
shouldn't cause an already-built environment to fail concretization.

A user reported that this was happening with an error like:

```console
spack concretize
==> Error: Package chapel does not depend on py-protobuf@5.28.2/a4rf4glr2tntfwsz6myzwmlk5iu25t74
```

Or, with traceback:
```console
  File "/apps/other/spack-devel/lib/spack/spack/solver/asp.py", line 3014, in setup
    raise spack.spec.InvalidDependencyError(spec.name, missing_deps)
spack.spec.InvalidDependencyError: Package chapel does not depend on py-protobuf@5.28.2/a4rf4glr2tntfwsz6myzwmlk5iu25t74
```

Fix this by skipping the check for concrete input specs. We already ignore conflicts,
etc. for concrete/external specs, and we do not need metadata in the solve for
concrete dependencies b/c they're imposed by hash constraints.

- [x] Ignore the package existence check for concrete input specs.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2025-03-26 23:58:12 +00:00