Commit graph

6240 commits

Author SHA1 Message Date
Massimiliano Culpo
89520467e0
Use single quotes to inline manifest in Dockerfiles (#37571)
fixes #22341

Using double quotes creates issues with shell variable substitutions,
in particular when the manifest has "definitions:" in it. Use single
quotes instead.
2023-05-09 13:20:25 +02:00
Harmen Stoppels
9e1440ec7b
spack view copy: relocate symlinks (#32306) 2023-05-09 12:17:16 +02:00
Massimiliano Culpo
0139288ced
Add a "requires" directive, extend functionality of package requirements (#36286)
Add a "require" directive to packages, which functions exactly like
requirements specified in packages.yaml (uses the same fact-generation
logic); update both to allow making the requirement conditional.

* Packages may now use "require" to add constraints. This can be useful
  for something like "require(%gcc)" (where before we had to add a
  conflict for every compiler except gcc).
* Requirements (in packages.yaml or in a "require" directive) can be
  conditional on a spec, e.g. "require(%gcc, when=@1.0.0)" (version
  1.0.0 can only build with gcc).
* Requirements may include a message which clarifies why they are needed.
  The concretizer assigns a high priority to errors which generate these
  messages (in particular over errors for unsatisfied requirements that
  do not produce messages, but also over a number of more-generic
  errors).
2023-05-08 10:12:26 -07:00
Tamara Dahlgren
374264f610
Packaging Guide: build-time test updates: option and test logs (#37093)
* Packaging Guide: build-time test updates: option and test logs
* Fix a couple of typos
2023-05-05 22:19:06 -06:00
Harmen Stoppels
fa7719a031
Improve version, version range, and version list syntax and behavior (#36273)
## Version types, parsing and printing

- The version classes have changed: `VersionBase` is removed, there is now a
  `ConcreteVersion` base class. `StandardVersion` and `GitVersion` both inherit
  from this.

- The public api (`Version`, `VersionRange`, `ver`) has changed a bit:
  1. `Version` produces either `StandardVersion` or `GitVersion` instances.
  2. `VersionRange` produces a `ClosedOpenRange`, but this shouldn't affect the user.
  3. `ver` produces any of `VersionList`, `ClosedOpenRange`, `StandardVersion`
     or `GitVersion`.

- No unexpected type promotion, so that the following is no longer an identity:
  `Version(x) != VersionRange(x, x)`.

- `VersionList.concrete` now returns a version if it contains only a single element
  subtyping `ConcreteVersion` (i.e. `StandardVersion(...)` or `GitVersion(...)`)

- In version lists, the parser turns `@x` into `VersionRange(x, x)` instead
  of `Version(x)`.

- The above also means that `ver("x")` produces a range, whereas
  `ver("=x")` produces a `StandardVersion`. The `=` is part of _VersionList_
  syntax.

- `VersionList.__str__` now outputs `=x.y.z` for specific version entries,
  and `x.y.z` as a short-hand for ranges `x.y.z:x.y.z`.

- `Spec.format` no longer aliases `{version}` to `{versions}`, but pulls the
  concrete version out of the list and prints that -- except when the list is
  is not concrete, then is falls back to `{versions}` to avoid a pedantic error.
  For projections of concrete specs, `{version}` should be used to render
  `1.2.3` instead of `=1.2.3` (which you would get with `{versions}`).
  The default `Spec` format string used in `Spec.__str__` now uses
  `{versions}` so that `str(Spec(string)) == string` holds.

## Changes to `GitVersion`

- `GitVersion` is a small wrapper around `StandardVersion` which enriches it
   with a git ref. It no longer inherits from it.

- `GitVersion` _always_ needs to be able to look up an associated Spack version
  if it was not assigned (yet). It throws a `VersionLookupError` whenever `ref_version`
  is accessed but it has no means to look up the ref; in the past Spack would
  not error and use the commit sha as a literal version, which was incorrect.
   
- `GitVersion` is never equal to `StandardVersion`, nor is satisfied by it. This
  is such that we don't lose transitivity. This fixes the following bug on `develop`
  where `git_version_a == standard_version == git_version_b` does not imply
  `git_version_a == git_version_b`. It also ensures equality always implies equal
  hash, which is also currently broken on develop; inclusion tests of a set of
  versions + git versions would behave differently from inclusion tests of a
  list of the same objects.

- The above means `ver("ref=1.2.3) != ver("=1.2.3")` could break packages that branch
  on specific versions, but that was brittle already, since the same happens with
  externals: `pkg@1.2.3-external` suffixes wouldn't be exactly equal either. Instead,
  those checks should be `x.satisfies("@1.2.3")` which works both for git versions and
  custom version suffixes.

- `GitVersion` from commit will now print as `<hash>=<version>` once the
  git ref is resolved to a spack version. This is for reliability -- version is frozen
  when added to the database and queried later. It also improves performance
  since there is no need to clone all repos of all git versions after `spack clean -m`
  is run and something queries the database, triggering version comparison, such
  as potentially reuse concretization.

- The "empty VerstionStrComponent trick" for `GitVerison` is dropped since it wasn't
  representable as a version string (by design). Instead, it's replaced by `git`,
  so you get `1.2.3.git.4` (which reads 4 commits after a tag 1.2.3). This means
  that there's an edge case for version schemes `1.1.1`, `1.1.1a`, since the
  generated git version `1.1.1.git.1` (1 commit after `1.1.1`) compares larger
  than `1.1.1a`, since `a < git` are compared as strings. This is currently a
  wont-fix edge case, but if really required, could be fixed by special casing
  the `git` string.

- Saved, concrete specs (database, lock file, ...) that only had a git sha as their
  version, but have no means to look the effective Spack version anymore, will
  now see their version mapped to `hash=develop`. Previously these specs
  would always have their sha literally interpreted as a version string (even when
  it _could_ be looked up). This only applies to databases, lock files and spec.json
  files created before Spack 0.20; after this PR, we always have a Spack version
  associated to the relevant GitVersion).

- Fixes a bug where previously `to_dict` / `from_dict` (de)serialization would not
  reattach the repo to the GitVersion, causing the git hash to be used as a literal
  (bogus) version instead of the resolved version. This was in particularly breaking
  version comparison in the build process on macOS/Windows.


## Installing or matching specific versions

- In the past, `spack install pkg@3.2` would install `pkg@=3.2` if it was a
  known specific version defined in the package, even when newer patch releases
  `3.2.1`, `3.2.2`, `...` were available. This behavior was only there because
  there was no syntax to distinguish between `3.2` and `3.2.1`. Since there is
  syntax for this now through `pkg@=3.2`, the old exact matching behavior is
  removed. This means that `spack install pkg@3.2` constrains the `pkg` version
  to the range `3.2`, and `spack install pkg@=3.2` constrains it to the specific
  version `3.2`.

- Also in directives such as `depends_on("pkg@2.3")` and their when
  conditions `conflicts("...", when="@2.3")` ranges are ranges, and specific
  version matches require `@=2.3.`.

- No matching version: in the case `pkg@3.2` matches nothing, concretization
  errors. However, if you run `spack install pkg@=3.2` and this version
  doesn't exist, Spack will define it; this allows you to install non-registered
  versions.

- For consistency, you can now do `%gcc@10` and let it match a configured
  `10.x.y` compiler. It errors when there is no matching compiler.
  In the past it was interpreted like a specific `gcc@=10` version, which
  would get bootstrapped.

- When compiler _bootstrapping_ is enabled, `%gcc@=10.2.0` can be used to
  bootstrap a specific compiler version.

## Other changes

- Externals, compilers, and develop spec definitions are backwards compatible.
  They are typically defined as `pkg@3.2.1` even though they should be
  saying `pkg@=3.2.1`. Spack now transforms `pkg@3` into `pkg@=3` in those cases.

- Finally, fix strictness of `version(...)` directive/declaration. It just does a simple
  type check, and now requires strings/integers. Floats are not allowed because
  they are ambiguous `str(3.10) == "3.1"`.
2023-05-05 22:04:41 -06:00
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
Harmen Stoppels
a676f706a8
move depfile logic into its own module, separate traversal logic from model (#36911) 2023-04-17 15:27:01 +02:00
Doug Jacobsen
690394fabc
Change environment modifications to escape with double quotes (#36789)
This commit changes the environment modifications class to escape
strings with double quotes instead of single quotes.

Single quotes prevent the expansion of enviornment variables that are
nested within environment variable definitions.
2023-04-14 10:13:17 -07:00
Scott Wittenburg
bfa94c5781
gitlab ci: Better tagging of "service" jobs (#36846)
- Tag non-rebuild jobs to target a cheaper (and more highly available)
subset of runners.

- Add missing resource requests to these jobs as well.
2023-04-14 09:03:12 -06:00
Massimiliano Culpo
9ec289857c
netcdf: fix bugs introduced with multiple build systems split (#36825)
Fixes #36689

- The "base" builder class should be last in the MRO
- `filter_compiler_wrappers` needs to be moved to builders
- Decorating a function from a mixin class require using
   the correct metaclass for the mixin
2023-04-14 10:59:12 +02:00
Wouter Deconinck
ff319e9863
Resolve <include-fragment> tags e.g. in github release pages (#36674)
This aims to resolve #34164 by resolving the <include-fragment> tags
that GitHub has started using for their release pages, see
https://github.github.io/include-fragment-element/.

This feels a bit hacky but intended as a starting point for discussion.
After reading a page during spidering, it first parses for
include-fragments, gets them all, and treats them all as separate pages.
Then it looks for href links in both the page itself and the fragments.

Co-authored-by: Alec Scott <alec@bcs.sh>
2023-04-13 20:26:26 +02:00
Massimiliano Culpo
d918ae0bde
containerize: strip binaries in a less aggressive way (#36683) 2023-04-13 17:09:34 +02:00
John W. Parent
530669346a
Windows/MSVC: propagate all VCVARS changes to Spack env (#36582)
MSVC compilers rely on vcvars environment setup scripts to establish
build environement variables neccesary for all projects to build
successfully. Prior to this we were only piping LIB, INCLUDE, and PATH
change through.

Instead we need to propegate all changes to the env variables made by
VCVARs in order to establish robust support for the MSVC compiler.
This most significantly impacts projects that need to be build with
NMake and MSBuild
2023-04-11 19:04:34 -04:00
markus-ferrell
3edb044706
Windows testing: reenable tests for "spack dependents" (#36786)
All the tests worked out of the box. This just removes the skip statements.
2023-04-11 14:30:40 -07:00
Harmen Stoppels
1c3961bdd0
Remove a unit-test that monkey-patches os.stat (#36757)
"test_create_stage_root_bad_uid" started failing as pytest updated to v7.3.0
2023-04-11 14:02:35 +02:00
kwryankrattiger
b2310f9e64
Ci backwards compat (#36045)
* CI: Fixup docs for bootstrap.

* CI: Add compatibility shim

* Add an update method for CI

Update requires manually renaming section to `ci`. After
this patch, updating and using the deprecated `gitlab-ci` section
should be possible.

* Fix typos in generate warnings

* Fixup CI schema validation

* Add unit tests for legacy CI

* Add deprecated CI stack for continuous testing

* Allow updating gitlab-ci section directly with env update

* Make warning give good advice for updating gitlab-ci

* Fix typo in CI name

* Remove white space

* Remove unneeded component of deprected-ci
2023-04-10 16:46:45 -05:00
Massimiliano Culpo
a7b2196eab
Fix incorrect reformatting of spack.yaml (#36698)
* Extract a method to warn when the manifest is not up-to-date

* Extract methods to update the repository and ensure dir exists

* Simplify further the write method, add failing unit-test

* Fix the function computing YAML equivalence between two instances
2023-04-07 13:37:28 +02:00
Massimiliano Culpo
0b9694575f
spack install: fail if --log-file and not --log-format (#36684)
fixes #34551

"spack install" now fails if a user passed the --logfile option without specifying a log format.
2023-04-06 09:09:18 -07:00
Massimiliano Culpo
3e1c6b27a4
Update archspec to HEAD of develop (#36657) 2023-04-05 13:23:42 -04:00
Jonathon Anderson
78f5b2a2c6
Add workflow:rules:always to spack ci output (#36011) 2023-04-04 10:03:58 -05:00
Harmen Stoppels
dc1399386c
Make spack config update work on environments (#36542)
Previously `spack -e bla config update <section>` would treat the
environment config scope as standard config file instead of a single
file config scope. This fixes that.
2023-04-04 10:19:05 +02:00
Harmen Stoppels
e9a1d0a157
filter __spack_path_placeholder__ in generated module files after buildcache install (#36611)
* filter __spack_path_placeholder__ in generated module files after buildcache install

* fix windows
2023-04-04 09:45:43 +02:00
Xavier Delaruelle
7a77ecbdb6
modules: remove default symlink on uninstall (#36454)
When app is uninstalled, if it matches a default, then remove the
default symlink targeting its modulefile.

Until now, when a default were uninstalled, the default symlink were
left pointing to a nonexistent modulefile.
2023-04-03 22:54:18 +02:00
Massimiliano Culpo
f91968cf6f
Improve Dockerfile recipe generation (#35187)
- Update default image to Ubuntu 22.04 (previously was still Ubuntu 18.04)
- Optionally use depfiles to install the environment within the container
- Allow extending Dockerfile Jinja2 template
- Allow extending Singularity definition file Jinja2 template
- Deprecate previous options to add extra instructions
2023-04-03 21:05:19 +02:00
Massimiliano Culpo
9d68100891
Rework error handling within the ASP logic program (#36536)
* Reduce effort on grounding by employing cardinality constraints

If we use a cardinality constraint instead of a rule
using pair of values, we'll end up grounding 1 rule
instead of all the possible pair combinations of the
allowed values.

* Display all errors from concretization, instead of just one

If clingo produces multiple "error" facts, we now print all
of them in the error message. Before we were printing just
the one with the least priority.

Consolidate a few common patterns in concretize.lp to ensure
that certain node attributes have one and only one value
assigned.

All errors are displayed, so use a single criterion
instead of three.

* Account for weights in concretize.lp

To recover the optimization order we had before, account
for weights of errors when minimizing.

The priority is mapped to powers of 10, so to effectively
get back the same results as with priorities.
2023-04-03 19:23:29 +02:00
Xavier Delaruelle
7e4927b892
modules: correctly detect explicit installation (#36533)
When generating modulefile, correctly detect software installation asked
by user as explicit installation.

Explicit installation status were previously fetched from database
record of spec, which was only set after modulefile generation.

Code is updated to pass down the explicit status of software
installation to the object that generates modulefiles.

Fixes #34730.
Fixes #12105.

A value for the explicit argument has to be set when creating a new
installation, but for operations on existing installation, this value is
retrieved from database. Such operations are: module rm, module refresh,
module setdefaults or when get_module function is used.

Update on the way tests that mimics an installation, thus explicit
argument has to be set under such situation.
2023-04-03 11:19:18 +02:00
John W. Parent
a8e2961010
Allow configurable stage names (#36509)
Add `config:stage_name` which is a Spec format string that can
customize the names of stages created by Spack. This was primarily
created to allow generating shorter stage names on Windows (along
with `config:build_stage`, this can be used to create stages with
short absolute paths).

By default, this is not set and the prior name stage format is used.

This also removes the username component that is always added to
Stage paths on Windows (if users want to include this, they can
add it to the `build_stage`).
2023-03-31 11:46:47 -07:00
Harmen Stoppels
46bbce1922
compiler wrapper: fix -Xlinker parsing (#35929)
* compiler wrapper: fix -Xlinker parsing
* handle the case of -rpath without value; avoid that we drop the flag
* also handle the -Xlinker -rpath -Xlinker without further args case...
* fix test
* get rid of global $rp var, reduce branching
2023-03-31 09:47:24 -07:00
Harmen Stoppels
b0e7b8c794
typehint a few globals (#36544) 2023-03-31 08:32:56 +02:00
Massimiliano Culpo
e1a104e3a2
Add type-hints to spack.bootstrap (#36491) 2023-03-30 22:12:18 +02:00
Massimiliano Culpo
16404034dc
Fix a couple of minor bugs with ASP weights (#36522)
Reorder versions so that deprecated ones are last. 

Account for default not used when the variant exists.
2023-03-30 01:08:57 -04:00
Todd Gamblin
d76a8b7de7
retry: bugfix: package requirements with git commits (#35057) (#36347)
- [x] Specs that define 'new' versions in the require: section need to generate associated facts to indicate that those versions are valid.
- [x] add test to verify success with unknown versions.
- [x] remove unneeded check that was leading to extra complexity and test
      failures (at this point, all `hash=version` does not require listing out that version
      in `packages.yaml`)
- [x] unique index for origin (dont reuse 0)

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
2023-03-28 11:18:54 -07:00
Harmen Stoppels
d862edcce0
macos: set new ad-hoc signature with codesign after binary string replacement (#35585) 2023-03-28 00:33:35 -04:00
Harmen Stoppels
5072e48dab
Add llnl.util.filesystem.find_first (#36083)
Add a `find_first` method that locates one instance of a file
that matches a specified pattern by recursively searching a directory
tree. Unlike other `find` methods, this only locates one file at most,
so can use optimizations that avoid searching the entire tree:
Typically the relevant files are at low depth, so it makes sense to
locate files through iterative deepening and early exit.
2023-03-27 09:42:16 -07:00
Xavier Delaruelle
ea60220a84
modules: enhance help message (#36410)
Update tcl and lmod modulefile template to provide more information on
help message (name, version and target) like done on whatis for lmod
modulefiles.
2023-03-27 10:48:25 +02:00
Xavier Delaruelle
c4923fe3b3
modules: add support for append_flags/remove_flags (#36402)
Adapt tcl and lmod modulefile templates to generate append-path or
remove-path commands in modulefile when respectively append_flags or
remove_flags commands are defined in package for run environment.

Fixes #10299.
2023-03-24 15:38:24 -04:00
Xavier Delaruelle
906151075d
modules tcl: simplify env modification block in template (#36334)
Simplify environment modification block in modulefile Tcl template by
always setting a path delimiter to the prepend-path, append-path and
remove-path commands.

Remove --delim option to the setenv command as this command does not
allow such option.

Update test_prepend_path_separator test to explicitly check the 6
path-like commands that should be present in generated modulefile.
2023-03-24 10:28:10 +01:00
Harmen Stoppels
118d8e4f57
unit tests: don't hard-code arch in compiler config (#36360)
This breaks when testing on non-x86_64 machines outside CI
2023-03-23 23:22:45 +01:00
Massimiliano Culpo
b0e54bc0ac
Fix regression on compiler constraint (#36342)
fixes #36339

We were missing a rule that enforced a match between
the `node_compiler` and the compiler used to satisfy
a requirement.

Fix compiler with custom, made up version too
2023-03-23 20:43:13 +01:00
Harmen Stoppels
4dc9d9f60e
Revert "Bugfix: package requirements with git commits (#35057)" (#36341)
This reverts commit 3d597e29be.
2023-03-23 12:10:46 +01:00
Peter Scheibel
3d597e29be
Bugfix: package requirements with git commits (#35057)
* Specs that define 'new' versions in the require: section need to generate
  associated facts to indicate that those versions are valid.

* add test to verify success with unknown versions.
2023-03-23 01:58:20 -07:00
Xavier Delaruelle
47d710dc4d
modules tcl: switch default all:autoload from none to direct (#36269)
Since environment-modules has support for autoloading since 4.2,
and Spack-builds of it enable it by default, use the same autoload
default for tcl as lmod.
2023-03-23 07:49:17 +01:00
Leopold Talirz
311d3be18e
docs: mention cuda multi-arch capability (#36321) 2023-03-22 16:52:53 -04:00
Peter Scheibel
c3e41153ac
Package requirements: allow single specs in requirement lists (#36258)
If you have a "require:" section in your packages config, and you
use it to specify a list of requirements, the list elements can
now include strings (before this, each element in the list had to
be a `one_of` or `any_of` specification, which is awkward if you
wanted to apply just one spec with no alternatives).
2023-03-20 12:30:33 -07:00
Harmen Stoppels
88d78025a6
spack install: simplify behavior when inside environments (#35206)
Example one:

```
spack install --add x y z
```

is equivalent to

```
spack add x y z
spack concretize
spack install --only-concrete
```

where `--only-concrete` installs without modifying spack.yaml/spack.lock

Example two:

```
spack install
```

concretizes current spack.yaml if outdated and installs all specs.

Example three:

```
spack install x y z
```

concretizes current spack.yaml if outdated and installs *only* concrete
specs in the environment that match abstract specs `x`, `y`, or `z`.
2023-03-20 13:51:30 +01:00
Adam J. Stewart
5dc8ed2694
Remove unused ignore parameter of extends() directive (#35588)
The `ignore` parameter was only used for `spack activate/deactivate`, and it isn't used
by Spack Environments which have their own handling of file conflicts. We should remove it.

Everything that handles `ignore=` was removed in #29317 and included in 0.19, when we
removed `spack activate` and `spack deactivate` in favor of environments.  So all of these
usages removed here were already being ignored by Spack.
2023-03-20 07:22:59 -04:00
Harmen Stoppels
b8e5fc061d
ci.py: remove redundant wrapper around get (#36188) 2023-03-20 10:56:19 +01:00
Xavier Delaruelle
41d7fe0a50
modules tcl: fix autoload mechanism in template (#36237)
Adapt tcl modulefile template to call "module load" on autoload
dependency without testing if this dependency is already loaded or not.

The is-loaded test is not necessary, as module commands know how to cope
with an already loaded module. With environment-modules 4.2+ (released
in 2018) it is also important to have this "module load" command even if
dependency is already loaded in order to record that the modulefile
declares such dependency. This is important if you want to keep a
consistent environment when a dependent module is unloaded.

The "Autoloading" verbose message is also removed as recent module
commands will report such information to the user (depending on the
verbosity configured for the module command).

Such change has been test successfully with Modules 3.2 (EL7), 4.5 (EL8)
and 5.2 (latest) and also with Lmod 7 and 8 (as it is mentionned in
Spack docs that Lmod can be used along with tcl modules). Dependencies
are correctly loaded or unloaded, whether they are loaded/unloaded or
not.

This change fixes Tcl quoting issue introduced in #32853.

Fixes #19155.
2023-03-20 09:23:40 +01:00
Xavier Delaruelle
df97827a7b
Fix case spelling for Lmod and Tcl (#36215) 2023-03-19 01:42:50 +00:00
Massimiliano Culpo
d84c6ad29e
cmake build system: make "generator" a variant (#35552) 2023-03-18 16:39:04 +01:00
Massimiliano Culpo
2f07c64f2d
Fix wrong computation of concrete specs due to a bug in intersects (#36194)
fixes #36190
2023-03-18 12:50:52 +01:00
Massimiliano Culpo
0478e5f684
Improve wording of audit message (#36180) 2023-03-17 17:43:35 -04:00
John W. Parent
8195f27a66
Windows: properly handle symlink failures (#36003)
In the Windows filesystem logic for creating a symlink, we intend to
fall back to a copy when the symlink cannot be created (for some
configuration settings on Windows it is not possible for the user
to create a symlink). It turns out we were overly-broad in which
exceptions lead to this fallback, and the subsequent copy would
also fail: at least one case where this occurred is when we
attempted to create a symlink that already existed.

The updated logic expressly avoids falling back to a copy when the
file/symlink already exists.
2023-03-17 10:19:32 -07:00
Massimiliano Culpo
97193a25ce
Mitigation for GitVersion bug when no =reference is given (#36159)
* ASP-based solver: use satisfies instead of intersects

They are semantically equivalent for concrete versions,
but the GitVersion.intersects implementation is buggy

* Mitigation for git version bug

fixes #36134

This commit works around the issue in #36134, by using
GitVersion.satisfies instead of GitVersion.intersects

There are still underlying issues when trying to infer the
"reference version" when no explicit one is given, but:

1. They are not reproducible with our synthetic repo
2. They occur only when the `git.<xxx>` form of Git version
   is used

Here we just work around the user facing issue and ensure
the tests are correct with our synthetic repository.
2023-03-17 11:36:29 +01:00
Massimiliano Culpo
8517a74f37
ASP-based solver: tweak heuristic, modify compiler encoding (#35989)
This PR does 2 unrelated things:
1. It changes the encoding of the compilers
2. It tweaks the heuristic for the solves in a0d88179074f81d13a3fad629a43d86334e7f982

Both were initially motivated by trying to get a performance gain but, while 2 showed significant speed-ups[^1], 1 instead didn't. I kept it anyhow, since I think the code related to compilers is more consolidated with the new encoding and we might get some performance improvement out of it if we can base our errors on the `node_compiler(Package, CompilerID)` atoms instead of `attrs`.

[^1]: In general the changes in the heuristic brought a ~10% speed-up on the tests I did. I'll post detailed results below.

Add a warning about compilers.yaml that is triggered if there are multiple compilers with the same spec, os and
target (since they can't be selected by users with the spec syntax only).
2023-03-17 00:39:41 -07:00
Harmen Stoppels
ba00da61e4
reduce spec.json.sig file size (#36157)
Since GPG clear-sign cannot deal with lines longer than 19995 characters
and doesn't even error but simply truncates those linese (don't ask me
why...), we have to be careful not to hit that line limit when reducing
the filesize.

So, instead this PR sets the indent level to 0 and drops the whitespace
after `: `, which still reduces file size by 50% or so.
2023-03-16 19:46:13 +01:00
Harmen Stoppels
50cc1d12f9
Revert "minify spec.json in buildcache (#36138)" (#36156)
This reverts commit 1a8eefe09b.
2023-03-16 10:30:52 +01:00
Harmen Stoppels
1a8eefe09b
minify spec.json in buildcache (#36138)
saves about 50% of data, which is significant
for hundreds of thousands of spec.json files
in our buildcaches.
2023-03-15 16:54:03 -04:00
Shahzeb Siddiqui
b5f3b5bf78
Remove leftover command from documentation (#36116)
The command refers to dotkit files, which are not supported since a long time.
2023-03-14 20:48:28 -04:00
John W. Parent
cd42fc5cc8
Libogg and libtheora: build on windows (#35099)
Adds builders appropriate for building these packages on Windows.
It is intended that builds on other platforms are unaffected (e.g.
they build with Autotools as before on Linux).
2023-03-14 16:46:49 -07:00
Harmen Stoppels
96b205ce6c
environment.matching_spec: linear time traversal (#35534)
... and use colors in disambiguate message for clarity.

This commit avoids the loop:

```
for root in roots:
  for dep in deps(root):
    ...
```

instead it ensures each node is visited once and only once.

Also adds a small optimization when searching for concrete specs, since
we can assume uniqueness of dag hash, so it's fine to early exit.
2023-03-14 11:18:10 -07:00
Harmen Stoppels
40019dacd9
Use bfs in get_spec_filter_list (#36093) 2023-03-14 14:34:56 +01:00
Harmen Stoppels
1691b7caac
Fix typo affecting Gitlab CI (#36103)
Introduced in #35944
2023-03-14 14:18:05 +01:00
Harmen Stoppels
f7da7db9b2
use stage dir for buildcache create (#36091) 2023-03-14 09:35:47 +01:00
Michael Kuhn
5bae742826
concretizer: add mode to reuse dependencies only (#30990)
This adds a new mode for `concretizer:reuse` called `dependencies`,
which only reuses dependencies. Currently, `spack install foo` will
reuse older versions of `foo`, which might be surprising to users.
2023-03-14 09:22:20 +01:00
Greg Becker
66bf9bc7a6
cce compiler: bugfix for version regex to avoid conflation with apple-clang (#35974)
Currently apple-clang is detected as cce, and it should not be.
---------

Co-authored-by: becker33 <becker33@users.noreply.github.com>
2023-03-12 08:17:09 +00:00
Harmen Stoppels
844701b974
get --dev and drop set -x (#36010) 2023-03-10 22:59:57 -08:00
kwryankrattiger
181bb54372
Hotfix: Fix CI unit test after CI refactor (#36004)
* Hotfix: Fix CI unit test after CI refactor
2023-03-10 13:31:40 -08:00
kwryankrattiger
f3595da600
CI boilerplate reduction (#34272)
* CI configuration boilerplate reduction and refactor

Configuration:
- New notation for list concatenation (prepend/append)
- New notation for string concatenation (prepend/append)
- Break out configuration files for: ci.yaml, cdash.yaml, view.yaml
- Spack CI section refactored to improve self-consistency and
composability
  - Scripts are now lists of lists and/or lists of strings
  - Job attributes are now listed under precedence ordered list that are
  composed/merged using Spack config merge rules.
  - "service-jobs" are identified explicitly rather than as a batch

CI:
- Consolidate common, platform, and architecture configurations for all CI stacks into composable configuration files
- Make padding consistent across all stacks (256)
- Merge all package -> runner mappings to be consistent across all
stacks

Unit Test:
- Refactor CI module unit-tests for refactor configuration

Docs:
- Add docs for new notations in configuration.rst
- Rewrite docs on CI pipelines to be consistent with refactored CI
workflow

* Script verbose environ, dev bootstrap

* Port #35409
2023-03-10 12:25:35 -07:00
Greg Becker
a51f4b77d9
reorder_flags: properly handle flags from concrete reused specs (#35951) 2023-03-09 16:46:47 -08:00
Peter Scheibel
1b8561f752
add logging to help users debug where external file searches are taking a long time (#35900) 2023-03-08 09:46:13 -08:00
Scott Wittenburg
4a9ffdcfa2
gitlab ci: Provide a knob to control untouched spec pruning (#35274)
When untouched spec pruning is enabled, specs possibly affected
by a change cannot be pruned from a pipeline.

Previously spack looked at all specs matching changed package
names, and traversed dependents of each, all the way to the
environment root, to compute the set of environment specs
possibly affected by a change (and thus, not candidates for
pruning).

With this PR, when untouched spec pruning is enabled, a new
environment variable can control how far towards the root spack
traverses to compute the set of specs possibly affected by a
change.  SPACK_UNTOUCHED_PRUNING_DEPENDENT_DEPTH can be set
to any numeric value before the "spack ci generate" command
is called to control this traversal depth parameter.  Setting
it to "0" traverses only touched specs, setting it to "1"
traverses only touched specs and their direct dependents, and
so on.  Omitting the variable results in the previous behavior
of traversing all the way to the root.  Setting it to a negative
value means no traversal is done, and always yields an empty
set of possibly affected specs (which would result in the max
pruning possible).
2023-03-08 09:38:07 -07:00
Harmen Stoppels
22d4e79037
buildcache create: reproducible tarballs (#35623)
Currently `spack buildcache create` creates compressed tarballs that
differ between each invocation, thanks to:

1. The gzip header containing mtime set to time.time()
2. The generated buildinfo file which has a different mtime every time.

To avoid this, you have to explicitly construct GZipFile yourself, since
the Python API doesn't expose the mtime arg, and we have to manually
create the tarinfo object for the buildinfo metadata file.

Normalize mode: regular files & hardlinks executable by user, dirs, symlinks: set 0o755 permissions in tarfile; other files use 0o644
2023-03-08 15:51:55 +00:00
Massimiliano Culpo
d54611af2c
Split satisfies(..., strict=True/False) into two functions (#35681)
This commit formalizes `satisfies(lhs, rhs, strict=True/False)`
and splits it into two functions: `satisfies(lhs, rhs)` and
`intersects(lhs, rhs)`.

- `satisfies(lhs, rhs)` means: all concrete specs matching the
   left hand side also match the right hand side
- `intersects(lhs, rhs)` means: there exist concrete specs
   matching both lhs and rhs.

`intersects` now has the property that it's commutative,
which previously was not guaranteed.

For abstract specs, `intersects(lhs, rhs)` implies that
`constrain(lhs, rhs)` works.

What's *not* done in this PR is ensuring that
`intersects(concrete, abstract)` returns false when the
abstract spec has additional properties not present in the
concrete spec, but `constrain(concrete, abstract)` will
raise an error.

To accomplish this, some semantics have changed, as well
as bugfixes to ArchSpec:
- GitVersion is now interpreted as a more constrained
  version
- Compiler flags are interpreted as strings since their
  order is important
- Abstract specs respect variant type (bool / multivalued)
2023-03-08 13:00:53 +01:00
Tamara Dahlgren
b06648eb64
docs: added platform conflicts example, fix quotes (#35771) 2023-03-08 10:10:01 +01:00
Harmen Stoppels
c37d6f97dc
compiler wrapper: parse Wl and Xlinker properly (#35912)
Two fixes:

1. `-Wl,a,b,c,d` is a comma separated list of linker arguments, we
   incorrectly assume key/value pairs, which runs into issues with for
   example `-Wl,--enable-new-dtags,-rpath,/x`
2. `-Xlinker,xxx` is not a think, so it shouldn't be parsed.
2023-03-08 09:03:31 +01:00
Greg Becker
2ff337a2a5
compiler flags: fix multiple compilers with different flags (#35721)
Currently, if two compilers with the same spec differ on the flags, the concretizer will:

1. mix both sets of flags for the spec in the ASP program
2. error noting that the set of flags from the compiler (both of them) doesn't match the set from the lower priority compiler

This PR fixes both -- only flags from the highest priority compiler with a given spec are considered.
2023-03-06 10:29:48 -08:00
Todd Gamblin
42a02411b4
windows: use sys.platform == "win32" instead of is_windows (#35640)
`mypy` only understands `sys.platform == "win32"`, not indirect assignments of that
value to things like `is_windows`. If we don't use the accepted platform checks, `mypy`
registers many Windows-only symbols as not present on Linux, when it should skip the
checks for platform-specific code.
2023-03-05 07:58:05 -08:00
Massimiliano Culpo
046416479a
Polish spack.util.environment (#35812)
Update `spack.util.environment` to remove legacy idioms.
* Remove kwargs from method signature and use a class for traces
* Uppercase a few global variables
* spack.util.environment: add type-hints
* Improve docstrings
* Fixed most style issues reported by pylint
2023-03-03 16:17:27 -05:00
Brian Van Essen
eb29889f6e
Detection of Cray's slingshot detection has relied on the presence of (#35779)
a shared library /lib64/libcxi.so, which seems to also appear on other
non-slingshot systems.  This patch also checks to make sure that there
is a Cray programming enviornment in /opt/cray/pe in addition to the
shared library.
2023-03-01 23:19:20 -08:00
Adam J. Stewart
583d89e95a
Simplify spack help --spec output (#35626) 2023-03-01 16:26:59 +01:00
Adam J. Stewart
146464e063
Docs: fix link to PythonPackage docs (#35725) 2023-03-01 11:14:05 +01:00
Massimiliano Culpo
07e251c887
Remove handling of deprecated target names (graviton) (#35537)
* Update target names for Gitlab pipelines

* Remove handling of deprecated names for graviton
2023-03-01 11:03:12 +01:00
Alberto Invernizzi
4e13b5374f
fix dump problem (#35673)
if dump file existed it was not truncating the file, resulting in
a file with unaltered filesize, with the new content at the beginning,
"padded" with the tail of the old content, since the new content was
not enough to overwrite it.
2023-02-24 21:32:33 -08:00
Todd Gamblin
6b27aebeb4
colify.py: get rid of **kwargs (#35641)
`colify` is an old module in Spack that still uses `**kwargs` liberally. 

We should be more explicit. Doing this eliminates the need for many 
checks (can't pass the wrong arg if it isn't allowed) and makes the 
function documentation more clear.
2023-02-23 11:18:54 -08:00
Harmen Stoppels
3d41b71664
buildcache push: ensure bool arguments for include_* (#35632)
Fixes a bug introduced in 44ed0de8c0
where the push method of binary_distribution now takes named args
include_root and include_depedencies, to avoid the **kwarg hole.

But the call site wasn't update and we passed a dict of keys/values instead
of arguments, which resulted in a call like this:

```
push(include_root={"include_root": True, "include_dependencies": False})
```

This commit fixes that, and adds a test to see if we push the correct packages.
2023-02-23 01:44:47 +01:00
Harmen Stoppels
3be9af8c13
copy_files_to_artifacts: error -> warning (#35613)
This error shows up a lot, typically it's harmless because an error
happened before the source build even started, in which case we don't
have build logs to copy. So, warn instead of error, cause it distracts
from the actual CI error.
2023-02-22 11:53:42 +00:00
Harmen Stoppels
6e477d547d
add cdash arg to source build only (#35565) 2023-02-22 11:08:32 +01:00
Harmen Stoppels
9d6630e245
spack build-env: error when deps are not installed (#35533)
Currently we attempt to setup the build environment even when
dependencies are not installed, which typically results in error while
searching for libraries or executables in a dependency's prefix.

With this change, we get a more user friendly error:

```
$ spack build-env perl
==> Error: Not all dependencies of perl are installed, cannot setup build environment:
 -   qpj6dw5  perl@5.36.0%apple-clang@14.0.0+cpanm+open+shared+threads build_system=generic arch=darwin-ventura-m1
 -   jq2plbe      ^berkeley-db@18.1.40%apple-clang@14.0.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-ventura-m1
...
$ echo $?
1
```
2023-02-22 10:35:44 +01:00
psakievich
b8d15e816b
Allow users to specify root env dir (#32836)
* Allow users to specify root env dir

Environments managed by spack have some advantages over anonymous Environments
but they are tucked away inside spack's directory tree. This PR gives
users the ability to specify where the environments should live.

See #32823

This is also taken as an opportunity to ensure that all references are to "managed environments",
rather than "named environments". Prior to this PR some references to the latter persisted.

Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
2023-02-22 00:37:14 +00:00
Harmen Stoppels
bc24a8f290
Spec.satisfies should be commutative when strict=False (#35598)
The call:
```
x.satisfies(y[, strict=False])
```
is commutative, and tests non-empty intersection, whereas:
```
x.satsifies(y, strict=True)
```
is not commutative, and tests set-inclusion.

There are 2 fast paths. When strict=False both self and other need to 
be concrete, when strict=True we can optimize when other is concrete.
2023-02-21 14:30:47 +01:00
simon-Leary42
33bf1fd033
nonexistent module concise error message (#35502) 2023-02-21 04:50:56 -08:00
Adam J. Stewart
ce9f8143cc
Fix view support for optional Python extensions (#35489)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-02-20 11:58:28 -08:00
Harmen Stoppels
c1ff7bbf04
environment views: better, earlier error on clash (#35541)
Spack generally ignores file-file projection clashes in environment
views, but would eventually error when linking the `.spack` directory
for two specs of the same package.

This leads to obscure errors where users have no clue what the issue is
and how to fix it. On top of that, the error comes very late, since it
happens when the .spack dir contents are linked (which happens after
everything else)

This PR improves that by doing a quick check ahead of time if clashes
are going to be anticipated (by simply checking for clashes in the
projection of each spec's .spack metadir). If there are clashes, a
human-readable error is thrown which shows two of the conflicting specs,
and tells users to user unify:true, view:false, or set up custom
projections.
2023-02-20 19:14:27 +01:00
Ben Wibking
e8238fe330
Patchel shutil.copystat to avoid PermissionError on Lustre (#27247) 2023-02-20 17:28:03 +01:00
Harmen Stoppels
5e337d907b
spack ci: remove 120s db timeout since 60s is the default now (#35566) 2023-02-20 14:41:26 +01:00
Harmen Stoppels
208c9585b8
Revert "lib/spack/spack/store.py: Fix #28170 for padding relocation (#33122)" (#35077)
This reverts commit c721aab006.
2023-02-20 13:56:11 +01:00
elenimath
c769582709
Pass tests argument to solver method when concretizing together (#35290)
to make the workaround for #29447 work with `concretizer:unify:true` option
2023-02-20 10:21:24 +01:00
Adam J. Stewart
7c01d3ba35
Fix broken links in docs (#35582) 2023-02-20 09:21:18 +01:00
Harmen Stoppels
86320eb569
Improve error handling in buildcache downloads (#35568)
The checksum exception was not detailed enough and not reraised when using cache only, resulting in useless error messages.

Now it dumps the file path, expected
hash, computed hash, and the downloaded file summary.
2023-02-18 19:22:48 +01:00
Harmen Stoppels
fb644de086
clang/apple-clang correct c/c++ standard flags (#35062) 2023-02-17 23:18:01 +01:00