Commit Graph

7687 Commits

Author SHA1 Message Date
Harmen Stoppels
4691301eba
Compiler.default_libc: early exit on darwin/win (#47554)
* Compiler.default_libc: early exit on darwin/win

* use .cc when testing c++ compiler if c compiler is missing
2024-11-11 14:12:43 -08:00
Peter Scheibel
9ed5e1de8e
Bugfix: spack find -x in environments (#46798)
This addresses part [1] of #46345

#44713 introduced a bug where all non-spec query parameters like date
ranges, -x, etc. were ignored when an env was active.

This fixes that issue and adds tests for it.

---------

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-11-11 10:13:31 -08:00
Massimiliano Culpo
4eb7b998e8
Move concretization tests to the same folder (#47539)
* Move concretization tests to the same folder

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

* Fix for clingo-cffi

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-11-11 19:01:24 +01:00
kwryankrattiger
b803dabb2c
mirrors: allow username/password as environment variables (#46549)
`spack mirror add` and `set` now have flags `--oci-password-variable`, `--oci-password-variable`, `--s3-access-key-id-variable`, `--s3-access-key-secret-variable`, `--s3-access-token-variable`, which allows users to specify an environment variable in which a username or password is stored.

Storing plain text passwords in config files is considered deprecated.

The schema for mirrors.yaml has changed, notably the `access_pair` list is generally replaced with a dictionary of `{id: ..., secret_variable: ...}` or `{id_variable: ..., secret_variable: ...}`.
2024-11-11 16:34:39 +01:00
Todd Gamblin
c4a5a996a5 solver: avoid parsing specs in setup
- [x] Get rid of a call to `parser.quote_if_needed()` during solver setup, which
      introduces a circular import and also isn't necessary.

- [x] Rename `spack.variant.Value` to `spack.variant.ConditionalValue`, as it is *only*
      used for conditional values. This makes it much easier to understand some of the
      logic for variant definitions.

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-11 01:54:57 -08:00
Todd Gamblin
6961514122 imports: move conditional to directives.py
`conditional()`, which defines conditional variant values, and the other ways to declare
variant values should probably be in a layer above `spack.variant`. This does the simple
thing and moves *just* `conditional()` to `spack.directives` to avoid a circular import.

We can revisit the public variant interface later, when we split packages from core.

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-11 01:54:57 -08:00
Harmen Stoppels
a9e6074996
filesystem.py find: return directories and improve performance (#47537) 2024-11-11 09:43:23 +00:00
Todd Gamblin
7fbfb0f6dc
Revert "fix patched dependencies across repositories (#42463)" (#47519)
This reverts commit da1d533877.
2024-11-09 10:25:25 +01:00
Massimiliano Culpo
11d276ab6f
Fix style checks on develop (#47518)
`mypy` checks have been accidentally broken by #47213
2024-11-08 23:50:37 -08:00
Greg Becker
da1d533877
fix patched dependencies across repositories (#42463)
Currently, if a package has a dependency from another repository and patches it,
generation of the patch cache will fail. Concretization succeeds if a fixed patch
cache is in place.

- [x] don't assume that patched dependencies are in the same repo when indexing
- [x] add some test fixtures to support multi-repo tests.

---------

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-08 18:07:40 -07:00
Harmen Stoppels
c6997e11a7
spack.compiler/spack.util.libc: add caching (#47213)
* spack.compiler: cache output

* compute libc from the dynamic linker at most once per spack process

* wrap compiler cache entry in class, add type hints

* test compiler caching

* ensure tests do not populate user cache, and fix 2 tests

* avoid recursion: cache lookup -> compute key -> cflags -> real_version -> cache lookup

* allow compiler execution in test that depends on get_real_version
2024-11-08 16:25:02 -08:00
Harmen Stoppels
907a37145f
llnl.util.filesystem: multiple entrypoints and max_depth (#47495)
If a package `foo` doesn't implement `libs`, the default was to search recursively for `libfoo` whenever asking for `spec[foo].libs` (this also happens automatically if a package includes `foo` as a link dependency).

This can lead to some strange behavior:
1. A package that is normally used as a build dependency (e.g. `cmake` at one point) is referenced like
   `depends_on(cmake)` which leads to a fully-recursive search for `libcmake` (this can take
   "forever" when CMake is registered as an external with a prefix like `/usr`, particularly on NFS mounts).
2. A similar hang can occur if a package is registered as an external with an incorrect prefix

- [x] Update the default library search to stop after a maximum depth (by default, search
  the root prefix and each directory in it, but no lower).
- [x] 

The following is a list of known changes to `find` compared to `develop`:

1. Matching directories are no longer returned -- `find` consistently only finds non-dirs, 
   even at `max_depth`
2. Symlinked directories are followed (needed to support max_depth)
3. `find(..., "dir/*.txt")` is allowed, for finding files inside certain dirs. These "complex"
   patterns are delegated to `glob`, like they are on `develop`.
4. `root` and `files` arguments both support generic sequences, and `root`
   allows both `str` and `path` types. This allows us to specify multiple entry points to `find`.

---------

Co-authored-by: Peter Scheibel <scheibel1@llnl.gov>
2024-11-08 13:55:53 -08:00
Harmen Stoppels
4778d2d332
Add missing imports (#47496) 2024-11-08 17:51:58 +01:00
Alec Scott
ff26d2f833
spack env track command (#41897)
This PR adds a sub-command to `spack env` (`track`) which allows users to add/link
anonymous environments into their installation as named environments. This allows
users to more easily track their installed packages and the environments they're
dependencies of. For example, with the addition of #41731 it's now easier to remove
all packages not required by any environments with,

```
spack gc -bE
```

#### Usage
```
spack env track /path/to/env
==> Linked environment in /path/to/env
==> You can activate this environment with:
==>     spack env activate env
```

By default `track /path/to/env` will use the last directory in the path as the name of 
the environment. However users may customize the name of the linked environment
with `-n | --name`. Shown below.
```
spack env track /path/to/env --name foo 
==> Tracking environment in /path/to/env
==> You can activate this environment with:
==>     spack env activate foo
```

When removing a linked environment, Spack will remove the link to the environment
but will keep the structure of the environment within the directory. This will allow
users to remove a linked environment from their installation without deleting it from
a shared repository.

There is a `spack env untrack` command that can be used to *only* untrack a tracked
environment -- it will fail if it is used on a managed environment.  Users can also use
`spack env remove` to untrack an environment.

This allows users to continue to share environments in git repositories  while also having
the dependencies of those environments be remembered by Spack.

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-08 00:16:01 -08:00
Harmen Stoppels
ed916ffe6c Revert "filesystem.py: add max_depth argument to find (#41945)"
This reverts commit 38c8069ab4.
2024-11-07 13:09:10 -08:00
Harmen Stoppels
4fbdf2f2c0 Revert "llnl.util.filesystem.find: restore old error handling (#47463)"
This reverts commit a31c525778.
2024-11-07 13:09:10 -08:00
Harmen Stoppels
60ba61f6b2 Revert "llnl.util.filesystem.find: multiple entrypoints (#47436)"
This reverts commit 73219e4b02.
2024-11-07 13:09:10 -08:00
Harmen Stoppels
0d817878ea
spec.py: fix comparison with multivalued variants (#47485) 2024-11-07 19:29:37 +00:00
Harmen Stoppels
73219e4b02
llnl.util.filesystem.find: multiple entrypoints (#47436)
You can now provide multiple roots to a single `find()` call and all of
them will be searched. The roots can overlap (e.g. can be parents of one
another).

This also adds a library function for taking a set of regular expression
patterns and creating a single OR expression (and that library function
is used in `find` to improve its performance).
2024-11-06 15:22:26 -08:00
Massimiliano Culpo
e62cf9c45b
Fix spack -c <override> when env active (#47403)
Set command line scopes last in _main, so they are higher scopes

Restore the global configuration in a spawned process by inspecting
the result of ctx.get_start_method()

Add the ability to pass a mp.context to PackageInstallContext.

Add shell-tests to check overriding the configuration:
- Using both -c and -C from command line
- With and without an environment active
2024-11-06 17:18:58 +01:00
Harmen Stoppels
d09b185522
Fix various bootstrap/concretizer import issues (#47467) 2024-11-06 14:35:04 +00:00
Harmen Stoppels
a31c525778
llnl.util.filesystem.find: restore old error handling (#47463) 2024-11-06 11:49:14 +01:00
Richarda Butler
0c164d2740
Feature: Allow variants to propagate if not available in source pkg (#42931)
Variants can now be propagated from a dependent package to (transitive) dependencies, 
even if the source or transitive dependencies have the propagated variants.

For example, here `zlib` doesn't have a `guile` variant, but `gmake` does:
```
$ spack spec zlib++guile
 -   zlib@1.3%gcc@12.2.0+optimize+pic+shared build_system=makefile arch=linux-rhel8-broadwell
 -       ^gcc-runtime@12.2.0%gcc@12.2.0 build_system=generic arch=linux-rhel8-broadwell
 -       ^gmake@4.4.1%gcc@12.2.0+guile build_system=generic arch=linux-rhel8-broadwell
```

Adding this property has some strange ramifications for `satisfies()`. In particular:
* The abstract specs `pkg++variant` and `pkg+variant`  do not intersect, because `+variant`
  implies that `pkg` *has* the variant, but `++variant` does not.
* This means that `spec.satisfies("++foo")` is `True` if:
    * for concrete specs: `spec` and its dependencies all have `foo` set if it exists
    * for abstract specs: no dependency of `spec`  has `~foo` (i.e. no dependency contradicts `++foo`).
* This also means that `Spec("++foo").satisfies("+foo")` is `False` -- we only know after concretization.

The `satisfies()` semantics may be surprising, but this is the cost of introducing non-subset
semantics (which are more useful than proper subsets here).

- [x] Change checks for variants
- [x] Resolve conflicts
- [x] Add tests
- [x] Add documentation

---------

Co-authored-by: Gregory Becker <becker33@llnl.gov>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-11-06 00:53:52 -08:00
Harmen Stoppels
dadb30f0e2
libc.py: detect glibc also in chinese locale (#47434) 2024-11-05 12:30:32 +01:00
Harmen Stoppels
d45f682573
Revert "Ci generate on change (#47318)" (#47431)
This reverts commit 1462c35761.
2024-11-05 10:51:12 +01:00
Massimiliano Culpo
14bc900e9d
spack.concretize: add type-hints, remove kwargs (#47382)
Also remove find_spec, which was used by the old concretizer.
Currently, it seems to be used only in tests.
2024-11-05 07:46:49 +01:00
Peter Scheibel
38c8069ab4
filesystem.py: add max_depth argument to find (#41945)
* `find(..., max_depth=...)` can be used to control how many directories at most to descend into below the starting point
* `find` now enters every unique (symlinked) directory once at the lowest depth
* `find` is now repeatable: it traverses the directory tree in a deterministic order
2024-11-04 20:31:57 +01:00
Todd Gamblin
5cc07522ab cc: parse RPATHs when in ld mode
In the pure `ld` case, we weren't actually parsing `RPATH` arguments separately as we
do for `ccld`. Fix this by adding *another* nested case statement for raw `RPATH`
parsing.

There are now 3 places where we deal with `-rpath` and friends, but I don't see a great
way to unify them, as `-Wl,`, `-Xlinker`, and raw `-rpath` arguments are all ever so
slightly different.

Also, this Fixes ordering of assertions to make `pytest` diffs more intelligible.
The meaning of `+` and `-` in diffs changed in `pytest` 6.0 and the "preferred" order
for assertions became `assert actual == expected` instead of the other way around.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-04 19:52:08 +01:00
Todd Gamblin
575a006ca3 cc: simplify ordered list handling
`cc` divides most paths up into system paths, spack managed paths, and other paths.
This gets really repetitive and makes the code hard to read. Simplify the script
by adding some functions to do most of the redundant work for us.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-04 19:52:08 +01:00
John Gouwar
23ac56edfb
Times spec building and timing to public concretizer API (#47310)
This PR has two small contributions:
- It adds another phase to the timer for concrectization, "construct_specs", to actually see the time the concretizer spends interpreting the `clingo` output to build the Python object for a concretized spec. 
- It adds the method `Solver.solve_with_stats` to expose the timers that were already in the concretizer to the public solver API. `Solver.solve` just becomes a special case of `Solver.solve_with_stats` that throws away the timing output (which is what it was already doing).  

These changes will make it easier to benchmark concretizer performance and provide a more complete picture of the time spent in the concretizer by including the time spent interpreting clingo output.
2024-11-04 09:48:18 -08:00
Harmen Stoppels
8d0856d1cc
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-04 13:52:05 +01:00
Massimiliano Culpo
395c911689
Specs: propagated variants affect == equality (#47376)
This PR changes the semantic of == for spec so that:

hdf5++mpi == hdf5+mpi

won't hold true anymore. It also changes the constrain semantic, so that a
non-propagating variant always override a propagating variant. This means:

(hdf5++mpi).constrain(hdf5+mpi) -> hdf5+mpi

Before we had a very weird semantic, that was supposed to be tested by unit-tests:

(libelf++debug).constrain(libelf+debug+foo) -> libelf++debug++foo

This semantic has been dropped, as it was never really tested due to the == bug.
2024-11-03 22:35:16 -08:00
Tamara Dahlgren
b8461f3d2d
Remove ignored config:install_missing_compilers from unit tests (#47357) 2024-11-02 09:36:05 +01:00
Massimiliano Culpo
133895e785
Rework the schema for reusing environments (#47364)
Currently, the schema reads:

  from:
    - type:
        environment: path_or_name

but this can't be extended easily to other types, e.g. to buildcaches,
without duplicating the extension keys. Use instead:

  from:
    - type: environment
      path: path_or_name
2024-11-02 09:03:42 +01:00
dependabot[bot]
19e3ab83cf
build(deps): bump python-levenshtein in /lib/spack/docs (#47372)
Bumps [python-levenshtein](https://github.com/rapidfuzz/python-Levenshtein) from 0.26.0 to 0.26.1.
- [Release notes](https://github.com/rapidfuzz/python-Levenshtein/releases)
- [Changelog](https://github.com/rapidfuzz/python-Levenshtein/blob/main/HISTORY.md)
- [Commits](https://github.com/rapidfuzz/python-Levenshtein/compare/v0.26.0...v0.26.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 23:55:18 +00:00
Greg Becker
e42a4a8bac
parse_specs: unify specs based on concretizer:unify (#44843)
Currently, the `concretizer:unify:` config option only affects environments.

With this PR, it now affects any group of specs given to a command using the `parse_specs(*, concretize=True)` interface.

- [x] implementation in `parse_specs`
- [x] tests
- [x] ensure all commands that accept multiple specs and concretize use `parse_specs` interface

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-01 23:49:26 +00:00
kwryankrattiger
1462c35761
Ci generate on change (#47318)
* don't concretize in CI if changed packages are not in stacks

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>

* Generate noop job when no specs to rebuild due to untouched pruning

* Add test to verify skipping generate creates a noop job

* Changed debug for early exit

---------

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-11-01 22:07:23 +00:00
Massimiliano Culpo
0cf8cb70f4
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-01 13:43:16 -07:00
dependabot[bot]
5df7dc88fc
build(deps): bump docutils from 0.20.1 to 0.21.2 in /lib/spack/docs (#45592)
Bumps [docutils](https://docutils.sourceforge.io) from 0.20.1 to 0.21.2.

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 06:23:10 -05:00
Harmen Stoppels
e3aca49e25
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-10-31 13:58:42 -07:00
kwryankrattiger
0c00a297e1
Concretize reuse: reuse specs from environment (#45139)
The already concrete specs in an environment are now among the reusable specs for the concretizer.

This includes concrete specs from all include_concrete environments.

In addition to this change to the default reuse, `environment` is added as a reuse type for 
the concretizer config. This allows users to specify:

spack:
  concretizer:
    # Reuse from this environment (including included concrete) but not elsewhere
    reuse:
      from:
      - type: environment
    # or reuse from only my_env included environment
    reuse:
      from:
      - type:
          environment: my_env
    # or reuse from everywhere
    reuse: true

If reuse is specified from a specific environment, only specs from that environment will be reused.
If the reused environment is not specified via include_concrete, the concrete specs will be retried
at concretization time to be reused.

Signed-off-by: Ryan Krattiger <ryan.krattiger@kitware.com>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
2024-10-31 10:31:34 -07:00
Adam J. Stewart
6ab92b119d
Docs: remove reference to pyspack (#47346) 2024-10-31 11:15:51 +01:00
Harmen Stoppels
c3435b4e7d
hooks: run in clear, fixed order (#47329)
Currently the order in which hooks are run is arbitrary.

This can be fixed by sorted(list_modules(...)) but I think it is much
more clear to just have a static list.

Hooks are not extensible other than modifying Spack code, which
means it's unlikely people maintain custom hooks since they'd have
to fork Spack. And if they fork Spack, they might as well add an entry
to the list when they're continuously rebasing.
2024-10-30 18:57:49 +00:00
Harmen Stoppels
8892c878ce
types: remove singleton union in globals (#47282) 2024-10-30 13:48:32 +01:00
Harmen Stoppels
cbf4d3967a
add std_pip_args global to the audit list (#47320) 2024-10-30 13:14:15 +01:00
Harmen Stoppels
8bc0b2e086
Spec.__str__: use full hash (#47322)
The idea is that `spack -e env add ./concrete-spec.json` would list the
full hash in the specs, so that (a) it's not ambiguous and (b) it could
in principle results in constant time lookup instead of linear time
substring match in large build caches.
2024-10-30 12:44:51 +01:00
Massimiliano Culpo
354615d491
Spec.dependencies: allow to filter on virtuals (#47284)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-30 12:15:01 +01:00
Alex Hedges
34b2f28a5e
Fix malformed RST link in documentation (#47309) 2024-10-30 09:40:35 +01:00
Massimiliano Culpo
b8e3246e89
llnl.util.lang: add classes to help with deprecations (#47279)
* Add a descriptor to have a class level constant

This descriptor helps intercept places where we set a value on instances.
It does not really behave like "const" in C-like languages, but is the
simplest implementation that might still be useful.

* Add a descriptor to deprecate properties/attributes of an object

This descriptor is used as a base class. Derived classes may implement a
factory to return an adaptor to the attribute being deprecated. The
descriptor can either warn, or raise an error, when usage of the deprecated
attribute is intercepted.

---------

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-10-29 19:06:26 +01:00
Harmen Stoppels
ea1aa0714b
bootstrap: do not consider source when metadata file missing (#47278) 2024-10-29 10:57:31 +01:00
Harmen Stoppels
7af1a3d240
std_meson_args: deprecate (#47259) 2024-10-29 07:54:28 +01:00
Harmen Stoppels
962115b386
builder.py: builder_cls should be associated to spack.pkg module (#47269) 2024-10-29 07:53:06 +01:00
Harmen Stoppels
f81ca0cd89
directives_meta.py: use startswith to test module part of spack.pkg (#47270) 2024-10-29 07:51:36 +01:00
Greg Becker
e81ce18cad
cmd/solve: use interface from cmd/spec (#47182)
Currently, `spack solve` has different spec selection semantics than `spack spec`.
`spack solve` currently does not allow specifying a single spec when an environment is active.

This PR modifies `spack solve` to inherit the interface from `spack spec`, and to use
the same spec selection logic. This will allow for better use of `spack solve --show opt`
for debugging.

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-28 19:28:03 -07:00
Harmen Stoppels
2ec4281c4f
Remove a few redundant imports (#47250)
* remove self-imports

* remove unused imports
2024-10-27 15:40:05 -06:00
Greg Becker
47e70c5c3a
explicit splice: do not fail for bad config replacement if target not matched (#46925)
Originally, concretization failed if the splice config points to an invalid replacement.

This PR defers the check until we know the splice is needed, so that irrelevant splices
with bad config cannot stop concretization.

While I was at it, I improved an error message from an assert to a ValueError.
2024-10-27 11:35:10 -07:00
Todd Gamblin
c8bebff7f5
Add -t short option for spack --backtrace (#47227)
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-26 09:16:31 +02:00
John W. Parent
7b27aed4c8
Normalize Spack Win entry points (#38648)
* Normalize Spack Win entrypoints

Currently Spack has multiple entrypoints on Windows that in addition to
differing from *nix implementations, differ from shell to shell on
Windows. This is a bit confusing for new users and in general
unnecessary.
This PR adds a normal setup script for the batch shell while preserving
the previous "click from file explorer for spack shell" behavior.
Additionally adds a shell title to both powershell and cmd letting users
know this is a Spack shell

* remove doskeys
2024-10-25 15:23:29 -04:00
Dom Heinzeller
ad0b256407
Intel/Oneapi compilers: suppress warnings when using Cray wrappers (#47046)
#44588 we added logic to suppress deprecation warnings for the
Intel classic compilers. This depended on matching against 

* The compiler names (looking for icc, icpc, ifort)
* The compiler version

When using an Intel compiler with fortran wrappers, the first check
always fails. To support using the fortran wrappers (in combination
with the classic Intel compilers), we remove the first check and
suppress if just the version matches. This works because:

* The newer compilers like icx can handle (ignore) the flags that
  suppress deprecation warnings
* The Cray wrappers pass the underlying compiler version (e.g. they
  report what icc would report)
2024-10-25 12:17:49 -07:00
Harmen Stoppels
7d86670826 ensure write_fd.close() isn't called when sys.std* cannot be redirected 2024-10-25 10:16:44 -07:00
Harmen Stoppels
ae306b73c3 Avoid a socket to communicate effectively a bit 2024-10-25 10:16:44 -07:00
Harmen Stoppels
b63cbe4e6e 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-10-25 10:16:44 -07:00
Harmen Stoppels
e86a3b68f7
file_cache.py: allow read transaction on uninitialized cache (#47212)
This allows the following

```python
cache.init_entry("my/cache")
with cache.read_transaction("my/cache") as f:
    data = f.read() if f is not None else None
```

mirroring `write_transaction`, which returns a tuple `(old, new)` where
`old` is `None` if the cache file did not exist yet.

The alternative that requires less defensive programming on the call
site would be to create the "old" file upon first read, but I did not
want to think about how to safely atomically create the file, and it's
not unthinkable that an empty file is an invalid format (for instance
the call site may expect a json file, which requires at least {} bytes).
2024-10-25 17:10:14 +02:00
Jordan Galby
f13d998d21
Add spack short version in config variables (#47016) 2024-10-25 07:34:59 +02:00
Tamara Dahlgren
1b0631b69e
Env help: expand and refine subcommand help and descriptions (#47089)
This PR is in response to a question in the `environments` slack channel (https://spackpm.slack.com/archives/CMHK7MF51/p1729200068557219) about inadequate CLI help/documentation for one specific subcommand.

This PR uses the approach I took for the descriptions and help for `spack test` subcommands.  Namely, I use the first line of the relevant docstring as the description, which is shown per subcommand in `spack env -h`, and the entire docstring as the help.  I then added, where it seemed appropriate, help.  I also tweaked argument docstrings to tighten them up, make consistent with similar arguments elsewhere in the command, and elaborate when it seemed important.  (The only subcommand I didn't touch is `loads`.)

For example, before:
```
$ spack env update -h
usage: spack env update [-hy] env

positional arguments:
  env               name or directory of the environment to activate

optional arguments:
  -h, --help        show this help message and exit
  -y, --yes-to-all  assume "yes" is the answer to every confirmation request
```

After the changes in this PR:
```
$ spack env update -h
usage: spack env update [-hy] env

update the environment manifest to the latest schema format

    update the environment to the latest schema format, which may not be
    readable by older versions of spack

    a backup copy of the manifest is retained in case there is a need to revert
    this operation
    

positional arguments:
  env               name or directory of the environment

optional arguments:
  -h, --help        show this help message and exit
  -y, --yes-to-all  assume "yes" is the answer to every confirmation request
```

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-24 13:55:00 -07:00
Harmen Stoppels
5ac2b8a178
compilers.yaml: require list of strings for modules (#47197) 2024-10-24 13:28:38 -06:00
Kyle Knoepfel
e0eea48ccf
Restore bold uncolored font face (#47108)
Commit aa0825d642 accidentally added a semicolon
to the ANSI escape sequence even if the color code was `None` or unknown, breaking the
bold, uncolored font-face.  This PR restores the old behavior.

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-24 09:11:43 +00:00
Harmen Stoppels
d8c8074762
bootstrap: add clingo 3.13 binaries and more (#47126) 2024-10-24 08:55:14 +02:00
Massimiliano Culpo
f6ad1e23f8
Improve Database.query* methods (#47116)
* Add type hints to all query* methods
* Inline docstrings
* Change defaults from `any` to `None` so they can be type hinted in old Python
* Pre-filter on given hashes instead of iterating over all db specs
* Fix a bug where the `--origin` option of uninstall had no effect
* Fix a bug where query args were not applied when searching by concrete spec

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-24 08:13:07 +02:00
Harmen Stoppels
79ad6f6b48
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.
2024-10-23 21:17:40 +00:00
Scott Wittenburg
1472dcace4
ci: Remove deprecated logic from the ci module (#47062)
ci: Remove deprecated logic from the ci module

Remove the following from the ci module, schema, and tests:

- deprecated ci stack and handling of old ci config
- deprecated mirror handling logic
- support for artifacts buildcache
- support for temporary storage url
2024-10-23 12:50:55 -06:00
Todd Gamblin
f33912d707
mypy: work around typing issues with functools.partial (#47160) 2024-10-23 06:33:09 -06:00
dependabot[bot]
e785d3716e
build(deps): bump sphinx from 7.4.7 to 8.1.3 in /lib/spack/docs (#47159)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.7 to 8.1.3.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/v8.1.3/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.7...v8.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-23 06:18:20 -06:00
Massimiliano Culpo
ed15b73c3b
Remove spurious warning, introduced in #46992 (#47152)
fixes #47135

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-23 07:33:09 +02:00
dependabot[bot]
50aa5a7b24
build(deps): bump black from 24.8.0 to 24.10.0 in /lib/spack/docs (#47118)
Bumps [black](https://github.com/psf/black) from 24.8.0 to 24.10.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/24.8.0...24.10.0)

---
updated-dependencies:
- dependency-name: black
  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>
2024-10-22 18:58:31 +02:00
Harmen Stoppels
ef9bb7ebe5
spack arch: add --family --generic flags (#47078)
This allows users to do:

```
spack install ... target=$(spack arch --target --family)
spack install ... arch=$(spack arch --family)

spack install ... target=$(spack arch --target --generic)
spack install ... arch=$(spack arch --generic)
```

Deprecate `--generic-target` in favor of `--generic --target`
2024-10-22 14:13:11 +00:00
Harmen Stoppels
cbad3d464a
buildcache: recognize . and .. as paths instead of names (#47105) 2024-10-22 13:05:06 +02:00
Peter Scheibel
275d1d88f4
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-10-21 18:44:28 +00:00
Tom Scogland
a07d42d35b
Devtools darwin (#46910)
* stacks: add a stack for devtools on darwin

After getting this whole mess building on darwin, let's keep it that
way, and maybe make it so we have some non-ML darwin binaries in spack
as well.

* reuse: false for devtools

* dtc: fix darwin dylib name and id

On mac the convention is `lib<name>.<num>.dylib`, while the makefile
creates a num suffixed one by default. The id in the file is also a
local name rather than rewritten to the full path, this fixes both
problems.

* node-js: make whereis more deterministic

* relocation(darwin): catch Mach-O load failure

The MachO library can throw an exception rather than return no headers,
this happened in an elf file in the test data of go-bootstrap.  Trying
catching the exception and moving on for now.  May also need to look
into why we're trying to rewrite an elf file.

* qemu: add darwin flags to clear out warnings

There's a build failure for qemu in CI, but it's invisible because of
the immense mass of warning output.  Explicitly specify the target macos
version and remove the extraneous unknown-warning-option flag.

* dtc: libyaml is also a link dependency

libyaml is required at runtime to run the dtc binary, lack of it caused
the ci for qemu to fail when the library wasn't found.
2024-10-21 17:32:14 +00:00
Harmen Stoppels
19ad29a690
bootstrap: handle a new edge case of binary python packages with missing python-venv (#47094)
relevant for clingo installed without gcc-runtime and python-venv, which
is done for good reasons.
2024-10-21 10:46:13 -06:00
Massimiliano Culpo
4187c57250
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-10-21 18:03:57 +02:00
Jordan Galby
e5a602c1bb
Modules suffixes config are now spec format strings (#38411) 2024-10-21 09:08:59 +02:00
Tamara Dahlgren
260b36e272
Docs: clarify include path options (#47083) 2024-10-21 07:26:18 +02:00
Harmen Stoppels
9b8c06a049
spack external find: show backtrace on error when --backtrace (#47082) 2024-10-19 15:45:59 +02:00
dependabot[bot]
011ff48f82
build(deps): bump python-levenshtein in /lib/spack/docs (#46494)
Bumps [python-levenshtein](https://github.com/rapidfuzz/python-Levenshtein) from 0.25.1 to 0.26.0.
- [Release notes](https://github.com/rapidfuzz/python-Levenshtein/releases)
- [Changelog](https://github.com/rapidfuzz/python-Levenshtein/blob/main/HISTORY.md)
- [Commits](https://github.com/rapidfuzz/python-Levenshtein/compare/v0.25.1...v0.26.0)

---
updated-dependencies:
- dependency-name: python-levenshtein
  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>
2024-10-19 12:12:13 +02:00
Wouter Deconinck
31bdcd7dc6
rtd: bump sphinx-rtd-theme to 3.0.1 (#47002) 2024-10-19 03:29:36 +02:00
John W. Parent
31cfcafeba
Build logic fix: reorder definition of package module variables (#46992)
#44327 made sure to always run `set_package_py_globals` on all
packages before running `setup_dependent_package` for any package,
so that packages implementing the latter could depend on variables
like `spack_cc` being defined.

This ran into an undocumented dependency: `std_cmake_args` is set in
`set_package_py_globals` and makes use of `cmake_prefix_paths` (if it
is defined in the package); `py-torch`es implementation of
`cmake_prefix_paths` depends on a variable set by
`setup_dependent_package` (`python_platlib`).

This generally restores #44327, and corrects the resulting issue by
moving assignment of `std_cmake_args` to after both actions have been
run.
2024-10-18 13:36:16 -07:00
Sean Koyama
c006cb573a
implement prefix property for OneAPI compiler (#47066) 2024-10-18 11:50:12 -04:00
Harmen Stoppels
c6bfe7c6bd
fix use of traceback.format_exception (#47080)
Co-authored-by: Peter Scheibel <scheibel1@llnl.gov>
2024-10-18 14:54:21 +00:00
kwryankrattiger
34c89c0f7b
CI RESTful Configuration (#41622)
* CI: Add dynamic mapping section

* Doc: Add documentation for dynamic mapping section

* Add missing schema property

* Fixes from review

* query build fix up
* add warning output for dynamic mapping request errors

* Cleanup ci schema

* Add more protections for disabling/mitigating bad endpoints for dynamic
mapping

* Remove references to "gantry" in the docs

* Fixup rtd header

* Add unit testing for dynamic-mapping section

* Add arch to dynamic-mapping query string

* Tests and cleanup schema
2024-10-16 14:06:09 -06:00
Massimiliano Culpo
cbdc07248f
unit-tests: install.py (#47007)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-16 15:02:52 +02:00
Harmen Stoppels
8c70912b11
Update release documentation (#46991) 2024-10-16 09:11:53 +02:00
Massimiliano Culpo
64f90c38be
unit-tests: oci/integration_test.py (#47006)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-16 09:09:52 +02:00
psakievich
0477875667
remove concrete spec constraint from spack develop (#46911)
Remove the constraint for concrete specs and simply take the
max(version) if a version is not given. This should default to the
highest infinity version which is also the logical best guess for
doing development.

* Remove concrete verision constriant for develop, set docs

* Add unit-test

* Update lib/spack/docs/environments.rst

Co-authored-by: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>

* Update lib/spack/spack/cmd/develop.py

Co-authored-by: Greg Becker <becker33@llnl.gov>

* Consolidate env collection in cmd

* Style

---------

Co-authored-by: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>
Co-authored-by: Greg Becker <becker33@llnl.gov>
2024-10-15 17:46:27 +00:00
Tobias Ribizel
834ed2f117
env depfile: generate Makefile with absolute script path (#46966)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2024-10-15 13:52:31 +00:00
Massimiliano Culpo
2f711bda5f
Improve behavior of spack deprecate (#46917)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-15 09:04:12 +02:00
kwryankrattiger
c8f61c8662
Don't require OIDC initialization for noop (#46921)
ref. https://github.com/spack/spack-infrastructure/pull/957
2024-10-14 23:39:55 -05:00
Tamara Dahlgren
507965cbc6
Docs: reduce confusion in configuration override of scope precedence section (#46977) 2024-10-15 04:07:48 +00:00
Harmen Stoppels
21c2eedb80
detection: prefer dir instead of symlink in case of duplicate search paths (#46957) 2024-10-14 17:09:55 +00:00
Massimiliano Culpo
66a3c7bc42
archspec: update to v0.2.5 (#46958)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-14 19:09:17 +02:00
Harmen Stoppels
8b3d3ac2de
cmake: remove custom CMAKE_INSTALL_RPATH (#46685)
The CMake builder in Spack actually adds incorrect rpaths. They are
unfiltered and incorrectly ordered compared to what the compiler wrapper
adds.

There is no need to specify paths to dependencies in `CMAKE_INSTALL_RPATH`
because of two reasons:

1. CMake preserves "toolchain" rpaths, which includes the rpaths injected
   by our compiler wrapper.
2. We use `CMAKE_INSTALL_RPATH_USE_LINK_PATH=ON`, so libraries we link
   to are rpath'ed automatically.

However, CMake does not create install rpaths to directories in the package's
own install prefix, so we set `CMAKE_INSTALL_RPATH` to the educated guess
`<prefix>/{lib,lib64}`, but omit dependencies.
2024-10-14 12:35:50 +02:00
John W. Parent
6c6b262140
Add "only_windows" marker for unit tests (#45979) 2024-10-14 09:02:49 +02:00
Jordan Galby
02a991688f
Fix makefile target check with Make jobserver keep-going (#46784) 2024-10-13 15:02:49 -07:00
Massimiliano Culpo
d5966e676d
Fix splicing related unit tests (#46914)
Some assertion are not testing DAG invariants, and they are passing only
because of the simple structure of the builtin.mock repository on develop.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-12 00:25:41 +00:00
Stephen Sachs
22043617aa
libunistring: 1.2 needs std=c18 for icc, add icc C++ flags update (#37607) 2024-10-11 02:25:32 +02:00
Nathan Hanford
af62a062cc
Installer: rewire spliced specs via RewireTask (#39136)
This PR allows users to configure explicit splicing replacement of an abstract spec in the concretizer.

concretizer:
  splice:
    explicit:
    - target: mpi
      replacement: mpich/abcdef
      transitive: true

This config block would mean "for any spec that concretizes to use mpi, splice in mpich/abcdef in place of the mpi it would naturally concretize to use. See #20262, #26873, #27919, and #46382 for PRs enabling splicing in the Spec object. This PR will be the first place the splice method is used in a user-facing manner. See https://spack.readthedocs.io/en/latest/spack.html#spack.spec.Spec.splice for more information on splicing.

This will allow users to reuse generic public binaries while splicing in the performant local mpi implementation on their system.

In the config file, the target may be any abstract spec. The replacement must be a spec that includes an abstract hash `/abcdef`. The transitive key is optional, defaulting to true if left out.

Two important items to note:

1. When writing explicit splice config, the user is in charge of ensuring that the replacement specs they use are binary compatible with whatever targets they replace. In practice, this will likely require either specific knowledge of what packages will be installed by the user's workflow, or somewhat more specific abstract "target" specs for splicing, to ensure binary compatibility.
2. Explicit splices can cause the output of the concretizer not to satisfy the input. For example, using the config above and consider a package in a binary cache `hdf5/xyzabc` that depends on mvapich2. Then the command `spack install hdf5/xyzabc` will instead install the result of splicing `mpich/abcdef` into `hdf5/xyzabc` in place of whatever mvapich2 spec it previously depended on. When this occurs, a warning message is printed `Warning: explicit splice configuration has caused the the concretized spec {concrete_spec} not to satisfy the input spec {input_spec}".

Highlighted technical details of implementation:

1. This PR required modifying the installer to have two separate types of Tasks, `RewireTask` and `BuildTask`. Spliced specs are queued as `RewireTask` and standard specs are queued as `BuildTask`. Each spliced spec retains a pointer to its build_spec for provenance. If a RewireTask is dequeued and the associated `build_spec` is neither available in the install_tree nor from a binary cache, the RewireTask is requeued with a new dependency on a BuildTask for the build_spec, and BuildTasks are queued for the build spec and its dependencies.
2. Relocation is modified so that a spack binary can be simultaneously installed and rewired. This ensures that installing the build_spec is not necessary when splicing from a binary cache.
3. The splicing model is modified to more accurately represent build dependencies -- that is, spliced specs do not have build dependencies, as spliced specs are never built. Their build_specs retain the build dependencies, as they may be built as part of installing the spliced spec.
4. There were vestiges of the compiler bootstrapping logic that were not removed in #46237 because I asked alalazo to leave them in to avoid making the rebase for this PR harder than it needed to be. Those last remains are removed in this PR.

Co-authored-by: Nathan Hanford <hanford1@llnl.gov>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
2024-10-10 15:48:58 -07:00
pauleonix
caaaba464e
cuda: add v12.6.2 (#46864)
* cuda: Add 12.6.2
* Update cuda build system
   - Remove gcc@6 conflict that was only a deprecation (probably has be added again with cuda@13)
   - Update cuda_arch support by CUDA version
   - Kepler support has ended with cuda@12
   - Recently added 90a Hopper "experimental" features architecture was
    missing the dependency on cuda@12:
2024-10-10 09:48:20 -06:00
psakievich
afc01f9570
CMake: Improve incremental build speed. (#46878)
* CMake: Improve incremental build speed.

CMake automatically embeds an updated configure step into make/ninja that will be called during the build phase.  By default if a `CMakeCache.txt` file exists in the build directory CMake will use it and this + `spec.is_develop` is sufficient evidence of an incremental build.

This PR removes duplicate work/expense from CMake packages when using `spack develop`.

* Update cmake.py

* [@spackbot] updating style on behalf of psakievich

* Update cmake.py

meant self not spec...

---------

Co-authored-by: psakievich <psakievich@users.noreply.github.com>
2024-10-10 00:45:10 -06:00
Greg Becker
f807337273
Environment.clear: ensure clearing is passed through to manifest (#46880)
* Environment.clear: ensure clearing is passed through to manifest
* test/cmd/env: make test_remove_commmand round-trip to disk
* cleanup vestigial variables
2024-10-09 11:13:56 -07:00
Massimiliano Culpo
8e4e3c9060
python: rework how we compute the "command" property (#46850)
Some Windows Python installations may store the Python exe in Scripts/
rather than the base directory. Update `.command` to search in both
locations on Windows. On all systems, the search is now done
recursively from the search root: on Windows, that is the base install
directory, and on other systems it is bin/.
2024-10-09 01:08:27 -06:00
Massimiliano Culpo
d70e9e131d
Fix relocating MachO binary, when store projection changes (#46840)
* Remove "modify_object_macholib"

According to documentation, this function is used when installing
Mach-O binaries on linux. The implementation seems questionable at
least, and the code seems to be never hit (Spack currently doesn't
support installing Mach-O binaries on linux).

* Fix relocation on macOS, when store projection changes

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-08 13:32:28 +02:00
James Smillie
a09b9f0659
Windows/Testing: enable spack view tests on Windows (#46335)
Enable tests for symlink-based views (this works with almost no
modifications to the view logic). View logic is not yet robust
for hardlink/junction-based views, so those are disabled for now
(both in the tests and as subcommands to `spack view`).
2024-10-07 16:05:23 -07:00
John W. Parent
717d4800e1
Qt package: Add Windows Port (#46788)
Also adds support for Paraview and CMake to build with Qt support on
Windows.

The remaining edits are to enable building of Qt itself on Windows:

* Several packages needed to update `.libs` to properly locate
  libraries on Windows
* Qt needed a patch to allow it to build using a Python with a space
  in the path
* Some Qt dependencies had not been ported to Windows yet
  (e.g. `harfbuzz` and `lcms`)

This PR does not provide a sufficient GL for Qt to use Qt Quick2, as
such Qt Quick2 is disabled on the Windows platform by this PR.

---------

Co-authored-by: Dan Lipsa <dan.lipsa@kitware.com>
2024-10-07 13:33:25 -07:00
Tamara Dahlgren
c77916146c
Bugfix/Installer: properly track task queueing (#46293)
* Bugfix/Installer: properly track task queueing
* Move ordinal() to llnl.string; change time to attempt
* Convert BuildTask to use kwargs (after pkg); convert STATUS_ to BuildStats enum
* BuildTask: instantiate with keyword only args after the request
* Installer: build request is required for initializing task
* Installer: only the initial BuildTask cannnot have status REMOVED
* Change queueing check
* ordinal(): simplify suffix determination [tgamblin]
* BuildStatus: ADDED -> QUEUED [becker33]
* BuildTask: clarify TypeError for 'installed' argument
2024-10-07 10:42:09 -07:00
Todd Gamblin
d763d6f738
gc: restrict to specific specs (#46790)
`spack gc` has so far been a global or environment-specific thing.
This adds the ability to restrict garbage collection to specific specs,
e.g. if you *just* want to get rid of all your unused python installations,
you could write:

```console
spack gc python
```

- [x] add `constraint` arg to `spack gc`
- [x] add a simple test

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-04 17:43:10 -07:00
Massimiliano Culpo
1756aeb45a
re2c: rework package to use multiple build systems (#46748)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-04 20:48:58 +03:00
Todd Gamblin
3c2a682876
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-10-03 14:36:53 -07:00
AcriusWinter
76243bfcd7
Stand-alone testing: remove deprecated methods (#45752)
* Stand-alone testing: remove deprecated methods
* audit: replace deprecated test method checks for test callbacks (AcriusWinter)
* install_test: replace deprecated with new test method name starts (AcriusWinter)
* package_base: removed deprecated test methods (AcriusWinter)
* test/package_class: remove deprecated test methods (AcriusWinter)
* test/reporters: remove deprecated test methods (AcriusWinter)
* reporters/extract: remove deprecated test-related methods (AcriusWinter)
* py-test-callback: rename test in callbacks and output (AcriusWinter)
* reporters/extract: remove deprecated expected failure output capture (AcriusWinter)
* stand-alone test cleanup: f-string, remove deprecation warning, etc. (AcriusWinter)
* stand-alone tests: f-string fix and remove unused imports (AcriusWinter)
* package_base: finish removing the rest of deprecated run_test method (AcriusWinter)
* py-test-callback: remove stand-alone test method (AcriusWinter)
* package_base: remove now unused imports (AcriusWinter)
* Python: test_imports replaces test (tldahlgren)
* mptensor, trivial-smoke-test: replace deprecated cache_extra_test_sources method (tldahlgren)
* trivial-smoke-test: replace deprecated install_test_root method (tldahlgren)
* docs: update perl and scons package's test methods (tldahlgren)
* builder: remove deprecated test() method (tldahlgren)
* Update legion and mfem test data for stand-alone tests (tldahlgren)
* py-test-callback: restore the test method
* Audit/stand-alone testing: Fix and added stand-alone test audit checks
   - fix audit failure message for build-time test callback check
   - remove empty test method check during stand-alone testing
   - change build-time test callback check to package_properties
   - add test method docstring audit check and mock fail-test-audit-docstring pkg
   - add test method implementation audit check and mock fail-test-audit-impl pkg
   - add new mock packages to test_package_audits and test_test_list_all
* audits: loosen docstring content constraints
* Add missing test method docstring
* py-test-callback: resolve builder issues
* Audits: Add checks for use of deprecated stand-alone test methods; improve output for other test-related checks
* Fix style issues
* test_test_list_all: add new fail-test-audit-deprecated package

---------

Signed-off-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2024-10-03 11:36:18 +00:00
kwryankrattiger
742e8142cf
Do not fail noop jobs in Spack CI (#46713) 2024-10-02 16:04:21 -06:00
Harmen Stoppels
fcf72201d3
aspell_dict: remove unused import (#46716) 2024-10-02 17:49:04 +02:00
Alec Scott
dcdc678b19
GoPackage: fix attributes to allow for custom build_directory values (#46707) 2024-10-02 06:23:13 -06:00
Andrew W Elble
4016172938
cuda: add conflict for aarch64 with gcc-13.2.0 and cuda@12.4 (#46694)
https://github.com/spack/spack/pull/39666#issuecomment-2377609263
2024-10-02 06:05:07 -06:00
Harmen Stoppels
8ccf244c6b
Revert "cc: ensure that RPATHs passed to linker are unique" (#46712)
* Revert "`cc`: ensure that RPATHs passed to linker are unique"

This reverts commit 2613a14c43.

* Revert "`cc`: simplify ordered list handling"

This reverts commit a76a48c42e.
2024-10-02 11:50:09 +02:00
Tamara Dahlgren
c8efea117f
Docs: environment update (#44087)
Updated the terminology for the two types of environments to be
consistent with that used in the tutorial for the last three years.

Additionally:
* changed 'anonymous' to 'independent in environment command+test for consistency.
2024-10-01 22:26:31 +02:00
Harmen Stoppels
e4f571b1ee
build_environment: small cleanup and add todo comments (#46687) 2024-10-01 18:35:23 +02:00
Harmen Stoppels
44618e31c8
stable_partition: use TypeVar (#46686) 2024-10-01 15:58:24 +02:00
Massimiliano Culpo
acce67241e
Do not use single letter packages in unit-tests (#46665)
#45205 already removed previous use of single letter packages
from unit tests, in view of reserving `c` as a language (see #45191).

Some use of them has been re-introduced accidentally in #46382, and
is making unit-tests fail in the feature branch #45189 since there
`c` is a virtual package.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-01 02:33:24 +00:00
Harmen Stoppels
02499c72c9
avoid rpath'ing default search paths (#44686)
On sysroot systems like gentoo prefix, as well as nix/guix, our "is
system path" logic is broken cause it's static.

Talking about "the system paths" is not helpful, we have to talk
about default search paths of the dynamic linker instead.

If glibc is recent enough, we can query the dynamic loader's default
search paths, which is a much more robust way to avoid registering
rpaths to system dirs, which can shadow Spack dirs.

This PR adds an **additional** filter on rpaths the compiler wrapper
adds, dropping rpaths that are default search paths. The PR **does
not** remove any of the original `is_system_path` code yet.

This fixes issues where build systems run just-built executables
linked against their *not-yet-installed libraries*, typically:

```
LD_LIBRARY_PATH=. ./exe
```

which happens in `perl`, `python`, and other non-cmake packages.
If a default path is rpath'ed, it takes precedence over
`LD_LIBRARY_PATH`, and a system library gets loaded instead
of the just-built library in the stage dir, breaking the build. If
default paths are not rpath'ed, then LD_LIBRARY_PATH takes
precedence, as is desired.

This PR additionally fixes an inconsistency in rpaths between
cmake and non-cmake packages. The cmake build system
computed rpaths by itself, but used a different order than
computed for the compiler wrapper. In fact it's not necessary
to compute rpaths at all, since we let cmake do that thanks to
`CMAKE_INSTALL_RPATH_USE_LINK_PATH`. This covers rpaths
for all dependencies. The only install rpaths we need to set are
`<install prefix>/{lib,lib64}`, which cmake unfortunately omits,
although it could also know these. Also, cmake does *not*
delete rpaths added by the toolchain (i.e. Spack's compiler
wrapper), so I don't think it should be controversial to simplify
things.
2024-09-30 20:32:50 +02:00
Alec Scott
5c8d22c597
Better shell completion support for packages (#44756) 2024-09-27 16:02:37 -07:00
Greg Becker
07e964c688
Spec.splice: Allow splices when multiples nodes in the DAG share a name (#46382)
The current `Spec.splice` model is very limited by the inability to splice specs that
contain multiple nodes with the same name.  This is an artifact of the original
algorithm design predating the separate concretization of build dependencies,
which was the first feature to allow multiple specs in a DAG to share a name.

This PR provides a complete reimplementation of `Spec.splice` to avoid that
limitation. At the same time, the new algorithm ensures that build dependencies
for spliced specs are not changed, since the splice by definition cannot change
the build-time information of the spec. This is handled by splitting the dependency
edges and link/run edges into separate dependencies as needed.

Signed-off-by: Gregory Becker <becker33@llnl.gov>
2024-09-27 13:58:43 -07:00
kwryankrattiger
35b2750407
CI: Add documentation for adding new stacks and runners (#42179)
* CI: Add documentation for adding new stacks and runners
* More docs for runner registration

---------

Co-authored-by: Zack Galbreath <zack.galbreath@kitware.com>
Co-authored-by: Bernhard Kaindl <contact@bernhard.kaindl.dev>
2024-09-27 13:09:41 -07:00
Massimiliano Culpo
639854ba8b
spec: simplify string formatting (#46609)
This PR shorten the string representation for concrete specs,
in order to make it more legible.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-27 12:59:14 -07:00
Alec Scott
9b5f15abec
docs: add --depth=2 to reduce download size (#46605)
* docs: add --depth=2 to reduce download size

* Add note to tell users about --depth=2 and manyFiles

* Fix inline code in info block
2024-09-27 09:09:19 -07:00
Todd Gamblin
2613a14c43 cc: ensure that RPATHs passed to linker are unique
macOS Sequoia's linker will complain if RPATHs on the CLI are specified more than once.
To avoid errors due to this, make `cc` only append unique RPATHs to the final args list.

This required a few improvements to the logic in `cc`:

1. List functions in `cc` didn't have any way to append unique elements to a list. Add a
   `contains()` shell function that works like our other list functions. Use it to implement
   an optional `"unique"` argument to `append()` and an `extend_unique()`. Use that to add
   RPATHs to the `args_list`.

2. In the pure `ld` case, we weren't actually parsing `RPATH` arguments separately as we
   do for `ccld`. Fix this by adding *another* nested case statement for raw `RPATH`
   parsing. There are now 3 places where we deal with `-rpath` and friends, but I don't
   see a great way to unify them, as `-Wl,`, `-Xlinker`, and raw `-rpath` arguments are
   all ever so slightly different.

3. Fix ordering of assertions to make `pytest` diffs more intelligible. The meaning of
   `+` and `-` in diffs changed in `pytest` 6.0 and the "preferred" order for assertions
   became `assert actual == expected` instead of the other way around.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-27 05:27:26 -07:00
Todd Gamblin
a76a48c42e cc: simplify ordered list handling
`cc` divides most paths up into system paths, spack managed paths, and other paths.
This gets really repetitive and makes the code hard to read. Simplify the script
by adding some functions to do most of the redundant work for us.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-27 05:27:26 -07:00
Richard Berger
7d6231b38a
aspell: various fixes and updates (#46383)
SimpleFilesystemView was producing an error due to looking for a
<prefix>/lib/.spack folder. Also, view_destination had no effect and
wasn't called. Changed this by instead patching in the correct
installation prefix for dictionaries.

Since aspell is using the resolved path of the executable prefix, the
runtime environment variable ASPELL_CONF is set to correct the prefix
when in a view. With this change aspell can now find installed
dictionaries. Verified with:

aspell dump config
aspell dump dicts
2024-09-27 10:48:08 +02:00
psakievich
ea6e39805a
Add a custom hook for dev_path changes (#46529)
* Add a custom hook for dev_path changes

Co-authored-by: Greg Becker <becker33@llnl.gov>
2024-09-26 08:59:13 -07:00
Harmen Stoppels
f01dbe2c35
Remove a few redundant imports (#46512) 2024-09-25 10:05:11 +02:00
Samuel Browne
022eca1cfe
Fix off-by-one padding bug (#46560)
If `add_padding()` is allowed to return a path with a trailing path
separator, it will get collapsed elsewhere in Spack. This can lead to
buildcache entries that have RPATHS that are too short to be replaced by
other users whose install root happens to be padded to the correct
length.  Detect this and replace the trailing path separator with a
concrete path character.

Signed-off-by: Samuel E. Browne <sebrown@sandia.gov>
2024-09-24 15:37:52 -06:00
Todd Gamblin
c070ddac97
database: don't call socket.getfqdn() on every write (#46554)
We've seen `getfqdn()` cause slowdowns on macOS in CI when added elsewhere. It's also
called by database.py every time we write the DB file.

- [x] replace the call with a memoized version so that it is only called once per process.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-23 23:59:07 -07:00
Massimiliano Culpo
679770b02c
solver: use a new heuristic (#46548)
This PR introduces a new heuristic for the solver, which behaves better when
compilers are treated as nodes. Apparently, it performs better also on `develop`,
where compilers are still node attributes.

The new heuristic:
- Sets an initial priority for guessing a few attributes. The order is "nodes" (300), 
  "dependencies" (150), "virtual dependencies" (60), "version" and "variants" (30), and
  "targets" and "compilers" (1). This initial priority decays over time during the solve, and
  falls back to the defaults.

- By default, it considers most guessed facts as "false". For instance, by default a node
  doesn't exist in the optimal answer set, or a version is not picked as a node version etc.

- There are certain conditions that override the default heuristic using the _priority_ of
  a rule, which previously we didn't use. For instance, by default we guess that a
  `attr("variant", Node, Variant, Value)` is false, but if we know that the node is already
  in the answer set, and the value is the default one, then we guess it is true.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-23 23:44:47 -07:00
Justin Cook
971577d853
spec: fix spelling (#46550)
Signed-off-by: Justin Cook <jscook@lbl.gov>
2024-09-24 07:06:54 +02:00
Massimiliano Culpo
b93c57cab9
Remove spack.target from code (#46503)
The `spack.target.Target` class is a weird entity, that is just needed to:

1. Sort microarchitectures in lists deterministically
2. Being able to use microarchitectures in hashed containers

This PR removes it, and uses `archspec.cpu.Microarchitecture` directly. To sort lists, we use a proper `key=` when needed. Being able to use `Microarchitecture` objects in sets is achieved by updating the external `archspec`.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-21 14:05:41 +02:00
John W. Parent
cfee88a5bb
Docs/Windows: Clarify supported shells and caveats (#46381)
While the existing getting started guide does in fact reference the
powershell support, it's a footnote and easily missed. This PR adds
explicit, upfront mentions of the powershell support. Additionally
this PR adds notes about some of the issues with certain components
of the spec syntax when using CMD.
2024-09-20 11:55:17 -07:00
Harmen Stoppels
7711730f2c
spack.modules: move get_module up (#46428) 2024-09-20 19:30:09 +02:00
Massimiliano Culpo
b28583bc58
Remove code from Compiler that is not used anymore (#45982)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-20 10:00:34 +02:00
Tamara Dahlgren
f9f6f094c3
do_install: post #46423 cleanup (#46496) 2024-09-20 09:45:31 +02:00
Harmen Stoppels
e4927b35d1
package_base: break dependency on installer (#46423)
Removes `spack.package_base.PackageBase.do_{install,deprecate}` in favor of
`spack.installer.PackageInstaller.install` and `spack.installer.deprecate` resp.

That drops a dependency of `spack.package_base` on `spack.installer`, which is
necessary to get rid of circular dependencies in Spack.

Also change the signature of `PackageInstaller.__init__` from taking a dict as
positional argument, to an explicit list of keyword arguments.
2024-09-19 23:25:36 +02:00
Harmen Stoppels
db7aece186
require spec in develop entry (#46485) 2024-09-19 20:11:22 +02:00
Harmen Stoppels
1d18f571ae
url join: fix oci scheme (#46483)
* url.py: also special case oci scheme in join

* avoid fetching keys from oci mirror
2024-09-19 16:06:44 +02:00
Harmen Stoppels
586360a8fe
Revert "For "when:" and install_environment.json: Support fully qualified hos…" (#46478)
This reverts commit 6b0011c8f1.

It caused a major performance penalty in unit test time on macOS (about 30 minutes).
2024-09-19 15:34:12 +02:00
Harmen Stoppels
7395656663
docs: refer to upstreams.yaml in chain.rst title (#46475) 2024-09-19 13:08:05 +02:00
Harmen Stoppels
d0b736607b
spack.util.url: fix join breakage in python 3.12.6 (#46453) 2024-09-19 12:29:56 +02:00
Harmen Stoppels
fe5d7881f5
avoid multiprocessing in tests (#46439)
- silences a few pytest warnings related to forking in xdist
- speeds up a few tests / avoids possible oversubscription in xdist
2024-09-19 10:34:23 +02:00
Massimiliano Culpo
314a3fbe77
Bump archspec to latest commit (#46445)
This should fix an issue with Neoverse XX detection

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-18 00:54:39 +00:00
Todd Gamblin
9818002219
variants: Unify metadata dictionaries to index by when (#44425)
Continuing the work started in #40326, his changes the structure
of Variant metadata on Packages from a single variant definition
per name with a list of `when` specs:

```
name: (Variant, [when_spec, ...])
```

to a Variant definition per `when_spec` per name:

```
when_spec: { name: Variant }
```

With this change, everything on a package *except* versions is
 keyed by `when` spec. This:

1. makes things consistent, in that conditional things are (nearly)
   all modeled in the same way; and

2. fixes an issue where we would lose information about multiple
   variant definitions in a package (see #38302). We can now have,
   e.g., different defaults for the same variant in different
   versions of a package.

Some notes:

1. This required some pretty deep changes to the solver. Previously,
   the solver's job was to select value(s) for a single variant definition
   per name per package. Now, the solver needs to:

   a. Determine which variant definition should be used for a given node,
      which can depend on the node's version, compiler, target, other variants, etc.
   b. Select valid value(s) for variants for each node based on the selected
      variant definition.

   When multiple variant definitions are enabled via their `when=` clause, we will
   always prefer the *last* matching definition, by declaration order in packages. This
   is implemented by adding a `precedence` to each variant at definition time, and we
   ensure they are added to the solver in order of precedence.

   This has the effect that variant definitions from derived classes are preferred over
   definitions from superclasses, and the last definition within the same class sticks.
   This matches python semantics. Some examples:

    ```python
    class ROCmPackage(PackageBase):
        variant("amdgpu_target", ..., when="+rocm")

    class Hipblas(ROCmPackage):
        variant("amdgpu_target", ...)
    ```

   The global variant in `hipblas` will always supersede the `when="+rocm"` variant in
   `ROCmPackage`. If `hipblas`'s variant was also conditional on `+rocm` (as it probably
   should be), we would again filter out the definition from `ROCmPackage` because it
   could never be activated. If you instead have:

    ```python
    class ROCmPackage(PackageBase):
        variant("amdgpu_target", ..., when="+rocm")

    class Hipblas(ROCmPackage):
        variant("amdgpu_target", ..., when="+rocm+foo")
    ```

   The variant on `hipblas` will win for `+rocm+foo` but the one on `ROCmPackage` will
   win with `rocm~foo`.

   So, *if* we can statically determine if a variant is overridden, we filter it out.
   This isn't strictly necessary, as the solver can handle many definitions fine, but
   this reduces the complexity of the problem instance presented to `clingo`, and
   simplifies output in `spack info` for derived packages. e.g., `spack info hipblas`
   now shows only one definition of `amdgpu_target` where before it showed two, one of
   which would never be used.

2. Nearly all access to the `variants` dictionary on packages has been refactored to
   use the following class methods on `PackageBase`:
    * `variant_names(cls) -> List[str]`: get all variant names for a package
    * `has_variant(cls, name) -> bool`: whether a package has a variant with a given name
    * `variant_definitions(cls, name: str) -> List[Tuple[Spec, Variant]]`: all definitions
      of variant `name` that are possible, along with their `when` specs.
    * `variant_items() -> `: iterate over `pkg.variants.items()`, with impossible variants
      filtered out.

   Consolidating to these methods seems to simplify the code a lot.

3. The solver does a lot more validation on variant values at setup time now. In
   particular, it checks whether a variant value on a spec is valid given the other
   constraints on that spec. This allowed us to remove the crufty logic in
   `update_variant_validate`, which was needed because we previously didn't *know* after
   a solve which variant definition had been used. Now, variant values from solves are
   constructed strictly based on which variant definition was selected -- no more
   heuristics.

4. The same prevalidation can now be done in package audits, and you can run:

   ```
   spack audit packages --strict-variants
   ```

   This turns up around 18 different places where a variant specification isn't valid
   given the conditions on variant definitions in packages. I haven't fixed those here
   but will open a separate PR to iterate on them. I plan to make strict checking the
   defaults once all existing package issues are resolved. It's not clear to me that
   strict checking should be the default for the prevalidation done at solve time.

There are a few other changes here that might be of interest:

  1. The `generator` variant in `CMakePackage` is now only defined when `build_system=cmake`.
  2. `spack info` has been updated to support the new metadata layout.
  3.  split out variant propagation into its own `.lp` file in the `solver` code.
  4. Add better typing and clean up code for variant types in `variant.py`.
  5. Add tests for new variant behavior.
2024-09-17 09:59:05 -07:00
Harmen Stoppels
aa6651fe27
drop main dep from build_environment/subprocess_context (#46426) 2024-09-17 17:06:16 +02:00
Harmen Stoppels
3ded2fc9c5
untangle spack.config / spack.util.cpus & spack.spec (#46427) 2024-09-17 17:06:00 +02:00
Harmen Stoppels
623c5a4d24
package_base.py: do not depend on spack.environment (#46424) 2024-09-17 14:43:03 +02:00
Harmen Stoppels
673565aefe
imports: automate missing imports (#46410) 2024-09-17 07:45:59 +02:00
Massimiliano Culpo
61d6c5486c
Add repositories for "requirements" and "flag mixing" unit tests (#46412) 2024-09-16 17:59:35 +02:00
Harmen Stoppels
55e0ef1e64
Add missing & remove redundant imports (#46407) 2024-09-16 12:54:16 +02:00
Harmen Stoppels
8225b18985
Fix a few circular deps (#46373) 2024-09-16 09:15:51 +02:00
Harmen Stoppels
b4e32706db
fetch_strategy: show the effective URL on checksum validation failure (#46349) 2024-09-15 20:26:02 +02:00
dependabot[bot]
d04358c369
build(deps): bump urllib3 from 2.2.2 to 2.2.3 in /lib/spack/docs (#46368)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 08:15:21 -05:00
Kyle Knoepfel
4fe417b620
Optionally output package namespace (#46359) 2024-09-13 08:08:58 -05:00
Harmen Stoppels
7573ea2ae5
audit: deprecate certain globals (#44895) 2024-09-13 13:21:58 +02:00
Harmen Stoppels
71df434d1f
remove self-import cycles (#46371) 2024-09-13 11:16:36 +02:00
dependabot[bot]
d8d1bc5d7e
build(deps): bump pytest from 8.3.2 to 8.3.3 in /lib/spack/docs (#46315)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-12 08:57:05 -07:00
Peter Scheibel
527e0fb4b4
bugfix: unit test broken everywhere by package change(#46344)
Openmpi provider statements were changed in #46102. The package change
was fine in and of itself, but apparently one of our tests depends on
the precise constraints used in those statements. I updated the test
to remove the checks for constraints that were removed.
2024-09-11 19:52:40 -07:00
Adam J. Stewart
5fa8890bd3
CUDA: support Grace Hopper 9.0a compute capability (#45540)
* CUDA: support Grace Hopper 9.0a compute capability

* Fix other packages

* Add type annotations

* Support ancient Python versions

* isort

* spec -> self.spec

Co-authored-by: Andrew W Elble <aweits@rit.edu>

* [@spackbot] updating style on behalf of adamjstewart

---------

Co-authored-by: Andrew W Elble <aweits@rit.edu>
Co-authored-by: adamjstewart <adamjstewart@users.noreply.github.com>
2024-09-11 17:43:20 +02:00
Massimiliano Culpo
ffdfa498bf
Deprecate config:install_missing_compilers (#46237)
The option config:install_missing_compilers is currently buggy,
and has been for a while. Remove it, since it won't be needed
when compilers are treated as dependencies.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-10 20:02:05 +02:00
Harmen Stoppels
0905edf592
r: do not create dir in setup_dependent_package (#46282) 2024-09-10 09:04:09 +02:00
Harmen Stoppels
16dba78288
spec.py: dedent format logic (#46279) 2024-09-10 09:02:37 +02:00
Harmen Stoppels
2f789f01d3
Revert "Set module variables for all packages before running setup_dependent_…" (#46283)
This reverts commit 6f08db4631.
2024-09-09 10:37:26 -07:00
Harmen Stoppels
9059756a11
reindex: do not assume fixed layout (#46170)
`spack reindex` relies on projections from configuration to locate
installed specs and prefixes. This is problematic because config can
change over time, and we have reasons to do so when turning compilers
into depedencies (removing `{compiler.name}-{compiler.version}` from
projections)

This commit makes reindex recursively search for .spack/ metadirs.
2024-09-09 17:26:30 +02:00
Jordan Galby
2502a3c2b6
Fix regression in spec format string for indiviual variants (#46206)
Fix a regression in {variants.X} and {variants.X.value} spec format strings.
2024-09-09 10:42:04 +02:00
Dan Lipsa
6f08db4631
Set module variables for all packages before running setup_dependent_package (#44327)
When a package is running `setup_dependent_package` on a parent, ensure
that module variables like `spack_cc` are available. This was often
true prior to this commit, but externals were an exception.

---------

Co-authored-by: John Parent <john.parent@kitware.com>
2024-09-06 18:54:09 -06:00
Massimiliano Culpo
a3fa54812f
Remove deprecated config options (#44061)
These options have been deprecated in v0.21, and
slated for removal in v0.23
2024-09-06 15:14:36 -06:00
Peter Scheibel
78a4d3e7d2
Mixed-source cflags (#41049)
Allow flags from different sources (compilers, `require:`, command-line
specs, and `depends_on`) to be merged together, and enforce a consistent
order among them.

The order is based on the sources, e.g. flags on specs from the command
line always come last. Some flag order consistency issues are fixed:

1. Flags from `compilers.yaml` and the command line were always intra- and
   inter-source order consistent.
2. Flags from dependents and packages.yaml (introduced via `require:`)
   were not: for `-a -b` from one source and `-c` from another, the final
   result might rearrange `-a -b`, and would also be inconsistent in terms
   of whether `-c` came before or after.

(1) is/was handled by going back to the original source, i.e., flags are
retrieved directly from the command line spec rather than the solver.

(2) is addressed by:

* Keeping track of grouped flags in the solver
* Keeping track of flag sources in the solver on a per-flag basis

The latter info is used in this PR to enforce DAG ordering on flags
applied from multiple dependents to the same package, e.g., for this
graph:

```
   a
  /|\
 b | c
  \|/
   d
```

If `a`, `b`, and `c` impose flags on `d`, the combined flags on `d` will
contain the flags of `a`, `b`, and `c` -- in that order. 

Conflicting flags are allowed (e.g. -O2 and -O3). `Spec.satisifes()` has
been updated such that X satisfies Y as long as X has *at least* all of
the flags that Y has. This is also true in the solver constraints.
`.satisfies` does not account for how order can change behavior (so
`-O2 -O3` can satisfy `-O3 -O2`); it is expected that this can be
addressed later (e.g. by prohibiting flag conflicts).

`Spec.constrain` and `.intersects` have been updated to be consistent
with this new definition of `.satisfies`.
2024-09-06 10:37:33 -07:00
John W. Parent
4042afaa99
Bootstrap GnuPG and file on Windows (#41810)
Spack can now bootstrap two new dependencies on Windows: GnuPG, and file. 

These dependencies are modeled as a separate package, and they install a cross-compiled binary.
Details on how they binaries are built are in https://github.com/spack/windows-bootstrap-resources
2024-09-06 14:26:46 +02:00
Harmen Stoppels
7fdf1029b7
fish: use shlex.quote instead of custom quote (#46251) 2024-09-06 11:38:14 +00:00
Harmen Stoppels
7c473937ba
db: more type hints (#46242) 2024-09-06 09:13:14 +02:00
Massimiliano Culpo
9a8bff01ad
Allow deprecating more than one property in config (#46221)
* Allow deprecating more than one property in config

This internal change allows the customization of errors
and warnings to be printed when deprecating a property.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

* fix

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

* Use a list comprehension for "issues"

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>

---------

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-05 15:33:20 -07:00
Nicole C.
434a703bcf
Windows: Update pytest with echo and remove others (#45620)
* Windows: Update pytest with echo and remove others

* Fix style

* Remove unused pytest import in undevelop

* Update test_test_part_pass to be Window compatible

* Style
2024-09-05 15:34:19 -05:00
Massimiliano Culpo
c4d18671fe
Avoid best-effort expansion of stacks (#40792)
fixes #40791

Currently stacks behave differently if used in unify:false
environments, which leads to inconsistencies during concretization.

For instance, we might have two abstract user specs that do not
intersect with each other map to the same concrete spec in the
environment. This is clearly wrong.

This PR removes the best effort expansion, so that user specs
are always applied strictly.
2024-09-05 10:32:15 -06:00
Harmen Stoppels
02faa7b97e
reindex: ensure database is empty before reindex (#46199)
fixes two tests that did not clear the in-memory bits of a database
before calling reindex.
2024-09-05 14:53:29 +02:00
Harmen Stoppels
7e5e6f2833
Pass Database layout in constructor (#46219)
Ensures that Database instances do not reference a global
`spack.store.STORE.layout`. Simplify Database.{add,reindex} signature.
2024-09-05 10:49:03 +00:00
Massimiliano Culpo
37ea9657cf
Remove test_external_package_module (#46218)
This test was possibly meant for the Cray platform, and
currently is a no-op.

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-05 12:10:59 +02:00
Harmen Stoppels
2107a88514
spack deprecate: deprecate --link-type flag (#46202) 2024-09-05 11:06:46 +02:00
Massimiliano Culpo
9e18e63053
solver: minor cleanup and optimization (#46176)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-03 10:35:54 +00:00
Harmen Stoppels
069286bda7
database: remove a few class properties (#46175) 2024-09-03 11:22:14 +02:00
Harmen Stoppels
fe2d06399f
db: type hints (#46168) 2024-09-02 14:44:49 +02:00
Harmen Stoppels
b5dec35113
projections: simplify expression (#46167) 2024-09-02 12:38:47 +00:00
Harmen Stoppels
20565ba8ab
remove dead code: fs.is_writable_dir was used on file (#46166) 2024-09-02 11:55:40 +00:00
Wouter Deconinck
c47a3ee05b
package_base: sort deprecated versions later in preferred_version (#46025) 2024-09-02 10:42:15 +00:00
pauleonix
6b649ccf4f
cuda: add v12.6.1 (#46143)
Update build system conflict between CUDA 12.6 and Clang 18
2024-09-02 08:46:03 +02:00
Georgia Stuart
d463d4566d
docs: update conditional definition arch (#46139)
Signed-off-by: Georgia Stuart <gstuart@umass.edu>

Co-authored-by: Jordan Galby <67924449+Jordan474@users.noreply.github.com>
2024-09-02 08:32:26 +02:00
Harmen Stoppels
f7de621d0c
Remove redundant inspect.getmodule(self) idiom in packages (#46073) 2024-09-01 11:25:51 +02:00
Massimiliano Culpo
c283fce487
Remove DetectedPackage class (#46071)
This PR simplifies the code doing external spec detection by removing 
the `DetectedPackage` class. Now, functions accepting or returning lists 
of `DetectedPackage`, will accept or return list of specs.

Performance doesn't seem to change if we use `Spec.__reduce__` instead 
of `DetectionPackage.__reduce__`.
2024-08-30 08:11:17 +00:00
Chris Marsh
cade66d842
CMakePackage: Set policy CMP0042 NEW on macos (#46114)
so linking to shared libraries works well at runtime on darwin for all packages with cmake_minimum_required < 3.
2024-08-29 18:49:53 +00:00
Harmen Stoppels
dc3f5cd606
windows_establish_runtime_linkage: post install hook (#46103) 2024-08-29 17:16:36 +02:00
Tamara Dahlgren
b6ff126494
Executable: make the timeout message readable (#46098) 2024-08-29 11:46:15 +00:00
Massimiliano Culpo
f9065f0c7e
Remove "get_compiler_duplicates" (#46077)
This function is used only in tests.
2024-08-29 06:53:17 +02:00
Jordan Galby
4c91e6245c
Don't check checksums on spack-develop packages (#46076)
Fix regression introduced in spack 0.22.1 where Spack would ask about checksums
on spack-develop packages.
2024-08-28 17:07:30 +00:00
Jordan Galby
6b0011c8f1
For "when:" and install_environment.json: Support fully qualified hostname (#45522) 2024-08-28 18:38:54 +02:00
Harmen Stoppels
85487f23bc
buildcache.py: elide string not spec (#46074) 2024-08-28 15:27:44 +02:00
Harmen Stoppels
fb4811ec3f
Drop now redundant use of inspect (#46057)
inspect.isclass -> isinstance(..., type)
inspect.getmro -> cls.__mro__
2024-08-28 14:35:08 +02:00
Massimiliano Culpo
25ba3124bd
Spec.from_detection now accounts for external prefix (#46063)
Change the signature of Spec.from_detection to set the
external prefix, and the external modules, if they are
present.

Delete "spack.package_prefs.spec_externals" since it
is unused.
2024-08-28 10:51:36 +02:00
Massimiliano Culpo
df57e1ceb3
Remove llnl.util.lang.has_method, use built-in hasattr instead (#46072) 2024-08-28 10:17:12 +02:00
Harmen Stoppels
9d8f94a7c8
spack_yaml: delete custom deepcopy (#46048) 2024-08-27 18:45:44 +02:00
Massimiliano Culpo
1297673a70
Remove "prevent_cray_detection" context manager (#46060)
This context manager was used to prevent detecting a platform
as "cray". Since now Cray machines are detected as linux, we can
remove the context manager.
2024-08-27 18:43:07 +02:00
Harmen Stoppels
0fee2c234e
config.py: tell don't ask (#46040) 2024-08-27 15:55:44 +02:00
Massimiliano Culpo
394e6159d6
Remove a few unused classes and globals (#46054) 2024-08-27 15:06:39 +02:00
Massimiliano Culpo
9a91f021a7
Move spack.compilers._to_dict to Compiler (#46051) 2024-08-27 14:01:50 +02:00
Harmen Stoppels
297e43b097
abi.py: remove (#46047) 2024-08-27 10:38:54 +02:00
Harmen Stoppels
a60d1084b1
jsonschema: remove optional deps (#46041) 2024-08-26 22:15:52 +02:00
Harmen Stoppels
497e19f0e3
distro.py: avoid excessive stat calls (#46030) 2024-08-26 18:55:55 +02:00
pauleonix
8c92836c39
cuda: add v12.6 (#45558) 2024-08-26 15:27:07 +02:00
Todd Gamblin
1d70ab934c
ci generate: don't warn when no cdash config (#46004)
Right now if you run `spack ci generate` you get a warning about CDash credentials even
if there's no CDash configuration specified. We should only warn if there was actually a
CDash config.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-26 13:58:41 +02:00
Harmen Stoppels
02f329a8af
compilers: avoid redundant fs operations and cache (#46031) 2024-08-26 12:49:58 +02:00
Harmen Stoppels
94c99fc5d4
variant.py: extract spec bits into spec.py (#45941) 2024-08-24 09:45:23 +02:00
John W. Parent
1f1021a47f
PythonExtension: use different bin dir on Windows (#45427) 2024-08-24 09:34:24 +02:00
Harmen Stoppels
296e5308a7
mirror: fetch by digest (#45809)
Source mirrors store entries by digest and add a human readable alias of the
form 'name-version'. If no digest is available, the alias is used as the primary
storage location.

Spack erroneously fetches by alias when the digest path does not exist. This is
problematic if `version(..., sha256=...)` changes in package.py, and the mirror
is populated with the old shasum. That would result in an error when a digest
is available, but in case of git versions with a modified commit sha, the wrong
sources would be fetched without error. With this PR, only the digest path is
used, not the alias, in case a digest is available. This is also a small performance
optimization, as the number of request is halved for mirrors that don't contain
the sources.

Further, for git sources the tag was used as a digest, but this is a moving
target. Only commit sha is used now.

Also whenever the alias already existed, Spack used to keep it in place when
updating the mirror cache, which means that aliases would always point to
outdated mirror entries whenever digests are modified. With this PR the alias
is moved in place.

Lastly, fix a recent regression where `Stage.disable_mirrors` disabled mirrors
but not the local download cache, which was the intention.
2024-08-24 09:09:25 +02:00
Massimiliano Culpo
47e79c32fd
Substitute __import__ with importlib.import_module (#45965) 2024-08-23 21:41:26 +02:00
Harmen Stoppels
b8cbbb8e2e
spack create: add depends_on(<lang>) statements (#45296) 2024-08-23 10:33:05 +02:00
Harmen Stoppels
d40f847497
Add missing MultiMethodMeta metaclass in builders (#45879)
* Add missing MultiMethodMeta metaclass in builders

and remove the Python 2 fallback option in favor of hard errors to catch
similar issues going forward.

The fallback option can cause about 10K stat calls due to use of
`realpath` in the inspect module, depending on how deep Spack itself is
nested in the file system, which is ... undesirable.

* code shuffling to avoid circular import

* more reshuffling

* move reserved variant names into variants module
2024-08-23 09:23:25 +02:00
Massimiliano Culpo
ead25b1e9e
Add a new audit to find missing package.py files (#45868)
* Add a new audit to find missing package.py files

* Remove directory without package.py
2024-08-22 14:22:54 -07:00
Nicole C.
1bcb1fcebc
Windows: port tests for mirror/blame (#45259) 2024-08-22 09:49:32 -07:00
Massimiliano Culpo
836be2364c
Make spack compiler find use external find (#45784)
so that there is no duplicate detection logic for compilers
2024-08-22 12:13:08 +02:00
John W. Parent
182bc87fe1
Windows: Port icu4c; define cxx std flags for MSVC (#45547)
* Adds an MSBuild system + Builder to the icu4c package
* Adds custom install method as MSBuild system does not vendor an
  install target
* The cxxstd variant is not supported on Windows (there are no config
  options you use to tell the build system what cxx standard to
  build against), so the variant definition was updated to occur
  everywhere except Windows

Also, this commit defines the c/cxx..._flag properties of the MSVC
compiler (although they are not used by `icu4c` and not strictly
necessary to bundle with this PR).
2024-08-21 16:08:57 -06:00
Greg Becker
c1736077bb
spack bootstrap status --dev: function call for new interface (#45822) 2024-08-20 13:04:39 +00:00
psakievich
85905959dc
Increase min version for sparse_checkout (#45818)
* Increase min version for sparse_checkout

* Update git_fetch.py

* style
2024-08-20 13:04:23 +00:00
Harmen Stoppels
2ae5596e92
Unify url and oci buildcache push code paths (#45776) 2024-08-20 13:17:49 +02:00
Harmen Stoppels
ac9398ed21
build_environment: explicitly disable ccache if disabled (#45275) 2024-08-19 13:49:38 +02:00
Harmen Stoppels
57769fac7d
Simplify URLFetchStrategy (#45741) 2024-08-19 11:34:13 +02:00
Alec Scott
428b4e340a
Remove deprecated --safe-only in spack version cmd (#45765) 2024-08-19 08:28:19 +02:00
Wouter Deconinck
553cc3b70a
util/web.py: parse new GitLab JS dropdown links (#45764)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2024-08-17 09:02:03 +02:00
Greg Becker
9ec8eaa0d3
include_concrete: read from older env formats properly (#45766)
* include_concrete: read from older env formats properly
* spack env rm: fix logic for checking env includes
* regression test

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-16 20:40:41 +00:00
James Smillie
cc7a29c55a
Windows: fix stage cleaning for long paths (#45786)
Paths over 260 characters in length are not handled by `shutil.rmtree`
unless they use the extended-length path syntax (using a prefix of
"\\?\").

This fixes an issue where stage cleaning fails when paths in a stage
exceed the normal 260-character limit.

This indicates that other parts of the codebase should be examined/
refactored to handle long paths.
2024-08-16 11:16:13 -07:00
Harmen Stoppels
54b57c5d1e
Revert "Change environment modifications to escape with double quotes (#36789)" (#42780)
This reverts commit 690394fabc, as it causes arbitrary code execution.
2024-08-16 17:32:48 +02:00
Harmen Stoppels
725ef8f5c8
oci: support --only=package (#45775)
Previously `spack buildcache push --only=package` errored in the OCI
case, but it's been requested that OCI can be used as pure storage w/o
the need for runnable container images.

This commit makes it so that

1. manifests refer only to runtime dependencies that were selected to be
   pushed
2. failure to upload a blob among the selected specs does not prevent a
   manifest/tag to be created for dependents: they just don't refer to
   the missing blob as a layer/dependency

This fixes the following issues:

1. dependents of non-redistributable specs can now be pushed to oci
   build caches without error
2. failure to upload one tarball does not cause cascading failures for
   dependents whose tarballs do upload succesfully -- so it's better
   best-effort behavior
3. for some people uploading with deps caused a massive amount of
   fetches of their manifests (which certain registries count as a
   download of an image, even though their layers are not fetched) --
   being able to specify --only=package reduces the number of fetches.
2024-08-16 15:24:04 +02:00
Harmen Stoppels
f51a9a9107
stage: provide mirrors in constructor (#45792)
Stage objects create mirrors ad-hoc from current config.

- There is no way to prevent mirrors from being used
- There is no way to restrict mirrors to source/binary, which is of
  course context dependent.
- Stage is also used in build caches, where iterating over mirrors is
  already implemented differently, and wouldn't work anyways cause it's
  source only, and in particular it makes no sense for OCI build caches.

This commit:

1. Injects the sensible mirrors into the stage object from contexts
   where it is relevant
2. Separates mirrors from cache, so that w/o mirrors download cache can
   still be used
2024-08-16 15:21:47 +02:00
Massimiliano Culpo
4f0e336ed0 Remove "test_foreground_background" 2024-08-16 14:22:59 +02:00
Massimiliano Culpo
64774f3015 Skip test_foreground_background + other minor cleanups
The test_foreground_background unit test has been marked
xfail for a while, meaning:
- Nobody looks at the results of the test
- It still runs every time

That test happens to hang frequently on some Apple M1 I have access to,
so here I mark it as skip.

Also went through other xfailing and skipped tests, and applied minor changes.
2024-08-16 14:22:59 +02:00
Massimiliano Culpo
4e9fbca033
Clean up test/cmd/ci.py (#45774)
* Use absolute paths instead of https:// fake mirrors (this speed-up tests by avoiding requests)
* Add a fixture to gather in a single place code that is copy/pasted in a lot of tests
* General clean-up of tests and repeated code

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-08-16 13:42:01 +02:00
Massimiliano Culpo
165c171659
Update archspec to v0.2.5-dev (7e6740012b897ae4a950f0bba7e9726b767e921f) (#45721) 2024-08-15 19:49:07 +02:00
psakievich
1b82779087
Add options for sparse checkout in GitFetcher (#45473)
* Add options for sparse checkout in GitFetcher

Newer versions of git have a beta feature called sparse checkout
that allow users to check out a portion of a large repo.

This feature will be ideal for monolithic repo projects that want to
model their infrastructure via spack.  This PR implements an addition
to the GitFetcher that allows users to add a `git_sparse_paths`
attribute to package classes or versions which will then use sparse
checkout on those directories/files for the package.

* Style

* Split git clone into multiple functions

* Add sparse-checkout impl

* Internalize src clone functions

* Docs

* Adding sparse clone test

* Add test for partial clone

* [@spackbot] updating style on behalf of psakievich

* Small fixes

* Restore default branch status

* Fix attributes for package

* Update lib/spack/docs/packaging_guide.rst

Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com>

* Extend unit test to multiple git versions

* style

---------

Co-authored-by: psakievich <psakievich@users.noreply.github.com>
Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com>
2024-08-15 05:28:34 +00:00
Greg Becker
f42486b684
spack info: use spec fullname (#45753) 2024-08-14 22:00:00 +00:00
Greg Becker
2b6bdc7013
OneapiPackage: do not use getpass.getuser (#45727)
* OneapiPackage: do not use getpass.getuser
2024-08-14 09:48:44 -07:00
Massimiliano Culpo
586a35be43
SpecHashDescriptor: better repr in debugger (#45739) 2024-08-14 18:02:09 +02:00
Harmen Stoppels
29b50527a6
spack buildcache push: parallel in general (#45682)
Make spack buildcache push for the non-oci case also parallel, and --update-index more efficieny
2024-08-14 17:19:45 +02:00
Massimiliano Culpo
94961ffe0a
Optimize marshaling of Repo and RepoPath (#45742)
When sending Repo and RepoPath over to a child process,
we go through a marshaling procedure with pickle. The
default behavior for these classes is highly inefficient,
as it serializes a lot of specs that can just be
reconstructed on the other end of the pipe.

Here we write optimized procedures to __reduce__ both
classes.
2024-08-14 14:34:35 +02:00
Massimiliano Culpo
03a7da1e44
Micro-optimize finding executables (#45740) 2024-08-14 13:52:28 +02:00
Massimiliano Culpo
97ffe2e575
Add schema for compiler options in packages.yaml (#45738) 2024-08-14 11:47:36 +02:00
Harmen Stoppels
7b10aae356
Show underlying errors on fetch failure (#45714)
- unwrap/flatten nested exceptions
- improve tests
- unify curl lookup
2024-08-14 08:15:15 +00:00
Tamara Dahlgren
8ba6e7eed2
Bugfix: allow test_* build-time and stand-alone tests (#45699) 2024-08-13 16:58:00 -07:00
Massimiliano Culpo
7001a2a65a
Fix a bug with automatic tag detection (#45696)
Extracted from #45638

When adding the "detectable" tag to a package class that has the
"tag" attribute inherited from a base class, we need to copy it to
avoid modifying the base class.
2024-08-13 10:19:26 +02:00
Harmen Stoppels
a66586d749
spack buildcache push: best effort (#45631)
"spack buildcache push" for partially installed environments pushes all it 
can by default, and only dumps errors towards the end.

If --fail-fast is provided, error out before pushing anything if any
of the packages is uninstalled

oci build caches using parallel push now use futures to ensure pushing
goes in best-effort style.
2024-08-13 08:12:48 +02:00
Nicole C.
27557a133b
debug: Update cmd and test for Windows (#45309)
* debug: Update cmd and test for Windows

* Add comment tar options not supported by Win tar
2024-08-12 15:50:51 -04:00
Harmen Stoppels
3b59817ea7
deal with TimeoutError from ssl.py (#45683) 2024-08-12 13:06:13 +02:00
Harmen Stoppels
7ddc886d6d
buildcache: fix hard-coded, outdated layout version (#45645) 2024-08-12 09:25:31 +02:00
Massimiliano Culpo
2079b888c8
Remove the old concretizer (#45215)
The old concretizer is still used to bootstrap clingo from source. If we switch to a DAG model
where compilers are treated as nodes, we need to either:

1. fix the old concretizer to support this (which is a lot of work and possibly research), or
2. bootstrap `clingo` without the old concretizer.

This PR takes the second approach and gets rid of the old concretizer code. To bootstrap
`clingo`, we store some concrete spec prototypes as JSON, select one according to the
coarse-grained system architecture, and tweak them according to the current host.

The old concretizer and related dead code are removed.  In particular, this removes
`Spec.normalize()` and related methods, which were used in many unit-tests to set
up the test context. The tests have been updated not to use `normalize()`.

- [x] Bootstrap clingo concretization based on a JSON file
- [x] Bootstrap clingo *before* patchelf
- [x] Remove any use of the old concretizer, including:
      * Remove only_clingo and only_original fixtures
      * Remove _old_concretize and _new_concretize
      * Remove _concretize_together_old
      * Remove _concretize_together_new
      * Remove any use of `SPACK_TEST_SOLVER`
      * Simplify CI jobs
- [x] ensure bootstrapping `clingo` works on on Darwin and Windows
- [x] Raise an intelligible error when a compiler is missing
- [x] Ensure bootstrapping works on FreeBSD
- [x] remove normalize and related methods

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-10 16:12:27 -07:00
Greg Becker
7a83cdbcc7
Concretizer should respect namespace of reused specs (#45538)
* concretize.lp: improve coverage of internal_error facts
* concretizer: track namespaces for reused packages
* regression test
2024-08-09 13:51:34 -07:00
Dominic Hofer
da33c12ad4
Remove execution permission from setup-env.sh (#45641)
`setup-env.sh` is meant to be sourced, not executed directly.
By revoking execution permissions, users who accidentally execute
the script will receive an error instead of seeing no effect.

* Remove execution permission from `setup-env.sh` and friends
* Don't make output file executable in `spack commands --update-completion`

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-09 13:27:07 -07:00
Massimiliano Culpo
007c1148c0
Remove Compiler.PrgEnv* attributes (#45615) 2024-08-08 18:15:42 +02:00
Dom Heinzeller
0902910784
Compiler wrapper: add env var to pass vcheck flags (#44588)
Fixes #43494

Add a set of environment variables SPACK_ALWAYS_CFLAGS (etc.) that
are always applied by the compiler wrapper.

Unlike SPACK_CFLAGS, for example, these will also be applied to
version checks (both SPACK_CFLAGS and SPACK_ALWAYS_CFLAGS will be
applied to the other invocation modes like ccld etc.).

Using this new functionality, the classic Intel and oneAPI compilers
are updated to pass compiler flags that disable warning messages
when newer versions are invoked via their older binary names
(these warnings were also generated for version checks, hence the
need for a new wrapper variable).

---------

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
2024-08-08 06:40:36 +00:00
Jordan Galby
d2f269ed7b
Fix SIP build system installing files into python-venv (#45360)
For example: spack install py-pyqt5 or py-pyqt6 would install pylupdate5 pyrcc5 and
pyuic5 into in python-venv's install prefix.

Fix https://github.com/spack/spack/issues/45359
2024-08-07 12:12:56 +02:00
Gavin John
e3904d4cbf
Fix spack url stats (#45584) 2024-08-06 02:54:01 -06:00
dependabot[bot]
4a8d09dcc1
build(deps): bump flake8 from 7.1.0 to 7.1.1 in /lib/spack/docs (#45588)
Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.0 to 7.1.1.
- [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 07:08:57 +02:00
Massimiliano Culpo
b9125ae3e7
Do not halt concretization on unknown variants in externals (#45326)
* Do not halt concretization on unkwnown variants in externals
2024-08-05 09:24:57 -07:00
dependabot[bot]
f3bd820374
build(deps): bump pytest from 8.3.1 to 8.3.2 in /lib/spack/docs (#45461)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.1 to 8.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.1...8.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-04 05:44:52 +00:00
dependabot[bot]
1090895e72
build(deps): bump black from 24.4.2 to 24.8.0 in /lib/spack/docs (#45563)
Bumps [black](https://github.com/psf/black) from 24.4.2 to 24.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/24.4.2...24.8.0)

---
updated-dependencies:
- dependency-name: black
  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>
2024-08-03 21:48:50 -05:00
dependabot[bot]
e983f4a858
build(deps): bump sphinx-design from 0.6.0 to 0.6.1 in /lib/spack/docs (#45562)
Bumps [sphinx-design](https://github.com/executablebooks/sphinx-design) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/executablebooks/sphinx-design/releases)
- [Changelog](https://github.com/executablebooks/sphinx-design/blob/main/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/sphinx-design/compare/v0.6.0...v0.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 21:46:19 -05:00
dependabot[bot]
3ee6507dd6
build(deps): bump mypy from 1.11.0 to 1.11.1 in /lib/spack/docs (#45530)
Bumps [mypy](https://github.com/python/mypy) from 1.11.0 to 1.11.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.11...v1.11.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 17:01:25 -06:00
Todd Gamblin
425bba2f1a
Allow spec queries by namespace (#45416)
* Allow spec queries by `namespace`

Spack specs have "namespaces" that indicate what package repository they come from, but
there has not been a way to use the spec syntax to match one.

You can say things like this:

```console
spack find builtin.zlib
spack find myrepo.zlib
```

But, because namespaces are written as a dot-separated prefix on the name, you can't say
"find me all specs in namespace myrepo". The syntax doesn't allow it.

This PR allows you to specify anonymous specs with namespaces on the CLI. Specifically
you can do queries like this:

```console
spack find namespace=builtin
spack find namespace=myrepo
```

You can use this anywhere else you use spec syntax, e.g. in a config file to separate
installations based on what repo they came from:

```yaml
spack:
    config:
        install_tree:
            root: $spack/opt/spack
            projections:
                namespace=myrepo: "myrepo_special_path/{name}-{hash}"
                namespace=builtin: "builtin/{name}-{hash}"
```

This PR adds a special `namespace_if_anonymous` attribute to specs, which returns the
`namespace` if the spec has no name, otherwise it returns `None`. This allows us to
print the namespace for anonymous specs but to continue hiding it for most views, as
we've done so far.

This is implemented as a special case, but it's one that already exists, along with
`platform`, `os`, `target`, etc. This also reserves existing special case names for
variants so that users cannot define them in their package files. This change is
potentially breaking, but I do not think it will be common. There are no builtin
packages with a variant called `namespace`, and defining `os`, `target`, or `platform`
as a variant would've likely caused other problems if they were already being used.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-02 13:38:14 -05:00
Todd Gamblin
96ddbd5e17
format: allow spaces in format specifiers (#45487)
* format: allow spaces in format specifiers

Key-value pair format specifiers can now contain spaces in the key. This allows us to
add spaces to format strings that are *only* present when the attribute formatted is not
``None``. Instead of writing:

```
    {arch=architecture}
```

and special casing `arch=` like a sigil in `Spec.format()`, we can now write:

```
    { arch=architecture}
```

And the space is *only* printed when `architecture` is not `None`. This allows us to
remove the special case in `Spec.format()` for `arch=`.

Previously the only `key=` prefix allowed in format specifiers was `arch=`, but this PR
removes that requirement, and the `key=` part of a key-value specifier can be any name.
It does *not* have to correspond to the formatted attribute.

- [x] modify `SPEC_FORMAT_RE` to allow arbitrary keys in key-value pairs.
- [x] remove special case for `arch=` from `Spec.format()`.
- [x] modify format strings using `{arch=architecture}` to use `{ arch=architecture}`
- [x] add more tests for formatting

This PR saves other more complex attributes like compiler flags and their spacing for later.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-01 18:20:43 -06:00
John W. Parent
ffcb4ee487
Windows msvsc: Report accurate platform toolset version for VS2022 (#45525)
VC toolset versions 144 and 143 are both associated with the platform
toolset 143; this deviates from prior version choices made by the
MSVC devs; add a special case to report platform toolset version
as 143 when VC toolset version is >= 143 (this will need revisiting
for later releases).
2024-08-01 11:27:17 -07:00
Todd Gamblin
4a35dec206 wasi-sdk: add default provider
This was missed in #45394 because we don't run unit tests for package PRs, and
`test_all_virtual_packages_have_default_providers`, which would've caught it, is a unit
test, not an audit.

- [x] add a default provider for `wasi-sdk` in `etc/spack/defaults/packages.yaml` (which
      we require for all virtuals)
- [x] rework `test_all_virtual_packages_have_default_providers` as an audit called
      `_ensure_all_virtual_packages_have_default_providers`

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-29 01:30:14 -07:00
Todd Gamblin
a841ddd00c
spack pkg grep: don't warn when grepping for quoted strings (#45412)
The `Executable` class emits a warning when you pass quoted arguments to it:

```
> spack pkg grep '"namespace"'
==> Warning: Quotes in command arguments can confuse scripts like configure.
  The following arguments may cause problems when executed:
      "namespace"
  Quotes aren't needed because spack doesn't use a shell. Consider removing them.
  If multiple levels of quotation are required, use `ignore_quotes=True`.
```

This is to warn new package authors who aren't used to calling build commands in python.
It's not useful for `spack pkg grep`, where we really are passing args on the command
line, and if we pass a quoted string, we probably meant to.

- [x] make `ignore_quotes` an instance variable, not just an argument to ``__call__`
- [x] set `ignore_quotes` to `True` in `spack pkg grep`

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-24 08:11:32 -07:00
dependabot[bot]
6ea944bf17
build(deps): bump pytest from 8.2.2 to 8.3.1 in /lib/spack/docs (#45377)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.1)

---
updated-dependencies:
- dependency-name: pytest
  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>
2024-07-23 11:53:55 -04:00
dependabot[bot]
8c6177c47f
build(deps): bump sphinx from 7.4.6 to 7.4.7 in /lib/spack/docs (#45376)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.6 to 7.4.7.
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.6...v7.4.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 11:53:43 -04:00
Wouter Deconinck
0d326f83b6
GoPackage: default -modcacherw to ensure stage cleanup (#45350) 2024-07-23 11:48:52 -04:00
dependabot[bot]
0d04223ccd
build(deps): bump mypy from 1.10.1 to 1.11.0 in /lib/spack/docs (#45337)
Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-20 11:25:31 -05:00
Peter Scheibel
5ef222d62f
Testing: omit test on windows (#45340)
Re-disable a test that was enabled in #45031
2024-07-20 00:32:37 -07:00
Nicole C.
6810e9ed2e
Windows Tests: enable more cmd tests on Windows (#45031)
* Several tests can be enabled on Windows with no changes to logic
  (either the test logic or logic being tested)
* Test for `spack location` requires modification of the test logic,
  but with a minor change can be enabled on Windows
2024-07-19 18:08:28 -07:00
Wouter Deconinck
24b73da9e6
docs: util/environment.py: use re.Pattern[str] instead of re (#45329)
* docs: util/environment.py: use `re.Pattern[str]` instead of `re`

* docs: sphinx==7.4.6
2024-07-19 20:03:07 +02:00
Massimiliano Culpo
9443e31b1e
Do not initialize previous store state in "use_store" (#45268)
The "use_store" context manager is used to swap the value
of a global variable (spack.store.STORE), while keeping
another global variable consistent (spack.config.CONFIG).

When doing that it tries to evaluate the previous value
of the store, if that was not done already. This is wrong,
since the configuration might be in an "intermediate" state
that was never meant to trigger side effects.

Remove that operation, and add a unit test to
prevent regressions.
2024-07-18 07:18:14 +02:00
Wouter Deconinck
b869538544
environment: handle view root at existing directory better (#45263)
- remove empty dir if exists at view root
- error better if non-empty dir

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-07-17 23:17:30 +02:00
Massimiliano Culpo
9ae1014e55
Run minimization of weights only on known targets (#45269)
This prevents excessive output from clingo of the kind:

.../spack/lib/spack/spack/solver/concretize.lp:1640:5-11: info: tuple ignored:
  #sup@2
2024-07-17 11:10:00 -07:00
Massimiliano Culpo
ce1b569b69
Fix order of deserialization in subprocess context (#45229)
Since the the MetaPathFinder now owns a lazily constructed RepoPath object, we need to deserialize environments before the package that needs to be restored. Before we were relying on globals to be inconsistent in a way that let the entire process go.
2024-07-16 10:15:29 -06:00
Harmen Stoppels
b539eb5aab
concretizer: show input specs on error (#45245) 2024-07-16 14:04:56 +02:00
Massimiliano Culpo
42232a8ab6
Fix error message for test log in child process (#45233)
If we don't have a log, we'll mask the real error with
another caused by using None as an argument to os.path.join
2024-07-16 06:58:36 +02:00
Wouter Deconinck
a11da7bdb9
cmd/dependents.py: remove unused loop over all packages (#45166) 2024-07-16 06:38:01 +02:00
Harmen Stoppels
d4e6c29f25
unparser.py: remove print statements (#45235) 2024-07-15 21:55:11 +02:00
pauleonix
a26ac1dbcc
cuda: add v12.5.1 (#44342)
- Add explicit conflict on ppc64le for 12.5 and newer.
- Update/fix intel compiler conflict to reflect that intel@2021 is compatible
  only since 11.4.1 and not since 11.1.1.
- Add intel compiler conflicts to reflect strict support matrix since
  12.2.0.
2024-07-15 20:04:47 +02:00
Harmen Stoppels
0ce35dafe1
Add c to the list of languages (#45191) 2024-07-12 15:25:41 +02:00
Harmen Stoppels
517b7fb0c9
directives: types, avoid redundant parsing (#45208) 2024-07-12 13:35:16 +02:00
Harmen Stoppels
9c8846b37b
Add pkg- prefix to builtin.mock a b c d ... (#45205) 2024-07-12 11:27:40 +02:00
Tamara Dahlgren
737b70cbbf
Buildcache: remove deprecated --allow-root and preview subcommand (#45204) 2024-07-11 18:19:04 -07:00
Harmen Stoppels
5c53973220
concretize.lp: drop 0 weight of external providers (#45025)
If an external happens to be a provider of anything, the solver would
set its weight to 0, meaning that it is most preferred, even if
packages.yaml config disagrees.

That was done so that `spack external find mpich` would be sufficent to
pick it up as mpi provider.

That may have made sense for mpi specifically, but doesn't make sense
for other virtuals. For example `glibc` provides iconv, and is an
external by design, but it's better to use libiconv as a separate
package as a provider.

Therefore, drop this rule, and instead let users add config:

```
mpi:
  require: [mpich]
```

or

```
mpi:
  buildable: false
```

which is well-documented.
2024-07-11 15:29:56 +02:00
Harmen Stoppels
278a38f4af
external find --not-buildable: mark virtuals (#45159)
This change makes `spack external find --not-buildable` mark virtuals
provided by detected packages as non-buildable, so that it's sufficient
for users to let spack detect say mpich and have the concretizer pick it
up as mpi provider even when openmpi is "more preferred".
2024-07-11 15:19:55 +02:00
Massimiliano Culpo
2153f6056d
checksum: fix circular imports on macOS (#45187) 2024-07-11 10:49:29 +02:00
Nicole C
2eb566b884
Spack on Windows: update dev_build tests to run on Windows (#45039) 2024-07-10 16:52:01 -07:00
Harmen Stoppels
e6f1b4e63a
Avoid duplicate detectable tag (#45160)
in case of inheritance the static tags prop may be updated multiple
times, and it turns out builder classes magically inherit from
traditional package classes
2024-07-10 18:14:28 +02:00
Stephen Nicholas Swatman
c458e985af
Set LD_LIBRARY_PATH for OneAPI compiler (#45059)
While trying to build packages with the OneAPI compiler version 2024.1 I
ran into the following error, indicating that the compiler is unable to
find some necessary libraries:

```
/storage/Software/oneapi/2024.1/compiler/2024.1/bin/sycl-post-link: error
  while loading shared libraries: libonnxruntime.1.12.22.721.so: cannot open
  shared object file: No such file or directory

  icpx: error: unable to execute command: No such file or directory

  icpx: error: sycl-post-link command failed due to signal (use -v to see
  invocation)
```

Indeed, `libonnxruntime.1.12.22.721.so` does come bundled with the
OneAPI compiler, but it is not available in the build environment by
default. In this commit, I update the custom environment created by
OneAPI to include the `lib/` directory in which these libraries reside
in the `LD_LIBRARY_PATH` environment variable.
2024-07-10 06:50:07 -06:00
Massimiliano Culpo
9001e9328a
Remove unnecessary copy.deepcopy calls (#45135) 2024-07-10 09:33:48 +02:00
Massimiliano Culpo
aa911eca40
Add compatibility of sequoia with previous macOS versions (#45127)
* Add compatibility of sequoia with previous macOS versions

* Add compatibility of sequoia with previous macOS versions
2024-07-09 17:48:24 -07:00
Peter Scheibel
56a1663cd9
spack find -c: search all concretized-but-not-installed specs (#44713)
Originally if you had `x -> y -> z`, and an env with `x` in its speclist that is concretized but not installed, then `spack find -c y` would not show anything. This was intended: `spack find` has up-until-now only ever listed out installed specs (and `-c` was for adding a preamble section about roots).

This changes `spack find` so:

* `-c` makes it search through all concretized specs in the env (in a sense it is anticipated that a concretized environment would serve as a "speculative" DB and users may want to query it like they query the DB outside of envs)
* Adds a `-i/--install-status` option, equivalent to `-I` from `spack spec`
* Shows install status for either `-c` or `-i`
* As a side effect to prior point, `spack find -i` can now distinguish different installation states (upstream/external)

Examples:

```
$ spack find -r
==> In environment findtest
==> 1 root specs
 -  raja

==> 6 installed packages (not shown)
==> 12 concretized packages to be installed (not shown)
```

```
$ spack find
==> In environment findtest
==> 1 root specs
 -  raja

-- darwin-ventura-m1 / apple-clang@14.0.3 -----------------------
berkeley-db@18.1.40  bzip2@1.0.8  diffutils@3.10  gmake@4.4.1  gnuconfig@2022-09-17  libiconv@1.17
==> 6 installed packages
==> 12 concretized packages to be installed (show with `spack find -c`)
```

```
$ spack find -c
==> In environment findtest
==> 1 root specs
 -  raja

-- darwin-ventura-m1 / apple-clang@14.0.3 -----------------------
[+]  berkeley-db@18.1.40  [+]  bzip2@1.0.8      -   cmake@3.29.4  [+]  diffutils@3.10  [+]  gmake@4.4.1           [+]  libiconv@1.17   -   nghttp2@1.62.0   -   pkgconf@2.2.0    -   readline@8.2
 -   blt@0.6.2             -   camp@2024.02.1   -   curl@8.7.1     -   gdbm@1.23       [+]  gnuconfig@2022-09-17   -   ncurses@6.5     -   perl@5.38.2      -   raja@2024.02.2   -   zlib-ng@2.1.6
==> 6 installed packages
==> 12 concretized packages to be installed


```
$ spack -E find
...
==> 82 installed packages
```
2024-07-09 11:53:20 -07:00
Massimiliano Culpo
54ee7d4165
Remove the "install_mockery_mutable_config" fixture (#45129)
This fixture was introduced in #16429, and made
redundant in #39024
2024-07-09 11:23:49 +02:00
Massimiliano Culpo
15efcbe042
Fix conflicting use of config and mutable_config fixtures in unit tests (#45106)
and add a fixture to detect use of conflicting fixtures
2024-07-09 09:51:04 +02:00
Harmen Stoppels
3212cf86f4
environments.rst: go from simple to advanced (#45004)
* environments.rst: go from simple to advanced
* improvements
* notes about activation
2024-07-08 15:36:18 -07:00
Harmen Stoppels
a04b12a3ef
spec.py: print right deptype in tree (#45091)
Fix a bug where Spec.tree with cover=nodes reduces deptypes from all
in-edges, including from nodes not reachable from the root, which almost
always happens for concrete specs
2024-07-08 18:25:57 +02:00
Harmen Stoppels
297874bfed
spec.py: fix __getitem__ looking outside of dag (#45090)
`Spec.__getitem__` queries dependent edges, which almost always point to
nodes outside the sub-dag considered. It should only ever look at edges
being traversed.
2024-07-08 14:53:51 +02:00
Massimiliano Culpo
74398d74ac
Add type-hints to RepoPath (#45068)
* Also, fix a bug with use_repositories + import spack.pkg
2024-07-08 11:48:39 +02:00
Harmen Stoppels
8a430f89b3
spack -C <env>: use env config w/o activation (#45046)
Precedence:

1. Named environment
2. Anonymous environment
3. Generic directory
2024-07-06 22:02:25 -07:00
Todd Gamblin
ba79542f3c
spack gc: remove debug print statement (#45067)
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-05 22:36:45 +02:00
Harmen Stoppels
1d8bdcfc04
config: fix class hierarchy (#45044)
1. Avoid that `self.path` is of type `Optional[str]`
2. Simplify immutable config with a property.
2024-07-05 12:41:13 +02:00
Massimiliano Culpo
95cf341b50
Inject dependencies in repo classes (#45053) 2024-07-05 12:00:41 +02:00
Wouter Deconinck
04044a9744
containers: rm centos7 since EOL (#45049) 2024-07-04 22:22:23 +02:00
Jordan Galby
491cb278f3
spack audit packages: Fix message (#45045)
Fix message formatting of the "virtual dependency cannot have variants" error.
2024-07-04 14:30:30 +02:00
Massimiliano Culpo
c5cdc2c0a2
Heuristic decays to default over time (#45023)
This modifies heuristic to decay to clingo default
over time. The hope is that this helps with specs
that have an optimal solution with a high penalty.

Let target and compiler heuristic decay too, do not
guess compiler
2024-07-04 08:19:52 +02:00
Adam J. Stewart
f951f38883
Add support for macOS Sequoia (#45018) 2024-07-03 10:59:26 -07:00
Massimiliano Culpo
6b85f6b405
ci: deprecate the --dependencies and --optimize option (#45005) 2024-07-02 22:06:52 +02:00
Harmen Stoppels
5b4edb9499
queue -> stack (#45002) 2024-07-02 16:41:29 +02:00
Harmen Stoppels
a6e6093922
spack_yaml.py: fix default_flow_style (#44998) 2024-07-02 14:01:13 +02:00
Harmen Stoppels
2e8b4e660e
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-07-02 14:00:19 +02:00
Harmen Stoppels
fff126204c
cmd/develop.py: fix readability (#44980)
stage[0] is assumed to be for sources, 1: and onwards is
patches/resources, make that a bit more clear.
2024-07-01 12:14:00 -07:00
Kun Wu
c6da4d586b
cuda: add v12.5.0 (#44971)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-07-01 17:45:04 +00:00
Tamara Dahlgren
61d6fc70e8
Docs: include cmake spec property for the command (#44956) 2024-07-01 10:28:26 -07:00
Harmen Stoppels
fa3f27e8e7
archive.py: undo unrelated changes from #43851 (#44947) 2024-07-01 11:35:32 +02:00
Harmen Stoppels
6b0fefff29
Use composite stage also for develop specs (#44950) 2024-07-01 11:24:16 +02:00
Massimiliano Culpo
f613316282
Flag propagation: restrict to link/run (#44925)
In practice people don't care about having their build dependencies reinstalled with say cflags=-O3 if that is what is set at the input spec, so restrict propagation to link/run deps only.

Also simplify the encoding in asp.
2024-07-01 09:57:51 +02:00
Massimiliano Culpo
1b5b74390f
neoverse-v1: restore py-cinemasci (#44976)
Use a different tactic for determining conflicts.

Give more priority to setting False very old versions.
2024-07-01 09:53:24 +02:00
Harmen Stoppels
e34d9cbe5f
Remove DIYStage (#44949) 2024-07-01 08:33:56 +02:00
Harmen Stoppels
0b3b49b4e0
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-06-28 11:26:56 +02:00
Dan Lipsa
4c7d18a772
Spack on Windows: fix "spack load --list" and "spack unload" (#35720)
Fix the following on Windows:

* `spack load --list` (this printed 0 packages even if packages were
  loaded)
* `spack unload <package>` (this said that the package is not loaded
  even if it was)

Update unit tests for `spack load` to also run on Windows (specifically
for ".bat"). This involved refactoring a few tests to parameterize
based on whether the unit tests are being run on a Windows system
(and to account for batch syntax).
2024-06-27 11:44:36 -07:00
Matthew Whitlock
22c86074c8
Fix bug in logfile parsing (#42706)
* Fix bug in logfile parsing

* Cite ECMA-48 standards for CSI

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

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
2024-06-27 07:07:30 -06:00
Massimiliano Culpo
ef9e449322
Ensure parent runtime version >= child (#44834)
Fixes a bug where old gcc-runtime libraries would be loaded at runtime, but newer are required by dependencies, breaking the binaries.
2024-06-27 14:58:42 +02:00
dependabot[bot]
d6419f32b8
build(deps): bump mypy from 1.10.0 to 1.10.1 in /lib/spack/docs (#44885)
Bumps [mypy](https://github.com/python/mypy) from 1.10.0 to 1.10.1.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.10.0...v1.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 12:40:14 +02:00
Miguel
60ed682577
Fix typo in docs (#44891)
Fixes on the rst formatting of the make_jobs
2024-06-27 12:32:16 +02:00
Wouter Deconinck
f916b50491
containers: centos:stream -> centos:stream9 (#44876) 2024-06-27 10:38:56 +02:00
Massimiliano Culpo
b0b6016e12
ASP-based solver: add a generic rule for propagation (#44870)
This adds a generic propagate/2 rule to propagate any
fact to children in the DAG.
2024-06-26 16:02:00 +02:00
Massimiliano Culpo
c0f9f47b8c
Simplify and improve solver heuristic (#44893)
When we changed how to deal with errors in November,
we didn't realize that for an unconstrained choice
rule it is more important in the heuristic to guess
what is NOT in the answer set, since it will be the
majority of options.

Previously this was following automatically from what
was in the answer set, via `1 { ... } 1` cardinality
constraints.

Here we improve the heuristic and the solve time for specs.
2024-06-26 13:08:41 +02:00
psakievich
54d192e026
Steal source was not assigning the package class (#44886)
Fetcher was missing the package class assignment
2024-06-25 23:17:56 -07:00
Tamara Dahlgren
baf82c0245
Docs: Update stand-alone test information (#44755)
Update and slightly reorganize stand-alone test information to include new and improved examples and more links that can be used in PR feedback.
2024-06-25 13:33:41 -07:00
Miguel
536856874c
add documentation for make_jobs variable (#44838)
* add documentation for make_jobs variable

* apply suggested changes

* Update packaging_guide.rst

add suggestions to the documentation

* Update packaging_guide.rst

fix missing quotes in the documentation

* suggestions to packaging_guide.rst
2024-06-25 11:24:49 -06:00
Nicole C
d8b0df6f5b
Make url_fetch tests work on Windows (#44809) 2024-06-25 07:34:11 +00:00
Harmen Stoppels
0282fe9efd
spec_list: do not resolve abstract hashes (#44760) 2024-06-24 16:43:01 +02:00
Tamara Dahlgren
3848c41494
Bugfix: test_is_externally_detectable needs to use mockpackages (#44795) 2024-06-21 12:24:46 +02:00