Commit graph

5895 commits

Author SHA1 Message Date
Adam J. Stewart
5b3b0130f2
Build System docs: consistent headers (#34047) 2022-11-23 13:35:55 +01:00
Michael Kuhn
0fd3c9f451
cmd/checksum: allow adding new versions to package (#24532)
This adds super-lazy maintainer mode to `spack checksum`: Instead of
only printing the new checksums to the terminal, `-a` and
`--add-to-package` will add the new checksums to the `package.py` file
and open it in the editor afterwards for final checks.
2022-11-22 16:30:49 -08:00
Harmen Stoppels
4bf964e6b3
spack uninstall: use topo order (#34053) 2022-11-22 07:22:07 -07:00
Massimiliano Culpo
bd198312c9
Revert "Warn about removal of deprecated format strings (#33829)" (#34056)
This reverts commit 7f9af8d4a0.
2022-11-22 12:35:36 +01:00
Greg Becker
7f9af8d4a0
Warn about removal of deprecated format strings (#33829)
Co-authored-by: becker33 <becker33@users.noreply.github.com>
2022-11-22 10:56:57 +01:00
John W. Parent
793a7bc6a9
Windows: add registry query and SDK/WDK packages (#33021)
* Add a WindowsRegistryView class, which can query for existing
  package installations on Windows. This is particularly important
  because some Windows packages (including those added here)
  do not allow two simultaneous installs, and this can be
  queried in order to provide a clear error message.
* Consolidate external path detection logic for Windows into
  WindowsKitExternalPaths and WindowsCompilerExternalPaths objects.
* Add external-only packages win-sdk and wgl
* Add win-wdk (including external detection) which depends on
  win-sdk
* Replace prior msmpi implementation with a source-based install
  (depends on win-wdk). This install can control the install
  destination (unlike the binary installation).
* Update MSVC compiler to choose vcvars based on win-sdk dependency
* Provide "msbuild" module-level variable to packages during build
* When creating symlinks on Windows, need to explicitly specify when
  a symlink target is a directory
* executables_in_path no-longer defaults to using PATH (this is
  now expected to be taken care of by the caller)
2022-11-22 00:27:42 -08:00
Harmen Stoppels
44c22a54c9
Spec traversal: add option for topological ordering (#33817)
Spec traversals can now specify a topological ordering. A topologically-
ordered traversal with input specs X1, X2... will

* include all of X1, X2... and their children
* be ordered such that a given node is guaranteed to appear before any
  of its children in the traversal

Other notes:

* Input specs can be children of other input specs (this is useful if
  a user specifies a set of specs to uninstall: some of those specs
  might be children of others)
* `direction="parents"` will produce a reversed topological order
  (children always come before parents).
* `cover="edges"` will generate a list of edges L such that (a) input
  edges will always appear before output edges and (b) if you create
  a list with the destination of each edge in L the result is
  topologically ordered
2022-11-21 18:33:35 -08:00
Massimiliano Culpo
0e4ee3d352
Speed-up a few unit-tests (#34044)
* test_suite.py: speed up slow test by using mock packages

* Don't resolve the sha during unit-tests

* Skip long-running test that fails, instead of executing it
2022-11-21 23:50:55 +01:00
Scott Wittenburg
6411cbd803
ci: restore ability to reproduce gitlab job failures (#33953) 2022-11-21 10:39:03 -06:00
Harmen Stoppels
8ea366b33f
uninstall: fix accidental cubic complexity (#34005)
* uninstall: fix accidental cubic complexity

Currently spack uninstall runs in worst case cubic time complexity
thanks to traversal during traversal during traversal while collecting
the specs to be uninstalled.

Also brings down the number of error messages printed to something
linear in the amount of matching specs instead of quadratic.
2022-11-21 16:44:48 +01:00
Massimiliano Culpo
45b4cedb7e
spack find: remove deprecated "--bootstrap" option (#34015) 2022-11-19 16:09:34 +01:00
Chris Green
409cf185ce
package_base.py: Fix #34006: test msg needs to be a string (#34007) 2022-11-19 13:02:51 +01:00
Chris Green
e715901cb2
PackageBase should not define builder legacy attributes (#33942)
* Add a regression test for 33928

* PackageBase should not set `(build|install)_time_test_callbacks`

* Fix audits by preserving the current semantic

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2022-11-18 22:22:51 +01:00
Massimiliano Culpo
839a14c0ba
Improve error message for requirements (#33988)
refers #33985
2022-11-18 15:49:46 +01:00
Jared Popelar
381bedf369
Hdf5 package: build on Windows (#31141)
* Enable hdf5 build (including +mpi) on Windows
* This includes updates to hdf5 dependencies openssl (minor edit) and
  bzip2 (more-extensive edits)
* Add binary-based installation of msmpi (this is currently the only
  supported MPI implementation in Spack for Windows). Note that this
  does not install to the Spack-specified prefix. This implementation
  will be replaced with a source-based implementation

Co-authored-by: John Parent <john.parent@kitware.com>
2022-11-17 10:40:53 -08:00
Chris Green
22aada0e20
Waf build system: fix typo in legacy_attributes (#33958)
Fix erroneous duplication of `build_time_test_callbacks` in
`legacy_attributes`: one of the duplicates should be
`install_time_test_callbacks`
2022-11-17 16:54:46 +01:00
Harmen Stoppels
cc2d0eade6
docs: fix typo in multiple build systems (#33965) 2022-11-17 15:20:10 +01:00
Harmen Stoppels
f00e411287
relocate.py: small refactor for file_is_relocatable (#33967) 2022-11-17 13:21:27 +01:00
Massimiliano Culpo
da0a6280ac
Remove deprecated subcommands from "spack bootstrap" (#33964)
These commands are slated for removal in v0.20
2022-11-17 12:42:57 +01:00
Michael Kuhn
93eecae0c3
Add sgid notice when running on AFS (#30247) 2022-11-17 09:17:41 +01:00
Brian Vanderwende
c721aab006
lib/spack/spack/store.py: Fix #28170 for padding relocation (#33122) 2022-11-17 03:56:00 +01:00
Greg Becker
1263b5c444
initial implementation of slingshot detection (#33793) 2022-11-16 13:01:37 -08:00
psakievich
90f0a8eacc
Upstreams: add canonicalize path (#33946) 2022-11-16 14:37:32 -06:00
John W. Parent
61a7420c94
Windows bootstrapping: remove unneeded call to add dll to PATH (#33622)
#32942 fixed bootstrapping on Windows by having the core Spack
code explicitly add the Clingo package bin/ directory as a
DLL path.

Since then, #33400 has been merged, which ensures that the Python
module installed by the Spack `clingo` package can find the DLLs
in bin/.

Note that this only works for Spack instances which have been
bootstrapped after #33400: for installations bootstrapped before
then, you will need to run `spack clean -b` (this would only
be needed for Spack instances running on Windows).
2022-11-16 12:04:57 -08:00
Stephen Sachs
39a1f1462b
SIP build system: fix "python not defined in builder" (#33906)
Co-authored-by: Stephen Sachs <stesachs@amazon.com>
2022-11-16 13:36:25 -06:00
Harmen Stoppels
0a952f8b7b
docs updates for spack env depfile (#33937) 2022-11-16 15:47:31 +01:00
Harmen Stoppels
d18cccf7c5
spack env depfile in Gitlab CI should use install-deps/pkg-version-hash target (#33936) 2022-11-16 14:02:56 +00:00
Kevin Broch
fbe6b4b486
Change code suggestions to output black formatter compliant code (#33931) 2022-11-16 12:08:20 +01:00
Adam J. Stewart
93430496e2
Getting Started: Python 2 is no longer supported (#33927) 2022-11-16 08:36:49 +01:00
Michael Kuhn
901b31a7aa
docs: fix typo (#33926) 2022-11-15 16:06:12 -08:00
Harmen Stoppels
a0182c069f
Show time per phase (#33874) 2022-11-15 21:10:07 +01:00
Harmen Stoppels
af74680405
depfile: improve tab completion (#33773)
This PR allows you to do:

```
spack env create -d .
spack -e . add python
spack -e . concretize
spack -e . env depfile -o Makefile

make in<tab>              # -> install
make install-<tab>        # -> install-deps/
make install-deps/py<tab> # -> install-deps/python-x.y.z-hash
make install/zl<tab>      # -> install/zlib-x.y.z-hash

make SP<tab>              # -> make SPACK
make SPACK_<tab>          # -> make SPACK_INSTALL_FLAGS=
```
2022-11-15 18:03:17 +01:00
Harmen Stoppels
d1715c5fdf
Fixup: start the timer before the phase (#33917) 2022-11-15 16:52:43 +01:00
Harmen Stoppels
b245f1ece1
Fix incorrect timer (#33900)
Revamp the timer so we always have a designated begin and end.

Fix a bug where the phase timer was stopped before the phase started,
resulting in incorrect timing reports in timers.json.
2022-11-15 16:33:47 +01:00
Brian Van Essen
fd4f905ce5
External find now searches all dynamic linker paths (#33800)
Add spack.ld_so_conf.host_dynamic_linker_search_paths

Retrieve the current host runtime search paths for shared libraries;
for GNU and musl Linux we try to retrieve the dynamic linker from the
current Python interpreter and then find the corresponding config file
(e.g. ld.so.conf or ld-musl-<arch>.path). Similar can be done for
BSD and others, but this is not implemented yet. The default paths
are always returned. We don't check if the listed directories exist.

Use this in spack external find for libraries.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2022-11-15 14:48:15 +01:00
Harmen Stoppels
2948248d7a
Remove exit(0) (#33896)
Since they cause --backtrace to report backtraces even with exit code 0
2022-11-15 14:35:44 +01:00
Massimiliano Culpo
b3124bff7c
Stop using six in Spack (#33905)
Since we dropped support for Python 2.7, there's no need
so use `six` anymore. We still need to vendor it until
we update our vendored dependencies.
2022-11-15 10:07:54 +01:00
Scott Wittenburg
5c4137baf1
gitlab: Add shared PR mirror to places pipelines look for binaries. (#33746)
While binaries built for PRs that get merged must still be rebuilt
in develop pipelines, they can be used by other PRs that find they
would otherwise need to rebuild them.  Now that spackbot is
managing copying PR binaries from merged PRs into a shared location,
keeping it pruned to a reasonable size, and making sure the indices
are up to date, spack can use these mirrors as a potential source
of binaries.
2022-11-14 19:37:23 -07:00
psakievich
2460c4fc28
Add $date option to the list of config variables (#33875)
I'm finding I often want the date in my paths and it would be nice if spack had a config variable for this.

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2022-11-14 10:13:30 -08:00
Cory Bloor
6e39efbb9a
rocm: add all GFX9, GFX10 and GFX11 amdgpu_targets (#33871)
This change adds all documented AMDGPU processors from GFX9 through GFX11 and sorts the list.
2022-11-14 10:11:22 -08:00
Todd Gamblin
6ecb57e91f Bump version to v0.20.0.dev0 2022-11-14 08:22:29 -06:00
Harmen Stoppels
a75af62fe3
Get rid of context for exceptions outside PackageBase (#33887) 2022-11-14 14:11:22 +01:00
Massimiliano Culpo
e4e02dbeae
Fix a bug/typo in a config_values.py fixture (#33886) 2022-11-14 05:26:14 -07:00
Massimiliano Culpo
3efa4ee26f
Remove support for running with Python 2.7 (#33063)
* Remove CI jobs related to Python 2.7

* Remove Python 2.7 specific code from Spack core

* Remove externals for Python 2 only

* Remove llnl.util.compat
2022-11-14 13:11:28 +01:00
Harmen Stoppels
a4cec82841
Speed up traverse unit tests (#33840) 2022-11-14 09:34:14 +01:00
Todd Gamblin
3d811617e6
hotfix: ensure that schema is compatible with tutorial VM config
We added a hotfix to releases/v0.19 with a feature flag, but the flag
is incompatible with the config schema on `develop`.

- [x] Ensure schema is compatible on develop even though config option is unused.
2022-11-13 09:14:00 -06:00
Massimiliano Culpo
03224e52d2
Speed-up bootstrap and architecture unit tests (#33865)
* Speed-up bootstrap mirror unit test

The unit test doesn't need to concretize, since it checks
only metadata for the mirror.

* architecture.py: use "default_mock_concretization" for slow test
2022-11-13 13:09:22 +01:00
Greg Becker
4ebe57cd64
update tutorial command to newest release branch (#33867) 2022-11-12 13:29:38 -08:00
Greg Becker
343cd04a54
use spack.version_info as source of version truth for spack tutorial command (#33860)
* Use spack.spack_version_info as source of truth

Co-authored-by: Todd Gamblin <gamblin2@llnl.gov>
2022-11-12 11:42:59 -08:00
Massimiliano Culpo
022a2d2eaf
Speed-up unit tests by caching default mock concretization (#33755) 2022-11-11 21:32:40 +01:00
Greg Becker
2d2c591633
ensure view projections for extensions always point to extendee (#33848) 2022-11-11 10:59:23 -07:00
Harmen Stoppels
c14dc2f56a
docs: updates related to extensions (#33837) 2022-11-11 13:24:17 +01:00
Harmen Stoppels
0f54a63dfd
remove activate/deactivate support in favor of environments (#29317)
Environments and environment views have taken over the role of `spack activate/deactivate`, and we should deprecate these commands for several reasons:

- Global activation is a really poor idea:
   - Install prefixes should be immutable; since they can have multiple, unrelated dependents; see below
   - Added complexity elsewhere: verification of installations, tarballs for build caches, creation of environment views of packages with unrelated extensions "globally activated"... by removing the feature, it gets easier for people to contribute, and we'd end up with fewer bugs due to edge cases.
- Environment accomplish the same thing for non-global "activation" i.e. `spack view`, but better.

Also we write in the docs:

```
However, Spack global activations have two potential drawbacks:

#. Activated packages that involve compiled C extensions may still
   need their dependencies to be loaded manually.  For example,
   ``spack load openblas`` might be required to make ``py-numpy``
   work.

#. Global activations "break" a core feature of Spack, which is that
   multiple versions of a package can co-exist side-by-side.  For example,
   suppose you wish to run a Python package in two different
   environments but the same basic Python --- one with
   ``py-numpy@1.7`` and one with ``py-numpy@1.8``.  Spack extensions
   will not support this potential debugging use case.
```

Now that environments are established and views can take over the role of activation
non-destructively, we can remove global activation/deactivation.
2022-11-11 00:50:07 -08:00
Greg Becker
f11778bb02
remove deprecated top-level module config (#33828)
* remove deprecated top-level module config per deprecation in 0.18
2022-11-10 23:35:33 -08:00
Greg Becker
277234c044
remove deprecated concretization environment key (#33774) 2022-11-11 00:11:52 +00:00
Harmen Stoppels
0077a25639
Use bfs order in spack find --deps tree (#33782)
* Use bfs order in spack find --deps tree
* fix printing tests
2022-11-10 15:39:07 -08:00
Massimiliano Culpo
cfd0dc6d89
spack location: fix attribute lookup after multiple build systems (#33791)
fixes #33785
2022-11-10 01:53:59 -07:00
Chris White
bb1cd430c0
always use the cxx compiler as a host compiler (#33771) 2022-11-09 13:22:43 -08:00
Harmen Stoppels
d1d668a9d5
Revert "fix racy sbang (#33549)" (#33778)
This reverts commit 4d28a64661.
2022-11-09 09:31:27 +00:00
Greg Becker
284c3a3fd8
ensure external PythonPackages have python deps (#33777)
Currently, external `PythonPackage`s cause install failures because the logic in `PythonPackage` assumes that it can ask for `spec["python"]`.  Because we chop off externals' dependencies, an external Python extension may not have a `python` dependency.

This PR resolves the issue by guaranteeing that a `python` node is present in one of two ways:
1. If there is already a `python` node in the DAG, we wire the external up to it.
2. If there is no existing `python` node, we wire up a synthetic external `python` node, and we assume that it has the same prefix as the external.

The assumption in (2) isn't always valid, but it's better than leaving the user with a non-working `PythonPackage`.

The logic here is specific to `python`, but other types of extensions could take advantage of it.  Packages need only define `update_external_dependencies(self)`, and this method will be called on externals after concretization.  This likely needs to be fleshed out in the future so that any added nodes are included in concretization, but for now we only bolt on dependencies post-concretization.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2022-11-09 08:25:30 +00:00
Massimiliano Culpo
ec89c47aee
Account for patchelf binaries when creating local bootstrap mirror (#33776)
This was overlooked when we added binary patchelf buildcaches
2022-11-08 23:05:03 -08:00
Harmen Stoppels
4d28a64661
fix racy sbang (#33549)
Spack currently creates a temporary sbang that is moved "atomically" in place,
but this temporary causes races when multiple processes start installing sbang.

Let's just stick to an idempotent approach. Notice that we only re-install sbang
if Spack updates it (since we do file compare), and sbang was only touched
18 times in the past 6 years, whereas we hit the sbang tempfile issue
frequently with parallel install on a fresh spack instance in CI.

Also fixes a bug where permissions weren't updated if config changed but
the latest version of the sbang file was already installed.
2022-11-08 11:05:05 -08:00
Greg Becker
97fe7ad32b
use pwd for usernames on unix (#19980) 2022-11-08 10:36:10 -08:00
Stephen Sachs
80f5939a94
Install from source if binary cache checksum validation fails (#31696)
* Fix https://github.com/spack/spack/issues/31640

Some packages in the binary cache fail checksum validation. Instead of having to
go back and manually install all failed packages with `--no-cache` option,
requeue those failed packages for installation from source

```shell
$ spack install py-pip
==> Installing py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7
==> Fetching https://binaries.spack.io/releases/v0.18/build_cache/linux-amzn2-graviton2-gcc-7.3.1-py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7.spec.json.sig
gpg: Signature made Wed 20 Jul 2022 12:13:43 PM UTC using RSA key ID 3DB0C723
gpg: Good signature from "Spack Project Official Binaries <maintainers@spack.io>"
==> Fetching https://binaries.spack.io/releases/v0.18/build_cache/linux-amzn2-graviton2/gcc-7.3.1/py-pip-21.3.1/linux-amzn2-graviton2-gcc-7.3.1-py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7.spack
==> Extracting py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7 from binary cache
==> Error: Failed to install py-pip due to NoChecksumException: Requeue for manual installation.
==> Installing py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7
==> Using cached archive: /shared/spack/var/spack/cache/_source-cache/archive/de/deaf32dcd9ab821e359cd8330786bcd077604b5c5730c0b096eda46f95c24a2d
==> No patches needed for py-pip
==> py-pip: Executing phase: 'install'
==> py-pip: Successfully installed py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7
  Fetch: 0.01s.  Build: 2.81s.  Total: 2.82s.
[+] /shared/spack/opt/spack/linux-amzn2-graviton2/gcc-7.3.1/py-pip-21.3.1-s2cx4gqrqkdqhashlinqyzkrvuwkl3x7
```

* Cleanup style

* better wording

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* Update lib/spack/spack/installer.py

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

* changes quotes for style checks

* Update lib/spack/spack/installer.py

Co-authored-by: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>

* Addressing @kwryankrattiger comment to use local 'use_cache`

Co-authored-by: Stephen Sachs <stesachs@amazon.com>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>
2022-11-08 09:19:55 -08:00
Massimiliano Culpo
89976af732
scons: fix Scons builder after multi build-system refactoring (#33753) 2022-11-08 16:03:15 +01:00
Massimiliano Culpo
e4218595de
Rework unit test to avoid tripping into concretization slowdown (#33749) 2022-11-08 10:56:24 +01:00
Greg Becker
c9561c5a0e
intel oneapi classic bootstrapping (#31285)
The `intel` compiler at versions > 20 is provided by the `intel-oneapi-compilers-classic`
package (a thin wrapper around the `intel-oneapi-compilers` package), and the `oneapi`
compiler is provided by the `intel-oneapi-compilers` package. 

Prior to this work, neither of these compilers could be bootstrapped by Spack as part of
an install with `install_missing_compilers: True`.

Changes made to make these two packages bootstrappable:

1. The `intel-oneapi-compilers-classic` package includes a bin directory and symlinks
   to the compiler executables, not just logical pointers in Spack.
2. Spack can look for bootstrapped compilers in directories other than `$prefix/bin`,
   defined on a per-package basis
3. `intel-oneapi-compilers` specifies a non-default search directory for the
   compiler executables.
4. The `spack.compilers` module now can make more advanced associations between
   packages and compilers, not just simple name translations
5. Spack support for lmod hierarchies accounts for differences between package
   names and the associated compiler names for `intel-oneapi-compilers/oneapi`,
   `intel-oneapi-compilers-classic/intel@20:`, `llvm+clang/clang`, and
   `llvm-amdgpu/rocmcc`.

- [x] full end-to-end testing
- [x] add unit tests
2022-11-07 21:50:16 -08:00
Peter Scheibel
1a3415619e
"spack uninstall": don't modify env (#33711)
"spack install foo" no longer adds package "foo" to the environment
(i.e. to the list of root specs) by default: you must specify "--add".
Likewise "spack uninstall foo" no longer removes package "foo" from
the environment: you must specify --remove. Generally this means
that install/uninstall commands will no longer modify the users list
of root specs (which many users found problematic: they had to
deactivate an environment if they wanted to uninstall a spec without
changing their spack.yaml description).

In more detail: if you have environments e1 and e2, and specs [P, Q, R]
such that P depends on R, Q depends on R, [P, R] are in e1, and [Q, R]
are in e2:

* `spack uninstall --dependents --remove r` in e1: removes R from e1
  (but does not uninstall it) and uninstalls (and removes) P
* `spack uninstall -f --dependents r` in e1: will uninstall P, Q, and
   R (i.e. e2 will have dependent specs uninstalled as a side effect)
* `spack uninstall -f --dependents --remove r` in e1: this uninstalls
   P, Q, and R, and removes [P, R] from e1
* `spack uninstall -f --remove r` in e1: uninstalls R (so it is
  "missing" in both environments) and removes R from e1 (note that e1
  would still install R as a dependency of P, but it would no longer
  be listed as a root spec)
* `spack uninstall --dependents r` in e1: will fail because e2 needs R

Individual unit tests were created for each of these scenarios.
2022-11-08 03:24:51 +00:00
Jordan Galby
84a3d32aa3
Fix missing "*.spack*" files in views (#30980)
All files/dirs containing ".spack" anywhere their name were ignored when
generating a spack view.

For example, this happened with the 'r' package.
2022-11-08 02:58:19 +00:00
Harmen Stoppels
3693622edf
reorder packages.yaml: requirements first, then preferences (#33741)
* reorder packages.yaml: requirements first, then preferences
* expand preferences vs reuse vs requirements
2022-11-07 16:16:11 -08:00
Scott Wittenburg
b3b675157c
gitlab ci: Add "script_failure" as a reason for retrying service jobs (#33420)
Somehow a network error when cloning the repo for ci gets
categorized by gitlab as a script failure.  To make sure we retry
jobs that failed for that reason or a similar one, include 
"script_failure" as one of the reasons for retrying service jobs
(which include "no specs to rebuild" jobs, update buildcache
index jobs, and temp storage cleanup jobs.
2022-11-07 16:11:04 -07:00
Tom Scogland
6241cdb27b
encode development requirements in pyproject.toml (#32616)
Add a `project` block to the toml config along with development and CI
dependencies and a minimal `build-system` block, doing basically
nothing, so that spack can be bootstrapped to a full development
environment with:

```shell
$ hatch -e dev shell
```

or for a minimal environment without hatch:

```shell
$ python3 -m venv venv
$ source venv/bin/activate
$ python3 -m pip install --upgrade pip
$ python3 -m pip install -e '.[dev]'
```

This means we can re-use the requirements list throughout the workflow
yaml files and otherwise maintain this list in *one place* rather than
several disparate ones.  We may be stuck with a couple more temporarily
to continue supporting python2.7, but aside from that it's less places
to get out of sync and a couple new bootstrap options.

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2022-11-07 15:00:22 -08:00
Scott Wittenburg
28a77c2821
binary_distribution: Speed up buildcache update-index (#32796)
This change uses the aws cli, if available, to retrieve spec files
from the mirror to a local temp directory, then parallelizes the
reading of those files from disk using multiprocessing.ThreadPool.

If the aws cli is not available, then a ThreadPool is used to fetch
and read the spec files from the mirror.

Using aws cli results in ~16 times speed up to recreate the binary
mirror index, while just parallelizing the fetching and reading
results in ~3 speed up.
2022-11-07 21:31:14 +01:00
Harmen Stoppels
cc84ab1e92
Remove known issues (#33738) 2022-11-07 19:41:16 +00:00
Greg Becker
ec05543054
Bugfix: Compiler bootstrapping for compilers that are independently present in env (#32228)
The compiler bootstrapping logic currently does not add a task when the compiler package is already in the install task queue. This causes failures when the compiler package is added without the additional metadata telling the task to update the compilers list.

Solution: requeue compilers for bootstrapping when needed, to update `task.compiler` metadata.
2022-11-07 09:38:51 -08:00
Greg Becker
a30b60f9a6
Apply dev specs for dependencies of roots (#30909)
Currently, develop specs that are not roots and are not explicitly listed dependencies 
of the roots are not applied.

- [x] ensure dev specs are applied.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2022-11-07 09:37:03 -08:00
Harmen Stoppels
47df88404a
Simplify repeated _add_dependency calls for same package (#33732) 2022-11-07 16:33:18 +01:00
Axel Huebl
1eb35d0378
Doc: lsb-release (#32479)
Without the `lsb-release` tool installed, Spack cannot identify the
Ubuntu/Debian version.
2022-11-07 16:13:17 +01:00
Harmen Stoppels
2ab974f530
concretizer:unify:true as a default (#31787)
`spack env create` enables a view by default (in a weird hidden
directory, but well...). This is asking for trouble with the other
default of `concretizer:unify:false`, since having different flavors of
the same spec in an environment, leads to collision errors when
generating the view.

A change of defaults would improve user experience:

However, `unify:true` makes most sense, since any time the issue is
brought up in Slack, the user changes the concretization config, since
it wasn't the intention to have different flavors of the same spec, and
install times are decreased.

Further we improve the docs and drop the duplicate root spec limitation
2022-11-07 15:38:24 +01:00
Massimiliano Culpo
e045dabb3a
archspec: update version, translate renamed uarchs (#33556)
* Update archspec version

* Add a translation table from old names
2022-11-07 04:50:38 -08:00
Greg Becker
4b84cd8af5
bugfix for matrices with dependencies by hash (#22991)
Dependencies specified by hash are unique in Spack in that the abstract
specs are created with internal structure. In this case, the constraint
generation for spec matrices fails due to flattening the structure.

It turns out that the dep_difference method for Spec.constrain does not
need to operate on transitive deps to ensure correctness. Removing transitive
deps from this method resolves the bug.

- [x] Includes regression test
2022-11-06 16:49:35 -08:00
Greg Becker
fce7bf179f
solver setup: extract virtual dependencies from reusable specs (#32434)
* extract virtual dependencies from reusable specs
* bugfix to avoid establishing new node for virtual
2022-11-06 16:47:07 -08:00
Greg Becker
f3db624b86
package preferences: allow specs to be configured buildable when their virtuals are not (#18269)
* respect spec buildable that overrides virtual buildable
2022-11-06 16:45:38 -08:00
Greg Becker
22c2f3fe89
improve error message for dependency on nonexistant compiler (#32084) 2022-11-06 16:44:11 -08:00
Greg Becker
52cc798948
solver: do not punish explicitly requested compiler mismatches (#30074) 2022-11-06 16:40:00 -08:00
Michael Kuhn
258edf7dac
MesonPackage: disable automatic download and install of dependencies (#33717)
Without this, Meson will use its Wraps to automatically download and
install dependencies. We want to manage dependencies explicitly,
therefore disable this functionality.
2022-11-06 19:34:43 +00:00
Greg Becker
d4b45605c8
allow multiple compatible deps from CLI (#21262)
Currently, Spack can fail for a valid spec if the spec is constructed from overlapping, but not conflicting, concrete specs via the hash.

For example, if abcdef and ghijkl are the hashes of specs that both depend on zlib/mnopqr, then foo ^/abcdef ^/ghijkl will fail to construct a spec, with the error message "Cannot depend on zlib... twice".

This PR changes this behavior to check whether the specs are compatible before failing.

With this PR, foo ^/abcdef ^/ghijkl will concretize.

As a side-effect, so will foo ^zlib ^zlib and other specs that are redundant on their dependencies.
2022-11-06 11:30:37 -08:00
Greg Becker
27e1d28c0b
canonicalize_path: add arch information to substitutions (#29810)
Co-authored-by: becker33 <becker33@users.noreply.github.com>
2022-11-06 10:11:59 +01:00
Massimiliano Culpo
5558940ce6
Add support for Python 3.11 (#33505)
Argparse started raising ArgumentError exceptions
when the same parser is added twice. Therefore, we
perform the addition only if the parser is not there
already

Port match syntax to our unparser
2022-11-05 15:59:12 +01:00
Tom Scogland
3346c0918b
Fix relocation to avoid overwriting merged constant strings (#32253)
Compilers and linker optimize string constants for space by aliasing
them when one is a suffix of another. For gcc / binutils this happens
already at -O1, due to -fmerge-constants. This means that we have
to take care during relocation to always preserve a certain length
of the suffix of those prefixes that are C-strings. 

In this commit we pick length 7 as a safe suffix length, assuming the
suffix is typically the 7 characters from the hash (i.e. random), so
it's unlikely to alias with any string constant used in the sources.

In general we now pad shortened strings from the left with leading
dir seperators, but in the case of C-strings that are much shorter
and don't share a common suffix (due to projections), we do allow
shrinking the C-string, appending a null, and retaining the old part
of the prefix.

Also when rewiring, we ensure that the new hash preserves the last
7 bytes of the old hash.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2022-11-05 11:09:35 +01:00
Peter Scheibel
71d480515b
packages.yaml: set url/git (#33275)
A user may want to set some attributes on a package without actually modifying the package (e.g. if they want to git pull updates to the package without conflicts). This PR adds a per-package configuration section called "set", which is a dictionary of attribute names to desired values. For example:

packages:
  openblas:
    package_attributes:
      submodules: true
      git: "https://github.com/myfork/openblas"

in this case, the package will always retrieve git submodules, and will use an alternate location for the git repo.

While git, url, and submodules are the attributes for which we envision the most usage, this allows any attribute to be overridden, and the acceptable values are any value parseable from yaml.
2022-11-05 08:44:50 +00:00
Massimiliano Culpo
c0ed5612ab
unparser: fix bug in unit test assertion (#33722) 2022-11-05 09:00:54 +01:00
iarspider
9becc82dfc
Fix formatting in packaging guide (#33714) 2022-11-05 02:00:16 +00:00
Greg Becker
912d544afe
demote warning for no source id to debug message (#33657)
* demote warning for no source id to debug message
2022-11-04 21:52:58 +00:00
Greg Becker
53fbaa5dcd
Cray support: use linux platform for newer craype versions (#29392)
Newer versions of the CrayPE for EX systems have standalone compiler executables for CCE and compiler wrappers for Cray MPICH. With those, we can treat the cray systems as part of the linux platform rather than having a separate cray platform.

This PR:
- [x] Changes cray platform detection to ignore EX systems with Craype version 21.10 or later
- [x] Changes the cce compiler to be detectable via paths
- [x] Changes the spack compiler wrapper to understand the executable names for the standalone cce compiler (`craycc`, `crayCC`, `crayftn`).
2022-11-04 14:52:11 -07:00
Greg Becker
a88c74dc17
delegate to cray modules for target args on cray (#17857) 2022-11-04 14:50:05 -07:00
Matthieu Boileau
76ec64859a
Fix typo in docs (#33662) 2022-11-04 20:19:34 +01:00
Massimiliano Culpo
a4f3fe2ac7
Deprecate old YAML format for buildcaches (#33707) 2022-11-04 12:06:42 -07:00
Tamara Dahlgren
d338ac0634
Updates to stand-alone test documentation (#33703) 2022-11-04 18:55:38 +00:00
Greg Becker
17eaf34902
fix requires test for aarch64 (#33656) 2022-11-04 18:12:55 +00:00