Commit graph

6135 commits

Author SHA1 Message Date
Eric Berquist
b2a8e8734e
Fix typos in packaging guide (#37460) 2023-05-05 22:08:58 +00:00
Harmen Stoppels
9ef062fcca
Add spack buildcache push (alias to buildcache create) (#34861)
`spack buildcache create` is a misnomer cause it's the only way to push to
an existing buildcache (and it in fact calls binary_distribution.push).

Also we have `spack buildcache update-index` but for create the flag is
`--rebuild-index`, which is confusing (and also... why "rebuild"
something if the command is "create" in the first place, that implies it
wasn't there to begin with).

So, after this PR, you can use either

```
spack buildcache create --rebuild-index
```

or

```
spack buildcache push --update-index
```

Also, alias `spack buildcache rebuild-index` to `spack buildcache
update-index`.
2023-05-05 19:54:26 +02:00
Chris Green
d600aef4f4
Relax environment manifest filename requirements and lockfile identification criteria (#37413)
* Relax filename requirements and lockfile identification criteria

* Tests

* Update function docs and help text

* Update function documentation

* Update Sphinx documentation

* Adjustments per https://github.com/spack/spack/pull/37413#pullrequestreview-1413540132

* Further tweaks per https://github.com/spack/spack/pull/37413#pullrequestreview-1413971254

* Doc fixes per https://github.com/spack/spack/pull/37413#issuecomment-1535976068
2023-05-05 07:40:49 -05:00
Harmen Stoppels
bbc779f3f0
cc: deal with -Wl,-rpath= without value, deal with NAG (#37215)
Spack never parsed `nagfor` linker arguments put on the compiler line: 
```
nagfor -Wl,-Wl,,-rpath,,/path
````
so, let's continue not attempting to parse that.
2023-05-05 12:16:31 +02:00
Michael Kuhn
b2c3973d4a
meson: change default build type to "release" (#37436)
The same was done for CMake in #36679.
2023-05-05 10:35:40 +02:00
Harmen Stoppels
35e1dc8eba
spack uninstall: reduce verbosity with named environments (#34001) 2023-05-05 10:23:08 +02:00
Harmen Stoppels
bf71b78094
deprecate buildcache create --rel, buildcache install --allow-root (#37285)
`buildcache create --rel`: deprecate this because there is no point in
making things relative before tarballing; on install you need to expand
`$ORIGIN` / `@loader_path` / relative symlinks anyways because some
dependencies may actually be in an upstream, or have different
projections.

`buildcache install --allow-root`: this flag was propagated through a
lot of functions but was ultimately unused.
2023-05-05 09:51:53 +02:00
Massimiliano Culpo
0c5a5e2ce0
Remove "blacklist" and "whitelist" from module configuration (#37432)
The sections were deprecated in v0.19
2023-05-05 00:28:34 -04:00
Greg Becker
c3593e5b48
Allow choosing the name of the packages subdirectory in repositories (#36643)
Co-authored-by: becker33 <becker33@users.noreply.github.com>
2023-05-04 23:36:21 +02:00
Massimiliano Culpo
16613408e4
Place an upper bound on urllib3 to build docs (#37433) 2023-05-04 19:40:43 +02:00
Robert Cohn
420e093e42
detect ifx 2023.1, add test (#37377) 2023-05-04 10:27:19 -07:00
Massimiliano Culpo
86d3bad1e0
cmake build system: change default build type to Release (#36679)
This switches the default Make build type to `build_type=Release`.

This offers:
- higher optimization level, including loop vectorization on older GCC
- adds NDEBUG define, which disables assertions, which could cause speedups if assertions are in loops etc
- no `-g` means smaller install size

Downsides are:
- worse backtraces (though this does NOT strip symbols)
- perf reports may be useless
- no function arguments / local variables in debugger (could be of course)
- no file path / line numbers in debugger

The downsides can be mitigated by overriding to `build_type=RelWithDebInfo` in `packages.yaml`,
if needed.  The upside is that builds will be MUCH smaller (and faster) with this change.

---------

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2023-05-04 11:33:35 -04:00
Massimiliano Culpo
600955edd4
Update vendored ruamel.yaml to v0.17.21 (#37008)
* Vendor ruamel.yaml v0.17.21

* Add unit test for whitespace regression

* Add an abstraction layer in Spack to wrap ruamel.yaml

All YAML operations are routed through spack.util.spack_yaml

The custom classes have been adapted to the new ruamel.yaml
class hierarchy.

Fixed line annotation issue in "spack config blame"
2023-05-04 08:00:38 -07:00
Massimiliano Culpo
95e61f2fdf
Remove the old spec format in configuration (#37425)
The format was deprecated in v0.15
2023-05-04 07:59:11 -07:00
Massimiliano Culpo
cf5daff6f5
Deprecate env: as top level environment key (#37424) 2023-05-04 07:08:29 -04:00
Annop Wongwathanarat
e5dcaebd43
acfl: add compiler-package mapping and fix version number (#36768) 2023-05-04 03:59:15 -05:00
Harmen Stoppels
84a70c26d9
buildcache metadata: store hash -> prefix mapping (#37404)
This ensures that:

a) no externals are added to the tarball metadata file
b) no externals are added to the prefix to prefix map on install, also
for old tarballs that did include externals
c) ensure that the prefix -> prefix map is always string to string, and
doesn't contain None in case for some reason a hash is missing
2023-05-04 10:09:22 +02:00
Bryce Torcello
541cdbbef2
docs: update RHEL/CentOS system prerequisites (#36720) 2023-05-03 19:04:16 +02:00
Egbert Eich
1491d8471d
Add 'zypper' to the valid container.os_packages options (#36681)
Signed-off-by: Egbert Eich <eich@suse.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: e4t <e4t@users.noreply.github.com>
2023-05-03 13:05:14 +02:00
Massimiliano Culpo
03d1841385
Allow adding specs to an environment without the 'specs' attribute (#37378) 2023-05-03 13:01:16 +02:00
Harmen Stoppels
7c8590ee44
remove unused global in bindist tests (#37358)
* remove unused global in bindist tests
* remove unused function
2023-05-03 05:34:14 -04:00
Scott Wittenburg
c7e60f441a
buildcache push: improve printing (#36141) 2023-05-03 10:42:22 +02:00
Massimiliano Culpo
a92f1e37aa
Disable module file generation by default (#37258)
* Disable module generation by default (#35564)

a) It's used by site administrators, so it's niche
b) If it's used by site administrators, they likely need to modify the config anyhow, so the default config only serves as an example to get started
c) it's too arbitrary to enable tcl, but disable lmod

* Remove leftover from old module file schema

* Warn if module file config is detected and generation is disabled

---------

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-05-02 10:28:27 +02:00
Massimiliano Culpo
3c3a4c7577
Factor YAML manifest manipulation out of the Environment class (#36927)
Change the signature of the Environment.__init__ method to have
a single argument, i.e. the directory where the environment manifest 
is located. Initializing that directory is now delegated to a function 
taking care of all the error handling upfront. Environment objects 
require a "spack.yaml" to be available to be constructed.

Add a class to manage the environment manifest file. The environment 
now delegates to an attribute of that class the responsibility of keeping
track of changes modifying the manifest. This allows simplifying the 
updates of the manifest file, and helps keeping in sync the spec lists in
memory with the spack.yaml on disk.
2023-05-01 15:06:10 +02:00
Greg Becker
21cadf96e0
Spec.format: fix bug in dependency hash formatting (#37073)
Co-authored-by: becker33 <becker33@users.noreply.github.com>
2023-04-28 23:33:05 +02:00
Harmen Stoppels
c85877566f
Reduce the number of stat calls in "spack verify" (#37251)
Spack comes to a crawl post-install of nvhpc, which is partly thanks to
this post install hook which has a lot of redundancy, and isn't correct.

1. There's no need to store "type" because that _is_ "mode".
2. There are more file types than "symlink", "dir", "file".
3. Don't checksum device type things
4. Don't run 3 stat calls (exists, stat, isdir/islink), but one lstat
   call
5. Don't read entire files into memory

I also don't know why `spack.crypto` wasn't used for checksumming, but I
guess it's too late for that now. Finally md5 would've been the faster
algorithm, which would've been fine given that a non cryptographicall
checksum was used anyways.
2023-04-28 13:24:24 +00:00
Jonathon Anderson
cba8d1253d
Add container images supporting RHEL alternatives (#36713)
Add container support for AlmaLinux, Fedora 37 and 38 and Rocky Linux
2023-04-28 12:28:33 +02:00
Harmen Stoppels
97beb2658b
require: do not allow additional properties (#37174) 2023-04-25 11:52:51 +02:00
Adam J. Stewart
7df2865dce
Copy more logs to CI artifacts (#36783)
* Copy more logs to CI artifacts

* Trigger rebuilds again

* Remove test variant
2023-04-24 10:08:30 -05:00
John W. Parent
d8451b0c3f
Windows: shell variables are case-insensitive (#36813)
If we modify both Path and PATH, on Windows they will clobber one
another. This PR updates the shell modification logic to automatically
convert variable names to upper-case on Windows.
2023-04-21 11:38:58 -07:00
markus-ferrell
c64ca97877
Enable verify tests on windows (#36975) 2023-04-21 14:32:33 +02:00
markus-ferrell
cd4dddbef1
Enable versions cmd tests on windows (#36974) 2023-04-21 14:31:14 +02:00
markus-ferrell
e77b1da772
Enable test suite tests on windows (#36966) 2023-04-21 14:18:06 +02:00
markus-ferrell
e1e8d3b66e
Enable database tests for windows (#36968) 2023-04-21 14:15:29 +02:00
markus-ferrell
962df6334d
Enable config values tests on windows (#36969) 2023-04-21 14:15:09 +02:00
markus-ferrell
ba255cf5ec
Enable graph tests on windows (#36967) 2023-04-21 14:14:51 +02:00
Massimiliano Culpo
cac44b9e15
Update archspec to latest release (#37070)
Fix -mcpu flags for gcc on neoverse-v1

Add support for NVHPC flags
2023-04-21 11:01:37 +02:00
Massimiliano Culpo
1b7cf171ce
Use core API to create a Makefile during bootstrapping (#37023) 2023-04-20 15:11:56 +02:00
Harmen Stoppels
d51af675ef
make version(...) kwargs explicit (#36998)
- [x] Replace `version(ver, checksum=None, **kwargs)` signature with
      `version(ver, checksum=None, *, sha256=..., ...)` explicitly listing all arguments.
- [x] Fix various issues in packages:
  - `tags` instead of `tag`
  - `default` instead of `preferred`
  - `sha26` instead of `sha256`
  - etc

Also, use `sha256=...` consistently.

Note: setting `sha256` currently doesn't validate the checksum length, so you could do
`sha256="a"*32` and it would get checked as `md5`... but that's something for another PR.
2023-04-19 14:17:47 -07:00
Harmen Stoppels
ae909b3688
Extract depfile logic from cli command into a core module (#36995) 2023-04-19 14:36:29 +02:00
Alec Scott
3a5e48f476
installer.py: drop build edges of installed packages by default (#36707)
This means that `spack install` will now build the minimal set of packages
required to install the root(s).

To opt out of build edge pruning, use `spack install --include-build-deps`.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-04-19 10:00:40 +02:00
Todd Gamblin
b260234faf editing: add higher-precedence SPACK_EDITOR environment variable
Other tools like git support `GIT_EDITOR` which takes higher precedence than the
standard `VISUAL` or `EDITOR` variables. This adds similar support for Spack, in the
`SPACK_EDITOR` env var.

- [x] consolidate editor code from hooks into `spack.util.editor`
- [x] add more editor tests
- [x] add support for `SPACK_EDITOR`
- [x] add a documentation section for controlling the editor and reference it
2023-04-18 16:23:00 -07:00
Todd Gamblin
2f30da1762 refactor: unify use of spack.util.editor
Code from `spack.util.editor` was duplicated into our licensing hook in #11968. We
really only want one place where editor search logic is implemented. This consolidates
the logic into `spack.util.editor`, including a special case to run `gvim` with `-f`.

- [x] consolidate editor search logic in spack.util.editor
- [x] add tests for licensing case, where `Executable` is used instead of `os.execv`
- [x] make `_exec_func` argument of `editor()` into public `exec_fn` arg
- [x] add type annotations
2023-04-18 16:23:00 -07:00
Massimiliano Culpo
d92c21ec97
Fix compilation on Cray (target: any) (#37011)
fixes #36628

Fix using compilers that declare "target: any" in their
configuration. This should happen only on Cray with the
module based programming environment.
2023-04-18 15:47:52 -07:00
Jonathon Anderson
08fd8c8d0a
spack ci: preserve custom attributes in build jobs (#36651)
* Simplify test/cmd/ci.py::test_ci_generate_with_custom_scripts

* Rearrange the build-job logic in generate_gitlab_ci_yaml

* Preserve all unknown attributes in build jobs

* Slip tests for custom attributes in the tests for other job types

* Support custom artifacts

* [@spackbot] updating style on behalf of blue42u

* Don't bother sorting needs

---------

Co-authored-by: blue42u <blue42u@users.noreply.github.com>
2023-04-18 15:40:43 -05:00
Todd Gamblin
6845f41d67
Revert addition of SPACK_EDITOR pending review.
This reverts commit d8a26905ee.
This reverts commit 1ee049ccc3.

These were spuriously pushed to `develop`.
2023-04-18 03:57:24 -07:00
Todd Gamblin
1ee049ccc3
editing: add higher-precedence SPACK_EDITOR environment variable
Other tools like git support `GIT_EDITOR` which takes higher precedence than the
standard `VISUAL` or `EDITOR` variables. This adds similar support for Spack, in the
`SPACK_EDITOR` env var.

- [x] consolidate editor code from hooks into `spack.util.editor`
- [x] add more editor tests
- [x] add support for `SPACK_EDITOR`
- [x] add a documentation section for controlling the editor and reference it
2023-04-18 03:42:56 -07:00
Todd Gamblin
d8a26905ee
refactor: unify use of spack.util.editor
Code from `spack.util.editor` was duplicated into our licensing hook in #11968. We
really only want one place where editor search logic is implemented. This consolidates
the logic into `spack.util.editor`, including a special case to run `gvim` with `-f`.

- [x] consolidate editor search logic in spack.util.editor
- [x] add tests for licensing case, where `Executable` is used instead of `os.execv`
- [x] make `_exec_func` argument of `editor()` into public `exec_fn` arg
- [x] add type annotations
2023-04-18 03:00:04 -07:00
Greg Becker
480b7f397e
Allow users to remove items from hierarchy per-path (#31351)
* lmod modules: allow users to remove items from hierarchy per-spec

This allows MPI wrappers that depend on MPI to be removed from the MPI portion of
the hierarchy and be made available when the appropriate compiler is loaded.

module load gcc
module load mpi-wrapper  # implicitly loads mpi
module load hdf5

This allows users to treat an mpi wrapper like an mpi program
2023-04-17 22:17:11 -07:00
Harmen Stoppels
381c0af988
Revert "move depfile logic into its own module, separate traversal logic from model (#36911)" (#36985)
This reverts commit a676f706a8.
2023-04-17 20:58:38 +02:00