Commit Graph

38345 Commits

Author SHA1 Message Date
Todd Gamblin
bb77a7733c
remove superfluous debug lines in test
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:55:53 -07:00
Todd Gamblin
cb588d933c
remove straggling uses of hash_types.package_hash
- [x] don't allow calling `spec.package_hash()` on abstract specs
- [x] get rid of last few uses of `ht.package_hash`, which was removed.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:55:51 -07:00
Todd Gamblin
552a35e12e
bugfix: submodule callbacks need to be resolved in specs
The submodules argument for git versions supports callbacks (which are used on some key
packages to conditionally fetch certain submodules). Callbacks can't be serialized to
JSON, so we need to ensure that these things are resolved (by calling them) at
concretization time.

- [x] ensure that submodule callbacks are called when creating spec JSON
- [x] add tests that try serializing all types of git versions
2024-10-27 17:54:09 -07:00
Todd Gamblin
d5f4c69076
don't remove patches variant
Patches variant needs to stay on the spec even if we also have resources.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:09 -07:00
Todd Gamblin
b8ecccbde9
installer: show tracebacks from builds to debug failed installs
`installer.py` currently swallows the traceback and preserves only
the error messaege if a build process fails.

- [x] preserve exceptions from failed build processes
- [x] print a full traceback for each one when running with `spack -d`

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:09 -07:00
Todd Gamblin
b7ebcc4a7b
extra debug statements
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:09 -07:00
Todd Gamblin
74684ea089
fix string in test
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:09 -07:00
Todd Gamblin
97f868a54e
avoid circular import of spack.patch
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
4005ae8651
remove comment
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
cf9720e00d
remove useless check
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
752c0d4fe2
clarify comment on use of _package_hash
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
4a2f5f4b50
abbreviate hashes in mock packages
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
de62f7fed2
don't refer to source id
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
e296d19146
update docstring
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
d06d812013
remove TODO: resources
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -07:00
Todd Gamblin
eef041abee
specs: include source provenance in spec.json and package hash
We've included a package hash in Spack since #7193 for CI, and we started using it on
the spec in #28504. However, what goes into the package hash is a bit opaque. Here's
what `spec.json` looks like now:

```json
{
  "spec": {
    "_meta": {
      "version": 3
    },
    "nodes": [
      {
        "name": "zlib",
        "version": "1.2.12",
        ...
        "patches": [
          "0d38234384870bfd34dfcb738a9083952656f0c766a0f5990b1893076b084b76"
        ],
        "package_hash": "pthf7iophdyonixxeed7gyqiksopxeklzzjbxtjrw7nzlkcqleba====",
        "hash": "ke4alug7ypoxp37jb6namwlxssmws4kp"
      }
    ]
  }
}
```

The `package_hash` there is a hash of the concatenation of:

* A canonical hash of the `package.py` recipe, as implemented in #28156;
* `sha256`'s of patches applied to the spec; and
* Archive `sha256` sums of archives or commits/revisions of repos used to build the spec.

There are some issues with this: patches are counted twice in this spec (in `patches`
and in the `package_hash`), the hashes of sources used to build are conflated with the
`package.py` hash, and we don't actually include resources anywhere.

With this PR, I've expanded the package hash out in the `spec.json` body. Here is the
"same" spec with the new fields:

```json
{
  "spec": {
    "_meta": {
      "version": 3
    },
    "nodes": [
      {
        "name": "zlib",
        "version": "1.2.12",
        ...
        "package_hash": "6kkliqdv67ucuvfpfdwaacy5bz6s6en4",
        "sources": [
          {
            "type": "archive",
            "sha256": "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9"
          }
        ],
        "patches": [
          "0d38234384870bfd34dfcb738a9083952656f0c766a0f5990b1893076b084b76"
        ],
        "hash": "ts3gkpltbgzr5y6nrfy6rzwbjmkscein"
      }
    ]
  }
}
```

Now:

* Patches and archive hashes are no longer included in the `package_hash`;
* Artifacts used in the build go in `sources`, and we tell you their checksum in the `spec.json`;
* `sources` will include resources for packages that have it;
* Patches are the same as before -- but only represented once; and
* The `package_hash` is a base32-encoded `sha1`, like other hashes in Spack, and it only
  tells you that the `package.py` changed.

The behavior of the DAG hash (which includes the `package_hash`) is basically the same
as before, except now resources are included, and we can see differences in archives and
resources directly in the `spec.json`

Note that we do not need to bump the spec meta version on this, as past versions of
Spack can still read the new specs; they just will not notice the new fields (which is
fine, since we currently do not do anything with them).

