Commit graph

5598 commits

Author SHA1 Message Date
Tamara Dahlgren
f96b54b0a6
info: properly report default when for overridden variants (#32040) 2022-08-11 14:09:53 +02:00
Richarda Butler
ef818339db
Update tests so /tmp/store can be accessed (#32003) 2022-08-10 20:53:48 +00:00
Mikael Simberg
f237e669f2
Patch /usr/bin/file to file when on nixos (#30718)
These changes make many packages build on nixos where nearly nothing
comes from /bin or /usr/bin (the only things in "system locations" are
/bin/sh and /usr/bin/env, all the rest is found through PATH).

Many configuration scripts hardcode /usr/bin/file instead of using the
one from PATH. This patches them to use file from PATH.
2022-08-10 17:54:09 +02:00
Seth R. Johnson
5d6ab9a76c
core: add a helpful long message for UnknownPackageError (#31996)
```
Error: Package 'armpl' not found.
```
is pretty useless after an upgrade unless you're a spack pro. I've
recently hit this on multiple machines. See
https://github.com/spack/spack/issues/31453 ,
https://github.com/spack/spack/issues/31489  .
2022-08-10 11:01:07 +02:00
Harmen Stoppels
857a798aed
modules: add missing Python imports (#32012) 2022-08-10 10:00:33 +02:00
Tamara Dahlgren
3320c983a7
Reduce installation noise: filter path padding and make some details debug level 2 (#31998) 2022-08-09 19:22:09 +02:00
Adam J. Stewart
d29d5462c6
PythonPackage: add --config-settings support (#31823) 2022-08-09 10:09:51 -07:00
Harmen Stoppels
f53b522572
Add base class for directory visitor (#32008) 2022-08-09 15:43:30 +02:00
Massimiliano Culpo
b61187455a
Update release procedure, keep CHANGELOG up-to-date (#31969)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2022-08-09 12:10:49 +00:00
Massimiliano Culpo
65a4125dd0
spack mirror: skip non-concretizable specs (#31897)
fixes #31736

Catch errors when concretizing specs and report them as
debug messages. The corresponding spec is skipped.

Co-authored-by: Greg Becker <becker33@llnl.gov>
2022-08-05 19:19:51 +02:00
Massimiliano Culpo
5bf6b7e6a5
Refactor cmd/install.py for better readability (#31936)
* Extracted two functions in cmd/install.py

* Extracted a function to perform installation from the active environment

* Rename a few functions, remove args from their arguments

* Rework conditional in install_from_active_environment to reduce nesting in the function

* Extract functions to parsespecs from cli and files

* Extract functions to getuser confirmation for overwrite

* Extract functions to install specs inside and outside environments

* Rename a couple of functions

* Fix outdated comment

* Add missing imports

* Split conditional to dedent one level

* Invert check and exit early to dedent one level when requiring user confirmation
2022-08-05 12:36:33 +02:00
psakievich
ddc373b4e1
Fix doc format for code blocks: GitRef versions (#31937)
Rendering was not pretty using `console` from #31914
2022-08-05 02:01:03 +00:00
Chris Green
20de47a1e2
Move type hint to satisfy Python 3.6, 3.7 interpreters (#31932) 2022-08-04 20:48:05 +00:00
psakievich
d67ead5978
Add documentation for git refs as versions (#31914)
* document git commit versions

Include documentation for manually specifying associated known version

* document spack develop command

Co-authorerd-by: psakievich <psakiev@sandia.gov>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2022-08-04 13:20:33 -07:00
psakievich
3b1401f292
Git Ref versions can be paired to defined versions in the spec (#30998)
The current use of git ref's as a version requires a search algorithm to pick the right matching version based on the tags in the git history of the package.

This is less than ideal for the use case where users already know the specific version they want the git ref to be associated with. This PR makes a new version syntax [package]@[ref]=[version] to allow the users to specify the exact hash they wish to use.
2022-08-04 13:17:34 -07:00
Massimiliano Culpo
0e40804cd0
Deprecate support for Python 3.5 (by removing it from CI) (#31908)
* Deprecate support for Python 3.5 (by removing it from CI)

* Restore Python 3.9
2022-08-04 15:26:56 +02:00
Massimiliano Culpo
9a48035e49 asp: refactor low level API to permit the injection of configuration
This allows writing extension commands that can benchmark
different configurations in clingo, or try different
configurations for a single test.
2022-08-03 18:01:08 -07:00
dunatotatos
ab87cac63f
Match documentation of spack create with actual behavior. (#31892) 2022-08-03 10:38:56 +00:00
Jonathon Anderson
8c50ea9dc0
spack ci rebuild: Don't install in a login shell (#31771)
On some systems the shell in login mode wipes important parts of the
environment, such as PATH. This causes the build to fail since it can't
find `spack`.

For better robustness, don't use a login shell.

In a full CI job the final spack install is run in an environment formed by scripts running in this order:

export AWS_SECRET=...                  # 1. Load environment from GitLab project variables
source spack/share/spack/setup-env.sh  # 2. Load Spack into the environment (PATH)
spack env activate -V concrete_env     # 3. Activate the concrete environment
source /etc/profile                    # 4. Bash login shell (from -l)
spack install ...
Whereas when a user launches their own container with (docker|podman) run -it, they end up running spack install in an environment formed in this order:

source /etc/bash.bashrc                # (not 4). Bash interactive shell (default with TTY)
export AWS_SECRET=...                  #~1. Manually load environment from GitLab project variables
source spack/share/spack/setup-env.sh  # 2. Load Spack into the environment (PATH)
spack env activate -V concrete_env     # 3. Activate the concrete environment
spack install ...
The big problem being that (4) has a completely different position and content (on Leap 15 and possibly other containers).

So in context, this PR removes (4) from the CI job case, leaving us with the simpler:

export AWS_SECRET=...                  # 1. Load environment from GitLab project variables
source spack/share/spack/setup-env.sh  # 2. Load Spack into the environment (PATH)
spack env activate -V concrete_env     # 3. Activate the concrete environment
spack install ...
2022-08-02 11:45:50 -07:00
Massimiliano Culpo
6e0b7959a4
Optimize reuse from buildcaches (#30806)
* database: don't sort on return from query_local

* ASP-based solver: don't build the hash-lookup dictionary twice

Building this dictionary twice and traversing all the specs
might be time-consuming for large buildcaches.
2022-08-02 11:43:14 -07:00
Massimiliano Culpo
aeac72e1e3 Style fixes 2022-08-02 10:52:52 -07:00
Massimiliano Culpo
0b832b2929 Remove line that sets non-existing attribute? 2022-08-02 10:52:52 -07:00
Massimiliano Culpo
2b3f350071 Use __slots__ for fast attribute access 2022-08-02 10:52:52 -07:00
Massimiliano Culpo
b6c8779772 Use __slots__ for fast attribute access during parsing 2022-08-02 10:52:52 -07:00
Harmen Stoppels
57e6452831
Document that reuse is higher priority than preferences in packages.yaml (#31864)
Resurrect Known issues, since users ask frequently about that.
2022-08-02 18:54:41 +02:00
Todd Gamblin
415ac29665
docs: Fix outdated pre-0.18 text on build dependencies (#31860) 2022-08-02 11:34:58 +00:00
Adam J. Stewart
22d4612d94
Add meson Python build backend (#31809) 2022-08-02 07:55:41 +02:00
Adam J. Stewart
1a61252c64
spack checksum: black compliance (#31851) 2022-08-02 07:29:30 +02:00
Peter Scheibel
c0ede0e0fa
Add c++14 support flag for xl compiler (#31826) 2022-08-01 22:51:02 +00:00
Adam J. Stewart
f018b869e6
Add support for macOS Ventura (#31812) 2022-08-01 16:45:56 +00:00
Adam J. Stewart
c98d367a91
CUDA: add new GCC conflict (#31820) 2022-08-01 14:31:07 +00:00
Todd Gamblin
ab04d697c7 tests: remove old changed_files() test
This test relied on an old version of the `flake8_package` fixture that modified
the spack repository, but it doesn't do that anymore. There are other tests for
`changed_files()` that do a better job of mocking up a git repository with
changes, so we can just delete this one.
2022-07-31 21:01:02 -07:00
Todd Gamblin
143f3f830c style: simplify arguments with --tool TOOL and --skip TOOL
`spack style` tests were annoyingly brittle because we could not easily be
specific about which tools to run (we had to use `--no-black`, `--no-isort`,
`--no-flake8`, and `--no-mypy`). We should be able to specify what to run OR
what to skip.

Now you can run, e.g.:

    spack style --tool black,flake8

or:

    spack style --skip black,isort

- [x] Remove  `--no-black`, `--no-isort`, `--no-flake8`, and `--no-mypy` args.
- [x] Add `--tool TOOL` argument.
- [x] Add `--skip TOOL` argument.
- [x] Allow either `--tool black --tool flake8` or `--tool black,flake8` syntax.
2022-07-31 13:29:20 -07:00
Todd Gamblin
76b190a624 black: ensure that spack create templates are black-compliant
- [x] remove alignment spaces from tempaltes
- [x] replace single with double quotes
- [x] Makefile template now generates parsable code
      (function body is `pass` instead of just a comment)
- [x] template checks now run black to check output
2022-07-31 13:29:20 -07:00
Todd Gamblin
b87ca6da27 black: do not align sha56's with spaces in spack checksum output 2022-07-31 13:29:20 -07:00
Todd Gamblin
357968469e black: bootstrap if black in PATH is too new
Previously we'd accept any version for bootstrapping black, but we need <= 21.

- [x] modify bootstrapping code to check black version before accepting an
      executable from `PATH`.
2022-07-31 13:29:20 -07:00
Todd Gamblin
f27eeaa2e8 black: add .git-blame-ignore-revs toignore black reformatting in blame
- [x] add `.git-blame-ignore-revs` to ignore black reformatting
- [x] make `spack blame` respect `.git-blame-ignore-revs`
      (even if the user hasn't configured git to do so)
2022-07-31 13:29:20 -07:00
Todd Gamblin
c661ca248b black: fix format-sensitive tests
Some of our tests rely on single vs. double quotes, and others rely on specific
line numbers in the source. These needed fixing after the switch to Black.
2022-07-31 13:29:20 -07:00
Todd Gamblin
f52f6e99db black: reformat entire repository with black 2022-07-31 13:29:20 -07:00
Todd Gamblin
549ba1ed32 black: fix style check package and flake8 formatting for black
Black will automatically fix a lot of the exceptions we previously allowed for
directives, so we don't need them in our custom `flake8_formatter` anymore.

- [x] remove `E501` (long line) exceptions for directives from `flake8_formatter`,
      as they won't help us now.
- [x] Refine exceptions for long URLs in the `flake8_formatter`.
- [x] Adjust the mock `flake8-package` to exhibit the exceptions we still allow.
- [x] Update style tests for new `flake8-package`.
- [x] Blacken style test.
2022-07-31 13:29:20 -07:00
Todd Gamblin
156af2a60a black: clean up noqa comments from most of the code
Many noqa's in the code are no longer necessary now that the column limit is 99
characters. Others can easily be eliminated, and still more can just be made more
specific if they do not have to do with line length.

The only E501's still in the code are in the tests for `spack.util.path` and the tests
for `spack style`.
2022-07-31 13:29:20 -07:00
Todd Gamblin
3fa090f490 black: break up long strings that black cannot fix 2022-07-31 13:29:20 -07:00
Todd Gamblin
67d27841ae black: configuration
This adds necessary configuration for flake8 and black to work together.

This also sets the line length to 99, per the data here:

* https://github.com/spack/spack/pull/24718#issuecomment-876933636

Given the data and the spirit of black's 88-character limit, we set the limit to 99
characters for all of Spack, because:

* 99 is one less than 100, a nice round number, and all lines will fit in a
  100-character wide terminal (even when the text editor puts a \ at EOL).
* 99 is just past the knee the file size curve for packages, and it means that packages
  remain readable and not significantly longer than they are now.
* It doesn't seem to hurt core -- files in core might change length by a few percent but
  seem like they'll be mostly the same as before -- just a bit more roomy.

- [x] set line length to 99
- [x] remove most exceptions from `.flake8` and add the ones black cares about
- [x] add `[tool.black]` to `pyproject.toml`
- [x] make `black` run if available in `spack style --fix`

Co-Authored-By: Tom Scogland <tscogland@llnl.gov>
2022-07-31 13:29:20 -07:00
Adam J. Stewart
ec87924039
MACOSX_DEPLOYMENT_TARGET: MAJOR.MINOR (#31811) 2022-07-30 02:12:02 +00:00
Harmen Stoppels
e4f0f3582e
environment.py: only install root specs explicitly (#31645) 2022-07-28 12:16:35 -07:00
Stephen Sachs
584cc47fb3
Fix parsing of clean_url (#31783)
In #31618 the idea was to determine the file extension heuristically by dropping query params etc from a url and then consider it as a file path. That broke for URLs that only have query params like http://example.com/?patch=x as it would result in empty string as basename. This PR reverts to the old behavior of saving files as ?patch=x in that case.

Co-authored-by: Stephen Sachs <stesachs@amazon.com>
2022-07-28 09:24:19 +00:00
Harmen Stoppels
ce039e4fa5
environment.py: reduce # of locks further (#31643)
* environment.py: reduce # of locks further
2022-07-26 09:00:27 -07:00
Harmen Stoppels
e2056377d0
containerize: fix concretization -> concretizer (#31594)
* containerize: fix concretization -> concretizer

* fix test
2022-07-26 08:56:24 -07:00
Chuck Atkins
f38a2ebb25
llvm: Variant and dependency cleanup (#31331)
* llvm: Use variant when clauses for many of the expressed conflicts

* llvm: Remove the shared variant as it wasn't really used

* llvm: Remove unnecessary deps and make explicit the ones that are

* llvm: Cleanup patch conditions

* pocl: Update for llvm cleanup

* unit-test: update unparse package hash with the updated llvm package

* llvm: Fix ppc long double patching and add clarifying comments
2022-07-26 10:45:20 -05:00
Stephen Sachs
6a240c9b39
Fix self.extension for symlinks (#31743)
`self.archive_file` is (among others) a symlink to a tarball. `extension()` on a
symlink will result in no extension. This patch fixes the behavior introduced in
https://github.com/spack/spack/pull/31618.

Co-authored-by: Stephen Sachs <stesachs@amazon.com>
2022-07-26 13:05:41 +00:00