Commit graph

5023 commits

Author SHA1 Message Date
Olli Lupton
06c983d38f
cuda: add 11.4.1, 11.4.2, 11.5.0. (#26892)
* cuda: add 11.4.1, 11.4.2, 11.5.0.

Note that the curses dependency from cuda-gdb was dropped in 11.4.0.

* Update clang/gcc constraints.

* Address review, assume clang 12 is OK from 11.4.1 onwards.

* superlu-dist@7.1.0 conflicts with cuda@11.5.0.

* Update var/spack/repos/builtin/packages/superlu-dist/package.py

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-25 09:05:21 -07:00
Harmen Stoppels
276e637522 Reduce verbosity of module files warning
1. Currently it prints not just the spec name, but the dependencies +
their variants + their compilers + their architectures + ...
2. It's clear from the context what spec the message applies to, so,
let's not print the spec at all.
2021-10-25 17:07:56 +02:00
Harmen Stoppels
cc8d8cc9cb
Return early in do_fetch when there is no code or a package is external (#26926)
Co-authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
2021-10-25 13:51:23 +02:00
Todd Gamblin
de8e795563 virtuals: simplify virtual handling
These three rules in `concretize.lp` are overly complex:

```prolog
:- not provider(Package, Virtual),
   provides_virtual(Package, Virtual),
   virtual_node(Virtual).
```

```prolog
  :- provides_virtual(Package, V1), provides_virtual(Package, V2), V1 != V2,
     provider(Package, V1), not provider(Package, V2),
     virtual_node(V1), virtual_node(V2).
```

```prolog
provider(Package, Virtual) :- root(Package), provides_virtual(Package, Virtual).
```

and they can be simplified to just:

```prolog
provider(Package, Virtual) :- node(Package), provides_virtual(Package, Virtual).
```

- [x] simplify virtual rules to just one implication
- [x] rename `provides_virtual` to `virtual_condition_holds`
2021-10-25 09:11:04 +02:00
Massimiliano Culpo
6d69d23aa5 Add a unit test to prevent regression 2021-10-25 09:11:04 +02:00
Massimiliano Culpo
dd4d7bae1d ASP-based solver: a package eligible to provide a virtual must provide it
fixes #26866

This semantics fits with the way Spack currently treats providers of
virtual dependencies. It needs to be revisited when #15569 is reworked
with a new syntax.
2021-10-25 09:11:04 +02:00
Scott Wittenburg
2003fa1b35
Mark flaky test_ci_rebuild as xfail (#26911) 2021-10-24 22:46:26 +02:00
Morten Kristensen
9e11e62bca
py-vermin: add latest version 1.3.1 (#26920)
* py-vermin: add latest version 1.3.1

* Exclude line from Vermin since version is already being checked for

Vermin 1.3.1 finds that `encoding` kwarg of builtin `open()` requires Python 3+.
2021-10-24 16:49:05 +00:00
Harmen Stoppels
336c60c618
Document backport in py (#26897) 2021-10-22 19:14:35 +02:00
Harmen Stoppels
609a42d63b
Shorten long shebangs only if the execute permission is set (#26899)
The OS should only interpret shebangs, if a file is executable. 

Thus, there should be no need to modify files where no execute bit is set. 

This solves issues that are e.g. encountered while packaging software as 
COVISE (https://github.com/hlrs-vis/covise), which includes example data
in Tecplot format. The sbang post-install hook is applied to every installed
file that starts with the two characters #!, but this fails on the binary Tecplot
files, as they happen to start with #!TDV. Decoding them with UTF-8 fails 
and an exception is thrown during post_install.

Co-authored-by: Martin Aumüller <aumuell@reserv.at>
2021-10-22 16:55:19 +02:00
Harmen Stoppels
d274769761
Backport #186 from py-py to fix macOS failures (#26653)
Backports the relevant bits of 0f77b6e66f
2021-10-22 13:52:46 +02:00
Doug Jacobsen
d1d0021647
Add GCS Bucket Mirrors (#26382)
This commit contains changes to support Google Cloud Storage 
buckets as mirrors, meant for hosting Spack build-caches. This 
feature is beneficial for folks that are running infrastructure on 
Google Cloud Platform. On public cloud systems, resources are
ephemeral and in many cases, installing compilers, MPI flavors,
and user packages from scratch takes up considerable time.

Giving users the ability to host a Spack mirror that can store build
caches in GCS buckets offers a clean solution for reducing
application rebuilds for Google Cloud infrastructure.

Co-authored-by: Joe Schoonover <joe@fluidnumerics.com>
2021-10-22 06:22:38 +02:00
Harmen Stoppels
3fa0654d0b
Make 'spack location -e' print the current env, and 'spack cd -e' go to the current env (#26654) 2021-10-21 13:19:48 +02:00
Tamara Dahlgren
cc8b6ca69f
Add --preferred and --latest tospack checksum (#25830) 2021-10-20 13:38:55 +00:00
Massimiliano Culpo
56209cb114
Reduce verbosity of error messages when concretizing environments (#26843)
With this commit stacktraces of subprocesses are shown only if debug mode is active
2021-10-20 11:30:07 +00:00
Alexander Jaust
26b58701bc
Fix typo in repositories.rst (#26845) 2021-10-20 11:11:17 +00:00
Harmen Stoppels
1b634f05e0
A single process pool is not something to boast about (#26837) 2021-10-19 23:04:52 +00:00
Greg Becker
7dc0ca4ee6
cray architecture detection for zen3/milan (#26827)
* Update cray architecture detection for milan

Update the cray architecture module table with x86-milan -> zen3
Make cray architecture more robust to back off from frontend
architecture to a recent ancestor if necessary. This should make
future cray updates less paingful for users.

Co-authored-by: Gregory Becker <becker33.llnl.gov>
Co-authored-by: Todd Gamblin <gamblin2@llnl.gov>
2021-10-19 21:39:50 +00:00
Harmen Stoppels
e7c7f44bb6
Reduce verbosity of threaded concretization (#26822)
1. Don't use 16 digits of precision for the seconds, round to 2 digits after the comma
2. Don't print if we don't concretize (i.e. `spack concretize` without `-f` doesn't have to tell me it did nothing in `0.00` seconds)
2021-10-19 18:33:17 +00:00
Massimiliano Culpo
2d45a9d617
Speed-up environment concretization on linux with a process pool (#26264)
* Speed-up environment concretization with a process pool

We can exploit the fact that the environment is concretized
separately and use a pool of processes to concretize it.

* Add module spack.util.parallel

Module includes `pool` and `parallel_map` abstractions,
along with implementation details for both.

* Add a new hash type to pass specs across processes

* Add tty msg with concretization time
2021-10-19 10:09:34 -05:00
Christopher Kotfila
ad35251860
Fix trigger and child links in pipeline docs (#26814) 2021-10-19 14:44:36 +00:00
Scott Wittenburg
95538de731
Speed up pipeline generation (#26622)
- [x] Stage already concretized specs instead of abstract ones
- [x] Reduce number of network calls by reading naughty list up front
2021-10-18 20:58:02 -07:00
Todd Gamblin
c5ca0db27f
patches: make re-applied patches idempotent (#26784)
We use POSIX `patch` to apply patches to files when building, but
`patch` by default prompts the user when it looks like a patch
has already been applied. This means that:

1. If a patch lands in upstream and we don't disable it
   in a package, the build will start failing.
2. `spack develop` builds (which keep the stage around) will
   fail the second time you try to use them.

To avoid that, we can run `patch` with `-N` (also called
`--forward`, but the long option is not in POSIX). `-N` causes
`patch` to just ignore patches that have already been applied.
This *almost* makes `patch` idempotent, except that it returns 1
when it detects already applied patches with `-N`, so we have to
look at the output of the command to see if it's safe to ignore
the error.

- [x] Remove non-POSIX `-s` option from `patch` call
- [x] Add `-N` option to `patch`
- [x] Ignore error status when `patch` returns 1 due to `-N`
- [x] Add tests for applying a patch twice and applying a bad patch
- [x] Tweak `spack.util.executable` so that it saves the error that
      *would have been* raised with `fail_on_error=True`. This lets
      us easily re-raise it.

Co-authored-by: Greg Becker <becker33@llnl.gov>
2021-10-18 23:11:42 +00:00
Seth R. Johnson
c48b733773
Make macOS installed libraries more relocatable (#26608)
* relocate: call install_name_tool less

* zstd: fix race condition

Multiple times on my mac, trying to install in parallel led to failures
from multiple tasks trying to simultaneously create `$PREFIX/lib`.

* PackageMeta: simplify callback flush

* Relocate: use spack.platforms instead of platform

* Relocate: code improvements

* fix zstd

* Automatically fix rpaths for packages on macOS

* Only change library IDs when the path is already in the rpath

This restores the hardcoded library path for GCC.

* Delete nonexistent rpaths and add more testing

* Relocate: Allow @executable_path and @loader_path
2021-10-18 13:34:16 -04:00
Shahzeb Siddiqui
3c013b5be6
docutils > 0.17 issue with rendering list items in sphinx (#26355)
* downgrade_docutils_version

* invalid version

* Update requirements.txt

* Improve spelling and shorten the reference link

* Update spack.yaml

* update version requirement

* update version to maximum of 0.16

Co-authored-by: bernhardkaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-18 16:55:46 +00:00
Harmen Stoppels
30e8dd95b5
Remove unused exist_errors in installer.py (#26650) 2021-10-18 15:53:51 +02:00
Harmen Stoppels
1e5f7b3542
Don't print error output in the test whether gpgconf works (#26682) 2021-10-18 15:52:53 +02:00
Harmen Stoppels
33ef7d57c1
Revert 19736 because conflicts are avoided by clingo by default (#26721) 2021-10-18 08:41:35 +02:00
Brice Videau
0bc1bffe50
Fix ruby dependent extensions. (#26729)
* Fix ruby dependent extensions.

* Added Kerilk as maintainer.
2021-10-15 16:59:32 +00:00
Harmen Stoppels
f8e4aa7d70
Revert "Don't run lsb_release on linux (#26707)" (#26754)
This reverts commit fcac95b065.
2021-10-15 09:34:04 +00:00
Harmen Stoppels
e0fbf09239
EnvironmentModifications: allow disabling stack tracing (#26706)
Currently Spack keeps track of the origin in the code of any
modification to the environment variables. This is very slow 
and enabled unconditionally even in code paths where the 
origin of the modification is never queried.

The only place where we inspect the origins of environment 
modifications is before we start a build, If there's an override 
of the type `e.set(...)` after incremental changes like 
`e.append_path(..)`, which is a "suspicious" change.

This is very rare though.

If an override like this ever happens, it might mean a package is
broken. If that leads to build errors, we can just ask the user to run
`spack -d install ...` and check the warnings issued by Spack to find
the origins of the problem.
2021-10-15 10:00:44 +02:00
Tamara Dahlgren
41d375f6a4
Stand-alone tests: disallow re-using an alias (#25881)
It can be frustrating to successfully run `spack test run --alias <name>` only to find you cannot get the results because you already use `<name>` in some previous stand-alone test execution.  This PR prevents that from happening.
2021-10-14 15:08:00 -07:00
Massimiliano Culpo
eded8f48dc
ASP-based solver: add a rule for version uniqueness in virtual packages (#26740)
fixes #26718

A virtual package may or may not have a version, but it
never has more than one. Previously we were missing a rule
for that.
2021-10-14 23:06:41 +02:00
Massimiliano Culpo
949094544e
Constrain abstract specs rather than concatenating strings in the "when" context manager (#26700)
Using the Spec.constrain method doesn't work since it might
trigger a repository lookup which could break our directives
and triggers a circular import error.

To fix that we introduce a function to merge abstract anonymous
specs, based only on package names, which does not perform any
lookup in the repository.
2021-10-14 12:33:10 +02:00
Harmen Stoppels
fcac95b065
Don't run lsb_release on linux (#26707)
Running `lsb_release` on Linux takes about 50ms because it is written in
Python. We do not use the output, so this change makes use not call it.
2021-10-14 01:27:24 +02:00
Patrick Gartung
047c95aa8d
buildcache: do one less tar file extraction
The buildcache is now extracted in a temporary folder within the current store,
moved to its final place and relocated. 

"spack clean -s" has been extended to also clean the temporary extraction directory.

Add hardlinks with absolute paths for libraries in the corge, garply and quux packages
to detect incorrect handling of hardlinks in tests.
2021-10-13 17:38:29 +02:00
Harmen Stoppels
1ed695dca7
Improve error messages for bootstrap download failures (#26599) 2021-10-12 22:11:07 +02:00
Alexander Jaust
50a2316a15
Add missing spack command in basic usage tutorial (#26646)
The `find` command was missing for the examples forcing colorized output. Without this (or another suitable) command, spack produces output that is not using any color. Thus, without the `find` command one does not see any difference between forced colorized and non-colorized output.
2021-10-12 19:23:53 +02:00
Harmen Stoppels
e168320bb1
spack: Add package (#25979)
* Make python 2 use 'from __future__ import absolute_import' to allow import spack.pkgkit

* Add Spack

* Improve ranges
2021-10-12 11:39:39 -04:00
Vanessasaurus
ce7eebfc1f
allowing spack monitor to handle redirect (#26666)
when deployed on kubernetes, the server sends back permanent redirect responses.
This is elegantly handled by the requests library, but not urllib that we have
to use here, so I have to manually handle it by parsing the exception to
get the Location header, and then retrying the request there.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-10-12 17:29:22 +02:00
Massimiliano Culpo
551120ee0b
ASP-based solver: decrease the priority of multi-valued variant optimization for root (#26677)
The ASP-based solver maximizes the number of values in multi-valued
variants (if other higher order constraints are met), to avoid cases
where only a subset of the values that have been specified on the
command line or imposed by another constraint are selected.

Here we swap the priority of this optimization target with the
selection of the default providers, to avoid unexpected results
like the one in #26598
2021-10-12 14:15:48 +02:00
Harmen Stoppels
c2bf585d17
Fix potentially broken shutil.rmtree in tests (#26665)
Seems like https://bugs.python.org/issue29699 is relevant. Better to
just ignore errors when removing them tmpdir. The OS will remove it
anyways.

Errors are happening randomly from tests that are using this fixture.
2021-10-12 14:01:52 +02:00
Harmen Stoppels
0c0831861c
Avoid quadratic complexity in log parser (#26568)
TL;DR: there are matching groups trying to match 1 or more occurrences of
something. We don't use the matching group. Therefore it's sufficient to test
for 1 occurrence. This reduce quadratic complexity to linear time.

---

When parsing logs of an mpich build, I'm getting a 4 minute (!!) wait
with 16 threads for regexes to run:

```
In [1]: %time p.parse("mpich.log")
Wall time: 4min 14s
```

That's really unacceptably slow... 

After some digging, it seems a few regexes tend to have `O(n^2)` scaling
where `n` is the string / log line length. I don't think they *necessarily*
should scale like that, but it seems that way. The common pattern is this

```
([^:]+): error
```

which matches `: error` literally, and then one or more non-colons before that. So
for a log line like this:

```
abcdefghijklmnopqrstuvwxyz: error etc etc
```

Any of these are potential group matches when using `search` in Python:

```
abcdefghijklmnopqrstuvwxyz
 bcdefghijklmnopqrstuvwxyz
  cdefghijklmnopqrstuvwxyz
                         ⋮
                        yz
                         z
```

but clearly the capture group should return the longest match.

My hypothesis is that Python has a very bad implementation of `search`
that somehow considers all of these, even though it can be implemented
in linear time by scanning for `: error` first, and then greedily expanding
the longest possible `[^:]+` match to the left. If Python indeed considers
all possible matches, then with `n` matches of length `1 .. n` you
see the `O(n^2)` slowness (i verified this by replacing + with {1,k}
and doubling `k`, it doubles the execution time indeed).

This PR fixes this by removing the `+`, so effectively changing the 
O(n^2) into a O(n) worst case.

The reason we are fine with dropping `+` is that we don't use the
capture group anywhere, so, we just ensure `:: error` is not a match
but `x: error` is.

After going from O(n^2) to O(n), the 15MB mpich build log is parsed
in `1.288s`, so about 200x faster.

Just to be sure I've also updated `^CMake Error.*:` to `^CMake Error`,
so that it does not match with all the possible `:`'s in the line.
Another option is to use `.*?` there to make it quit scanning as soon as
possible, but what line that starts with `CMake Error` that does not have
a colon is really a false positive...
2021-10-12 00:05:11 -07:00
Michael Kuhn
d1f3279607
installer: Support showing status information in terminal title (#16259)
Installing packages with a lot of dependencies does not have an easy way
of judging the current progress (apart from running `spack spec -I pkg`
in another terminal). This change allows Spack to update the terminal's
title with status information, including its current progress as well as
information about the current and total number of packages.
2021-10-11 17:54:59 +02:00
Harmen Stoppels
89220bc0e1
Only install env modifications in <prefix>/.spack (#24081)
- Do not store the full list of environment variables in
  <prefix>/.spack/spack-build-env.txt because it may contain user secrets.

- Only store environment variable modifications upon installation.

- Variables like PATH may still contain user and system paths to make
  spack-build-env.txt sourceable. Variables containing paths are
  modified through prepending/appending, and if we don't apply these
  to the current environment variable, we end up with statements like
  `export PATH=/path/to/spack/bin` with system paths missing, meaning
  no system binaries are in the path, which is a bad user experience.

- Do write the full environment to spack-build-env.txt in the staging dir,
  but ensure it is readonly for the current user, to make it a bit safer
  on shared systems.
2021-10-11 09:07:45 -05:00
Harmen Stoppels
c0c9ab113e
Add spack env activate --temp (#25388)
Creates an environment in a temporary directory and activates it, which
is useful for a quick ephemeral environment:

```
$ spack env activate -p --temp
[spack-1a203lyg] $ spack add zlib
==> Adding zlib to environment /tmp/spack-1a203lyg
==> Updating view at /tmp/spack-1a203lyg/.spack-env/view
```
2021-10-11 06:56:03 -04:00
Harmen Stoppels
f28b08bf02
Remove unused --dependencies flag (#25731) 2021-10-11 10:16:11 +02:00
Massimiliano Culpo
2386630e10
Remove DB reindex during a read operation (#26601)
The DB should be what is trusted for certain operations.
If it is not present when read we should assume the
corresponding store is empty, rather than trying a
write operation during a read.

* Add a unit test
* Document what needs to be there in tests
2021-10-08 22:35:23 +00:00
Harmen Stoppels
7d89a95028
Fix leaky spack.binary_distribution.binary_index in tests (#26609)
* Fix issues with leaky binary index across tests

* More rigorous binary_index reset as now other tests are failing :(
2021-10-08 13:41:47 -04:00
Tamara Dahlgren
7f2611a960
Allow Version('') and map it to the empty tuple (#25953) 2021-10-08 10:36:54 +02:00