Among other things, this will more easily allow us to convert Spack specs to SBOM and
track relevant security information (like `sha256`'s of archives). For example, we could
do continuous scanning of a Spack installation based on these hashes, and if the
`sha256`'s become associated with CVE's, we'll know we're affected.

- [x] Add a method, `spec_attrs()` to `FetchStrategy` that can be used to describe a
      fetcher for a `spec.json`.

- [x] Simplify the way package_hash() is handled in Spack. Previously, it was handled as
      a special-case spec hash in `hash_types.py`, but it really doesn't belong there.
      Now, it's handled as part of `Spec._finalize_concretization()` and `hash_types.py`
      is much simpler.

- [x] Change `PackageBase.content_hash()` to `PackageBase.artifact_hashes()`, and
      include more information about artifacts in it.

- [x] Update package hash tests and make them check for artifact and resource hashes.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-27 17:54:08 -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
Harmen Stoppels
e80d75cbe3
gha: circular imports: pin (#47248) 2024-10-27 21:34:32 +01: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
William R Tobin
fea2171672
silo: resolve hdf5 develop-X.Y branch versions (#39344) 2024-10-27 06:44:20 -06:00
Beat Reichenbach
12a475e648
feat: Add OpenColorIO option to OpenImageIO (#47237)
* feat: Add OpenColorIO option to OpenImageIO

* style: Pep 8

---------

Co-authored-by: Beat Reichenbach <beatreichenbach@users.noreply.github.com>
2024-10-27 09:37:49 +01:00
Wouter Deconinck
c348891c07
pango: deprecate @:1.44 due to CVE (#47232) 2024-10-27 06:56:13 +01:00
Jeff Hammond
019e90ab36
NWChem: add TCE_CUDA option (#47191)
Signed-off-by: Jeff Hammond <jehammond@nvidia.com>
2024-10-27 06:54:06 +01:00
Jeff Hammond
19137b2653
add the USE_F90_ALLOCATABLE option to Spack (#47190)
Signed-off-by: Jeff Hammond <jehammond@nvidia.com>
2024-10-27 06:53:48 +01:00
Andrew W Elble
2761e650fa
gem5: new package (#47218) 2024-10-27 06:28:26 +01:00
Asa
84ea389017
py-olcf-velocity: new package (#47215)
* Add package py-olcf-velocity

* Removed trailing newline

* Fixed packages description line length

---------

Co-authored-by: Asa Rentschler <rentschleraj@ornl.gov>
2024-10-27 05:36:23 +01:00
Adam J. Stewart
17f07523f5
py-alive-progress: support newer Python (#47220) 2024-10-27 05:24:51 +01:00
Pranav Sivaraman
bd2ddb8909
byte-lite: new package (#47234)
* byte-lite: new package

* byte-lite: style adjustments
2024-10-27 05:22:58 +01:00
Adam J. Stewart
f5db757e66
adios2: mark conflict with newer Python@3.11 for @:2.7 (#47219) 2024-10-27 04:40:38 +01:00
Dave Keeshan
277f8596de
yosys: Update to version 0.46, also include 0.43, 0.44 and 0.45 (#47200) 2024-10-26 21:56:12 +02: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
Paul
61d2d21acc
Add Go 1.23.2, 1.22.8, and 1.22.7 (#47225) 2024-10-25 14:15:35 -06: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
Gregory Lee
a2a3a83a26
Packages/javacerts (#47201)
* new openjdk variant to symlink system certificate

* new openjdk variant to symlink system certificate

* new openjdk variant to symlink system certificate

* new openjdk variant to symlink system certificate

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

Co-authored-by: Alec Scott <hi@alecbcs.com>

---------

Co-authored-by: Alec Scott <hi@alecbcs.com>
2024-10-25 12:45:14 -06: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
dependabot[bot]
ef220daaca
build(deps): bump actions/checkout from 4.2.1 to 4.2.2 (#47185)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](eef61447b9...11bd71901b)

---
updated-dependencies:
- dependency-name: actions/checkout
  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-10-25 09:48:50 -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
Dave Keeshan
7319408bc7
Add version 0.0.3836 (#47204) 2024-10-25 08:30:08 +02:00
dependabot[bot]
b34159348f
build(deps): bump actions/setup-python from 5.2.0 to 5.3.0 (#47209)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](f677139bbe...0b93645e9f)

---
updated-dependencies:
- dependency-name: actions/setup-python
  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-25 07:36:14 +02:00
Jordan Galby
f13d998d21
Add spack short version in config variables (#47016) 2024-10-25 07:34:59 +02:00
Jon Rood
2912d4a661
tioga: add v1.2.0. (#47208) 2024-10-24 22:04:33 -06:00
Jon Rood
8e2ec58859
exawind: add v1.1.0. (#47207) 2024-10-24 22:00:22 -06:00
Jon Rood
01eb26578b
amr-wind: add v3.1.6. (#47205) 2024-10-24 21:53:54 -06:00
Jon Rood
fe0a8a1735
nalu-wind: add v2.1.0. (#47206) 2024-10-24 21:39:57 -06:00
Adam J. Stewart
d523f12e99
py-jupyter: add v1.1.1 (#47194) 2024-10-25 00:42:39 +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
AMD Toolchain Support
65bb3a12ea
hdf5: disable _Float16 support for aocc (#47123) 2024-10-24 14:44:09 -06:00