Commit graph

5693 commits

Author SHA1 Message Date
Harmen Stoppels
e7b14dd491
database: don't warn adding missing build deps (#33361)
When installing an individual spec `spack --only=package --cache-only /xyz`
from a buildcache, Spack currently issues tons of warnings about
missing build deps (and their deps) in the database.

This PR disables these warnings, since it's fine to have a spec without
its build deps in the db (they are just "missing").
2022-10-17 18:30:19 +02:00
Harmen Stoppels
39105a3a6f
installer.py: traverse_dependencies has local deptype (#33367)
Currently `traverse_dependencies` fixes deptypes to traverse once and
for all in the recursion, but this is incorrect, since deptypes depend
on the node (e.g. if it's a dependency and cache-only, don't follow
build type edges, even if the parent is build from sources and needs
build deps.)
2022-10-17 16:14:12 +00:00
Scott Wittenburg
29df7e9be3
Support spackbot rebuilding all specs from source (#32596)
Support spackbot rebuilding all specs from source when asked (with "rebuild everything")

- Allow overriding --prune-dag cli opt with env var
- Use job variable to optionally prevent rebuild jobs early exit behavior
- ci rebuild: Use new install argument to insist deps are always installed from binary, but
package is only installed from source.
- gitlab: fix bug w/ untouched pruning
- ci rebuild: install from hash rather than json file
- When doing a "rebuild everything" pipeline, make sure that each install job only consumes
binary dependencies from the mirror being populated by the current pipeline.  This avoids
using, e.g. binaries from develop, when rebuilding everything on a PR.
- When running a pipeline to rebuild everything, do not die because we generated a hash on
the broken specs list.  Instead only warn in that case.
- bugfix: Replace broken no-args tty.die() with sys.exit(1)
2022-10-17 09:45:09 -06:00
Harmen Stoppels
e882583b01
installer.py: fix/test get_deptypes (#33363)
Fixing an oversight in https://github.com/spack/spack/pull/32537

`get_deptypes` should depend on new `package/dependencies_cache_only`
props.
2022-10-17 08:57:58 -06:00
Scott Wittenburg
1be6506e29
gitlab ci: Do not force protected build jobs to run on aws runners (#33314) 2022-10-17 07:29:56 -07:00
Harmen Stoppels
2c802c12a5
installer.py: show timers for binary install (#33305)
Print a message of the form
```
Fetch mm:ss.  Build: mm:ss.  Total: mm:ss
```
when installing from buildcache. 

Previously this only happened for source builds.
2022-10-17 15:54:40 +02:00
Jonathon Anderson
10491e98a8
CI: allow multiple matches to combine tags (#32290)
Currently "spack ci generate" chooses the first matching entry in
gitlab-ci:mappings to fill attributes for a generated build-job,
requiring that the entire configuration matrix is listed out
explicitly. This unfortunately causes significant problems in
environments with large configuration spaces, for example the
environment in #31598 (spack.yaml) supports 5 operating systems,
3 architectures and 130 packages with explicit size requirements,
resulting in 1300 lines of configuration YAML.

This patch adds a configuraiton option to the gitlab-ci schema called
"match_behavior"; when it is set to "merge", all matching entries
are applied in order to the final build-job, allowing a few entries
to cover an entire matrix of configurations.

The default for "match_behavior" is "first", which behaves as before
this commit (only the runner attributes of the first match are used).

In addition, match entries may now include a "remove-attributes"
configuration, which allows matches to remove tags that have been
aggregated by prior matches. This only makes sense to use with
"match_behavior:merge". You can combine "runner-attributes" with
"remove-attributes" to effectively override prior tags.
2022-10-15 17:29:53 +00:00
Harmen Stoppels
2f6a56a43b
depfile: update docs (#33279) 2022-10-15 06:10:05 +02:00
Adam J. Stewart
d5ebb55338
meson: remove slash in path (#33292) 2022-10-13 20:26:51 -05:00
Scott Wittenburg
7da303334e
gitlab ci: Print better information about broken specs (#33124)
When a pipeline generation job is automatically failed because it
generated jobs for specs known to be broken on develop, print better
information about the broken specs that were encountered.  Include
at a minimum the hash and the url of the job whose failure caused it
to be put on the broken specs list in the first place.
2022-10-13 16:35:07 -06:00
Harmen Stoppels
599480ae9a
Add missing upperbound to docs/spack.yaml (#33280) 2022-10-13 11:54:20 -07:00
Harmen Stoppels
5009e3d94a
env depfile: allow deps only install (#33245)
* env depfile: allow deps only install

- Refactor `spack env depfile` to use a Jinja template, making it a bit
  easier to follow as a human being.
- Add a layer of indirection in the generated Makefile through an
  `<prefix>/.install-deps/<hash>` target, which allows one to specify
  different options when installing dependencies. For example, only
  verbose/debug mode on when installing some particular spec:
  ```
  $ spack -e my_env env depfile -o Makefile --make-target-prefix example
  $ make example/.install-deps/<hash> -j16
  $ make example/.install/<hash> SPACK="spack -d" SPACK_INSTALL_FLAGS=--verbose -j16
  ```

This could be used to speed up `spack ci rebuild`:
- Parallel install of dependencies from buildcache
- Better readability of logs, e.g. reducing verbosity when installing
  dependencies, and splitting logs into deps.log and current_spec.log

* Silence please!
2022-10-12 14:30:00 -07:00
Massimiliano Culpo
7efbd7d8eb
Fix typo in docs (#33182) 2022-10-12 08:31:48 +02:00
Harmen Stoppels
926dca9e5f
Specify GCC prefix in LLVM-based compilers (#33146)
* spack.compiler.Compiler: introduce prefix property

We currently don't really have something that gives the GCC install
path, which is used by many LLVM-based compilers (llvm, llvm-amdgpu,
nvhpc, ...) to fix the GCC toolchain once and for all.

This `prefix` property is dynamic in the sense that it queries the
compiler itself. This is necessary because it's not easy to deduce the
install path from the `cc` property (might be a symlink, might be a
filename like `gcc` which works by having the compiler load a module
that sets the PATH variable, might be a generic compiler wrapper based
on environment variables like on cray...).

With this property introduced, we can clean up some recipes that have
the logic repeated for GCC.

* intel-oneapi-compilers: set --gcc-sysroot to %gcc prefix
2022-10-11 17:45:51 -06:00
Massimiliano Culpo
de8c827983
Refactor a few classes related to package repositories (#32273)
Caches used by repositories don't reference the global spack.repo.path instance
anymore, but get the repository they refer to during initialization.
 
Spec.virtual now use the index, and computation done to compute the index 
use Repository.is_virtual_safe. 

Code to construct mock packages and mock repository has been factored into 
a unique MockRepositoryBuilder that is used throughout the codebase.

Add debug print for pushing and popping config scopes.

Changed spack.repo.use_repositories so that it can override or not previous repos

spack.repo.use_repositories updates spack.config.config according to the modifications done

Removed a peculiar behavior from spack.config.Configuration where push would always 
bubble-up a scope named command_line if it existed
2022-10-11 19:28:27 +02:00
Peter Scheibel
b594c0aee0
spack diff any specs you want (#32737)
Resolves #31782

With this change, if a spec is concrete after parsing (e.g. spec.yaml
or /hash-based), then it is not disambiguated (a process which requires
(a) that the spec be installed and (b) that it be part of the
currently-active environment).

This commit allows you to:

* Diff specs from an environment regardless of whether they have
  been installed (more useful for projection/matrix-based envs)
* Diff specs read from .yaml files which may or may not be entirely
  different installations of Spack

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2022-10-11 10:03:31 -06:00
Axel Huebl
9d89dba292
Docs: Getting Started Dependencies (#32480)
* Docs: Getting Started Dependencies

Finally document what one needs to install to use Spack on
Linux and Mac :-)

With <3 for minimal container users and my colleagues with
their fancy Macs.

* Debian Update Packages: GCC, Python

- build-essential: includes gcc, g++ (thx Cory)
- Python: add python3-venv, python3-distutils (thx Pradyun)

* Add RHEL8 Dependencies
2022-10-10 23:25:37 +00:00
Brian Vanderwende
27cf8dddec
shell prompt: enclose control sequence in brackets (#33079)
When setting `PS1` in Bash, it's required to enclose non-printable characters in square brackets, so that the width of the terminal is handled correctly.

See https://www.gnu.org/software/bash/manual/bash.html#Controlling-the-Prompt
2022-10-10 07:29:58 -06:00
Adam J. Stewart
7cb745b03a
PythonPackage: fix libs/headers attributes (#32970) 2022-10-10 13:26:30 +00:00
Sergey Kosukhin
4bc8f66388
autotools: extend patching of the libtool script (#30768)
* filter_file: introduce argument 'start_at'

* autotools: extend patching of the libtool script

* autotools: refactor _patch_usr_bin_file

* autotools: improve readability of the filtering

* autotools: keep the modification time of the configure scripts

* autotools: do not try to patch directories

* autotools: explain libtool patching for posterity

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2022-10-07 22:04:44 +00:00
MatthewLieber
23f6c92f33
add compatibility for rocky8 and rhel8 (#33068) 2022-10-07 04:25:58 +00:00
Massimiliano Culpo
1a12ddbd2d
Add a warning on Python 2.7 deprecation (#33052)
Co-authored-by: alalazo <alalazo@users.noreply.github.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2022-10-06 23:42:34 +02:00
Sergey Kosukhin
a520a7ef28
tcl module template: automatically unload automatically loaded modules (#32853)
Remove `module-info mode load` condition that prevents auto-unloading when autoloading is enabled. It looks like this condition was added to work around an issue in environment-modules that is no longer necessary.

Add quotes to make is-loaded happy
2022-10-06 20:15:28 +02:00
Harmen Stoppels
fc5da74998
docs: fix deprecated use of install_tree (#33004) 2022-10-06 09:45:46 +00:00
Andrew W Elble
28de7da0cc
cuda: add v11.8.0 (#33027)
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2022-10-06 09:46:01 +02:00
Jordan Galby
6c12630e95
Optimize concurrent misc_cache provider index rebuild (#32874)
When concurrent misc_cache provider index rebuilds happen, try to
rebuild it only once, so we don't exceed misc_cache lock timeout.

For example, when using `spack env depfile`, with no previous
misc_cache, running `make -f depfile -j8` could run at most 8 concurrent
`spack install` locking on misc_cache to rebuild the provider index. If
one rebuild takes 30s, before this fix, the "worst" lock could wait up
to 30s * 7, easily exceeding misc_cache lock timeout. Now, the "worst"
lock would take 30s * 1 + ~1s * 6.
2022-10-05 06:01:59 -06:00
Chris MacMackin
53cea629b7
autotools: Filter libtools when building with dpcpp (#32876)
Due to a [known
issue](https://community.intel.com/t5/Intel-oneAPI-Data-Parallel-C/dpcpp-and-GNU-Autotools/m-p/1296985)
with dpcpp, autotool-based builds that try to use it will fail because
they try to link against temporary files that no longer exist. This
commit filters those files out of the libtools script so that linking
can work properly.
2022-10-05 11:57:37 +00:00
Greg Becker
5f59821433
BuildEnvironment: accumulate module changes to poke to all relevant modules (#32340)
Currently, module changes from `setup_dependent_package` are applied only to the module of the package class, but not to any parent classes' modules between the package class module and `spack.package_base`.

In this PR, we create a custom class to accumulate module changes, and apply those changes to each class that requires it. This design allows us to code for a single module, while applying the changes to multiple modules as needed under the hood, without requiring the user to reason about package inheritance.
2022-10-04 13:06:50 -07:00
Todd Gamblin
8c50b44bfe
find/list: display package counts last (#32946)
* find/list: display package counts last

We have over 6,600 packages now, and `spack list` still displays the number of packages
before it lists them all. This is useless for large sets of results (e.g., with no args)
as the number has scrolled way off the screen before you can see it. The same is true
for `spack find` with large installations.

This PR changes `spack find` and `spack list` so that they display the package count
last.

* add some quick testing

Co-authored-by: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com>
2022-10-04 10:56:46 -07:00
Adam J. Stewart
450a3074e2
Fix typo in documentation (#32984) 2022-10-04 19:54:40 +02:00
John W. Parent
5a0f4970df
Fixup errors introduced by Clingo Pr: (#32905)
* re2c depends on cmake on Windows
* Winbison properly added to bootstrap package search list
2022-10-02 17:44:05 -07:00
Greg Becker
deae0c48e4
develop: canonicalize dev paths and base relative paths on env.path (#30075)
Allow environment variables and spack-specific path substitution variables (e.g. `$spack`) to be
used in the paths associated with develop specs, while maintaining the ability to keep those
paths relative to the environment rather than the working directory.
2022-09-30 20:56:53 +00:00
kwryankrattiger
a01c36da45
Install: Add use-buildcache option to install (#32537)
Install: Add use-buildcache option to install

* Allow differentiating between top level packages and dependencies when
determining whether to install from the cache or not.

* Add unit test for --use-buildcache

* Use metavar to display use-buildcache options.

* Update spack-completion
2022-09-29 13:48:06 -05:00
John W. Parent
650a668a9d
Windows: Support for Clingo and dependencies (#30690)
Make it possible to install the Clingo package on Windows; this
also provides a means to use Clingo with Spack on Windows.

This includes

* A new "winbison" package: Windows has a port of bison and flex where
  the two packages are grouped together. Clingo dependencies have been
  updated to use winbison on Windows and bison elsewhere (this avoids
  complicating the existin bison/flex packages until we can add support
  for implied virtuals).
* The CMake build system was incorrectly converting CMAKE_INSTALL_PREFIX
  to POSIX format.
* The re2c package has been modified to use CMake on Windows; for now
  this is done by overloading the configure/build/install methods to
  perform CMake-appropriate operations; the package should be refactored
  once support for multiple build systems in one Package is available.
2022-09-28 09:54:00 -06:00
Massimiliano Culpo
63dca0c6cc
Remove mentions of "best-effort" matrix expansion in the docs (#32755)
closes #20340
2022-09-28 09:15:36 +02:00
Alex Hornburg
67717c569e
shell.py: fix undefined variable in csh deactivate (#32816)
This commit fixes #27027.

The root cause of the issue is that the `SPACK_OLD_PROMPT` variable
was evaluated in string interpolation regardless of whether the
guard condition above evaluates to true or false. This commit uses
the `eval` keyword to defer evaluation until the command is executed.

Co-authored-by: Alexander Hornburg <alexande@xilinx.com>
2022-09-27 12:32:42 -07:00
Chris White
777271da18
improve lexing error (#32832) 2022-09-26 22:47:45 +00:00
John W. Parent
30f6fd8dc0
Fetching/decompressing: use magic numbers (#31589)
Spack currently depends on parsing filenames of downloaded files to
determine what type of archive they are and how to decompress them.
This commit adds a preliminary check based on magic numbers to
determine archive type (but falls back on name parsing if the
extension type cannot be determined).

As part of this work, this commit also enables decompression of
.tar.xz-compressed archives on Windows.
2022-09-26 00:01:42 -07:00
Tamara Dahlgren
4751881fd1
Fix two docstring typos (#32751) 2022-09-23 11:17:01 -07:00
Peter Scheibel
0a050785e9
Skip all tests using problematic fixture on python 2.7 (#32768) 2022-09-23 09:29:48 +02:00
Peter Scheibel
4094e59ab8
Fetching: log more exceptions (#32736)
Include exception info related to url retrieval in debug messages
which otherwise would be swallowed. This is intended to be useful
for detecting if CA configuration interferes with downloads from
HTTPS links.
2022-09-22 10:54:52 -07:00
Tamara Dahlgren
54d06fca79
Add hash hint to multi-spec message (#32652) 2022-09-22 09:18:43 +02:00
Massimiliano Culpo
7e01a1252a
Allow conditional variants as first values in a variant directive (#32740) 2022-09-21 19:22:58 +02:00
Tamara Dahlgren
f12ececee5
Docs: Update pipeline ci rebuild to add --tests (plus fixed typos) (#32048) 2022-09-21 14:23:58 +02:00
Manuela Kuhn
d4c13b0f8f
Add skip_import to PythonPackage and use it in py-nilearn (#32664)
* Add skip_import to PythonPackage and use it in py-nilearn

* Fix dependencies
2022-09-17 23:02:30 +00:00
Todd Gamblin
a0c7209dc1
bugfix: package hash should affect process, dag, and dunder hashes (#32516)
This fixes a bug where two installations that differ only by package hash will not show
up in `spack find`.

The bug arose because `_cmp_node` on `Spec` didn't include the package hash in its
yielded fields. So, any two `Spec` objects that were only different by package hash
would appear to be equal and would overwrite each other when inserted into the same
`dict`. Note that we could still *install* specs with different package hashes, and they
would appear in the database, but we code that needed to put them into data structures
that use `__hash__` would have issues.

This PR makes `Spec.__hash__` and `Spec.__eq__` include the `process_hash()`, and it
makes `Spec._cmp_node` include the package hash. All of these *should* include all
information in a spec so that we don't end up in a situation where we are blind to
particular field differences.

Eventually, we should unify the `_cmp_*` methods with `to_node_dict` so there aren't two
sources of truth, but this needs some thought, since the `_cmp_*` methods exist for
speed. We should benchmark whether it's really worth having two types of hashing now
that we use `json` instead of `yaml` for spec hashing.

- [x] Add `package_hash` to `Spec._cmp_node`
- [x] Add `package_hash` to `spack.solve.asp.spec_clauses` so that the `package_hash`
      will show up in `spack diff`.
- [x] Add `package_hash` to the `process_hash` (which doesn't affect abstract specs
      but will make concrete specs correct)
- [x] Make `_cmp_iter` report the dag_hash so that no two specs with different
      process hashes will be considered equal.
2022-09-16 00:57:10 +00:00
John W. Parent
deca34676f
Bugfix: find_libraries (#32653)
53a7b49 created a reference error which broke `.libs` (and
`find_libraries`) for many packages. This fixes the reference
error and improves the testing for `find_libraries` by actually
checking the extension types of libraries that are retrieved by
the function.
2022-09-14 14:45:42 -06:00
Peter Scheibel
7971985a06
Manifest parsing: skip invalid manifest files (#32467)
* catch json schema errors and reraise as property of SpackError
* no need to catch subclass of given error
* Builtin json library for Python 2 uses more generic type
* Correct instantiation of SpackError (requires a string rather than an exception)
* Use exception chaining (where possible)
2022-09-14 13:02:51 -07:00
psakievich
045a5e80cb
Allow version to accept the '=' token without activating lexer switch (#32257) 2022-09-14 10:16:28 -07:00
Sam Broderick
d6a3ffc301
Update module_file_support.rst (#32629)
Missing lead in "This may to inconsistent modulfiles if..."
2022-09-14 01:41:50 +00:00