Commit graph

6399 commits

Author SHA1 Message Date
Harmen Stoppels
da46b63a34
Fix broken semver regex (#39414) 2023-08-14 15:38:06 +02:00
Harmen Stoppels
c882214273
spack bootstrap dev: detect git as an external (#39417)
#36770 added git as a dependency to `setuptools-scm`. This in turn makes `git` a
transitive dependency for our bootstrapping process. 

Since `git` may take a long time to build, and is found on most systems, try to 
detect it as an external.
2023-08-14 10:29:15 +00:00
Sergey Kosukhin
237a56a305
autotools: set 'ldlibs' as 'LIBS' (#17254) 2023-08-13 00:38:10 -07:00
Scott Wittenburg
1b1ed1b1fa
ci: continue to support SPACK_SIGNING_KEY (#39170) 2023-08-12 08:52:46 -07:00
Adam J. Stewart
f7918fd8ab
Python: remove maintainer (#39384) 2023-08-12 09:08:25 +02:00
Todd Gamblin
ea082539e4
Revert "package import: remove magic import line (#39183)" (#39380)
This reverts commit 8e7c53a8ba.
2023-08-11 09:04:40 +02:00
Massimiliano Culpo
143146f4f3
spack.repo: uppercase the global PATH variable (#39372)
This makes the name of the global variable representing
the repository currently in use uppercase. Doing so is advised
by pylint rules, and helps to identify where the global is used.
2023-08-11 09:04:16 +02:00
dependabot[bot]
c764f9b1ab
build(deps): bump mypy from 1.4.1 to 1.5.0 in /lib/spack/docs (#39383)
Bumps [mypy](https://github.com/python/mypy) from 1.4.1 to 1.5.0.
- [Commits](https://github.com/python/mypy/compare/v1.4.1...v1.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-11 08:01:34 +02:00
markus-ferrell
f3c080e546
Windows build systems: use ninja and enable tests (#33589)
* Set default CMake generator is ninja on Windows
* Enable build systems tests (except for autotools/make)
2023-08-10 17:16:23 +00:00
dependabot[bot]
37634f8b08
build(deps): bump pygments from 2.15.1 to 2.16.1 in /lib/spack/docs (#39365)
Bumps [pygments](https://github.com/pygments/pygments) from 2.15.1 to 2.16.1.
- [Release notes](https://github.com/pygments/pygments/releases)
- [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES)
- [Commits](https://github.com/pygments/pygments/compare/2.15.1...2.16.1)

---
updated-dependencies:
- dependency-name: pygments
  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>
2023-08-10 18:10:32 +02:00
dependabot[bot]
3f83ef6566
build(deps): bump flake8 from 6.0.0 to 6.1.0 in /lib/spack/docs (#39366)
Bumps [flake8](https://github.com/pycqa/flake8) from 6.0.0 to 6.1.0.
- [Commits](https://github.com/pycqa/flake8/compare/6.0.0...6.1.0)

---
updated-dependencies:
- dependency-name: flake8
  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>
2023-08-10 05:34:33 -04:00
dependabot[bot]
554ce7f063
build(deps): bump sphinx-design from 0.4.1 to 0.5.0 in /lib/spack/docs (#39367)
Bumps [sphinx-design](https://github.com/executablebooks/sphinx-design) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/executablebooks/sphinx-design/releases)
- [Changelog](https://github.com/executablebooks/sphinx-design/blob/main/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/sphinx-design/compare/v0.4.1...v0.5.0)

---
updated-dependencies:
- dependency-name: sphinx-design
  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>
2023-08-10 05:29:52 -04:00
Aiden Grossman
23963779f4
Prefix conflict messages with package name (#39106)
* Prefix conflict messages with package name

This patch prefixes all conflict messages with the package name to
alleviate what was otherwise a very manual process. Note that this patch
is a one line change but has a fairly outsized impact.

* same for requires directive

---------

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2023-08-10 08:09:00 +00:00
Ricard Zarco Badia
45c5af10c3
Fixed broken calls to _if_ninja_target_execute (#38992)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2023-08-10 09:34:02 +02:00
Harmen Stoppels
532a37e7ba
Revert "Spec versions: allow git. references for branches with / (#38239)" (#39354)
This reverts commit 3453259c98.
2023-08-10 08:56:39 +02:00
dependabot[bot]
a3c7ad7669
build(deps): bump urllib3 from 2.0.3 to 2.0.4 in /lib/spack/docs (#39002)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.0.3...2.0.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-10 05:04:58 +00:00
markus-ferrell
01b7cc5106
Windows: enable more stage tests (#36834)
Enable some already-supported tests (no changes to staging logic).
2023-08-09 14:24:30 -07:00
Andrey Parfenov
b1e33ae37b
add info about devito and qe for intel env (#39357)
Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com>
2023-08-09 12:47:35 -04:00
Jordan Galby
c36617f9da
Fix package.py error handling bug (#39017) 2023-08-09 17:47:43 +02:00
dependabot[bot]
deadb64206
build(deps): bump black from 23.1.0 to 23.7.0 in /lib/spack/docs (#38982)
Bumps [black](https://github.com/psf/black) from 23.1.0 to 23.7.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.1.0...23.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 17:19:49 +02:00
Harmen Stoppels
8e7c53a8ba
package import: remove magic import line (#39183) 2023-08-09 14:28:06 +00:00
Adam J. Stewart
39d4c402d5
Fix suffix of tab completion scripts (#39154) 2023-08-09 08:28:55 -05:00
Harmen Stoppels
e51748ee8f
zlib-api: new virtual with zlib/zlib-ng as providers (#37372)
Introduces a new virtual zlib-api, which replaces zlib in most packages.

This allows users to switch to zlib-ng by default for better performance.
2023-08-09 09:22:58 -04:00
Jonathon Anderson
9aa3b4619b
containerize: ensure bootstrap images contain all system dependencies (#36818)
This also makes `spack bootstrap status` exit 1 if some dependency is missing
2023-08-09 09:46:59 +02:00
Peter Scheibel
3453259c98
Spec versions: allow git. references for branches with / (#38239) 2023-08-09 09:07:04 +02:00
Massimiliano Culpo
97d632a161
Push conflict between rocm and blt down to packages that actually use blt (#39339) 2023-08-09 07:53:17 +02:00
Adam J. Stewart
361632fc4b
Ensure that all variants have a description (#39025)
* Ensure that all variants have a description

* Update mock packages too

* Fix test invocations

* Black fix

* mgard: update variant descriptions

* flake8 fix

* black fix

* Add to audit tests

* Relax type hints

* Older Python support

* Undo all changes to mock packages

* Flake8 fix
2023-08-08 09:29:49 -05:00
simonLeary42
6576655137
Name clash error message include hash of clashing packages (#39234)
Co-authored-by: Simon <simonleary@umass.edu>
2023-08-08 14:36:49 +02:00
Harmen Stoppels
86f9d3865b
Fix broken inode assertion (#39188) 2023-08-08 09:21:23 +02:00
Harmen Stoppels
7bd5d1fd3c
use {%compiler.name}{@compiler.version} in matching_specs (#39247) 2023-08-07 18:54:10 +02:00
Massimiliano Culpo
ba1d295023
Extract prefix locks and failure markers from Database (#39024)
This PR extracts two responsibilities from the `Database` class:
1. Managing locks for prefixes during an installation
2. Marking installation failures

and pushes them into their own class (`SpecLocker` and `FailureMarker`). These responsibilities are also pushed up into the `Store`, leaving to `Database` only the duty to manage `index.json` files.

`SpecLocker` classes no longer share a global list of locks, but locks are per instance. Their identifier is simply `(dag hash, package name)`, and not the spec prefix path, to avoid circular dependencies across Store / Database / Spec.
2023-08-07 06:47:52 -04:00
Harmen Stoppels
27f04b3544
Picklable HTTPError (#39285) 2023-08-07 10:48:35 +02:00
Harmen Stoppels
ef544a3b6d
Add a more detailed HTTPError (#39187) 2023-08-05 11:16:51 +02:00
Adam J. Stewart
4eed832653
py-pyqt6: add new package (#32696) 2023-08-04 18:49:54 -05:00
Harmen Stoppels
6e933ac7df
repo cache: use -inf default instead of 0 (#39214)
FastPackageChecker.modified_since should use a default number < 0

When the repo cache does not exist, Spack uses mtime 0. This causes the repo
cache not to be generated when the repo has mtime 0.

Some popular package managers such as spack use 0 mtime normalization for
reproducible tarballs. So when installing spack with spack from a buildcache, the
repo cache doesn't generate

Also add some typehints
2023-08-03 14:13:13 +02:00
Harmen Stoppels
2069a42ba3
Buildcache commands cleanup, again... (#39203)
* Inform mypy that tty.die is noreturn

* avoid temporary allocation in env

* update spack buildcache save-specfile

* fix spack buildcache check/download/get-buildcache-name

- ensure that required args and mutually exclusive ones are marked as
  such in argparse for better error messages
- deprecate --spec-file everywhere
- use disambiguate for better error messages
2023-08-03 10:44:02 +02:00
Adam J. Stewart
edbf12cfa8
Add qmake virtual provider (#38848) 2023-08-02 13:50:37 -05:00
kwryankrattiger
0b4631a774
CI: Refactor ci reproducer (#37088)
* CI: Refactor ci reproducer

* Autostart container
* Reproducer paths match CI paths
* Generate start scripts for docker and reproducer

* CI: Add interactive and gpg options to reproduce-build

* Interactive will determine if the docker container persists
  after running reproduction.
* GPG path/url allow downloading GPG keys needed for binary
  cache download validation. This is important for running
  reproducer for protected CI jobs.

* Add exit_on_failure option to CI scripts

* CI: Add runtime option for reproducer
2023-08-02 09:51:12 -07:00
Harmen Stoppels
e7fa6d99bf
version: move to module, avoid circular imports (#39077) 2023-08-02 17:47:08 +02:00
Harmen Stoppels
03c0d74139
buildcache extractall: extract directly into spec.prefix (#37441)
- Run `mkdirp` on `spec.prefix`
- Extract directly into `spec.prefix`
  1. No need for `$store/tmp.xxx` where we extract the tarball directly, pray that it has one subdir `<name>-<version>-<hash>`, and then `rm -rf` the package prefix followed by `mv`.
  2. No need to clean up this temp dir in `spack clean`.
  3. Instead figure out package directory prefix from the tarball contents, and strip the tarinfo entries accordingly (kinda like tar --strip-components but more strict)
- Set package dir permissions
- Don't error during error handling when files cannot removed
- No need to "enrich" spec.json with this tarball-toplevel-path

After this PR, we can in fact tarball packages relative to `/` instead of `spec.prefix/..`, which makes it possible to use Spack tarballs as container layers, where relocation is impossible, and rootfs tarballs are expected.
2023-08-02 17:06:13 +02:00
Wouter Deconinck
a14f4b5a02
feat: move -N/--namespace(s) to common args, allow in buildcache list (#36719)
`spack buildcache list` did not have a way to display the namespace of
packages in the buildcache. This PR adds that functionality.

For consistency's sake, it moves the `-N/--namespace` arg definition to
the `common/arguments.py` and modifies `find`, `solve`, `spec` to use
the common definition.

Previously, `find` was using `--namespace` (singular) to control whether
to display the namespace (it doesn't restrict the search to that
namespace). The other commands were using `--namespaces` (plural). For
backwards compatibility and for consistency with `--deps`, `--tags`,
etc, the plural `--namespaces` was chosen. The argument parser ensures
that `find --namespace` will continue to behave as before.

Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2023-08-02 11:16:14 +00:00
Chris White
8d2a32f66d
remove CMAKE_GENERATOR from the host-config because it cannot be overwritten on the command line (#39044) 2023-08-01 08:57:56 -07:00
Alec Scott
d4f41b51f4
Add spack checksum --verify, fix --add (#38458)
* Add rewrite of spack checksum to include --verify and better add versions to package.py files
* Fix formatting and remove unused import
* Update checksum unit-tests to correctly test multiple versions and add to package
* Remove references to latest in stage.py
* Update bash-completion scripts to fix unit tests failures
* Fix docs generation
* Remove unused url_dict argument from methods
* Reduce chance of redundant remote_versions work
* Add print() before tty.die() to increase error readablity
* Update version regular expression to allow for multi-line versions
* Add a few unit tests to improve test coverage
* Update command completion
* Add type hints to added functions and fix a few py-lint suggestions
* Add @no_type_check to prevent mypy from failing on pkg.versions
* Add type hints to format.py and fix unit test
* Black format lib/spack/spack/package_base.py
* Attempt ignoring type errors
* Add optional dict type hint and declare versions in PackageBase
* Refactor util/format.py to allow for url_dict as an optional parameter
* Directly reference PackageBase class instead of using TypeVar
* Fix comment typo

---------

Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
2023-07-31 21:49:43 +00:00
Adam J. Stewart
9394fa403e
Remove Xcode mock-up (#39020)
* Remove Xcode mock-up

* Remove unused imports
2023-07-31 10:24:04 -07:00
Scott Wittenburg
2c74b433aa
ci: Make signing requirement explicit (#38995)
Instead of inferring whether to sign binaries, make it explicit,
and fail rebuild jobs early if signing is required but cannot be
accomplished.
2023-07-26 09:16:15 -06:00
Jonathon Anderson
3ad65bbfc1
Always set workflow:rules in spack ci pipelines (#38921) 2023-07-24 14:31:39 -05:00
Ashwin Kumar Karnad
399271832b
Fix typo: binary_caches.rst (#39064) 2023-07-24 15:09:34 +02:00
Harmen Stoppels
4bcceddba9
Don't add .spack/binary_distribution twice to the tarball when re-distributing (#39042)
Previously, spack would list the ./spack/binary_distribution file twice when pushing
a package that was installed from a binary tarball itself.
2023-07-24 14:39:37 +02:00
Harmen Stoppels
0fff219aa4
Fix broken sanitize_file_path (#38926)
The sanitization function is completely bogus as it tries to replace /
on unix after ... splitting on it. The way it's implemented is very
questionable: the input is a file name, not a path. It doesn't make
sense to interpret the input as a path and then make the components
valid -- you'll interpret / in a filename as a dir separator.

It also fails to deal with path components that contain just unsupported
characters (resulting in empty component).

The correct way to deal with this is to have a function that takes a
potential file name and replaces unsupported characters.

I'm not going to fix the other issues on Windows, such as reserved file
names, but left a note, and hope that @johnwparent can fix that
separately.

(Obviously we wouldn't have this problem at all if we just fixed the
filename in a safe way instead of trying to derive something from
the url; we could use the content digest when available for example)
2023-07-24 12:30:47 +02:00
百地 希留耶
90ac0ef66e
Implement fish completion (#29549)
* commands: provide more information to Command

* fish: Add script to generate fish completion

* fish: auto prepend `spack` command to avoid duplication

* fish: impove completion generation code readability

* commands: replace match-case with if-else

* fish: fix optspec variable name prefix

* fish: fix return value in get_optspecs

* fish: fix return value in get_optspecs

* format: split long line and trim trailing space

* bugfix: replace f-string with interpolation

* fish: compete more specs and some fixes

* fish: complete hash spec starts with /

* fish: improve compatibility

* style: trim trailing whitespace

* commands: add fish to update args and update tests

* commands: add fish completion file

* style: merge imports

* fish: source completion in setup-env

* fish: caret only completes dependencies

* fish: make sure we always get same order of output

* fish: spack activate
only show installed packages that have extensions

* fish: update completion file

* fish: make dict keys sorted

* Blacken code

* Fix bad merge

* Undo style changes to setup-env.fish

* Fix unit tests

* Style fix

* Compatible with fish_indent

* Use list for stability of order

* Sort one more place

* Sort more things

* Sorting unneeded

* Unsort

* Print difference

* Style fix

* Help messages need quotes

* Arguments to -a must be quoted

* Update types

* Update types

* Update types

* Add type hints

* Change order of positionals

* Always expand help

* Remove shared base class

* Fix type hints

* Remove platform-specific choices

* First line of help only

* Remove unused maps

* Remove suppress

* Remove debugging comments

* Better quoting

* Fish completions have no double dash

* Remove test for deleted class

* Fix grammar in header file

* Use single quotes in most places

* Better support for remainder nargs

* No magic strings

* * and + can also complete multiple

* lower case, no period

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-07-22 08:55:12 -05:00
Massimiliano Culpo
c0b42151c3
Remove spack.repo.IndexError (#39029)
This exception is never used and
overrides a built-in.
2023-07-21 15:33:30 +02:00
Ashwin Kumar Karnad
405f563909
binary_caches.rst: fix typo (#39030) 2023-07-21 10:39:53 +02:00
Sergey Kosukhin
d2566e3d62
nag: update the versioning scheme (#35457)
* nag: append build number to the version
* nag: add version 7.1.7125
* nag: deprecate unavailable versions
2023-07-20 12:03:26 -07:00
Massimiliano Culpo
50b90e430d
spack.util.lock: add type-hints, remove **kwargs in method signatures (#39011) 2023-07-20 09:41:23 +02:00
Massimiliano Culpo
3a565c66e9
Respect custom user store when bootstrapping (#39001)
The user store is lazily evaluated. The change
in #38975 made it such that the first evaluation
was happening in the middle of swapping to user
configuration.

Ensure we construct the user store before that.
2023-07-19 19:53:33 -04:00
Xavier Delaruelle
d9fbdfbee9
modules: use curly braces to enclose value in Tcl modulefile (#38375)
Use curly braces instead of quotes to enclose value or text in Tcl
modulefile. Within curly braces Tcl special characters like [, ] or $
are treated verbatim whereas they are evaluated within quotes.

Curly braces is Tcl recommended way to enclose verbatim content [1].

Note: if curly braces charaters are used within content, they must be
balanced. This point has been checked against current repository and no
unbalanced curly braces has been spotted.

Fixes #24243

[1] https://wiki.tcl-lang.org/page/Tcl+Minimal+Escaping+Style
2023-07-19 17:57:37 +02:00
Harmen Stoppels
185bccb70f
Fetch & patch: actually acquire stage lock, and many more issues (#38903)
* Fetching patches wouldn't result in acquiring a stage lock during install
* The installer would acquire a stage lock *after* fetching instead of
   before, leading to races
* The name of the stage for patches was random, so on build failure
   (where stage dirs are not removed), these directories would continue
   to exist after a second successful install.
* There was this redundant "composite fetch" object -- there's already
   a composite stage. Remove this.
* For some reason we do *double* shasum validation of patches, before
   and after compression -- that's just too much? I removed it.
2023-07-19 15:06:56 +02:00
Harmen Stoppels
886946395d
drop redundant rpaths post install (#38976)
Spack heuristically adds `<install prefix>/lib` and `<install prefix>/lib64` as rpath entries, as it doesn't know what the install dir is going to be ahead of the build. This PR cleans up non-existing, absolute paths[^1], which

1. avoids redundant stat calls at runtime
2. drops redundant rpaths in `patchelf`, making it relocatable -- you don't need patchelf recursively then.

[^1]: It also removes relative paths not starting with `$` (so, `$ORIGIN/../lib` is retained -- we _could_ interpolate `$ORIGIN`, but that's hard to get right when symlinks have to be taken into account). Relative paths _are_ supported in glibc, but are relative to _the current working directory_, which is madness, and it would be better to drop those paths.
2023-07-19 09:48:31 +00:00
Massimiliano Culpo
f34c93c5f8
llnl.util.lock: add type-hints (#38977)
Also uppercase global variables in the module
2023-07-19 11:23:08 +02:00
Massimiliano Culpo
a7f2abf924
Remove LazyReference from code (#38944)
A LazyReference object is a reference to an attribute of a 
lazily evaluated singleton. Its only purpose is to let developers
use shorter names to refer to such attribute.

This class does more harm than good, as it obfuscates the fact
that we are using the attribute of a global object. Also, it can easily
go out of sync with the singleton it refers to if, for instance, the
singleton is updated but the references are not.

This commit removes the LazyReference class entirely, and access
the attributes explicitly passing through the global value to which
they are attached.
2023-07-19 11:08:51 +02:00
markus-ferrell
416edfa229
Windows testing: enable tests for installer components (#36970)
These tests now work without any changes to core. Furthermore, it is
surprising that they had to be disabled (at least, as long as the
installer.py tests are run on Windows: these tests are more-basic
and their functionality would have been exercised automatically).
2023-07-18 16:19:14 -07:00
Massimiliano Culpo
14f3297cca
Ensure the bootstrap store has a padding length of zero (#38975)
Without this PR, padded length was propagating from user configuration to
bootstrap configuration, and was causing the issue reported in #38963
2023-07-18 23:49:22 +02:00
markus-ferrell
f24f98a1e2
Windows testing: enable bootstrap test (#36972) 2023-07-18 14:42:26 -07:00
markus-ferrell
ffc283ab8b
test_clear_failures_success: run on Windows too (#36792) 2023-07-18 22:42:57 +02:00
Harmen Stoppels
3fef586cfb
binary cache docs: remove redundant flag and comment (#38960) 2023-07-18 22:38:04 +02:00
markus-ferrell
b710778bda
Windows testing: enable architecture test (#36973)
Works out of the box: remove skip.
2023-07-18 12:33:52 -07:00
markus-ferrell
a965fe9354
Windows testing: enable "spack clean" tests (#36840)
They work out out of the box on windows. Simply removing skips.
2023-07-18 12:25:32 -07:00
Harmen Stoppels
5b23c5dcc0
buildcache push: make --allow-root the default and deprecate the option (#38878)
Without --allow-root spack cannot push binaries that contain paths in
binaries. This flag is almost always needed, so there is no point of
requiring users to spell it out. 

Even without --allow-root, rpaths would still have to be patched, so the 
flag is not there to guarantee binaries are not modified on install.

This commit makes --allow-root the default, and drops the code 
required for it. It also deprecates `spack buildcache preview`, since 
the command made sense only with --allow-root.

As a side effect, Spack no longer depends on binutils for relocation
2023-07-18 18:45:14 +02:00
Massimiliano Culpo
ad1fdcdf48
Pin Spack dev dependencies on RtD (#38950) 2023-07-18 18:37:04 +02:00
Massimiliano Culpo
82aa27f5a5
Fix default construction of locks (#38953)
This fixes a typo introduced in a refactor
2023-07-18 14:36:41 +02:00
Xavier Delaruelle
8c7adbf8f3
modules: add support for conflict in lua modulefile (#36701)
Add support for conflict directives in Lua modulefile like done for Tcl
modulefile.

Note that conflicts are correctly honored on Lmod and Environment
Modules <4.2 only if mutually expressed on both modulefiles that
conflict with each other.

Migrate conflict code from Tcl-specific classes to the common part. Add
tests for Lmod and split the conflict test case in two.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-07-18 10:24:46 +02:00
Peter Scheibel
10165397da
"spack develop": always pull full history for git repos (#38343) 2023-07-18 09:53:33 +02:00
Dan Lipsa
4831d45852
Decompression: fix naming issues (#37749)
* When using system tools to unpack a .gz file, the input file needs a
  different name than the output file. Normally, we generate this new
  name by stripping off the .gz extension off of the file name.
  This was not sufficient if the file name did not have an extension,
  so we temporarily rename the file in that case.
* When using system tar utility to untar on Windows, we were (erroneously)
  skipping the actual untar step if the filename was lacking a .tar
  extension
* For foo.txz, we were not changing the extension of the decompressed file
  (i.e. we would decompress foo.txz to foo.txz). This did not cause any
  problems, but is confusing, so has been updated such that the output
  filename reflects its decompressed state (i.e. foo.tar).
* Added test for strip_compression_extension
* Update test_native_unpacking to test each archive type with and without
  an extension as part of the file name (i.e. we test "foo.tar.gz", but
  also make sure we decompress properly if it is named "foo").
2023-07-17 14:33:18 -07:00
Harmen Stoppels
f05837a480
Fix wrong StageComposite keep override (#38938)
`Stage(keep=True)` was ignored when put in a composite that doesn't
override the value.
2023-07-17 23:20:24 +02:00
Manuela Kuhn
884b4952af
Fix python import tests (#38928)
Running `spack test run <python package>` resulted in the error
```
'str' object is not callable
```
because the python executable was not set correctly.
2023-07-17 13:19:47 -07:00
Massimiliano Culpo
53ae969aa0
Lock, database and store don't need global configuration on construction (#33495)
Lock objects can now be instantiated independently,
without being tied to the global configuration. The
same is true for database and store objects.

The database __init__ method has been simplified to
take a single lock configuration object. Some common
lock configurations (e.g. NO_LOCK or NO_TIMEOUT) have
been named and are provided as globals.

The use_store context manager keeps the configuration
consistent by pushing and popping an internal scope.
It can also be tuned by passing extra data to set up
e.g. upstreams or anything else that might be related
to the store.
2023-07-17 16:51:04 +02:00
Adam J. Stewart
2b5a7bb4d7
Update new PythonPackage template to prefer --config-settings (#38918) 2023-07-17 08:03:05 -05:00
Peter Scheibel
31431f967a
Environment/depfile: fix bug with Git hash versions (attempt #2) (#37560)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2023-07-17 11:17:32 +00:00
Massimiliano Culpo
63b88c4b75
Minimal cleanup of a few tests in test/packaging.py (#38880)
* Minimal cleanup of a few tests in packaging.py

* Use f-strings
2023-07-17 10:36:29 +02:00
Harmen Stoppels
ac5976d17d
Remove unused context manager (#38897) 2023-07-14 18:41:30 +02:00
Rocco Meli
244dfb3a35
Fix issue on cray with super call (#38895) 2023-07-14 10:00:02 +00:00
Tamara Dahlgren
2e9e7ce7c4
Bugfix/spack spec: read and use the environment concretizer:unification option (#38248)
* Bugfix: spack.yaml concretizer:unify needs to be read and used
* Optional: add environment test to ensure configuration scheme is used
* Activate environment in unit tests
  A more proper solution would be to keep
  an environment instance configuration as
  an attribute, but that is a bigger refactor
* Delay evaluation of Environment.unify
* Slightly simplify unit tests

---------

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-07-13 23:43:20 +02:00
Harmen Stoppels
033eb77aa9
spack buildcache push: improve argparse (#38876) 2023-07-13 16:01:09 +02:00
Harmen Stoppels
522d9e260b
mirrors: distinguish between source/binary mirror; simplify schema (#34523)
Allow the following formats:

```yaml
mirrors:
  name: <url>
```

```yaml
mirrors:
  name:
    url: s3://xyz
    access_pair: [x, y]
```

```yaml
mirrors:
  name:
    fetch: http://xyz
    push:
      url: s3://xyz
      access_pair: [x, y]
```

And reserve two new properties to indicate the mirror type (e.g.
mirror.spack.io is a source mirror, not a binary cache)

```yaml
mirrors:
  spack-public:
    source: true
    binary: false
    url: https://mirror.spack.io
```
2023-07-13 11:29:17 +00:00
Massimiliano Culpo
3261889e3a
spack audit: allow skipping version checks from package.py (#28372)
A few packages have version directives evaluated
within if statements, conditional on the value of
`platform.platform()`.

Sometimes there are no cases for e.g. platform=darwin and that
causes a lot of spurious failures with version existence
audits.

This PR allows expressing conditions to skip version
existence checks in audits and avoid these spurious reports.
2023-07-13 06:47:47 -04:00
Harmen Stoppels
161b30a32f
Add type hints to spack.installer (#38872) 2023-07-13 10:41:19 +00:00
Adam J. Stewart
b67f1f395b
Add missing space in error msg (#38863) 2023-07-13 10:24:02 +02:00
Adam J. Stewart
bb7f437bf5
Standardize subcommand help strings (#38804)
### Rationale

While working on #29549, I noticed a lot of inconsistencies in our argparse help messages. This is important for fish where these help messages end up as descriptions in the tab completion menu. See https://github.com/spack/spack/pull/29549#issuecomment-1627596477 for some examples of longer or more stylized help messages.

### Implementation

This PR makes the following changes:

- [x] help messages start with a lowercase letter.
- [x] Help messages do not end with a period
- [x] the first line of a help message is short and simple

    longer text is separated by an empty line
- [x] "help messages do not use triple quotes" 

    """(except docstrings)"""
- [x] Parentheses not needed for string concatenation inside function call
- [x] Remove "..." "..." string concatenation leftover from black reformatting
- [x] Remove Sphinx argument docs from help messages

The first 2 choices aren't very controversial, and are designed to match the syntax of the `--help` flag automatically added by argparse. The 3rd choice is more up for debate, and is designed to match our package/module docstrings. The 4th choice is designed to avoid excessive newline characters and indentation. We may actually want to go even further and disallow docstrings altogether.

### Alternatives

Choice 3 in particular has a lot of alternatives. My goal is solely to ensure that fish tab completion looks reasonable. Alternatives include:

1. Get rid of long help messages, only allow short simple messages
2. Move longer help messages to epilog
3. Separate by 2 newline characters instead of 1
4. Separate by period instead of newline. First sentence goes into tab completion description

The number of commands with long help text is actually rather small, and is mostly relegated to `spack ci` and `spack buildcache`. So 1 isn't actually as ridiculous as it sounds.

Let me know if there are any other standardizations or alternatives you would like to suggest.
2023-07-13 00:18:23 -07:00
Jonathon Anderson
90208da8a5
containers: retain shallow git data (#37734) 2023-07-12 21:03:10 +00:00
Michael Fink
c8026c3c87
Add path to MPI executables to ^mpi dependents (#35758) 2023-07-12 13:58:43 -05:00
Vicente Bolea
37ef31dc22
vtk-m: correct cuda_arch variant behavior (#38697)
Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
2023-07-12 14:34:50 +02:00
Michael Kuhn
d5d0b8821c
installer: Improve status reporting (#37903)
Refactor `TermTitle` into `InstallStatus` and use it to show progress
information both in the terminal title as well as inline. This also
turns on the terminal title status by default.

The inline output will look like the following after this change:
```
==> Installing m4-1.4.19-w2fxrpuz64zdq63woprqfxxzc3tzu7p3 [4/4]
```
2023-07-12 08:54:45 +02:00
Todd Gamblin
757f8ae59c
find: add --hashes shortcut for piping to other commands (#38663)
People frequently ask us how to pipe `spack find` output to other commands, and we tell
them to do things like this:

```console
$ spack find --format "/{hash}" | spack uninstall -ay
```

Sometimes users don't know about hash references and come up with potentially ambiguous
formulations like this:

```console
spack find --format {name}@{version}%{compiler} | spack uninstall -ay
```

Since this is a common enough thing to want to do, and to make it more obvious how, this
PR adds a `-H` / `--hashes` as a shortcut, so you can now just do:

```console
spack find -H | spack uninstall -ay
```
2023-07-10 09:43:37 +02:00
Jonathon Anderson
db879a5679
ci: Fix broken SPACK_CHECKOUT_VERSION (#38778) 2023-07-09 12:37:36 -07:00
Harmen Stoppels
374fda1063
Don’t call spec.format in Database._get_matching_spec_key (#38792)
`"%s" % spec` formats the spec with deps included, which produces sometimes KBs
of data and is slow to run in pure Python. It can delay otherwise very short-lived
read/write locks on the database.

Discovered in #38762 where profile output showed about 2 seconds is spent in
`spec.format`, which is significant overhead when using multiprocessing to install
from binary cache in parallel (installation often takes <5s for small packages). With
this change, `spec.format` no longer shows up in profile output.

(This line hasn't changed since Spack v0.9 ;p)

* move format() call to custom NoSuchSpecError exception
* add a comment saying why, so we can eventually change `Spec.__str__`
2023-07-09 11:27:38 -04:00
Massimiliano Culpo
6958b49c2f
Remove "node_compiler" from the list of unknown atoms (#38753) 2023-07-07 13:19:53 +02:00
Harmen Stoppels
a1d33e97ec
Fix multiple quadratic complexity issues in environments (#38771)
1. Fix O(n^2) iteration in `_get_overwrite_specs`
2. Early exit `get_by_hash` on full hash
3. Fix O(n^2) double lookup in `all_matching_specs` with hashes
4. Fix some legibility issues
2023-07-07 10:51:58 +00:00
Massimiliano Culpo
ca9b52bbc5
Prevent "spack external find" to error out on wrong permissions (#38755)
fixes #38733
2023-07-07 12:05:32 +02:00
Andrey Parfenov
ae00d7c358
add info about spack env from spack-configs for oneAPI build tools (#38751)
Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com>
2023-07-07 03:47:54 +00:00
Adam J. Stewart
45838cee0b
Drop Python 2 super syntax (#38718) 2023-07-05 09:04:29 -05:00