Commit graph

4685 commits

Author SHA1 Message Date
Massimiliano Culpo
e80276cd14
spack env deactivate/spack unload: demote warning message to debug message (#19864) 2020-11-11 12:02:03 -08:00
Adam J. Stewart
d1ca322aef
Restore spack checksum verbosity (#19480) 2020-11-11 11:26:17 -06:00
Peter Scheibel
9d5f4f9c6f
Binary caching: fix buildcache list (multiple invocations) (#19848)
When invoking "buildcache list" multiple times, the command was
reporting no specs in the cache the second time around. The
presence of an up-to-date index was causing the internal
representation to be left un-initialized.
2020-11-10 23:24:18 -08:00
Greg Becker
0183a51c6c
tutorial cmd: fix gpg invocation (#19829) 2020-11-09 21:09:36 -08:00
Adam J. Stewart
228a4d353c
Fix minor typo in function comment (#19804) 2020-11-09 20:25:45 -05:00
Emir İşman
98e709da3b
[docs] getting_started.rst: fix typo (#19815) 2020-11-09 16:31:53 -06:00
Todd Gamblin
4092c90b57
commands: add spack tutorial command (#19808)
Added a command to set up Spack for our tutorial at
https://spack-tutorial.readthedocs.io.

The command does some common operations we need first-time users to do.
Specifically:

- checks out a particular branch of Spack
- deletes spurious configuration in `~/.spack` that might be
  left over from prior parts of the tutorial
- adds a mirror and trusts its public key
2020-11-09 12:47:08 +01:00
Greg Becker
8b96e10ecc
Remove hardcoded version numbers from container logic (#19716)
Previously, we hardcoded a list of Spack versions which could be used by the containerize command.

This PR removes that list. It's a maintenance burden when cutting a release, and prevents older versions of Spack from creating containers to be used by newer versions.
2020-11-05 18:59:44 +01:00
Tamara Dahlgren
619eb6c08b
bug fix: Display error when curl is missing even in non-debug mode (#19695) 2020-11-04 15:47:08 -08:00
Shahzeb Siddiqui
75e73d7fcc
documentation: fix formatting of code-block section (#19693) 2020-11-03 12:15:46 +01:00
Todd Gamblin
ecc3bfd484
Bugfix - hashing: don't recompute full_hash or build_hash (#19672)
There was an error introduced in #19209 where `full_hash()` and
`build_hash()` are called on older specs that we've read in from the DB;
older specs may not be able to compute these hashes (e.g. if they have
removed patches used in computing the full_hash).

When serializing a Spec, we want to generate the full/build hash when
possible, but we need a mechanism to skip it for Specs that have
themselves been read from YAML (and may not support this).

To get around this ambiguity and to fix the issue, we:

- Add an attribute to the spec called `_hashes_final`, that is `True`
  if we can't lazily compute `build_hash` and `full_hash`.
- Set `_hashes_final` to `False` for new specs (i.e., lazily
  computing hashes is ok)
- Set `_hashes_final` to `True` for concrete specs read in via
  `from_node_dict`, as it may be too late to recompute hashes.
- Compute and write out all hashes in `node_dict_with_hashes` *if
  possible*.

Effectively what this means is that we can round-trip specs that are
missing `_build_hash` and `_full_hash` without recomputing them, but for
all new specs, we'll compute them and store them. So Spack should work
fine with old DBs now.
2020-11-02 13:21:11 -08:00
Todd Gamblin
a80d221bfa sbang: fixes for sbang relocation
This fixes sbang relocation when using old binary packages, and updates
code in `relocate.py`.

There are really two places where we would want to handle an `sbang`
relocation:

1. Installing an old package that uses `sbang` with shebang lines like
   `#!/bin/bash $spack_prefix/sbang`
2. Installing a *new* package that uses `sbang` with shebang lines like
   `#!/bin/sh $install_tree/sbang`

The second case is actually handled automatically by our text relocation;
we don't need any special relocation logic for new shebangs, as our
relocation logic already changes references to the build-time
`install_tree` to point to the `install_tree` at intall-time.

Case 1 was not properly handled -- we would not take an old binary
package and point its shebangs at the new `sbang` location. This PR fixes
that and updates the code in `relocation.py` with some notes.

There is one more case we don't currently handle: if a binary package is
created from an installation in a short prefix that does *not* need
`sbang` and is installed to a long prefix that *does* need `sbang`, we
won't do anything. We should just patch the file as we would for a normal
install. In some upcoming PR we should probably change *all* `sbang`
relocation logic to be idempotent and to apply to any sort of shebang'd
file. Then we'd only have to worry about which files to `sbang`-ify at
install time and wouldn't need to care about these special cases.
2020-11-01 16:23:48 -08:00
Massimiliano Culpo
c4aa5cb5bc
Update documentation on containers (#19631)
fixes #15183

- Moved the container related content from
  workflows.rst into containers.rst
- Deleted the docker_for_developers.rst file,
  since it describes an outdated procedure

Co-authored-by: Axel Huebl <a.huebl@hzdr.de>
Co-authored-by: Omar Padron <omar.padron@kitware.com>
2020-10-30 21:17:15 +01:00
Massimiliano Culpo
33c3c3c700
Config: cache results of get_config (#19605)
`config.get_config` now caches the results and returns the same
configuration if called multiple times with the same arguments
(i.e. the same section and scope).

As a consequence, it is expected that users will always call
update methods provided in the `config` module after changing
the configuration (even if manipulating it as a Python nested
dictionary). The following two examples should cover most
scenarios:

* Most configuration update logic in the core (e.g. relating to
  adding new compiler) should call `Configuration.update_config`
* Tests that need to change the global configuration should use the
  newly-provided `config.replace_config` function.

(if neither of these methods apply, then the essential requirement
is to use a method marked as `_config_mutator`)

Failure to call such a function after modifying the configuration
will lead to unexpected results (e.g. calling `get_config` after
changing the configuration will not reflect the changes since the
first call to get_config).
2020-10-30 13:10:45 -07:00
Massimiliano Culpo
458d88eaad
Make archspec a vendored dependency (#19600)
- Added archspec to the list of vendored dependencies
- Removed every reference to llnl.util.cpu
- Removed tests from Spack code base
2020-10-30 13:02:14 -07:00
Scott Wittenburg
31f57e56bb
Binary caching: use full hashes (#19209)
* "spack install" now has a "--require-full-hash-match" option, which
  forces Spack to skip an available binary package when the full hash
  doesn't match. Normally only a DAG-hash match is required, which
  ensures equivalent Specs, but does not account for changing logic
  inside the associated package.
* Add a local binary cache index which tracks specs that have a binary
  install available in a remote binary cache. It is updated with
  "spack buildcache list" or for a given spec when a binary package
  is retrieved for that Spec.
2020-10-30 12:53:33 -07:00
Peter Scheibel
3a863020f0
CI: disable vermin check for deprecated hash (#19612)
Spack has a fallback for hash checking with m55sums that may not be
supported in earlier versions of Python 3.x. The comments in the
Spack code acknowledge that this is best effort and may fail, but
recent vermin checks (running as part of our CI) reject this. This
disables vermin checks for that fallback.
2020-10-29 22:23:36 -07:00
Frank Willmore
c954d50998
Oneapi add compiler (#19330)
* enable flatcc to be built with gcc/9.X.X

* add static option for building libyogrt

* cleanup

* Initial working version

* rework new oneapi wrappers

* tested and removed my initials from source

* cleanup

* Update __init__.py

* remove whitespace

* working now with mods for testing, detection. Detection for oneapi is working, but entry needs to be modified to add link path for libimf.so. Cleared cruft for old Intel versions

* fixed some formatting

* cleanup

* flake8 cleanup

* flake8

* fixed syntax of compiler version detection tests

* fixed syntax of compiler version detection tests

	modified:   detection.py

* fix typo

* fixes for compilers tests

* remove erroneous tests for outdated -std= flags, remove ifx version check (output won't parse)

Co-authored-by: Frank Willmore <willmore@anl.gov>
2020-10-29 16:52:54 -05:00
Todd Gamblin
aebf20ebdc sbang: vendor sbang
`sbang` now lives at https://github.com/spack/sbang, and it has its own
test suite that's more extensive than what's in Spack. We'll leave sbang
tests to sbang from now on, and just vendor `bin/sbang` directly.
Remaining `sbang` tests have to do with patching files, not with
`sbang`'s functionality.

This update also fixes a bug with `sbang` and multiple command line
arguments that was introduced in #19529. See:
  * https://github.com/spack/sbang/pull/1
  * https://github.com/spack/sbang/pull/2

- [x] include latest `sbang` from https://github.com/spack/sbang
- [x] remove old `sbang` tests from Spack
- [x] update `COPYRIGHT` and `cmd/license.py`
2020-10-28 17:43:23 -07:00
Todd Gamblin
ec9456feb8 sbang: convert sbang script to POSIX shell
`sbang` was previously a bash script but did not need to be. This
converts it to a plain old POSIX shell script and adds some options. This
also allows us to simplify sbang shebangs to `#!/bin/sh /path/to/sbang`
instead of `#!/bin/bash /path/to/sbang`.

The new script passes shellcheck (with a few exceptions noted in the file)

- [x] `SBANG_DEBUG` env var enables printing what *would* be executed
- [x] `sbang` checks whether it has been passed an option and fails gracefully
- [x] `sbang` will now fail if it can't find a second shebang line, or if
      the second line happens to be sbang (avoid infinite loops)
- [x] add more rigorous tests for `sbang` behavior using `SBANG_DEBUG`
2020-10-27 13:59:46 -07:00
Toyohisa Kameyama
bb00b1a7c9
sbang: add support for php (#18299)
PHP supports an initial shebang, but its comment syntax can't handle our 2-line
shebangs. So, we need to embed the 2nd-line shebang comment to look like a
PHP comment:

    <?php #!/path/to/php ?>

This adds patching support to the sbang hook and support for
instrumenting php shebangs.

This also patches `phar`, which is a tool used to create php packages.
`phar` itself has to add sbangs to those packages (as phar archives
apparently contain UTF-8, as well as binary blobs), and `phar` sets a
checksum based on the contents of the package.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-10-26 22:11:43 -07:00
Patrick Gartung
1c2c30a139
sbang: put sbang in the install_tree (#11598)
`sbang` is not always accessible to users of packages, e.g., if Spack
is installed in someone's home directory and they deploy software
for others.  Avoid this by:

1. Always installing the `sbang` script in the `install_tree`
2. Relocating binaries to point to the copy in the `install_tree` 
   and not the one in the Spack installation.

This PR also:
- ensures that `sbang` is reinstalled if it is modified in Spack
- adds tests
- updates the way `gobject-introspection` patches Makefiles
   to support `sbang`

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-10-26 12:37:54 -07:00
Todd Gamblin
fd6c163e02
bugfix: test_push_and_fetch_keys should be skipped w/o gpg (#19511)
- [x] add a `@pytest.skipif` decorator
2020-10-26 07:24:49 -07:00
Todd Gamblin
01953dc513
bugfix: fix config merge order for OrderdDicts (#18482)
The logic in `config.py` merges lists correctly so that list elements
from higher-precedence config files come first, but the way we merge
`dict` elements reverses the precedence.

Since `mirrors.yaml` relies on `OrderedDict` for precedence, this bug
causes mirrors in lower-precedence config scopes to be checked before
higher-precedence scopes.

We should probably convert `mirrors.yaml` to use a list at some point,
but in the meantie here's a fix for `OrderedDict`.

- [x] ensuring that keys are ordered correctly in `OrderedDict` by
      re-inserting keys from the destination `dict` after adding the keys from
      the source `dict`.

- [x] also simplify the logic in `merge_yaml` by always reinserting
      common keys -- this preserves mark information without all the special
      cases, and makes it simpler to preserve insertion order.

Assuming a default spack configuration, if we run this:

```console
$ spack mirror add foo https://bar.com
```

Results before this change:

```console
$ spack config blame mirrors
---                                                          mirrors:
/Users/gamblin2/src/spack/etc/spack/defaults/mirrors.yaml:2    spack-public: https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/
/Users/gamblin2/.spack/mirrors.yaml:2                          foo: https://bar.com
```

Results after:

```console
$ spack config blame mirrors
---                                                          mirrors:
/Users/gamblin2/.spack/mirrors.yaml:2                          foo: https://bar.com
/Users/gamblin2/src/spack/etc/spack/defaults/mirrors.yaml:2    spack-public: https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/
```
2020-10-24 16:48:04 -07:00
Todd Gamblin
2893c23e7c
docs: update docs on shell support and using packages (#19486)
Shell integration no longer requires setting `SPACK_ROOT`, so we can
simplify the documentation on it. The docs on shell support and using
packages are getting a bit old, and information on `spack load` (which
seems to be everyone's most common way of using packages) is hard to
find.

This PR simplifies the shell documentation to remove SPACK_ROOT, and also
moves some sections around for clearer organization.

- [x] make docs on sourcing setup scripts clearer and simpler

- [x] introduce `spack load` early in the basic usage guide instead of
      burying it in the module docs

- [x] clean up module docs so that spack module tcl loads comes later

- [x] be clear about the different ways to use packages so that the users
      can find the docs better.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-10-23 22:16:01 -07:00
Todd Gamblin
560beb098e
csh: don't require SPACK_ROOT for sourcing setup-env.csh (#18225)
Don't require SPACK_ROOT for sourcing setup-env.csh and make output more consistent
2020-10-23 18:54:34 -07:00
Massimiliano Culpo
4ec404dfc0
Add scratch module roots to test configuration (#19477)
fixes #19476

Module file content is written to file in a
temporary location and read back to be analyzed
by unit tests.

The approach to patch "open" and write to a
StringIO in memory has been abandoned, since
over time other operations insisting on the
filesystem have been added to the module file
generator.
2020-10-22 13:59:39 -07:00
Todd Gamblin
8060cca494
tests: increase tolerance of termios tests (#19456)
Synchronization on GitHub macOS runners seems to be very slow, and
frequently the foreground/background tests fail due to the race this
causes. This increases the tolerance for slowness a bit more, to allow up
to 4 spurious output lines in the tests.

This should hopefully result in no more false negatives on these tests
for macOS on GitHub.
2020-10-21 18:12:48 -07:00
Tamara Dahlgren
e78764caa1
Added _poll_lock exception tests (#19446) 2020-10-21 17:32:04 -07:00
iarspider
399ca3b671
Add qgraf (#19404)
* Add recipe for qgraf

* Revert "Add recipe for qgraf"

This reverts commit 76783f73867a32b4a96e980e31a433ed3c0037fd.

* Add qgraf

* Update package.py

Changes from review

* Changes from MR

* Fix for URLs containing @ symbol

Co-authored-by: Ivan Razumov <ivan.razumov@cern.ch>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-10-21 19:16:11 -05:00
Massimiliano Culpo
c696518efd
Skip malformed spec strings when searching for externals (#19438)
fixes #19266

fzf search method has also been updated

Co-authored-by: Tom Scogland <tom.scogland@gmail.com>
2020-10-21 21:35:02 +02:00
Omri Mor
1147220b9b
CMakePackage: added 'ipo' variant (#18374)
+ipo sets CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
The option is not supported for CMake < 3.9
2020-10-21 11:09:45 +02:00
Massimiliano Culpo
bed929e7a9
Make url_fetch test independent of locale settings (#19390) 2020-10-21 09:18:50 +02:00
Greg Becker
a5faf7d27a
Change 'any' to wildcard for variants (#19381) 2020-10-21 08:05:29 +02:00
Massimiliano Culpo
a51702e3a2
py-archspec: added new package at v0.1.1 (#19395) 2020-10-20 18:40:31 +02:00
GaneshPrasadMA
0253f0af29
Adding AOCC compiler to SPACK community (#19345)
* Adding AOCC compiler to SPACK community

The AOCC compiler system offers a high level of advanced optimizations, multi-threading and processor support that includes global optimization, vectorization, inter-procedural analyses, loop transformations, and code generation. AMD also provides highly optimized libraries, which extract the optimal performance from each x86 processor core when utilized. The AOCC Compiler Suite simplifies and accelerates development and tuning for x86 applications.

* Added unit tests for detection and flags for AOCC

* Addressed reviewers comments w.r.t version checks and url,checksum related line lengths

Co-authored-by: Test User <spack@example.com>
2020-10-20 10:50:09 -05:00
Greg Becker
bf47045302
Fix python scripts relying on external python in env (#19241) 2020-10-20 10:09:13 +02:00
Scott Wittenburg
f561d3845b
Fix "buildcache update-index --keys ..." when mirror is S3 (#19141) 2020-10-19 15:24:41 -06:00
Sergey Kosukhin
fd7bfb1a50
filter_compiler_wrappers: a fix for NAG (#17133) 2020-10-18 23:18:18 -05:00
elsagermann
4750d479a0
Add testing option to dev-build command (#17293)
* ADD: testing to dev-build command

* RM: mutally exclusive group for testing in parser

* FIX: test option to subparser and not testing

* ADD: spack-completion.bash

* RM: local devbuildcosmo cmd

* FIX: bad merge --drop-in -b --before options forgotten

* FIX: --test place in spack-completion.bash

* FIX: typo

* FIX: blank line removing

* FIX: trailing white space

Co-authored-by: Elsa Germann <egermann@tsa-ln002.cm.cluster>
2020-10-18 23:17:07 -05:00
Wouter Deconinck
9471e9cb03
[docs] Pkg list: current version, not latest release (#18213)
The package list at https://spack.readthedocs.io/en/latest/package_list.html claims "it is automatically generated based on the packages in the latest Spack release" but it is actually based on the develop branch. This leads to confusion when users find that e.g. herwigpp is included in the list, but it cannot be found when they install the latest release. That latest release has a package list at https://spack.readthedocs.io/en/stable/package_list.html which does indeed not include herwigpp.

Changing the language from "the latest Spack release" to "this Spack version" might make that clearer. Maybe.
2020-10-18 23:11:20 -05:00
Jason Miller
25f817b8ae
Fix for buildcache -o (#19354)
* Fix for buildcache -o

The method has more positional arguments than the caller expects.

* Address length issue.

Fix pylint/flake errors.
2020-10-18 19:40:28 -05:00
Omri Mor
bff0291dac
Spec: fix multiple generator iteration in satisfies_dependencies (#18527) (#18559) 2020-10-17 11:40:31 +02:00
Scott McMillan
a612be1c98
New compiler: nvhpc (NVIDIA HPC SDK) (#19294)
* Add nvhpc compiler definition: "spack compiler add" will now look
  for instances of the NVIDIA HPC SDK compiler executables
  (nvc, nvc++, nvfortran) in supplied paths
* Add the nvhpc package which installs the nvhpc compiler
* Add testing for nvhpc detection and C++-standard/pic flags

Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
2020-10-16 14:04:27 -07:00
iarspider
8c7385096e
spack external find: fix debug output (#19342)
Output was, e.g. `Executables in /bin and /,u,s,r,/,b,i,n are both associated with the same spec xz@5.2.2`, will be `Executables in /bin and /usr/bin are both associated with the same spec xz@5.2.2`.
2020-10-16 16:46:41 +02:00
Toyohisa Kameyama
a481087695
autotools: recursively patch config.guess and config.sub (#18347)
Previously config.guess and config.sub were patched only
in the root of the source path. 

This modification extend the previous behavior to patch every
config.guess or config.sub file even in subfolders, if need be.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-10-16 11:30:06 +02:00
Greg Becker
7a6268593c
Environments: specify packages for developer builds (#15256)
* allow environments to specify dev-build packages

* spack develop and spack undevelop commands

* never pull dev-build packges from bincache

* reinstall dev_specs when code has changed; reinstall dependents too

* preserve dev info paths and versions in concretization as special variant

* move install overwrite transaction into installer

* move dev-build argument handling to package.do_install

now that specs are dev-aware, package.do_install can add
necessary args (keep_stage=True, use_cache=False) to dev
builds. This simplifies driving logic in cmd and env._install

* allow 'any' as wildcard for variants

* spec: allow anonymous dependencies

raise an error when constraining by or normalizing an anonymous dep
refactor concretize_develop to remove dev_build variant
refactor tests to check for ^dev_path=any instead of +dev_build

* fix variant class hierarchy
2020-10-15 17:23:16 -07:00
Tomoki, Karatsu
72f431b67b
autotools.py: fix the list of objects to be removed from libtool (Fujitsu). (#19303) 2020-10-14 19:01:49 +02:00
Massimiliano Culpo
b84812256d
autotools: add attribute to delete libtool archives .la files (#18850)
* autotools: add attribute to delete libtool archives .la files

According to Autotools Mythbuster (https://autotools.io/libtool/lafiles.html)
libtool archive files are mostly vestigial, but they might create issues
when relocating binary packages as shown in #18694.

For GCC specifically, most distributions remove these files with
explicit commands:

https://git.stg.centos.org/rpms/gcc/blob/master/f/gcc.spec#_1303

Considered all of that, this commit adds an easy way for each
AutotoolsPackage to remove every .la file that has been installed.
The default, for the time being, is to maintain them - to be consistent
with what Spack was doing previously.

* autotools: delete libtool archive files by default

Following review this commit changes the default for
libtool archive files deletion and adds test to verify
the behavior.
2020-10-13 09:15:48 -07:00
Massimiliano Culpo
2399c2e78d
autotools: refactor search paths for aclocal in its own method (#19258)
This commit refactors the computation of the search path
for aclocal in its own method, so that it's easier to reuse
for packages that need to have a custom autoreconf phase.

Co-authored-by: Toyohisa Kameyama <kameyama@riken.jp>
2020-10-12 16:35:52 +02:00
Tomoki, Karatsu
db16f3e0d4
autotools.py: removed some options from libtool only for Fujitsu. (#19217) 2020-10-12 14:42:49 +02:00
Adam J. Stewart
372ac4a073
Add testing for Python 3.9 (#19261) 2020-10-11 21:16:00 -07:00
Adam J. Stewart
759e8ee4c2
CUDA: update maintainers (#19262) 2020-10-11 21:11:17 -07:00
谭九鼎
5e9f4dc982
Use https for links (#19244) 2020-10-09 11:24:09 -05:00
Scott Wittenburg
438f80d19e
Revert binary distribution cache manager (#19158)
This reverts #18359 and follow-on PRs intended to address issues with
#18359 because that PR changes the hash of all specs. A future PR will
reintroduce the changes.

* Revert "Fix location in spec.yaml where we look for full_hash (#19132)"
* Revert "Fix fetch of spec.yaml files from buildcache (#19101)"
* Revert "Merge pull request #18359 from scottwittenburg/add-binary-distribution-cache-manager"
2020-10-05 16:02:37 -07:00
Scott Wittenburg
7cfdf61979
Fix location in spec.yaml where we look for full_hash (#19132)
When we attempt to determine whether a remote spec (in a binary mirror)
is up-to-date or needs to be rebuilt, we compare the full_hash stored in
the remote spec.yaml file against the full_hash computed from the local
concrete spec.  Since the full_hash moved into the spec (and is no longer
at the top level of the spec.yaml), we need to look there for it.  This
oversight from #18359 was causing all specs to get rebuilt when the
full_hash wasn't fouhd at the expected location.
2020-10-02 15:37:47 -06:00
Scott Wittenburg
a44135dccf
Update buildcache key index when we update the package index (#19117)
This changes makes sure that when we run the pipeline job that updates
the buildcache package index on the remote mirror, we also update the
key index.  The public keys corresponding to the signing keys used to
sign the package was pushed to the mirror as a part of creating the
buildcache index, so this is just ensuring those keys are reflected
in the key index.

Also, this change makes sure the "spack buildcache update-index"
job runs even when there may have been pipeline failures, since we
would like the index always to reflect the true state of the mirror.
2020-10-02 11:00:42 -06:00
Scott Wittenburg
d3d98075c5
Fix fetch of spec.yaml files from buildcache (#19101)
Since those files currently exist in buildcaches (in S3 buckets) with
potentially different content types, we should be less restrictive in
what content types we accept when attempting to fetch them.  This PR
removes the content type constraint so any file with the matching
name will be found.
2020-10-01 14:32:43 -06:00
Patrick Gartung
a2795519df
Binary caching: avoid duplicate RPATHs, unnecessary updates (#19061)
* Remove duplication of reconstructed RPATHs caused by multiple
  identical entries in prefixes dictionary
* Don't rewrite RPATHs if relative RPATHs are unchanged because the
  directory layout is unchanged
2020-10-01 13:21:02 -07:00
Patrick Gartung
a380ceb139
Buildcache: Need to check the binary is not a Mach-o binary in a linux package or an ELF binary in a macOS package. (#18670)
* Need to check the binary is not a Mach-o binary in a linux package or an ELF binary in a macOS package.

* use sys.platform

* Darwin -> darwin for sys.platform
2020-10-01 12:39:59 -05:00
Scott Wittenburg
075c3e0d92
Merge pull request #18359 from scottwittenburg/add-binary-distribution-cache-manager
Add binary distribution cache manager
2020-09-30 16:37:35 -06:00
Axel Huebl
8edb31e934
CUDA: added v11.1.0 (#19036)
Compiler conflicts have been updated accordingly
2020-09-29 11:38:56 +02:00
David Beckingsale
04771ad9f8
Fixup conflicts for CUDA 11.0.2 and GCC (#19035)
* Fixup conflicts for CUDA 11.0.2 and GCC
* Updates for ppc64le
* Fix missing "or newer"

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2020-09-28 18:01:20 -07:00
Tomoki, Karatsu
b76189a2e5
autotools: patch 'libtool' recursively in subdirectories (#18620)
Previous version was doing it only in the root build directory.
2020-09-28 10:53:56 +02:00
Adam J. Stewart
c8ac61979b
Fix usage of builtin file as variable name (#19018) 2020-09-28 07:14:39 +02:00
Omar Padron
2d93154119
Streamline key management for build caches (#17792)
* Rework spack.util.web.list_url()

list_url() now accepts an optional recursive argument (default: False)
for controlling whether to only return files within the prefix url or to
return all files whose path starts with the prefix url.  Allows for the
most effecient implementation for the given prefix url scheme.  For
example, only recursive queries are supported for S3 prefixes, so the
returned list is trimmed down if recursive == False, but the native
search is returned as-is when recursive == True.  Suitable
implementations for each case are also used for file system URLs.

* Switch to using an explicit index for public keys

Switches to maintaining a build cache's keys under build_cache/_pgp.
Within this directory is an index.json file listing all the available
keys and a <fingerprint>.pub file for each such key.

 - Adds spack.binary_distribution.generate_key_index()
   - (re)generates a build cache's key index

 - Modifies spack.binary_distribution.build_tarball()
   - if tarball is signed, automatically pushes the key used for signing
     along with the tarball
   - if regenerate_index == True, automatically (re)generates the build
     cache's key index along with the build cache's package index; as in
     spack.binary_distribution.generate_key_index()

 - Modifies spack.binary_distribution.get_keys()
   - a build cache's key index is now used instead of programmatic
     listing

 - Adds spack.binary_distribution.push_keys()
   - publishes keys from Spack's keyring to a given list of mirrors

 - Adds new spack subcommand: spack gpg publish
   - publishes keys from Spack's keyring to a given list of mirrors

 - Modifies spack.util.gpg.Gpg.signing_keys()
   - Accepts optional positional arguments for filtering the set of keys
     returned

 - Adds spack.util.gpg.Gpg.public_keys()
   - As spack.util.gpg.Gpg.signing_keys(), except public keys are
     returned

 - Modifies spack.util.gpg.Gpg.export_keys()
   - Fixes an issue where GnuPG would prompt for user input if trying to
     overwrite an existing file

 - Modifies spack.util.gpg.Gpg.untrust()
   - Fixes an issue where GnuPG would fail for input that were not key
     fingerprints

 - Modifies spack.util.web.url_exists()
   - Fixes an issue where url_exists() would throw instead of returning
     False

* rework gpg module/fix error with very long GNUPGHOME dir

* add a shim for functools.cached_property

* handle permission denied error in gpg util

* fix tests/make gpgconf optional if no socket dir is available
2020-09-25 12:54:24 -04:00
Greg Becker
f616422fd7
refactor install_tree to use projections format (#18341)
* refactor install_tree to use projections format

* Add update method for config.yaml

* add test for config update config
2020-09-25 11:15:49 -05:00
Greg Becker
5565b6494d
typo (#18845) 2020-09-21 11:54:23 -05:00
Massimiliano Culpo
fcb4dfc307
Ensure variant defaults are parsable from CLI. (#18661)
- Add a unit test to check if there are unparsable defaults
- Fix 'rust' and 'nsimd' variants
2020-09-19 07:54:26 +02:00
Greg Becker
7585b37865
do out of source builds in hashed directories (#18574) 2020-09-18 12:21:13 -07:00
Greg Becker
2e4892c111
env view failures: print underlying error message (#18713) 2020-09-18 10:21:14 -07:00
Scott Wittenburg
28ef5b1204 Do not assume we sit in the directory where the env file lives. 2020-09-14 10:37:42 -06:00
Scott Wittenburg
031490f6aa Remove :<name> interpolation, add SPACK_VERSION variables
Also fix issues with documentation to reflect changes
2020-09-14 10:37:42 -06:00
Scott Wittenburg
bf90cdd6c7 Document pipeline keys which can be global but overridden
Update pipelines documentation to describe how 'tags', 'variables',
'image', 'before_script', 'script', and 'after_script' can be
supplied at the top level, to be used by any of the runner mappings,
and also overridden by any of the runner mappings.

Also show an example of capturing the custom spack SHA at pipeline
generation time, so all jobs are sure to run with the same version
of spack, as a means to illustrate the $env:VARIABLE_NAME syntax.
2020-09-14 10:37:42 -06:00
Scott Wittenburg
d9e0718c9d Allow overridable global runner attributes 2020-09-14 10:37:42 -06:00
Scott Wittenburg
e686f1500e Update pipeline documentation to describe user-provided scripts 2020-09-14 10:37:42 -06:00
Scott Wittenburg
e18612a321 Add test for variable interpolation and scripts 2020-09-14 10:37:42 -06:00
Scott Wittenburg
2386f7582a Support variable interpolation at pipeline generation time 2020-09-14 10:37:42 -06:00
Scott Wittenburg
ace52bd476 Provide your own script, before_script, and after_script 2020-09-14 10:37:42 -06:00
Massimiliano Culpo
4ca7d46e15
Fix a typo in test/concretize.pyi (#18662) 2020-09-14 09:58:14 -05:00
Richarda Butler
8116153f2a
bugfix: include configuration ignoring files with the same basename (#18487)
* Use the config path instead of the basename

* Removing unused variables

Co-authored-by: Greg Becker <becker33@llnl.gov>

* Test
Making sure if there are 2 include config files with the same basename they are both implemented

* Edit test assert

Co-authored-by: Greg Becker <becker33@llnl.gov>
2020-09-11 16:45:36 -07:00
Massimiliano Culpo
8ad2cc2acf
Environments: Avoid inconsistent state on failed write (#18538)
Fixes #18441 

When writing an environment, there are cases where the lock file for
the environment may be removed. In this case there was a period 
between removing the lock file and writing the new manifest file
where an exception could leave the manifest in its old state (in
which case the lock and manifest would be out of sync).

This adds a context manager which is used to restore the prior lock
file state in cases where the manifest file cannot be written.
2020-09-11 10:57:29 -07:00
Rémi Lacroix
fa04ad5d92
tcl module files: fix configuration overriding (#18514)
This is a special case of overriding since each section is being matched with the current spec.

The trailing ':' for sections with override is now removed when parsing the configuration so the special handling for the modules configuration stopped working but it went unnoticed.
2020-09-09 18:05:58 +02:00
Tamara Dahlgren
88749de5c9
Clarify manual download required if unable to fetch package (#18242)
Clarify manual download required if unable to fetch (from mirror(s)); support (and tests) for package-specific download instructions
2020-09-08 17:15:48 -07:00
Richarda Butler
d721bd8070
commands: update help for spack install --yes-to-all (#18367)
`spack install --yes-to-all` doesn't actually make the build non-interactive,
but that is why people typically use it. This documents that you must also
specify `--no-checksum` for a fully non-interactive build.
2020-09-08 13:18:25 -07:00
Peter Josef Scheibel
ccd65895a6 print out debug information about which specs are applying which constraints 2020-09-08 12:19:02 -07:00
Adam J. Stewart
94e694b19f
spack docs: http -> https (#18573) 2020-09-08 20:19:20 +02:00
Rémi Lacroix
92bf9493cf
Modules: Deduplicate suffixes but don't sort them. (#18351)
* Modules: Deduplicate suffixes but don't sort them.

The suffixes' order is defined by the order in which they appear in the configuration file.

* Modules: Modify tests to use spack_yaml.load_config.

spack_yaml.load_config ensures that the configuration is stored in an ordered manner. Without this change, the behavior of the tests did not match Spack's.

* Modules: Tweak the suffixes test to better catch ordering issues.
2020-09-08 08:43:03 -06:00
Massimiliano Culpo
28c6ce9714
SpecList: remove mutable types from __init__ arguments (#18515)
fixes #18439
2020-09-07 11:53:59 -07:00
Robert Blake
ea57171712
Make spack environment configurations writable from spack external and spack compiler find (#18165)
* spack config: default modification scope can be an environment

The previous model was that environments are the highest priority config
scope for config reading operations, but were not considered for config
writing operations. Now, the active environment is the highest priority
config scope for both reading and writing operations.

Now spack config add, spack external find and spack compiler set environment 
configuration in the environment by default if an environment is active. This is a
change in default behavior for these routines, but better matches the mental
model for an environment taking precedence over the user's default config file.

* add scope argument to 'spack external find' to choose non-default scope

* Increase testing for config modifications on environments

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2020-09-05 01:12:26 -07:00
Adam J. Stewart
7d9f2bf4ed
depends_on cannot handle ^ sigil (#18220)
* depends_on cannot handle ^ sigil

* cardioid+mfem+cuda requires hypre+cuda

* Document this limitation

* Move warning message to Known Issues docs

* Better handling of parmetis dep
2020-09-03 17:31:00 -05:00
Adam J. Stewart
7728b0737b
Add new MavenPackage build system base class (#18185)
* Add new MavenPackage build system base class

* Fix flake8 and doc tests

* More specific regex

* Java 8 required for these packages
2020-09-03 17:30:39 -05:00
Massimiliano Culpo
fab2622a71
Hashing: force hash consistency for values read from config (#18446)
The 'external_modules' attribute on a Spec, when read from a YAML
configuration file, may contain extra formatting that is lost when
that Spec is written-to/read-from JSON format. This was resulting in
a hashing instability (when the Spec was read back, it would report a
different hash). This commit adds a function which removes the extra
formatting from 'external_modules' as it is passed to the Spec in
__init__ to ensure a consistent hash.
2020-09-03 10:49:36 -07:00
Adam J. Stewart
741bb9bafe
install/install_tree: glob support (#18376)
* install/install_tree: glob support

* Add unit tests

* Update existing packages

* Raise error if glob finds no files, document function raises
2020-09-03 10:47:19 -07:00
Tamara Dahlgren
84381fbc80
Bugfix: terminate if a spack.yaml include path does not exist (#18074) 2020-09-03 14:37:24 +02:00
Adam J. Stewart
443407cda5
Add new RubyPackage build system base class (#18199)
* Add new RubyPackage build system base class

* Ruby: add spack external find support

* Add build tests for RubyPackage
2020-09-02 16:26:36 -07:00
Adam J. Stewart
e58db067c3
PythonPackage: update documentation (#18181) 2020-09-02 15:05:10 -07:00
Adam J. Stewart
8eb375bf81
spack test: no gpg signing for git commits (#18454) 2020-09-02 14:48:48 -07:00
Adam J. Stewart
1992fdf712
Document test dependency type (#18365) 2020-09-02 13:46:52 -07:00
Rui Xue
d9b945f663
Mac OS: support Python >= 3.8 by using fork-based multiprocessing (#18124)
As detailed in https://bugs.python.org/issue33725, starting new
processes with 'fork' on Mac OS is not guaranteed to work in general.
As of Python 3.8 the default process spawning mechanism was changed
to avoid this issue.

Spack depends on the fork-based method to preserve file descriptors
transparently, to preserve global state, and to avoid pickling some
objects. An effort is underway to remove dependence on fork-based
process spawning (see #18205). In the meantime, this allows Spack to
run with Python 3.8 on Mac OS by explicitly choosing to use 'fork'.

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-09-02 00:15:39 -07:00
Adam J. Stewart
17f7b23783
Deprecate spack setup (#18240) 2020-09-01 18:07:48 -07:00
Patrick Gartung
ae44a8ff64
test/relocate.py: skip tests involving patchelf on macOS (#18451) 2020-09-01 14:49:05 -05:00
Adam J. Stewart
f4a37b2dc2
Remove unmatched triple quotes (#18272) 2020-08-31 13:05:07 +02:00
Greg Becker
d10dff1b89
docs: add main version to docs for develop-like versions (#18328) 2020-08-27 12:35:11 -07:00
Richarda Butler
416afa0059
docs: fix bugs in contribution, getting started guides (#18216)
Co-authored-by: Greg Becker <becker33@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-08-27 08:23:26 +02:00
Massimiliano Culpo
96ac5add9d
release procedure: add step to activate the documentation on readthedocs (#18288) 2020-08-26 12:47:47 -07:00
George Hartzell
b53b9fd17e
Fix redundant reset of terminal in prompt example (#17698)
I know that it's just an example, but I was trying to figure out what was going on and it wasn't making sense....

`tput sgr0` resets the terminal state (http://linuxcommand.org/lc3_adv_tput.php) and I can't see any reason to do it twice.  Deleting the second occurrence doesn't seem to break the fancy prompt effect.
2020-08-22 13:27:39 -05:00
Richarda Butler
d599e4d9d4
Added the file path for running a specific test (#18214) 2020-08-21 17:42:24 -05:00
Michael Kuhn
11b1ce84cf
docs: List tar and some compressors in prerequisites (#18169)
Fixes #18152
2020-08-20 17:13:47 -05:00
Greg Becker
ad9cd25285
allow external packages that violate conflicts (#18183) 2020-08-20 10:16:48 -07:00
Massimiliano Culpo
1addcff724
Test "is_extension" after a round trip to dict (#18188)
closes #3887
closes #3853
2020-08-20 08:08:49 -07:00
Greg Becker
ccf94ded67
Compilers: use Compiler._real_version for flag version checks (#18179)
Compilers can have strange versions, as the version is provided by the user.  We know the real version internally, (by querying the compiler) so expose it as a property and use it in places we don't trust the user.  Eventually we'll refactor this with compilers as dependencies, but this is the best fix we've got for now.

- [x] Make `real_version` a property and cache the version returned by the compiler
- [x] Use `real_version` to make C++ language level flags work
2020-08-19 21:56:06 -07:00
Tamara Dahlgren
1c0a92662b
Restore curl progress output (#18127)
Restores the fetching progress bar sans failure outputs; restores non-debug reporting of using fetch cache for installed packages; and adds a unit test.

* Add status bar check to test and fetch output when already installed
2020-08-19 12:10:18 -07:00
Michael Kuhn
b6321cdfa9
microarchitectures: Fix icelake (#18151)
Some of the feature flags are named differently and clwb is missing on
my i7-1065G7. cascadelake and cannonlake might have similar problems but
I do not have access to those architectures to test.
2020-08-19 11:49:43 +02:00
Massimiliano Culpo
1ed70d0e2c
'spack env update' can handle overrides (#18149)
fixes #18147

Before this commit the command erroneously reported
"Additional properties not allowed" for keys with a
double colon.
2020-08-18 17:05:25 +02:00
eugeneswalker
1b965ac507
Binary Distribution: Relocate RPATH on Cray (#18110)
* make_package_relative: relocate rpaths on cray

* relocate_package: relocate rpaths on cray

* platforms: add `binary_formats` property

We need to know which binary formats are supported on a platform so we
know which types of relocations to try. This adds a list of binary
formats to the platform and removes a bunch of special cases from
`binary_distribution.py`.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-08-17 13:21:36 -07:00
Massimiliano Culpo
395b478b1b
spack config update (bugfix): packages.yaml with empty attributes (#18057)
Before this PR, packages.yaml files that contained an
empty "paths" or "modules" attribute were not updated
correctly, since the update function was not reporting
them as changed after the update.

This PR fixes that issue and adds a unit test to
avoid regression.
2020-08-14 19:31:55 -07:00
Massimiliano Culpo
31f660bd90
Improve output of the external find command (#18017)
This commit adds output to the "spack external find"
command to inform users of the result of the operation.

It also fixes a bug introduced in #17804 due to the fact
that a function was not updated to conform to the new
packages.yaml format (_get_predefined_externals).
2020-08-13 14:36:58 -07:00
Harmen Stoppels
d6587ea365
fix buildcache create for environments with uninstalled root specs (#17859)
* Handle uninstalled rootspecs in buildcache

- Do not parse specs / find matching specs when in an environment and no
package string is provided
- Error only when a spec.yaml or spec string are not installed. In an
environment it is fine when the root spec does not exist.
- When iterating through the matched specs, simply skip uninstalled
packages
2020-08-13 09:59:20 -07:00
Massimiliano Culpo
d2f56830f1
"spack config update" can handle comments in YAML files (#18045)
fixes #18031

With this fix "spack config update" can update YAML
files that contain comments, while previously it
couldn't.
2020-08-13 09:54:07 -07:00
Todd Gamblin
b476f8aa63 Merge tag 'v0.15.4' into develop 2020-08-13 07:23:02 -07:00
Todd Gamblin
091b45c3c7 bump version number for 0.15.4 2020-08-13 00:33:31 -07:00
Massimiliano Culpo
1707448fde Move Python 2.6 unit tests to Github Actions (#17279)
* Run Python2.6 unit tests on Github Actions
* Skip url tests on Python 2.6 to reduce waiting times
* Skip foreground background tests on Python 2.6 to reduce waiting times
* Removed references to Travis in the documentation
* Deleted install_patchelf.sh (can be installed from repo on CentOS 6)
2020-08-13 00:33:31 -07:00
Patrick Gartung
4d25481473 Buildcache: bindist test without invoking spack compiler wrappers. (#15687)
* Buildcache:
   * Try mocking an install of quux, corge and garply using prebuilt binaries
   * Put patchelf install after ccache restore
   * Add script to install patchelf from source so it can be used on Ubuntu:Trusty which does not have a patchelf pat package. The script will skip building on macOS
   * Remove mirror at end of bindist test
   * Add patchelf to Ubuntu build env
   * Revert mock patchelf package to allow other tests to run.
   * Remove depends_on('patchelf', type='build') relying instead on
   * Test fixture to ensure patchelf is available.

* Call g++ command to build libraries directly during test build

* Flake8

* Install patchelf in before_install stage using apt unless on Trusty where a build is done.

* Add some symbolic links between packages

* Flake8

* Flake8:

* Update mock packages to write their own source files

* Create the stage because spec search does not create it any longer

* updates after change of list command arguments

* cleanup after merge

* flake8
2020-08-13 00:33:31 -07:00
Todd Gamblin
303882834a docs: document releases and branches in Spack
- [x] Remove references to `master` branch
- [x] Document how release branches are structured
- [x] Document how to make a major release
- [x] Document how to make a point release
- [x] Document how to do work in our release projects
2020-08-13 00:33:31 -07:00
Todd Gamblin
5b63ec8652 Remove references to master from CI
- [x] remove master from github actions
- [x] remove master from .travis.yml
- [x] make `develop` the default branch for `spack ci`
2020-08-13 00:30:51 -07:00
Massimiliano Culpo
fc94dde3fc Moved flake8, shell and documentation tests to Github Action (#17328)
* Move flake8 tests on Github Actions

* Move shell test to Github Actions

* Moved documentation build to Github Action

* Don't run coverage on Python 2.6

Since we get connection errors consistently on Travis
when trying to upload coverage results for Python 2.6,
avoid computing coverage entirely to speed-up tests.
2020-08-13 00:30:51 -07:00
Todd Gamblin
c05fa25057 bugfix: fix spack -V with releases/latest and shallow clones (#17884)
`spack -V` stopped working when we added the `releases/latest` tag to
track the most recent release. It started just reporting the version,
even on a `develop` checkout. We need to tell it to *only* search for
tags that start with `v`, so that it will ignore `releases/latest`.

`spack -V` also would print out unwanted git eror output on a shallow
clone.

- [x] add `--match 'v*'` to `git describe` arguments
- [x] route error output to `os.devnull`
2020-08-12 23:58:10 -07:00
Patrick Gartung
8e2f41fe18 Buildcache create: change NoOverwriteException back to a warning as in v0.14 (#17832)
* Change buildcache create `NoOverwriteException` back to a warning.
2020-08-12 23:58:10 -07:00
Todd Gamblin
5f8ab69396 bugfix: fix spack buildcache list --allarch
`spack buildcache list` was trying to construct an `Arch` object and
compare it to `arch_for_spec(<spec>)`. for each spec in the buildcache.
`Arch` objects are only intended to be constructed for the machine they
describe. The `ArchSpec` object (part of the `Spec`) is the descriptor
that lets us talk about architectures anywhere.

- [x] Modify `spack buildcache list` and `spack buildcache install` to
      filter with `Spec` matching instead of using `Arch`.
2020-08-12 23:58:10 -07:00
Todd Gamblin
aff0e8b592 architecture: make it easier to get a Spec for the default arch
- [x] Make it easier to get a `Spec` with a proper `ArchSpec` from an
      `Arch` object via new `Arch.to_spec()` method.

- [x] Pull `spack.architecture.default_arch()` out of
      `spack.architecture.sys_type()` so we can get an `Arch` instead of
      a string.
2020-08-12 23:58:10 -07:00
eugeneswalker
7302dd834f allow GNUPGHOME to come from SPACK_GNUPGHOME in env, if set (#17139) 2020-08-12 22:57:57 -07:00
Chris White
105caa7297
Axom + Conduit updates (#17863)
* Loosen Axom's variants, add shared variant for axom, fix clang/xlf rpath'ing problem on blueos

* Fix flake8

* Add main branch to list of known git branches
2020-08-12 20:15:59 -05:00
Harmen Stoppels
edcc334631
Respect $PATH ordering when registering compilers (#17967) 2020-08-12 13:38:08 +02:00
Massimiliano Culpo
6cda20472e
Fix loading of compiler modules on CRAY (#17984)
The modifications in 193e8333fa
introduced a bug in the loading of compiler modules, since a
function that was expecting a list of string was just getting
a string.

This commit fixes the bug and adds an assertion to verify the
prerequisite of the function.
2020-08-11 10:11:01 +02:00
Adam J. Stewart
f0c0cd5c3f
Fix typo in spack external debug msg (#17982) 2020-08-11 09:55:44 +02:00
Massimiliano Culpo
1dba0ce81b Removed references to BlueGene/Q in docs and comments 2020-08-10 17:09:09 -07:00
Massimiliano Culpo
98701279df Removed references to BlueGene/Q in core Spack 2020-08-10 17:09:09 -07:00
Massimiliano Culpo
c0d490ffbe Simplify the detection protocol for packages
Packages can implement “detect_version” to support detection
of external instances of a package. This is generally easier
than implementing “determine_spec_details”. The API for
determine_version is similar: for example you can return
“None” to indicate that an executable is not an instance
of a package.

Users may implement a “determine_variants” method for a package.
When doing external detection, executables are grouped by version
and each group results in a single invocation of “determine_variants”
for the associated spec. The method returns a string specifying
the variants for the package. The method may additionally return
a dictionary representing extra attributes for the package.

These will be stored in the spec yaml and can be retrieved
from self.spec.extra_attributes

The Spack GCC package has been updated with an implementation
of “determine_variants” which adds the following extra
attributes to the package: c, cxx, fortran
2020-08-10 11:59:05 -07:00
Massimiliano Culpo
193e8333fa Update packages.yaml format and support configuration updates
The YAML config for paths and modules of external packages has
changed: the new format allows a single spec to load multiple
modules. Spack will automatically convert from the old format
when reading the configs (the updates do not add new essential
properties, so this change in Spack is backwards-compatible).

With this update, Spack cannot modify existing configs/environments
without updating them (e.g. “spack config add” will fail if the
configuration is in a format that predates this PR). The user is
prompted to do this explicitly and commands are provided. All
config scopes can be updated at once. Each environment must be
updated one at a time.
2020-08-10 11:59:05 -07:00
Michael Kuhn
8c1329958c
Hotfix for config singleton initialization (#17263)
Fixes #17262
2020-08-10 07:48:33 +02:00
Todd Gamblin
7c9c486d07
deptypes: move deptype formatting code from Spec.format to dependency.py (#17843)
- This simplifies Spec.format somewhat
- Makes code to generate deptype strings (e.g., '[blrt]') reusable
2020-08-09 15:33:31 -07:00
Tomoki, Karatsu
c83236d3a4
Fujitsu compiler: Accept alphabet as version. (#17890)
* Fujitsu compiler: Accept alphabet as version.

* Fujitsu copiler: Updated test pattern.
2020-08-07 09:06:22 -05:00
Todd Gamblin
9dbe1d7776
bugfix: fix spack -V with releases/latest and shallow clones (#17884)
`spack -V` stopped working when we added the `releases/latest` tag to
track the most recent release. It started just reporting the version,
even on a `develop` checkout. We need to tell it to *only* search for
tags that start with `v`, so that it will ignore `releases/latest`.

`spack -V` also would print out unwanted git eror output on a shallow
clone.

- [x] add `--match 'v*'` to `git describe` arguments
- [x] route error output to `os.devnull`
2020-08-05 17:01:18 -07:00
Harmen Stoppels
c07102ac9f
Fix typo: yaml -> json (#17854) 2020-08-03 23:11:41 -05:00
Harmen Stoppels
827ca72c26
Fix docs about containers on cray (#17431)
* For detecting Cray: CRAYPE_VERSION is not used, but MODULEPATH

* Fix typo and write Cray with a capital
2020-08-03 16:16:18 -07:00
Patrick Gartung
33116d730d
Buildcache create: change NoOverwriteException back to a warning as in v0.14 (#17832)
* Change buildcache create `NoOverwriteException` back to a warning.
2020-08-02 13:52:15 -07:00
Patrick Gartung
f29dd48101 Add bindist tests for macOS. 2020-08-02 13:51:14 -07:00
Todd Gamblin
ff27233e30 bugfix: fix spack buildcache list --allarch
`spack buildcache list` was trying to construct an `Arch` object and
compare it to `arch_for_spec(<spec>)`. for each spec in the buildcache.
`Arch` objects are only intended to be constructed for the machine they
describe. The `ArchSpec` object (part of the `Spec`) is the descriptor
that lets us talk about architectures anywhere.

- [x] Modify `spack buildcache list` and `spack buildcache install` to
      filter with `Spec` matching instead of using `Arch`.
2020-08-01 08:36:12 -07:00
Todd Gamblin
0c48f0a15d architecture: make it easier to get a Spec for the default arch
- [x] Make it easier to get a `Spec` with a proper `ArchSpec` from an
      `Arch` object via new `Arch.to_spec()` method.

- [x] Pull `spack.architecture.default_arch()` out of
      `spack.architecture.sys_type()` so we can get an `Arch` instead of
      a string.
2020-08-01 08:36:12 -07:00
Massimiliano Culpo
9dbad500bc
Move Python 2.6 unit tests to Github Actions (#17279)
* Run Python2.6 unit tests on Github Actions
* Skip url tests on Python 2.6 to reduce waiting times
* Skip foreground background tests on Python 2.6 to reduce waiting times
* Removed references to Travis in the documentation
* Deleted install_patchelf.sh (can be installed from repo on CentOS 6)
2020-07-31 15:01:12 -07:00
Todd Gamblin
f24dd29cd2 Merge tag 'v0.15.3' into develop 2020-07-28 02:18:30 -07:00
Todd Gamblin
ae4bbbd241 bump version number for 0.15.3 2020-07-28 02:05:26 -07:00
Greg Becker
24bd9e3039 bugfix: allow relative view paths (#17721)
Relative paths in views have been broken since #17608 or earlier.

- [x] Fix by passing base path of the environment into the `ViewDescriptor`.
      Relative paths are calculated from this path.
2020-07-27 23:48:59 -07:00
Greg Becker
158ee6ac25
bugfix: allow relative view paths (#17721)
Relative paths in views have been broken since #17608 or earlier.

- [x] Fix by passing base path of the environment into the `ViewDescriptor`.
      Relative paths are calculated from this path.
2020-07-27 23:44:56 -07:00
Patrick Gartung
69775fcc07 Relocation of sbang needs to be done when the spack prefix changes even if the install tree has not changed. (#17455) 2020-07-27 11:38:48 -07:00
Patrick Gartung
ce772420dd Relocate rpaths for all binaries, then do text bin replacement if the rpaths still exist after running patchelf/otool (#17418) 2020-07-27 11:28:50 -07:00
Todd Gamblin
8d8cf6201b bugfix: don't redundantly print ChildErrors (#17709)
A bug was introduced in #13100 where ChildErrors would be redundantly
printed when raised during a build. We should eventually revisit error
handling in builds and figure out what the right separation of
responsibilities is for distributed builds, but for now just skip
printing.

- [x] SpackErrors were designed to be printed by the forked process, not
      by the parent, so check if they've already been printed.
- [x] update tests
2020-07-26 22:43:10 -07:00
Todd Gamblin
d351946194
bugfix: don't redundantly print ChildErrors (#17709)
A bug was introduced in #13100 where ChildErrors would be redundantly
printed when raised during a build. We should eventually revisit error
handling in builds and figure out what the right separation of
responsibilities is for distributed builds, but for now just skip
printing.

- [x] SpackErrors were designed to be printed by the forked process, not
      by the parent, so check if they've already been printed.
- [x] update tests
2020-07-26 22:41:55 -07:00
Dennis Klein
0c63c94103
Relax architecture compatibility check (#15972)
* Relax architecture compatibility check
* Add test coverage for the spack.abi module
2020-07-24 10:00:55 -07:00
Adam J. Stewart
f73a3d35a8
spack help --spec: add compiler flags (#17584) 2020-07-24 17:27:43 +02:00
Dmitriy
02f14fd857
Initialize new_specs in Environment.remove() (#17592) 2020-07-24 17:18:40 +02:00
Gregory Becker
63db5499ee Merge tag 'v0.15.2' into develop 2020-07-23 16:55:22 -07:00
Gregory Becker
3534717151 bump version number for 0.15.2 2020-07-23 16:04:08 -07:00
Chuck Atkins
547c71ad78
Revert "Add libglvnd packages/Add EGL support (#14572)" (#17682)
This reverts commit 573489db71.
2020-07-23 17:41:48 -04:00
Greg Becker
ed8250e055 cray: detect shasta os properly (#17467)
Fixes #17299

Cray Shasta systems appear to use an unmodified Sles or other Linux operating system on the backend (like Cray "Cluster" systems and unlike Cray "XC40" systems that use CNL).

This updates the CNL version detection to properly note that this is the underlying OS instead of CNL and delegate to LinuxDistro.
2020-07-23 14:01:09 -07:00
robo-wylder
40cd845479 environment-views: fix bug where missing recipe/repo breaks env commands (#17608)
* environment-views: fix bug where missing recipe/repo breaks env commands

When a recipe or a repo has been removed from Spack and an environment
is active, it causes the view activation to crash Spack before any
commands can be executed. Further, the error message it not at all clear
in explaining the issue.

This forces view regeneration to always start from scratch to avoid the
missing package recipes, and defaults add_view=False in main for views activated
by the `spack -e` option.

* add messages to env status and deactivate

Warn users that a view may be corrupt when deactivating an environment
or checking its status while active. Updated message for activate.

* tests for view checking

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2020-07-23 14:00:42 -07:00
Peter Scheibel
3b45241566 Update fetch order to match iteration order of MirrorReference (#17572) 2020-07-23 14:00:14 -07:00
Tamara Dahlgren
d5b0f85ea3 Reduce output verbosity with debug levels (#17546)
* switch from bool to int debug levels

* Added debug options and changed lock logging to use more detailed values

* Limit installer and timestamp PIDs to standard debug output

* Reduced verbosity of fetch/stage/install output, changing most to debug level 1

* Combine lock log methods; change build process install to debug

* Changed binary cache install messages to extraction messages
2020-07-23 13:59:12 -07:00
eugeneswalker
c6241e72a6 bugfix: use getattr for variation.prefix/suffix (#17669) 2020-07-23 13:56:45 -07:00
Todd Gamblin
f528022a7d bugfix: make compiler preferences slightly saner (#17590)
* bugfix: make compiler preferences slightly saner

This fixes two issues with the way we currently select compilers.

If multiple compilers have the same "id" (os/arch/compiler/version), we
currently prefer them by picking this one with the most supported
languages.  This can have some surprising effects:

* If you have no `gfortran` but you have `gfortran-8`, you can detect
  `clang` that has no configured C compiler -- just `f77` and `f90`. This
  happens frequently on macOS with homebrew. The bug is due to some
  kludginess about the way we detect mixed `clang`/`gfortran`.

* We can prefer suffixed versions of compilers to non-suffixed versions,
  which means we may select `clang-gpu` over `clang` at LLNL. But,
  `clang-gpu` is not actually clang, and it can break builds. We should
  prefer `clang` if it's available.

- [x] prefer compilers that have C compilers and prefer no name variation
  to variation.

* tests: add test for which()
2020-07-23 13:56:18 -07:00
Harmen Stoppels
665a47607e ci pipelines: activate environment without view (#17440) 2020-07-23 13:55:46 -07:00
Todd Gamblin
12958497dc bugfix: ignore Apple's "gcc" by default (#17589)
Apple's gcc is really clang. We previously ignored it by default but
there was a regression in #17110.

Originally we checked for all clang versions with this, but I know of
none other than `gcc` on macos that actually do this, so limiting to
`apple-clang` should be ok.

- [x] Fix check for `apple-clang` in `gcc.py` to use version detection
  from `spack.compilers.apple_clang`
2020-07-23 13:55:11 -07:00
Scott Wittenburg
3a8bc7ffc6 buildcache: list all mirrors even if one fails 2020-07-23 13:54:36 -07:00
Scott Wittenburg
9cbe358f84 Bugfix/install missing compiler from buildcache (#17536)
Ensure compilers installed from buildcache are registered.
2020-07-23 13:53:46 -07:00
Harmen Stoppels
24dff9cf20 Fix security issue in CI (#17545)
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
2020-07-23 13:52:09 -07:00
Sajid Ali
5e5cc99147 clear mpicc and friends before each build (#17450)
* clear mpi env vars
2020-07-23 13:48:47 -07:00
Greg Becker
44bc176d08
cray: detect shasta os properly (#17467)
Fixes #17299

Cray Shasta systems appear to use an unmodified Sles or other Linux operating system on the backend (like Cray "Cluster" systems and unlike Cray "XC40" systems that use CNL).

This updates the CNL version detection to properly note that this is the underlying OS instead of CNL and delegate to LinuxDistro.
2020-07-23 13:20:03 -07:00
robo-wylder
3c145b42bc
environment-views: fix bug where missing recipe/repo breaks env commands (#17608)
* environment-views: fix bug where missing recipe/repo breaks env commands

When a recipe or a repo has been removed from Spack and an environment
is active, it causes the view activation to crash Spack before any
commands can be executed. Further, the error message it not at all clear
in explaining the issue.

This forces view regeneration to always start from scratch to avoid the
missing package recipes, and defaults add_view=False in main for views activated
by the `spack -e` option.

* add messages to env status and deactivate

Warn users that a view may be corrupt when deactivating an environment
or checking its status while active. Updated message for activate.

* tests for view checking

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2020-07-23 11:00:58 -07:00
Peter Scheibel
ae82650174
Update fetch order to match iteration order of MirrorReference (#17572) 2020-07-23 10:58:59 -07:00
Greg Becker
e8aa737b09
util.executable.which: handle path separators like /bin/which (#17668)
* util.executable.which: handle path separators like /bin/which

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-07-23 10:54:25 -07:00
Tamara Dahlgren
605c1a76e0
Reduce output verbosity with debug levels (#17546)
* switch from bool to int debug levels

* Added debug options and changed lock logging to use more detailed values

* Limit installer and timestamp PIDs to standard debug output

* Reduced verbosity of fetch/stage/install output, changing most to debug level 1

* Combine lock log methods; change build process install to debug

* Changed binary cache install messages to extraction messages
2020-07-23 00:49:57 -07:00
eugeneswalker
f1eec05d0e
bugfix: use getattr for variation.prefix/suffix (#17669) 2020-07-22 16:15:25 -07:00
Todd Gamblin
0c44a9a504
bugfix: make compiler preferences slightly saner (#17590)
* bugfix: make compiler preferences slightly saner

This fixes two issues with the way we currently select compilers.

If multiple compilers have the same "id" (os/arch/compiler/version), we
currently prefer them by picking this one with the most supported
languages.  This can have some surprising effects:

* If you have no `gfortran` but you have `gfortran-8`, you can detect
  `clang` that has no configured C compiler -- just `f77` and `f90`. This
  happens frequently on macOS with homebrew. The bug is due to some
  kludginess about the way we detect mixed `clang`/`gfortran`.

* We can prefer suffixed versions of compilers to non-suffixed versions,
  which means we may select `clang-gpu` over `clang` at LLNL. But,
  `clang-gpu` is not actually clang, and it can break builds. We should
  prefer `clang` if it's available.

- [x] prefer compilers that have C compilers and prefer no name variation
  to variation.

* tests: add test for which()
2020-07-21 18:48:37 -07:00
Harmen Stoppels
6c69b8a4d4
ci pipelines: activate environment without view (#17440) 2020-07-21 10:15:43 -07:00
Todd Gamblin
897e80e596
bugfix: ignore Apple's "gcc" by default (#17589)
Apple's gcc is really clang. We previously ignored it by default but
there was a regression in #17110.

Originally we checked for all clang versions with this, but I know of
none other than `gcc` on macos that actually do this, so limiting to
`apple-clang` should be ok.

- [x] Fix check for `apple-clang` in `gcc.py` to use version detection
  from `spack.compilers.apple_clang`
2020-07-20 18:24:18 -07:00
Dr. Christian Tacke
bd236918dd
Configuration: allow usage of command-line scopes with environments (#14608)
Spack did not support usage of the `--config-scope` option in
combination with an environment: In `lib/spack/spack/main.py`,
`spack.config.command_line_scopes` is set equal to any config scopes
passed by the `--config-scope` option. However, this is done after
activating an environment. In the process of activating an environment,
the `spack.config.config` singleton is instantiated, so later setting of
`spack.config.command_line_scopes` is ignored.

This commit sets command line scopes before activating an environment to
ensure that they are included in the configuration.

Co-authored-by: Tim Fuller <tjfulle@sandia.gov>
2020-07-20 13:58:06 -07:00
eugeneswalker
96fa6f0c1b
allow GNUPGHOME to come from SPACK_GNUPGHOME in env, if set (#17139) 2020-07-17 13:29:30 -07:00
Scott Wittenburg
b5f82696e2
Bugfix/install missing compiler from buildcache (#17536)
Ensure compilers installed from buildcache are registered.
2020-07-17 11:13:36 -07:00
Scott Wittenburg
ae03782032 buildcache: list all mirrors even if one fails 2020-07-17 10:04:05 -06:00
Harmen Stoppels
1fcc00df96
Fix security issue in CI (#17545)
The `spack-build-env.txt` file may contains many secrets, but the obvious one is the private signing key in `SPACK_SIGNING_KEY`. This file is nonetheless uploaded as a build artifact to gitlab. For anyone running CI on a public version of Gitlab this is a major security problem. Even for private Gitlab instances it can be very problematic.

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
2020-07-16 17:27:37 -07:00
Axel Huebl
a6abd530bd
CUDA 11.0.2 (#17423)
- [x] wait for general release candidate
- [x] compute capability support
- [x] compiler conflicts
  - [x] ppc64le
- [x] new download links
2020-07-13 18:32:28 -05:00
Harmen Stoppels
2b809a5374
Add -o flag to tar decompressor (#17427)
For normal users, `-o` or `--no-same-owner` (GNU extension) is
the default behavior, but for the root user, `tar` attempts to preserve
the ownership from the tarball.

This makes `tar` use `-o` all the time.  This should improve untarring
files owned by users not available in rootless Docker builds.
2020-07-13 15:19:04 -07:00
Omar Padron
573489db71
Add libglvnd packages/Add EGL support (#14572)
* add new package: "libglvnd-frontend"

* add +glvnd variant to opengl package

* add +glvnd variant to mesa package

* add +egl variant to paraview package

* add libglvnd-frontend entries to default packages config

* fix style

* add default providers for glvnd virtuals

add default providers for glvnd-gl, glvnd-glx, and glvnd-egl

* WIP: rough start to external OpenGL documentation

* rename libglvnd-frontend package and backend virtual dependencies

* update documentation

* fix ligvnd-be-* typos

* fix libglvnd-fe package class name

* fix doc parse error
2020-07-13 11:32:36 -04:00
Greg Becker
406596af70
update docs on point releases (#17463) 2020-07-11 14:35:25 -07:00
Peter Josef Scheibel
5e50dc5acb Merge branch 'releases/v0.15' into develop 2020-07-10 23:14:36 -07:00
Peter Josef Scheibel
1741279f16 Bump version to 0.15.1; update CHANGELOG and version references 2020-07-10 16:54:49 -07:00
Greg Becker
c2393fe566 spack install: improve error message with no args (#17454)
The error message was not updated when the behavior of Spack environments
was changed to not automatically activate the local environment in #17258.
The previous error message no longer makes sense.
2020-07-10 13:05:49 -07:00
Greg Becker
afbb4a5cba installation: skip repository metadata for externals (#16954)
When Spack installs a package, it stores repository package.py files
for it and all of its dependencies - any package with a Spack metadata
directory in its installation prefix.

It turns out this was too broad: this ends up including external
packages installed by Spack (e.g. installed by another Spack instance).
Currently Spack doesn't store the namespace properly for such packages,
so even though the package file could be fetched from the external,
Spack is unable to locate it.

This commit avoids the issue by skipping any attempt to locate and copy
from the package repository of externals, regardless of whether they
have a Spack repo directory.
2020-07-10 13:05:49 -07:00
Michael Kuhn
4e4de51f0d autotools bugfix: handle missing config.guess (#17356)
Spack was attempting to calculate abspath on the located config.guess
path even when it was not found (None); this commit skips the abspath
calculation when config.guess is not found.
2020-07-10 13:05:49 -07:00
Michael Kuhn
44681dbca5 autotools: Fix config.guess detection, take two (#17333)
The previous fix from #17149 contained a thinko that produced errors for
packages that overwrite configure_directory.
2020-07-10 13:05:49 -07:00
Greg Becker
f2889e698a
spack install: improve error message with no args (#17454)
The error message was not updated when the behavior of Spack environments
was changed to not automatically activate the local environment in #17258.
The previous error message no longer makes sense.
2020-07-10 10:45:11 -07:00
Patrick Gartung
e72e2568dd
Relocation of sbang needs to be done when the spack prefix changes even if the install tree has not changed. (#17455) 2020-07-09 22:28:51 -05:00
Harmen Stoppels
84eae97f91
aspirin for buildaches (#17437) 2020-07-09 22:00:38 -05:00
Sajid Ali
12099ed55e
clear mpicc and friends before each build (#17450)
* clear mpi env vars
2020-07-09 16:14:49 -05:00
Greg Becker
d0f5b69a19
installation: skip repository metadata for externals (#16954)
When Spack installs a package, it stores repository package.py files
for it and all of its dependencies - any package with a Spack metadata
directory in its installation prefix.

It turns out this was too broad: this ends up including external
packages installed by Spack (e.g. installed by another Spack instance).
Currently Spack doesn't store the namespace properly for such packages,
so even though the package file could be fetched from the external,
Spack is unable to locate it.

This commit avoids the issue by skipping any attempt to locate and copy
from the package repository of externals, regardless of whether they
have a Spack repo directory.
2020-07-09 11:08:51 -07:00
Patrick Gartung
8c41173678
Buildcache: bindist test without invoking spack compiler wrappers. (#15687)
* Buildcache:
   * Try mocking an install of quux, corge and garply using prebuilt binaries
   * Put patchelf install after ccache restore
   * Add script to install patchelf from source so it can be used on Ubuntu:Trusty which does not have a patchelf pat package. The script will skip building on macOS
   * Remove mirror at end of bindist test
   * Add patchelf to Ubuntu build env
   * Revert mock patchelf package to allow other tests to run.
   * Remove depends_on('patchelf', type='build') relying instead on
   * Test fixture to ensure patchelf is available.

* Call g++ command to build libraries directly during test build

* Flake8

* Install patchelf in before_install stage using apt unless on Trusty where a build is done.

* Add some symbolic links between packages

* Flake8

* Flake8:

* Update mock packages to write their own source files

* Create the stage because spec search does not create it any longer

* updates after change of list command arguments

* cleanup after merge

* flake8
2020-07-08 15:05:58 -05:00
Adam J. Stewart
207e496162
spack create: ask how many to download (#17373) 2020-07-08 09:38:42 +02:00
Simon Byrne
f85da868ac
Improve Travis sample in the docs (#17420)
- printf is better than echo for multiline strings
- ** should be &&
- use line continuation
- Use multiline block
2020-07-08 07:25:37 +02:00
Patrick Gartung
7f8e827db8
Relocate rpaths for all binaries, then do text bin replacement if the rpaths still exist after running patchelf/otool (#17418) 2020-07-07 16:46:39 -05:00
Massimiliano Culpo
f4ac3770b4
CudaPackage: maintainers are listed in the docstring (#17409)
fixes #17396

This prevents the class attribute to be inherited and
saves current maintainers from becoming the default
maintainers of every Cuda package.
2020-07-07 20:45:41 +02:00
Todd Gamblin
b0506a722e
releases: document releases/latest tag (#17402)
We got rid of `master` after #17377, but users still want a way to get
the latest stable release without knowing its number.

We've added a `releases/latest` tag to replace what was once `master`.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-07-07 11:44:15 -07:00
Peter Scheibel
650ab563f4
Uninstall: tolerate hook failures when force=true (#16513)
Fixes #16478

This allows an uninstall to proceed even when encountering pre-uninstall
hook failures if the user chooses the --force option for the uninstall.

This also prevents post-uninstall hook failures from raising an exception,
which would terminate a sequence of uninstalls. This isn't likely essential
for #16478, but I think overall it will improve the user experience: if
the post-uninstall hook fails, there isn't much point in terminating a
sequence of spec uninstalls because at the point where the post-uninstall
hook is run, the spec has already been removed from the database (so it
will never have another chance to run).

Notes:

* When doing spack uninstall -a, certain pre/post-uninstall hooks aren't
  important to run, but this isn't easy to track with the current model.
  For example: if you are uninstalling a package and its extension, you
  do not have to do the activation check for the extension.
* This doesn't handle the uninstallation of specs that are not in the DB,
  so it may leave "dangling" specs in the installation prefix
2020-07-07 11:37:36 -07:00
Todd Gamblin
9ec9327f5a docs: document releases and branches in Spack
- [x] Remove references to `master` branch
- [x] Document how release branches are structured
- [x] Document how to make a major release
- [x] Document how to make a point release
- [x] Document how to do work in our release projects
2020-07-06 11:39:19 -07:00
Todd Gamblin
11088df402 Remove references to master from CI
- [x] remove master from github actions
- [x] remove master from .travis.yml
- [x] make `develop` the default branch for `spack ci`
2020-07-06 11:39:19 -07:00
Todd Gamblin
4ea76dc95c change master/child to controller/minion in pty docstrings
PTY support used the concept of 'master' and 'child' processes. 'master'
has been renamed to 'controller' and 'child' to 'minion'.
2020-07-06 11:39:19 -07:00
Michael Kuhn
516c3e659f
autotools bugfix: handle missing config.guess (#17356)
Spack was attempting to calculate abspath on the located config.guess
path even when it was not found (None); this commit skips the abspath
calculation when config.guess is not found.
2020-07-06 10:53:02 -07:00
Shahzeb Siddiqui
04f3000646
Pipelines doc: fixed two broken links (#17355) 2020-07-03 12:29:45 +02:00
Michael Kuhn
10016a34e0
autotools: Fix config.guess detection, take two (#17333)
The previous fix from #17149 contained a thinko that produced errors for
packages that overwrite configure_directory.
2020-07-02 00:45:41 -07:00
Massimiliano Culpo
a5eabfad91
Moved flake8, shell and documentation tests to Github Action (#17328)
* Move flake8 tests on Github Actions

* Move shell test to Github Actions

* Moved documentation build to Github Action

* Don't run coverage on Python 2.6

Since we get connection errors consistently on Travis
when trying to upload coverage results for Python 2.6,
avoid computing coverage entirely to speed-up tests.
2020-07-01 11:58:53 -05:00
Adam J. Stewart
6a77f1ff45
Fix hashlib function capitalization (#17323) 2020-07-01 09:46:20 -05:00
Glenn Johnson
60283775b3
Documentation update for container example (#17321)
This updates the documentation to reflect #17316.
2020-07-01 08:40:36 +02:00
Gregory Becker
49aebb44b1 bump version number 2020-06-30 18:21:32 -05:00
Massimiliano Culpo
486b4671b6
Don't detect "classic" on Cray to avoid a compiler bug (#17314)
* Don't detect "classic" on Cray to avoid a compiler bug

* add tests

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2020-06-30 15:45:29 -05:00
Johannes Blaschke
1d55adfd2b
Add fish shell support (#9279)
* share/spack/setup-env.fish file to setup environment in fish shell

* setup-env.fish testing script

* Update share/spack/setup-env.fish

Co-Authored-By: Elsa Gonsiorowski, PhD <gonsie@me.com>

* Update share/spack/qa/setup-env-test.fish

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* updates completions using `spack commands --update-completion`

* added stderr-nocaret warning

* added fish shell tests to CI system


Co-authored-by: becker33 <becker33@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Elsa Gonsiorowski, PhD <gonsie@me.com>
2020-06-30 14:26:27 -05:00
Greg Becker
212299a021
Cray compiler: fix implicit rpaths for classic versions (#17310)
* check link dirs for existence
2020-06-30 12:46:20 -05:00
Greg Becker
b52390dacc
cray compilers: fix bug with verifying cray compilers (#17303)
* fix bug with verifying cray compilers
2020-06-29 20:26:46 -05:00
Greg Becker
d71fdc9719
remove three commands that have been deprecated since v0.13.0 (#17291)
* remove three commands that have been deprecated since v0.13.0
2020-06-29 11:15:56 -05:00
Michael Kuhn
b07d38b3be
autotools: Fix config.guess detection (#17149)
The config.guess detection used a relative path that did not work in
combination with `check_call`. Use an absolute path instead.
2020-06-29 10:08:22 -05:00
Massimiliano Culpo
789d060ff6
Detect FE compilers automatically on Cray (#17267)
* cray: detect frontend compilers automatically

This commit permits to detect frontend compilers
automatically, with the exception of cce.

Co-authored-by: Gregory Becker <becker33.llnl.gov>
2020-06-29 09:53:08 -05:00
George Hartzell
e6bb8360d0
Fix indentation in containerize example (#17228)
[george.hartzell@172-16-193-97 spack-explore-docker]$ spack containerize
Running `spack containerize` with the example `spack.yaml` file fails
with an error that ends like so:

```
[...]
  File "/local_scratch/hartzell/tmp/spack-explore-docker/lib/spack/external/ruamel/yaml/scanner.py", line 165, in need_more_tokens
    self.stale_possible_simple_keys()
  File "/local_scratch/hartzell/tmp/spack-explore-docker/lib/spack/external/ruamel/yaml/scanner.py", line 309, in stale_possible_simple_keys
    "could not find expected ':'", self.get_mark())
ruamel.yaml.scanner.ScannerError: while scanning a simple key
  in "/local_scratch/hartzell/tmp/spack-explore-docker/spack.yaml", line 26, column 1
could not find expected ':'
  in "/local_scratch/hartzell/tmp/spack-explore-docker/spack.yaml", line 28, column 5
```

Indenting the block string fixes the problem for me.

CentOS 7,

```
$ spack --version
0.14.2-1529-ec58f28c2
```
2020-06-29 08:58:51 +02:00
Greg Becker
77351bd287
Restore compilers.yaml default directory (#17283) 2020-06-29 08:03:22 +02:00
Adam J. Stewart
edf776aeb9
Add support for macOS Big Sur (#17236)
* Add support for macOS Big Sur

* Big Sur is actually macOS 11.0
2020-06-27 15:07:21 -05:00
Greg Becker
56b4abbe38
env: no automatic activation (#17258)
* env: no automatic activation

* Ensure ci rebuild jobs activate the environment (no longer automagic)

Co-authored-by: Scott Wittenburg <scott.wittenburg@kitware.com>
2020-06-26 17:20:15 -05:00
Scott Wittenburg
dfac09eade
Use json for buildcache index (#15002)
* Start moving toward a json buildcache index

* Add spec and database index schemas

* Add a schema for buildcache spec.yaml files

* Provide a mode for database class to generate buildcache index

* Update db and ci tests to validate object w/ new schema

* Remove unused temporary upload-s3 command

* Use database class to generate buildcache index

* Do not generate index with each buildcache creation

* Make buildcache index mode into a couple of constructor args to Database class

* Use keyword args for  _createtarball 

* Parse new json index when we get specs from buildcache

Now that only one index file per mirror needs to be fetched in
order to have all the concrete specs for binaries available on the
mirror, we can just fetch and refresh the cached specs every time
instead of needing to use the '-f' flag to force re-reading.
2020-06-26 17:05:56 -05:00
Greg Becker
c39983eb1a
build_environment: verify compiler executables exist are are accessible (#17260)
* build_environment: verify compiler executables exist and are accessible

* fix existing tests

* test compiler executable verification
2020-06-26 16:12:22 -05:00
Omar Padron
1ed035def6
fix sorting issue with ci workarounds (#17277) 2020-06-26 14:24:08 -05:00
cedricchevalier19
529c659bd0
First fix for SPACK_DEPENDENCIES problem when doing setup (#10715)
* First fix for SPACK_DEPENDENCIES problem when doing setup

* Get rid of transitive include path in setup.

* Export SPACK_INCLUDE_DIRS into spconfig.py
2020-06-26 14:06:43 -05:00
eugeneswalker
d8da1e6dbc
spack ci generate: allow use of --output-file <file> with wo/ preceding path (#17275) 2020-06-26 11:18:29 -07:00
Jeffrey Salmond
1602b7a561
add environment-awareness to buildcache create (#16580)
* add buildcache create test

* add functionality and test to create buildcache from environment

* use env.concretized_user_specs rather than env.roots to get concretized specs, as suggested in review from becker33
2020-06-26 10:01:12 -05:00
Greg Becker
ec108dbebd
Allow spack remove -f and spack uninstall to work on matrices (#17222)
* Allow `spack remove -f` and `spack uninstall` to work on matrices

Allow Environment.remove(force=True) to remove the concrete spec from the environment
even when the user spec cannot be removed because it is in a matrix.
2020-06-26 09:57:22 -05:00
Massimiliano Culpo
c401c63156
Allow detection for "-classic" version of CCE (#17256)
* cce: detect modules based on the classic backend

* cce: tweaked version checks for clang based options

* Added unit test for cce flags
2020-06-25 21:20:09 -05:00
Omar Padron
7c54aa2eb0
add workaround for gitlab ci needs limit (#17219)
* add workaround for gitlab ci needs limit

* fix style/address review comments

* convert filter obj to list

* update command completion

* remove dict comprehension

* add workaround tests

* fix sorting issue between disparate types

* add indeces to format
2020-06-25 14:27:20 -04:00
Greg Becker
096bd69a94
prevent multiple version sigils in the same spec (#17246)
* prevent multiple version sigils in the same spec

* fix packages with malformed versions
2020-06-25 12:34:09 -05:00
Greg Becker
f936e3a1db
environment spec lists: improve ability to query architecture in when clauses (#17056) 2020-06-25 19:13:26 +02:00
Massimiliano Culpo
14599f09be
Separate Apple Clang from LLVM Clang (#17110)
* Separate Apple Clang from LLVM Clang

Apple Clang is a compiler of its own. All places
referring to "-apple" suffix have been updated.

* Hack to use a dash in 'apple-clang'

To be able to use autodoc from Sphinx we need
a valid Python name for the module that contains
Apple's Clang code.

* Updated packages to account for the existence of apple-clang

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Added unit test for XCode related functions

Co-authored-by: Gregory Becker <becker33@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-06-25 11:18:48 -05:00
Peter Scheibel
a31c115d79
Fix global activation check for upstream extendees (#17231)
* short-circuit is_activated check when the extendee is installed upstream

* add test for checking activation status of packages with an extendee installed upstream
2020-06-25 08:27:27 -05:00
Greg Becker
b26e93af3d
spack config: new subcommands add/remove (#13920)
spack config add <value>: add nested value value to the configuration scope specified
spack config remove/rm: remove specified configuration from the relevant scope
2020-06-25 09:38:01 +02:00
Tamara Dahlgren
48d3e8d350
features: Add install failure tracking removal through spack clean (#15314)
* Add ability to force removal of install failure tracking data through spack clean

* Add clean failures option to packaging guide
2020-06-24 20:28:53 -05:00
Sergey Kosukhin
bc53bb9b7c
Unset environment variables that are most commonly used by Autotools packages. (#8623) 2020-06-24 10:39:04 -05:00
Tom Payerle
fd710fc93e
Some minor fixes to set_permissions() in file_permissions.py (#17020)
* Some minor fixes to set_permissions() in file_permissions.py

The set_permissions() routine claims to prevent users from creating
world writable suid binaries.  However, it seems to only be checking
for/preventing group writable suid binaries.

This patch modifies the routine to check for both world and group
writable suid binaries, and complain appropriately.

* permissions.py: Add test to check blocks world writable SUID files

The original test_chmod_rejects_group_writable_suid tested
that the set_permissions() function in
lib/spack/spack/util/file_permissions.py
would raise an exception if changed permission on a file with
both SUID and SGID plus sticky bits is chmod-ed to g+rwx and o+rwx.

I have modified so that more narrowly tests a file with SUID
(and no SGID or sticky bit) set is chmod-ed to g+w.

I have added a second test test_chmod_rejects_world_writable_suid
that checks that exception is raised if an SUID file is chmod-ed
to o+w

* file_permissions.py: Raise exception when try to make sgid file world writable

Updated set_permissions() in file_permissions.py to also raise
an exception if try to make an SGID file world writable.  And
added corresponding unit test as well.

* Remove debugging prints from permissions.py
2020-06-23 19:50:19 -05:00
Tamara Dahlgren
e74c8e71cc
tests: check rpath presence not equality (#17216) 2020-06-23 17:17:35 -05:00
Matthias Wolf
0b57567824
Module index should not be unconditionally overwritten (#14837)
* Module index should not be unconditionally overwritten

Uncovered after we switched our CI to generate modules for packages
one-by-one rather than in bulk. This overwrote a complete module index
with an index with a single entry, and broke our downstream Spack
instances that needed the upstream module index.
2020-06-23 15:38:04 -05:00
Tamara Dahlgren
96932d65a8 Added support for --fail-fast install option to terminate on first failure 2020-06-23 10:22:41 -07:00
Tamara Dahlgren
f54a8a77b4 Allow a single ctrl-c to terminate an install in progress 2020-06-23 10:22:41 -07:00
Greg Becker
9067378c24
fix compiler environment handling to reset environment after (#17204)
bugfix: fix compiler environment handling to reset environment after
2020-06-23 09:26:15 -07:00
Omar Padron
224dc95159
Pre ci optimization (#16372)
* add initial optimization script

* integrate optimization in spack ci

* make optimization opt-in

* fix import error

* flake8 fixes

* update command completion

* work around vermin errors

* fix sphynx errors
2020-06-22 13:19:47 -04:00
Joseph Ciurej
42f2c168d2
swig: fix older builds on newer platforms by updating config files (#16854)
* swig: revise 'autotools' automated 'config.*' update mechanism to support 'config.sub' and adapt 'swig' accordingly
2020-06-22 10:44:29 -05:00
Axel Huebl
2fd3ab3c9c
Fetching from urls: Error Message (#16434)
* Fetching from urls: Error Message

Fix the error message when fetching from consecutive `urls` of a
package version. Each fail should show the currently failing URL,
not the first url.

Example multi-problem run that occured in real life:
```
==> 5821: Installing util-macros
curl: (28) Connection timed out after 10000 milliseconds
curl: (16) Error in the HTTP2 framing layer
curl: (22) The requested URL returned error: 403 Forbidden
==> Fetching https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2
==> Failed to fetch file from URL: https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2
    Curl failed with error 28
==> Fetching https://mirrors.ircam.fr/pub/x.org/individual/util/util-macros-1.19.1.tar.bz2
==> Failed to fetch file from URL: https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2
    Curl failed with error 16
==> Fetching http://xorg.mirrors.pair.com/individual/util/util-macros-1.19.1.tar.bz2
==> Failed to fetch file from URL: https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2
    URL https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2 was not found!
==> Fetching from https://www.x.org/archive/individual/util/util-macros-1.19.1.tar.bz2 failed.
==> Error: FetchError: All fetchers failed for spack-stage-util-macros-1.19.1-se2a2e74oyusj2r4esgcb7pr3qhh45ef
```

- `urls[0]`: HTTP2 layer error
- `urls[1]`: timeout
- `urls[2]`: missing file on mirror

* x.org: two more mirrors

x.org mirrors are a bit tricky, since many are out-of-sync or off.
A good package to test with is `util-macros`, which had a "recent"
release.
2020-06-18 10:37:32 +02:00
Adam J. Stewart
1f85d6eceb
Docs: fix rst link to spack ci (#17147) 2020-06-18 09:44:03 +02:00
Greg Becker
5b59e883c1
cray module do not work without CRAY_LD_LIBRARY_PATH (#17031)
Co-authored-by: Gregory Becker <becker33.llnl.gov>
2020-06-17 15:53:30 -07:00
Axel Huebl
896a14af82
Doc: E4S Build Cache Link (#16986)
Link to the E4S build cache in the according section of the docs.
2020-06-16 15:53:34 -07:00
psakievich
dc31afe67d
Yaml spec parsing corner case (#17101)
* Catch yaml filename corner case in spec parser

* improved regex and remove redundant error checking

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2020-06-16 13:27:33 -05:00
Massimiliano Culpo
5fc88a7c65
Skip failing test on MacOS (#17072)
* Skip failing test on MacOS

* Update setup-python action and unpin coverage
2020-06-15 13:24:56 -05:00
Greg Becker
58332d028e
clang: add 'version_argument', remove redundant method (#17071) 2020-06-13 15:31:24 +02:00
Patrick Gartung
08c21e4e74
Buildcache: Fix bug in binary string replacement (#17075)
* Fix bug in binary string replacement that results in padding being added multiple times

* Update comment

* Update comment again
2020-06-12 13:38:33 -05:00
Massimiliano Culpo
3609f36e60 Renamed flags.py to basics.py 2020-06-11 10:06:32 -07:00
Massimiliano Culpo
bbac630aac Reworked tests on compilers to separate version detection
Tests on version detection are now separate from other
tests done on compiler.
2020-06-11 10:06:32 -07:00
Massimiliano Culpo
478a8aff0e
Move to temporary directory before running dev-build test (#17028)
Without this the test would leave spurious "spack-build-*.txt"
files in the current working directory.
2020-06-10 08:10:57 -07:00
Joseph Ciurej
9a18fbbc3e
lib/spack : expand spack config vars in 'include' section (#16210)
* Changed the 'include' config section to use 'substitute_path_variables' to allow for Spack config variables to be used (e.g. $spack).

* Fixed a bug with 'include' section path expansion and added a test case for 'include' paths with embedded config variables.
2020-06-09 16:57:27 -07:00
Massimiliano Culpo
25a837bf79
Testing: create mock executable fixture (#16999) 2020-06-09 11:00:23 -07:00
Greg Becker
2421d903b0
SpecList: fix recursion for references (#16897)
* SpecList: fix and refactor variable expansion
2020-06-09 08:52:46 -07:00
Adam J. Stewart
bcf8ebff4f
Cray: fix Blue Waters support and user-built MPIs on Cray (#16593)
* Cray: fix Blue Waters support

* pkg-config env vars needed on Blue Waters

* cray platform: fix support for user-build MPI on cray machines

* reintroduce cray environment cleaning behind cnl version guard

* cray platform: fix support for user-build MPI on cray machines

Co-authored-by: Gregory <becker33@llnl.gov>
2020-06-08 16:44:07 -07:00
Greg Becker
bd1a0a9ad4
view remove: directly check whether specs own files before removing from view (#16955)
Bugfix for hardlinks and copies
2020-06-08 06:43:52 +02:00
Greg Becker
94e77333e6
spack dev-build: Do not mark -u builds in database (#16333)
Builds can be stopped before the final install phase due to user requests. Those builds 
should not be registered as installed in the database.

We had code intended to handle this but:

  1. It caught the wrong type of exception
  2. We were catching these exceptions to suppress them at a lower level in the stack

This PR allows the StopIteration to propagate through a ChildError, and catches it
properly. Also added to an existing test to prevent regression.
2020-06-05 00:35:16 -07:00
Massimiliano Culpo
5b272e3ff3
commands: use a single ThreadPool for spack versions (#16749)
This fixes a fork bomb in `spack versions`. Recursive generation of pools
to scrape URLs in `_spider` was creating large numbers of processes.
Instead of recursively creating process pools, we now use a single
`ThreadPool` with a concurrency limit.

More on the issue: having ~10 users running at the same time spack
versions on front-end nodes caused kernel lockup due to the high number
of sockets opened (sys-admin reports ~210k distributed over 3 nodes).
Users were internal, so they had ulimit -n set to ~70k.

The forking behavior could be observed by just running:

    $ spack versions boost

and checking the number of processes spawned. Number of processes
per se was not the issue, but each one of them opens a socket
which can stress `iptables`.

In the original issue the kernel watchdog was reporting:

    Message from syslogd@login03 at May 19 12:01:30 ...
    kernel:Watchdog CPU:110 Hard LOCKUP
    Message from syslogd@login03 at May 19 12:01:31 ...
    kernel:watchdog: BUG: soft lockup - CPU#110 stuck for 23s! [python3:2756]
    Message from syslogd@login03 at May 19 12:01:31 ...
    kernel:watchdog: BUG: soft lockup - CPU#94 stuck for 22s! [iptables:5603]
2020-06-05 00:08:32 -07:00
Adam J. Stewart
dd19d6f863
Fix parsing of EvtGen URL (#16883)
* Fix parsing of EvtGen URL

* Flake8 fix
2020-06-03 22:09:22 -05:00
Peter Scheibel
24775697f5
Mirrors: add option to exclude packages from "mirror create" (#14154)
* add an --exclude-file option to 'spack mirror create' which allows a user to specify a file of specs to exclude when creating a mirror. this is anticipated to be useful especially when using the '--all' option

* allow specifying number of versions when mirroring all packages

* when mirroring all specs within an environment, include dependencies of root specs

* add '--exclude-specs' option to allow user to specify that specs should be excluded on the command line

* add test for excluding specs
2020-06-03 17:43:51 -07:00
Greg Becker
3347ef2de4
Feature: add option to create view by copying/relocating files (#16480)
* add subcommand `spack view copy/relocate`

* update bash completions

* add copy/relocate commands to view tests

* allow copied views to be removed
2020-06-03 09:45:13 -07:00
Sergey Kosukhin
7aa9cb0f7a
Implicit rpaths for NAG/GCC mixed toolchain (#14782)
* Implicit rpaths for NAG.

* set up environment when checking for implicit rpaths
2020-06-03 09:42:13 -07:00
Massimiliano Culpo
70c3b0ba09
spack uninstall: improve help message (#16886)
fixes #12527

Mention that specs  can be uninstalled by hash also in
the help message. Reference `spack gc` in case people
are looking for ways to clean the store from build time
dependencies.

Use "spec" instead of "package" to avoid ambiguity in
the error message.
2020-06-03 16:30:12 +02:00
Massimiliano Culpo
d5ffec1b2f
Unify tests for compiler command in the same file (#16891)
* Unify tests for compiler command in the same file

Tests for the "spack compiler" command were previously
scattered among different files.

* Tests should use mutable_config, since they modify the compiler list
2020-06-02 14:59:42 -07:00
Greg Becker
2795414a80
Fix satisfaction checks for excluding variants from matrices (#16893)
Because of the way abstract variants are implemented, the following 
spec matrix does not work as intended:
```
matrix:
- [foo]
- [bar=a, bar=b]
exclude:
- bar=a
```
because abstract variants always satisfy any variant of the same
name, regardless of values.

This PR converts abstract variants to whatever their appropriate 
type is before running satisfaction checks for the excludes clause 
in a matrix.

fixes #16841
2020-06-02 11:02:28 +02:00
Jonathon Anderson
feda2a3073
openmpi: add opa-psm2 dependency (#16873)
Also document with_or_without and enable_or_disable, (which are used
to configure the opa-psm2 dependency).
2020-06-01 15:33:24 -07:00
Massimiliano Culpo
2a4ca34a61
Recognize system installed gcc-10 as compilers (#16884)
Now that the version number of GCC reached double digits, an update
to the regex is needed to recognize gcc-10 as an executable to be
inspected when searching for compilers.
2020-06-01 13:59:14 -07:00
Sergey Kosukhin
9d1f71e89f
repo: fix construction of UnknownPackageError (#16865)
Also improve the error messages
2020-05-29 20:07:44 +02:00
Robert Rosca
edd075a5e1
Mention that packages can be uninstalled by hash (#16863) 2020-05-29 13:23:02 +02:00
Greg Becker
bd95b7df86
spack module_cmd: set LD_LIBRARY_PATH for python in subshell. (#16827)
* Ensure python runs with proper ld_library_path within Spack regardless of environment
2020-05-29 11:57:21 +02:00
Jane Herriman
6af3272e1d
Update error message when UnavailableCompilerVersionError is triggered (#16838)
Co-authored-by: Herriman <herriman1@panorama.llnl.gov>
2020-05-29 10:53:43 +02:00
Greg Becker
a21fab6fe4
compilers: add opt_flags and debug_flags properties (#16710) 2020-05-29 10:52:31 +02:00
Greg Becker
38ac78489a
bugfix: use flags when computing implicit rpaths (#16634)
* make verbose_flag a property

* tests
2020-05-28 17:11:28 -07:00
Massimiliano Culpo
8f208b17e2 spack containerize: allow 0.14.3 tag for next release 2020-05-27 10:21:14 -07:00
Massimiliano Culpo
187cb51b49 spack containerize: allow 0.14.1 and 0.14.2 tags
fixes #16727
2020-05-27 10:21:14 -07:00
Sergey Kosukhin
e73c39a5db
concretize: fix UnboundLocalError due to import within a function (#16809) 2020-05-27 11:45:14 +02:00
Greg Becker
e9dcab9464
backwards compatibility for naming scheme (#16812)
* backwards compatibility for naming scheme
2020-05-26 14:06:25 -07:00
Massimiliano Culpo
c01433f60a
spack.relocate: further coverage for ELF related functions (#16585)
* make_link_relative: added docstring

* make_elf_binaries_relative: added docstring, unit tests

* raise_if_not_relocatable: added docstring, added unit test for exceptional case

* relocate_links: removed unused arguments, added docstring and comments

Also fixed a possible bug that was issuing spurious
warning when a file was relocated successfully

* relocate_text: added docstring and comments, renamed arguments

* relocate_text_bin: added docstring and comments, renamed arguments, unit tests
2020-05-26 11:47:31 -07:00
Stephen Herbein
c4031f0455
lua: fix compilation on Cray (#16713)
Problem: when calling `static_to_shared_library` on the `cray` arch, it
produces a non-sensical compiler command with no input files.  For
example, when installing lua@5.2.4, it produced:
'gcc -lm -ldl -o /big-long-spack-path/liblua.so.5.2.4'

Solution: do the same thing on `cray` that is done for `linux`
2020-05-25 15:18:47 +02:00
Peter Scheibel
768fa6bc53
bugfix: schema errors without line numbers (#16765)
* account for schema validation errors where the associated instance doesn't have a line number

* fix unrelated flake error (but it must be fixed because this PR touches this file and the flake rules have been updated since the last edit to this file)
2020-05-25 15:08:47 +02:00
Tomoki, Karatsu
a9b64bcaf1
autotools: delete args from postdep objects when %fj (#16274) 2020-05-21 20:50:57 +02:00
Greg Becker
cfb6f21236
externals: allow package prefs to configure default not buildable (#16735)
Allows `all` to be configured non-buildable in packages.yaml.

The following config would only allow zlib to be built by Spack, all other packages would have to be found as externals.

```
packages:
  all:
    buildable: False
  zlib:
    buildable: True
```
2020-05-20 17:09:07 -07:00
Tamara Dahlgren
92989fbbfd
tests: check presence not equality for rpath changes (#16637)
Fixes #16636
2020-05-20 18:11:26 +02:00
Scott Wittenburg
b1f1f5dddb Pipelines: Ensure consistent spack version for entire pipeline
Also retry jobs always, as script failure is not confined to only our
spack ci rebuild command exit code.
2020-05-19 09:40:02 -06:00
Greg Becker
84889ef3a3
move source dir to last cmake arg (#16709) 2020-05-18 16:39:13 -07:00
TZ
2ebadbc267
intel-mpi: add libfabrics directory to SPACK_COMPILER_EXTRA_RPATHS (#15214)
workaround for not finding an appropriate libfabrics.so with Intel
MPI 2019+. Fixes #11140 and #12493
2020-05-16 10:40:40 -05:00
Greg Becker
32a9adcf60
modules: use projections format for naming schemes (#16629)
* update tcl naming_scheme to use projections

* add projections to lmod modules
2020-05-15 11:12:52 -07:00
Scott Wittenburg
e0572a7d96 Pipelines: Support DAG scheduling and dynamic child pipelines
This change also adds a code path through the spack ci pipelines
infrastructure which supports PR testing on the Spack repository.
Gitlab pipelines run as a result of a PR (either creation or pushing
to a PR branch) will only verify that the packages in the environment
build without error.  When the PR branch is merged to develop,
another pipeline will run which results in the generated binaries
getting pushed to the binary mirror.
2020-05-14 21:11:07 -07:00
Scott Wittenburg
47b3dda1aa Support os-specific $padding in config:install_tree
Providing only $padding or ${padding} results in an attempt to
substitute a padding of maximum system path length, while leaving
room for the parts of the install path spack generates.  Providing
$padding-<len> or ${padding-<len>} simply substitutes padding of
the specified length.
2020-05-14 21:11:07 -07:00
Greg Becker
445cae5c81
Feature: Allow lmod configuration to set core specs (#16517)
Packages built with lmod core_compiler are placed in `Core`.

Other packages may belong in `Core`. For example, python may be built with a proprietary compiler for performance, but belong on the `Core` directory.

With this PR, lmod config can include a `core_specs` list. Any package that satisfies a spec in that list is placed in `Core`, regardless of its compiler or dependencies.
2020-05-14 11:27:37 -07:00
Greg Becker
7411fe2d43
cmake build system: filter system paths from rpaths (#16612) 2020-05-13 14:31:33 -07:00
Peter Scheibel
701fc1fdb1
Update docs on "spack external find" (#16482)
This improves the documentation for `spack external find` in several ways:

* Provide a code example of implementing `determine_spec_details` for a package
* Explain how to define executables to look for (and also e.g. that they are treated as regular expressions and so can pull in unexpected files).
* Add the "why" for a couple of constraints (i.e. explain that this logic only works for build/run deps because it examines `PATH` for executables)
* Spread the docs between build customization and packaging sections
* Add cross-references
* Add a label so that `spack external find` is linked from the command reference.
2020-05-12 17:08:08 -07:00
Greg Becker
0307111dd8
bugfix: reorder variants in Spec strings (#16462)
* change print order for variants to avoid zsh parsing bugs

* change tests for new variant parse order
2020-05-12 10:23:42 -07:00
Sajid Ali
b526a90220
Charm++: fix build prefix; add ucx/pmi support (#15666)
* Add pmi support (required by ucx, ofi, and gni backends)
* Add support for ucx backend
* Add dependency on MPI for pmi=simplepmi, slurmpmi, or slurmpmi2
* Remove charmpp as an MPI provider since the changes in this PR can
  add MPI as a dependency (mentioned previously)
* Install into transport_protocol-OS-arch subdirectory to match
  default charmpp installation behavior (which helps dependents find it)
2020-05-11 16:27:38 -07:00
Massimiliano Culpo
43c9ad3421
Remove 'spack bootstrap' and associated docs (#15179)
fixes #15145

This commit removes the outdated `spack bootstrap`
command and any reference to it in the documentation
and unit tests.
2020-05-11 10:55:18 -07:00
Massimiliano Culpo
b06bc31029
Increase coverage of spack.relocate (#16475)
- add docstrings and make parameter names consistent in `relocate.py`
- Make `replace_prefix_*` and other functions private (as they are implementation details)
- remove unused function _replace_prefix_nullterm()

- Add unit tests for `relocate.py` functions
  - add patchelf to Travis and use it during tests
  - add hello_world fixture with a compiled binary, so we can test relocation
2020-05-09 10:41:50 -07:00
Todd Gamblin
7b8e5c8999 bugfix: don't use sys.stdout as a default arg value (#16541)
After migrating to `travis-ci.com`, we saw I/O issues in our tests --
tests that relied on `capfd` and `capsys` were failing. We've also seen
this in GitHub actions, and it's kept us from switching to them so far.

Turns out that the issue is that using streams like `sys.stdout` as
default arguments doesn't play well with `pytest` and output redirection,
as `pytest` changes the values of `sys.stdout` and `sys.stderr`. if these
values are evaluated before output redirection (as they are when used as
default arg values), output won't be captured properly later.

- [x] replace all stream default arg values with `None`, and only assign stream
      values inside functions.
- [x] fix tests we didn't notice were relying on this erroneous behavior
2020-05-09 00:56:18 -07:00
Axel Huebl
f5844d3d81
all_urls: add urls[0] for versions (#16435)
This adds the `url` alternative `urls` to `package.all_urls`. With
this addition, one can find again new versions with
`spack versions <package>` for packages that are populated with
from mixin mirror `urls`.

Example: `util-macros` from x.org mixin.
2020-05-08 10:12:45 +02:00
Erik Schnetter
4ebff5cef9
Documentation: typo in option description (#16518) 2020-05-07 22:23:16 -07:00
iarspider
e2d42672b7
Config option to disable setting S_ISGID bit when creating installation directory (#14479)
* Add config option to disable setting S_ISGID bit when creating installation directory. 

Co-authored-by: Ivan Razumov <ivan.razumov@cern.ch>
2020-05-07 17:21:53 -07:00
iarspider
08f449ae9a
"spack checksum" QoL (#14311)
* Non-interactive mode for spack checksum; allow passing 'package@version' to spack checksum

* Flake8 fixes

* Update checksum.py

Fix typo

* Update spack-completion script

* Automatically set non-interactive mode if more than one version passed

* Update lib/spack/spack/cmd/checksum.py

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Add documentation and update spack-completion

* Flake8

* Rename option

* Update spack-completion

* Update lib/spack/spack/cmd/checksum.py

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Update checksum.py

* Update stage.py

* Update create.py

Use batch mode when adding a new package

Co-authored-by: Ivan Razumov <ivan.razumov@cern.ch>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-05-07 18:34:36 -05:00
Peter Scheibel
1ed564a1e6
Testing: fix unintended interactions between tests, part 2 (#16429)
This fixes some errors with setting up test configuration. These
errors do not cause current Spack tests to fail but do create
red herring issues elsewhere (see #15666). Fixing these errors
leads to more errors in tests that depended on the original
misconfigured state, so those are also addressed here.

This is an update to #16003 which accounts for some unit tests with
conflicting config/mutable_config fixtures. These conflicts were
not exposed until the mutable_config fixture was fixed. Details are
included below. The change which builds on #16003 is prefixed with
"(new)".

* For tests that use the real Spack package repository, the config
  needs to avoid using MPI providers that are not intended to be
  installed by Spack. Without this, it is possible that Spack tests
  which concretize the MPI virtual will end up trying to use an
  implementation that it shouldn't (e.g. one that is always
  provided externally). See #15666 for an example.
* The mutable_config test fixture was not initializing the scope
  roots to the right directories (so the resulting config was empty).
* The current_host fixture in the concretize.py tests was using the
  config fixture rather than mutable_config, and was polluting the
  config cache for other tests.
* One test in concretize.py was clearing a nonexistent cache
  (PackagePrefs._packages_config_cache). This reference has been
  removed.
* The test 'test_preferred_compilers' was was depending on cross
  test config pollution to succeed. The initial spec before
  concretization has been updated to updated to be explicit about
  the desired result.
* (new) For tests that use install_mockery and mutable_config,
  replace install_mockery with a separate install_mockery_mutable_config
  fixture that is exactly the same as install_mockery but uses the
  mutable_config fixture to avoid conflicts.
2020-05-07 14:01:58 -07:00
Todd Gamblin
b196e4396a
bugfix: spack shouldn't fail in an incomplete environment (#16473)
Fixed #15884.

Spack asks every package linked into an environment to tell us how
environment variables should be modified when a spack environment is
activated. As part of this, specs in an environment are symlinked into
the environment's view (see #13249), and the package calculates
environment modifications with *the default view as the prefix*.

All of this works nicely for pointing the user's environment at the view
*if* every package is successfully linked. Unfortunately, right now we
only track what specs "should" be in a view, not which specs actually
are. So we end up calculating environment modifications on things that
aren't linked into thee view, and the exception isn't caught, so lots of
spack commands end up failing.

This fixes the issue by ignoring and warning about specs where
calculating environment modifications fails. So we can still keep using
Spack even if the current environment is incomplete.

We should probably also just avoid computing env modifications *entirely*
for unlinked packages, but right now that is a slow operation (requires a
lot of YAML parsing). We should revisit that when we have some better
state management for views, but the fix adopted here will still be
necessary, as we want spack commands to be resilient to other types of
bugs in `setup_run_environment()` and friends. That code is in packages
and we have to assume it could be buggy when we call it outside of builds
(as it might fail more than just the build).
2020-05-07 02:30:09 -07:00
Greg Becker
d0220a990c
fix underscore/dash problems for mic_knl and skylake_avx512 (#16491) 2020-05-06 12:10:08 -07:00
Peter Scheibel
b030a81a5f
Automatically find externals (#15158)
Add a `spack external find` command that tries to populate
`packages.yaml` with external packages from the user's `$PATH`. This
focuses on finding build dependencies. Currently, support has only been
added for `cmake`.

For a package to be discoverable with `spack external find`, it must define:
  * an `executables` class attribute containing a list of
    regular expressions that match executable names.
  * a `determine_spec_details(prefix, specs_in_prefix)` method

Spack will call `determine_spec_details()` once for each prefix where
executables are found, passing in the path to the prefix and the path to
all found executables. The package is responsible for invoking the
executables and figuring out what type of installation(s) are in the
prefix, and returning one or more specs (each with version, variants or
whatever else the user decides to include in the spec).

The found specs and prefixes will be added to the user's `packages.yaml`
file. Providing the `--not-buildable` option will mark all generated
entries in `packages.yaml` as `buildable: False`
2020-05-05 17:37:34 -07:00
Greg Becker
dd3762d0f9
cray platform: support cray Cluster and XC type machines (#12989)
Cray has two machine types. "XC" machines are the larger
machines more common in HPC, but "Cluster" machines are
also cropping up at some HPC sites. Cluster machines run
a slightly different form of the CrayPE programming environment,
and often come without default modules loaded. Cluster
machines also run different versions of some software, and run
a linux distro on the backend nodes instead of running Compute 
Node Linux (CNL).

Below are the changes made to support "Cluster" machines in
Spack. Some of these changes are semi-related general upkeep
of the cray platform.

* cray platform: detect properly after module purge

* cray platform: support machines running OSs other than CNL

Make Cray backend OS delegate to LinuxDistro when no cle_release file
favor backend over frontend OS when name clashes

* cray platform: target detection uses multiple strategies

This commit improves the robustness of target
detection on Cray by trying multiple strategies.

The first one that produces results wins. If
nothing is found only the generic family of the
frontend host is used as a target.

* cray-libsci: add package from NERSC

* build_env: unload cray-libsci module when not explicitly needed

cray-libsci is a package in Spack. The cray PrgEnv
modules load it implicitly when we set up the compiler.
We now unload it after setting up the compiler and
only reload it when requested via external package.

* util/module_cmd: more robust module parsing

Cray modules have documentation inside the module
that is visible to the `module show` command.
Spack module parsing is now robust to documentation 
inside modules.

* cce compiler: uses clang flags for versions >= 9.0

* build_env: push CRAY_LD_LIBRARY_PATH into everything

Some Cray modules add paths to CRAY_LD_LIBRARY_PATH
instead of LD_LIBRARY_PATH. This has performance benefits
at load time, but leads to Spack builds not finding their
dependencies from external modules.
Spack now prepends CRAY_LD_LIBRARY_PATH to
LD_LIBRARY_PATH before beginning the build.

* mvapich2: setup cray compilers when on cray

previously, mpich was the only mpi implementation to support
cray systems (because it is the MPI on Cray XC systems). 
Cray cluster systems use mvapich2, which now supports cray
compiler wrappers.

* build_env: clean pkgconf from environment

Cray modules silently add pkgconf to the user environment
This can break builds that do not user pkgconf.
Now we remove it frmo the environment and add it again if it
is in the spec. 

* cray platform: cheat modules for rome/zen2 module on naples/zen node

Cray modules for naples/zen architecture currently specify
rome/zen2. For now, we detect this and return zen for modules
named `craype-x86-rome`.

* compiler: compiler default versions

When detecting compiler default versions for target/compiler
compatibility checks, Spack previously ran the compiler without
setting up its environment. Now we setup a temporary environment
to run the compiler with its modules to detect its version.

* compilers/cce: improve logic to determine C/C++ std flags

* tests: fix existing tests to play nicely with new cray support

* tests: test new functionality

Some new functionality can only be tested on a cray system.
Add tests for what can be tested on a linux system.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-05-05 13:58:46 -07:00
Massimiliano Culpo
aa9c98b6a2
Make usage example consistent with current MV variants (#16468)
Since #9481 Python's None is not permitted as a value for
MV variants. The string 'none' is used instead.

Add the same fix for the amgx and lammps packages
2020-05-05 20:22:32 +02:00
Greg Becker
3ae76d8c1e
bugfix: config:install_hash_length ignored (#15919) 2020-05-04 23:10:25 -07:00
Greg Becker
8e2f5ba861
environments: allow sigils to apply to entire reference (#15245)
* environments: allow sigils to apply to entire reference
2020-05-04 15:11:10 -07:00
Oliver Breitwieser
1cff717ca8 Fix git-related commands not working in worktrees
If spack is checked out in a git worktree (see [1]), all git-related
commands fail because the `spack_is_git_repo()`-check is not thorough
enough.

When developing in a feature-branch in a seperate worktree, this is
annoying as all unittests regarding git-related spack commands fail,
cluttering the test results with false-positives.

[1]: https://git-scm.com/docs/git-worktree

Change-Id: I94b573a2c0e058e9ccc169e7ee6561626fbb06fd
2020-05-04 14:39:25 -07:00
Peter Scheibel
40df44e021
Revert "Testing: fix unintended interactions between tests (#16003)" (#16420)
This was breaking tests on develop.
2020-05-01 13:39:43 -07:00
Peter Scheibel
31d12d380f
Testing: fix unintended interactions between tests (#16003)
* For tests that use the real Spack package repository, the config
  needs to avoid using MPI providers that are not intended to be
  installed by Spack. Without this, it is possible that Spack tests
  which concretize the MPI virtual will end up trying to use an
  implementation that it shouldn't (e.g. one that is always
  provided externally). See #15666 for an example.
* The mutable_config test fixture was not initializing the scope
  roots to the right directories (so the resulting config was empty).
* The current_host fixture in the concretize.py tests was using the
  config fixture rather than mutable_config, and was polluting the
  config cache for other tests.
* One test in concretize.py was clearing a nonexistent cache
  (PackagePrefs._packages_config_cache). This reference has been
  removed.
* The test 'test_preferred_compilers' was was depending on cross
  test config pollution to succeed. The initial spec before
  concretization has been updated to updated to be explicit about
  the desired result.
2020-05-01 10:47:46 -07:00
Axel Huebl
d0dfa1ea4d
dev-build: --drop-in <shell> (#14887)
* dev-build: --drop-in <shell>

Add a `--drop-in <shell>` option to `spack dev-build`.
This option will automatically run a
`spack build-env <spec> -- <shell>` at the end of a `dev-build`, e.g.
to quickly drop-and-devel into a build phase of a package.

Example usage:
```
spack dev-build --before cmake --drop-in bash openpmd-api@develop
```

* build_env: drop in unit test

Co-authored-by: Greg Becker <becker33@llnl.gov>
2020-05-01 09:37:21 -07:00
Adam J. Stewart
022c287e47
Fix typos in new AutotoolsPackage function (#16406) 2020-04-30 15:13:04 -05:00
Chris Green
9698907e74
Spack command extensions: error-handling (#13635)
Generally speaking, errors that are encountered when attempting to load
command extensions now terminate the running Spack instance.

* Added new exceptions `spack.cmd.PythonNameError` and
  `spack.cmd.CommandNameError`.
* New functions `spack.cmd.require_python_name(pname)` and
  `spack.cmd.require_cmd_name(cname)` check that `pname` and `cname`
  respectively meet requirements, throwing the appropriate error if not.
* `spack.cmd.get_module()` uses `require_cmd_name()` and passes through
  exceptions from module load attempts.
* `spack.cmd.get_command()` uses `require_cmd_name()` and invokes
  `get_module()` with the correct command-name form rather than the
  previous (incorrect) Python name.
* Added New exceptions `spack.extensions.CommandNotFoundError` and
  `spack.extensions.ExtensionNamingError`.
* `_extension_regexp` has a new leading underscore to indicate expected
  privacy.
* `spack.extensions.extension_name()` raises an `ExtensionNamingError`
  rather than using `tty.warn()`.
* `spack.extensions.load_command_extension()` checks command source
  existence early and bails out if missing. Also, exceptions raised by
  `load_module_from_file()` are passed through.
* `spack.extensions.get_module()` raises `CommandNotFoundError` as
  appropriate.
* Spack `main()` allows `parser.add_command()` exceptions to cause
  program end.

Tests:

* More common boilerplate has been pulled out into fixtures including
  `sys.modules` dictionary cleanup and resource-managed creation of a
  simple command extension with specified contents in the source file
  for a single named command.
* "Hello, World!" test now uses a command named `hello-world` instead of
  `hello` in order to verify correct handling of commands with hyphens.
* New tests for:
  * Missing (or misnamed) command.
  * Badly-named extension.
  * Verification that errors encountered during import of a command are
    propagated upward.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2020-04-29 18:18:48 -07:00
Nathan
b6b44948b8
prefix gets removed when adding additional configure options (#16335)
* prefix gets removed when adding additional configure options

* Update waf documentation to reflect the new change
2020-04-29 10:52:23 -05:00
Axel Huebl
00d83cd79d
dev-build: stop before phase (#14699)
Add `-b,--before` option to dev-build command to stop before the phase in question.
2020-04-28 09:55:57 -07:00
Axel Huebl
7670ae468f
Docs: Limit Microarch on Travis CI (#16200)
Update the travis CI docs: limiting the microarch is essential
for caching.
2020-04-28 11:54:02 -05:00
Massimiliano Culpo
a540e36922
relocate: remove an assertion in _make_relative (#16351)
This was an oversight in #15654 since `os.path.isfile`
checks that the something is a file in the current
filesystem.
2020-04-28 14:53:22 +02:00
Massimiliano Culpo
6b648c6e89
Improve the coverage of spack.relocate (#15654)
This PR introduces trivial refactoring in:
- `get_existing_elf_rpaths`
- `get_relative_elf_rpaths`
- `get_normalized_elf_rpaths`
- `set_placeholder`

mainly to be more consistent with practices used in other 
parts of the code and to simplify functions locally. It also 
adds or reworks unit tests for these functions and extends 
their docstrings.

Co-authored-by: Patrick Gartung <gartung@fnal.gov>
Co-authored-by: Peter J. Scheibel <scheibel1@llnl.gov>
2020-04-27 12:17:32 +02:00
Axel Huebl
5828a8f7e6
spack env: activate note (#16279)
print a note on how to activate a newly created environment
2020-04-24 13:24:52 -07:00
Todd Gamblin
c6ada206af
tests: each mock package now has its own class (#16157)
Packages in Spack are classes, and we need to be able to execute class
methods on mock packages.  The previous design used instances of a single
MockPackage class; this version gives each package its own class that can
spider depenencies.  This allows us to implement class methods like
`possible_dependencies()` on mock packages.

This design change moves mock package creation into the
`MockPackageMultiRepo`, and mock packages now *must* be created from a
repo.  This is required for us to mock `possible_dependencies()`, which
needs to be able to get dependency packages from the package repo.

Changes include:

* `MockPackage` is now `MockPackageBase`
* `MockPackageBase` instances must now be created with
  `MockPackageMultiRepo.add_package()`
* add `possible_dependencies()` method to `MockPackageBase`
* refactor tests to use new code structure
* move package mocking infrastructure into `spack.util.mock_package`,
  as it's becoming a more sophisticated class and it gets lots in `conftest.py`
2020-04-23 18:21:49 -07:00
Todd Gamblin
0c0f11caf6
spack info: allow variants section to be as wide as the terminal (#16254)
The variants table in `spack info` is cramped, as the *widest* it can be
is 80 columns.  And that's actually only sort of true -- the padding
calculation is off, so it still wraps on terminals of size 80 because it
comes out *slightly* wider.

This change looks at the terminal size and calculates the width of the
description column based on it.  On larger terminals, the output looks
much nicer, and on small terminals, the output no longer wraps.

Here's an example  for `spack info qmcpack` with 110 columns.

Before:
    Name [Default]          Allowed values          Description
    ====================    ====================    ==============================

    afqmc [off]             on, off                 Install with AFQMC support.
                                                    NOTE that if used in
                                                    combination with CUDA, only
                                                    AFQMC will have CUDA.
    build_type [Release]    Debug, Release,         The build type to build
                            RelWithDebInfo
    complex [off]           on, off                 Build the complex (general
                                                    twist/k-point) version
    cuda [off]              on, off                 Build with CUDA

After:
    Name [Default]          Allowed values          Description
    ====================    ====================    ========================================================

    afqmc [off]             on, off                 Install with AFQMC support. NOTE that if used in
                                                    combination with CUDA, only AFQMC will have CUDA.
    build_type [Release]    Debug, Release,         The build type to build
                            RelWithDebInfo
    complex [off]           on, off                 Build the complex (general twist/k-point) version
    cuda [off]              on, off                 Build with CUDA
2020-04-23 12:14:40 -07:00
Massimiliano Culpo
6f9373dd66
spack info: replace "True, False" with "on, off" (#16235)
fixes #16184
2020-04-22 17:48:52 -07:00
Greg Becker
ec23e4ffe5
update compiler config with bootstrapped compiler when already installed (#16221)
Update compiler config with bootstrapped compiler when it was already installed and added config defaults to code so mutable_config test fixture works.
2020-04-22 14:26:29 -07:00
George Hartzell
63ff121980
spack environments documentation: -E -> -e (#16242)
To specify an environment for a comment, the user can specify
"spack -e <env>". The documentation incorrectly specified "-E" (which
is actually used to ignore any implicit use of environments).
2020-04-22 13:04:17 -07:00
Axel Huebl
ca4c0b97ec
Doc: Conflict Msg Pkg Guide (#16201)
Document the nice `msg=` argument in conflicts. Super useful
for less generic conflict guidance.
2020-04-21 16:22:30 -05:00
Andrew W Elble
f1050c4be2
compiler wrappers: don't override -isystem with -I (#16077)
If the Spack compiler wrapper encounters any "-isystem" option, then
when adding include directories for Spack dependencies, Spack will
use "-isystem" instead of "-I". This prevents Spack-generated "-I"
options from overriding the "-isystem" options generated by the build
system. To ensure that build-system "-isystem" directories are
searched first, Spack places all of its inserted "-isystem"
directories after.

The new ordering of -isystem includes is:

* -isystem from build system (not system directories)
* -isystem from Spack
* -isystem from build system (for directories like /usr/include)

The prior order of "-I" arguments is preserved (although as of this
commit Spack no longer generates -I if -isystem is detected):

* -I from build system (not system directories)
* -I from Spack (only if there are no "-isystem" options)
* -I from build system (for directories like /usr/include)
2020-04-21 13:56:50 -07:00
Todd Gamblin
de13ea2284
autotools: remove FORCE_UNSAFE_CONFIGURE from docs, commands, code (#16145)
Since #16132, we've consolidated the setting of FORCE_UNSAFE_CONFIGURE to
`autotools.py`, so we don't need to use it in packages like `coreutils`,
in our commands, or in our container recipes.

- [x] Remove FORCE_UNSAFE_CONFIGURE from packages
- [x] Remove FORCE_UNSAFE_CONFIGURE from container recipes
- [x] Remove FORCE_UNSAFE_CONFIGURE from `spack ci` command
2020-04-20 08:32:03 -07:00
George Hartzell
c62f18304d
Typo: vew -> view (#16155) 2020-04-19 20:13:44 -05:00
Diego Magdaleno
d640bf899a
autotools: set FORCE_UNSAFE_CONFIGURE to 1 in autotools.py (#16132)
This commit sets the `FORCE_UNSAFE_CONFIGURE` environment variable to 1 in autotools builds.

We see a lot of builds popping up and complaining about `FORCE_UNSAFE_CONFIGURE`.  This behavior is not actually part of `autoconf` per se.  It comes from this patch to `mknod.m4`, which is used by a lot of autoconf builds:

    * https://lists.gnu.org/archive/html/bug-gnulib/2010-07/msg00282.html

Which originated from this problem that someone had on AIX:

    * https://lists.gnu.org/archive/html/bug-gnulib/2010-07/msg00279.html

The gist of the problem seems to be that they want to check whether `mknod` can do something as root, but instead of checking whether they're running as root and using `su` or something to test this, they just made it harder to run `configure` as root.

This seems very ad hoc and this is one of many checks that are run as root in `configure`.  Many of them run before this check, so it's not clear that the `FORCE_UNSAFE_CONFIGURE` thing is even preventing bad things from happening.

So:
1. This only happens in `autotools` builds, so we should go ahead and put it into `autotools.py` instead of in the global build environment, and

2. The variable does too little and provides a false sense of security in the first place, so we'll just disable it and avoid the nuisance.  If we really feel strongly about this we can put some warnings in Spack about running as root, but at the top level, not in the middle of an already running script like `configure`.
2020-04-18 14:25:19 -07:00
Todd Gamblin
eaccc58156
remove files accidentally committed with 0.14.0 (#16138) 2020-04-17 22:28:33 -07:00
Adam J. Stewart
ea8793f8f5
AutotoolsPackage: add aclocal for all build deps (#15784) 2020-04-17 16:30:21 -05:00
Adam J. Stewart
284e450c91
Language-specific PIC flags (#15474)
* Language-specific PIC flags

* Add tests for every compiler flag

* Fix bad rebase

* pic_flag -> cxx_pic_flag
2020-04-17 16:28:51 -05:00
Axel Huebl
abbc47823d
SourceForge: Mirror Mixin (#16112)
* SourceForge: Mirror Mixin

Add a mixing class for direct `CNAME`s to sourceforge mirrors.
Since the main gateway servers are often down, this could reduce
timeouts and fetch errors for sourceforge.net hosted software.

* SourceForge: unspectacular mirror replacement

add mirrors to all sourceforge packages with trivial
download logic.

tested fetch of latest version of each of these packages
with various mirrors before committing.

* SourceForge: xz

the author homepage is chronocially overrun and this is the offical
upload with many mirrors.
2020-04-16 21:35:30 -07:00
Todd Gamblin
f6d26db939 macos: use DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
`DYLD_LIBRARY_PATH` can frequently break builtin macOS software when
pointed at Spack libraries.  This is because it takes *higher* precedence
than the default library search paths, which are used by system software.

`DYLD_FALLBACK_LIBRARY_PATH`, on the other hand, takes lower precedence.
At first glance, this might seem bad, because the software installed by
Spack in an environment needs to find *its* libraries, and it should not
use the defaults.  However, Spack's isntallations are always `RPATH`'d,
so they do not have this problem.

`DYLD_FALLBACK_LIBRARY_PATH` is thus useful for things built in an
environment that need to use Spack's libraries, that don't set *their*
RPATHs correctly for whatever reason. We now prefer it to
`DYLD_LIBRARY_PATH` in modules and in environments because it helps a
little bit, and it is much less intrusive.
2020-04-16 17:23:33 -07:00
Marc Allen
a704922c29
Bugfix: For spack buildcache check, Handle specs where only the hash is (#15663)
provided (#15662).

Prior to this fix, the checked Spec object would not be populated, and
concretization would fail.

Co-authored-by: Marc Allen <mrcall@amazon.com>
2020-04-16 14:06:13 -07:00
Todd Gamblin
bd3f24afe1 Merge branch 'releases/v0.14' into develop 2020-04-15 15:27:00 -07:00
Michael Kuhn
277350ceed Make tags case insensitive
Currently, tags are case sensitive, which is unintuitive:
```console
$ spack list -t hpc
==> 2 packages.
nek5000  nektools
$ spack list -t HPC
==> 1 packages.
mfem
$ spack list -t Hpc
==> 0 packages.
```

This change makes them case insensitive:
```console
$ spack list -t hpc
==> 3 packages.
mfem  nek5000  nektools
$ spack list -t HPC
==> 3 packages.
mfem  nek5000  nektools
$ spack list -t Hpc
==> 3 packages.
mfem  nek5000  nektools
```
2020-04-15 14:56:25 -07:00
Todd Gamblin
a3bcd88f8d version bump: 0.14.2 2020-04-15 14:30:58 -07:00
Todd Gamblin
740f8fe1a9 bugfix: spack test should not output [+] for mock installs (#15609)
`spack test` has a spurious '[+] ' in the output:

```
lib/spack/spack/test/install.py .........[+] ......
```

Output is properly suppressed:

```
lib/spack/spack/test/install.py ...............
```
2020-04-15 14:30:58 -07:00
Todd Gamblin
430ca7c7cf spack install terminal output handling in foreground/background (#15723)
Makes the following changes:

* (Fixes #15620) tty configuration was failing when stdout was 
  redirected. The implementation now creates a pseudo terminal for
  stdin and checks stdout properly, so redirections of stdin/out/err
  should be handled now.
* Handles terminal configuration when the Spack process moves between
  the foreground and background (possibly multiple times) during a
  build.
* Spack adjusts terminal settings to allow users to to enable/disable
  build process output to the terminal using a "v" toggle, abnormal
  exit cases (like CTRL-C) could leave the terminal in an unusable
  state. This is addressed here with a special-case handler which
  restores terminal settings.

Significantly extend testing of process output logger:

* New PseudoShell object for setting up a master and child process
  and configuring file descriptor inheritance between the two
* Tests for "v" verbosity toggle making use of the added PseudoShell
  object
* Added `uniq` function which takes a list of elements and replaces
  any consecutive sequence of duplicate elements with a single
  instance (e.g. "112211" -> "121")

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-04-15 12:47:41 -07:00
Massimiliano Culpo
55f5afaf3c database: maintain in-memory consistency on remove (#15777)
The performance improvements done in #14693 where leaving the DB in an inconsistent state when specs were removed from it. This PR updates the DB internal state whenever the DB is written to a file.

Note that we still cannot properly enumerate installed dependents, so there is a TODO in this code. Fixing that will require the dependents dictionaries in specs to be re-keyed (either by hash, or not keyed at all -- a list would do).  See #11983 for details.
2020-04-15 12:47:16 -07:00
Andrew W Elble
6b559912c1 performance: add a verification file to the database (#14693)
Reading the database repeatedly can be quite slow.  We need a way to speed
up Spack when it reads the DB multiple times, but the DB has not been
modified between reads (which is nearly all the time).

- [x] Add a file containing a unique uuid that is regenerated at database
    write time. Use this uuid to suppress re-parsing the database
    contents if we know a previous uuid and the uuid has not changed.

- [x] Fix mutable_database fixture so that it resets the last seen
    verifier when it resets.

- [x] Enable not rereading the database immediately after a write. Make
    the tests reset the last seen verifier in between tests that use the
    database fixture.

- [x] make presence of uuid module optional
2020-04-15 12:47:00 -07:00
Peter Scheibel
9b5805a5cd Remove DB conversion of old index.yaml (#15298)
Removed the code that was converting the old index.yaml format into
index.json. Since the change happened in #2189 it should be
considered safe to drop this (untested) code.
2020-04-15 12:45:57 -07:00
Peter Scheibel
b9688a8c35 Environments/views: only override spec prefix for non-external packages (#15475)
* only override spec prefix for non-external packages

* add test that environment shell modifications respect explicitly-specified prefixes for external packages

* add clarifying comment
2020-04-15 12:37:37 -07:00
Jonathon Anderson
ed2781973c Source devnull in environment_after_sourcing_files (closes #15775) (#15791)
spack.util.environment_after_sourcing_files compares the local
environment against a shell environment after having sourced a
file; but this ends up including the default shell profile and
rc, which might differ from the local environment.

To change this, compare against the default shell environment,
expressed here as 'source /dev/null'.
2020-04-15 12:37:16 -07:00
Todd Gamblin
99bb88aead bugfix: TERM may not be in the environment on Cray (#15630) 2020-04-15 12:37:03 -07:00
Massimiliano Culpo
a85cce05a1 Blacklist Lmod variable modifications when sourcing files (#15778)
fixes #15775

Add all the variables listed here:

https://lmod.readthedocs.io/en/latest/090_configuring_lmod.html

to the list of those blacklisted when constructing environment
modifications by sourcing files.
2020-04-15 12:36:53 -07:00
Axel Huebl
e1e804168a Tests: Mirror Mixin Classes 2020-04-15 11:44:14 -07:00
Axel Huebl
7e5257e44a x.org: mirror mixin
According to my nightly CI/CD tests, x.org is another large provider
of software in common build chains that is often down.

Added a hand-selected amount of mirrors that is well up-to-sync.
Tested with `util-macros` that has a quite "recent" patch release.

Other packages to follow in an individual PR.
2020-04-15 11:44:14 -07:00
Todd Gamblin
a563884af3
spack install terminal output handling in foreground/background (#15723)
Makes the following changes:

* (Fixes #15620) tty configuration was failing when stdout was 
  redirected. The implementation now creates a pseudo terminal for
  stdin and checks stdout properly, so redirections of stdin/out/err
  should be handled now.
* Handles terminal configuration when the Spack process moves between
  the foreground and background (possibly multiple times) during a
  build.
* Spack adjusts terminal settings to allow users to to enable/disable
  build process output to the terminal using a "v" toggle, abnormal
  exit cases (like CTRL-C) could leave the terminal in an unusable
  state. This is addressed here with a special-case handler which
  restores terminal settings.

Significantly extend testing of process output logger:

* New PseudoShell object for setting up a master and child process
  and configuring file descriptor inheritance between the two
* Tests for "v" verbosity toggle making use of the added PseudoShell
  object
* Added `uniq` function which takes a list of elements and replaces
  any consecutive sequence of duplicate elements with a single
  instance (e.g. "112211" -> "121")

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-04-15 11:05:41 -07:00
Massimiliano Culpo
a11de1d29d
Package extensions: fixed a link in docs (#16040)
* Moved link to the right place in the docs

* Fixed a few minor issues in extensions docs

Fixed a typo, added a subsubsection for better
navigation, reworded "modules in Python" as
"Python packages"
2020-04-14 12:54:53 -05:00
Axel Huebl
5acea35e82
sourceware.org: mirror urls (#15992)
sourceware.org is often quite overrun and times out or results in
certificate errors.

Since libffi, bzip2, elfutils, etc. are quite fundamental in
build chains, lets add some official mirrors.

libffi, bzip2, elfutils, lvm2, valgrind: add mirrors
2020-04-14 11:09:30 -05:00
Massimiliano Culpo
7e46da73dd
database: maintain in-memory consistency on remove (#15777)
The performance improvements done in #14693 where leaving the DB in an inconsistent state when specs were removed from it. This PR updates the DB internal state whenever the DB is written to a file.

Note that we still cannot properly enumerate installed dependents, so there is a TODO in this code. Fixing that will require the dependents dictionaries in specs to be re-keyed (either by hash, or not keyed at all -- a list would do).  See #11983 for details.
2020-04-12 13:14:59 -07:00
Tomoki, Karatsu
08a491b062
fujitsu compiler: Delete custom environment function. (#15988) 2020-04-10 09:38:02 -05:00
Peter Scheibel
75640f0ed9
NAG compiler fix: skip implicit RPATH detection (#15902)
* Skip collection of compiler link paths if compiler does not define a verbose flag

* modules config bug: allow user to configure a compiler without an explicit entry for loaded modules
2020-04-09 10:48:29 +02:00
Scott Wittenburg
de95a9f5f3 pipelines: Document dynamic generation limitations 2020-04-07 15:20:01 -06:00
LPettey-Arm
da9ba2b254
Add build number to Arm compiler version identification (#15809)
* Add capability for detecting build number for Arm compilers

* Fixing fleck8 errors and updating test_arm_version_detection function for more detailed Arm compielr version detection

* Ran flake8 locally and corrected errors

* Altering Arm compielr version check to remove else clause and be more consistent with other compielr version checks. Added test case so both the 'if' and 'else' conditionals of the Arm compiler version check have a test case

Co-authored-by: EC2 Default User <ec2-user@ip-172-31-7-135.us-east-2.compute.internal>
2020-04-07 10:58:54 -05:00
Adam J. Stewart
fab1f68399
Docs: fix Spack Environments command (#15891) 2020-04-06 11:54:22 -05:00
Massimiliano Culpo
06f3381dfd
Blacklist Lmod variable modifications when sourcing files (#15778)
fixes #15775

Add all the variables listed here:

https://lmod.readthedocs.io/en/latest/090_configuring_lmod.html

to the list of those blacklisted when constructing environment
modifications by sourcing files.
2020-04-06 10:02:03 +02:00
Jonathon Anderson
359d7adf7e
Source devnull in environment_after_sourcing_files (closes #15775) (#15791)
spack.util.environment_after_sourcing_files compares the local
environment against a shell environment after having sourced a
file; but this ends up including the default shell profile and
rc, which might differ from the local environment.

To change this, compare against the default shell environment,
expressed here as 'source /dev/null'.
2020-04-06 10:00:42 +02:00
Stephen McDowell
51fbe518b8
verify other.exe attr exists before use in __eq__ (#15882) 2020-04-05 14:08:13 -05:00
G-Ragghianti
bae4f91bfe
Add option "--first" for "spack load" (#15622)
* Implemented --first option for "spack load"

* added test for "spack load --first"

Co-authored-by: gragghia <gragghia@localhost.localdomain>
2020-04-03 13:33:20 -07:00
Peter Scheibel
0b99cc2261
Environments/views: only override spec prefix for non-external packages (#15475)
* only override spec prefix for non-external packages

* add test that environment shell modifications respect explicitly-specified prefixes for external packages

* add clarifying comment
2020-04-03 13:26:33 -07:00
Adam J. Stewart
75a2f8046a
Add commands to facilitate Spack/Python/OS reporting (#15834)
* Add --version arg to spack python command
* Add `spack debug report` command
2020-04-02 23:12:03 -07:00
Greg Sjaardema
c3e8825f8e
Spelling fixes (#15805)
* Spelling fixes

* spelling fixes

* spelling fixes

* spelling fixes

* spelling fix

* spelling fix

* spelling fix

* spelling fixes

* spelling fix
2020-04-01 12:02:26 -05:00
Greg Becker
336191c251
packages.yaml: allow virtuals to specify buildable: false (#14934)
Currently, to force Spack to use an external MPI, you have to specify `buildable: False`
for every MPI provider in Spack in your packages.yaml file. This is both tedious and
fragile, as new MPI providers can be added and break your workflow when you do a
git pull.

This PR allows you to specify an entire virtual dependency as non-buildable, and
specify particular implementations to be built:

```
packages:
all:
    providers:
        mpi: [mpich]
mpi:
    buildable: false
    paths:
        mpich@3.2 %gcc@7.3.0: /usr/packages/mpich-3.2-gcc-7.3.0
```
will force all Spack builds to use the specified `mpich` install.
2020-03-31 16:09:08 -07:00
Massimiliano Culpo
7357b7023e
Update link for codecov's browser extensions (#15779) 2020-03-31 09:49:25 -05:00
Axel Huebl
3f50b9e08d
CUDA 10.1+ supports ICC 19.0 (#15764)
Fix the CUDA-ICC conflict check.
Simplify the XL 17 check.
2020-03-30 16:24:05 -05:00
Patrick Gartung
cbcac72254
Buildcache keys command speed up (#15727)
* Limit the spidering to depth=0 for keys

* depth=0 is default argument
2020-03-28 16:49:34 -05:00
Massimiliano Culpo
b42a96df98
provider index: removed import from + refactored a few parts (#15570)
Removed provider_index use of 'import from' and refactored a few routines to a further subclassing of _IndexBase for implementing user defined bindings of provider specs.
2020-03-25 09:48:05 -07:00
Massimiliano Culpo
1a5e4232ed
spack.repo: remove "import from" statements (#15505)
spack.repo: remove "import from" statements
2020-03-24 14:26:35 -07:00
Massimiliano Culpo
1b4de7813a
spack.relocate: add unit test (#15610)
* relocate: removed import from statements
* relocate: renamed *Exception to *Error

This aims at consistency in naming with both
the standard library (ValueError, AttributeError,
etc.) and other errors in 'spack.error'.

Improved existing docstrings

* relocate: simplified search function by un-nesting conditionals

The search function that searches for patchelf has been
refactored to remove deeply nested conditionals.

Extended docstring.

* relocate: removed a condition specific to unit tests
* relocate: added test for _patchelf
2020-03-24 09:02:54 +01:00
Peter Scheibel
8283068438
Bugfix: remove unit tests that install real packages (#15646)
Our unit tests run many times. Any unit test which actually installs
a package (which involves fetching code on the internet) is a severe
bug because it runs an installation many times (i.e. re-downloading
the same package for each version of Python that we run unit tests
for).

This reverts commit 25893f1, which added tests that install real
packages.
2020-03-23 18:10:44 -07:00
Todd Gamblin
cde4375c96
Vendoring: remove dependency on Setuptools from vendored pytest (#15612)
If the Python used by Spack does not include Setuptools, then
'spack test' will fail because Spack's vendored pytest dependency
imports and uses Setuptools in some of its functions. It turns out
that Spack doesn't use the functionality those methods enable, so
this PR removes those functions and thereby allows 'spack test' to
run without Setuptools.
2020-03-23 16:55:07 -07:00
Todd Gamblin
54a6c25da6
Bugfix (config): enable "spack test" when in an active environment (#15618)
For any Spack test using Spack's YAML configuration, avoid using real
Spack configuration that has been cached by other tests and Spack
startup logic. Previously this was only done for tests using
'mutable_config' (i.e. those which expected to *change* the
configuration of Spack), but in fact all tests that read Spack config
should use it.

This was an issue when running tests within an environment, because
compiler configuration ends up being queried earlier, and the user's
real config "leaks" into the cache. Outside an environment, the cache
is never set until tests touch it, so we weren't seeing this issue.
2020-03-23 15:15:36 -07:00
Todd Gamblin
0323f84e79
bugfix: TERM may not be in the environment on Cray (#15630) 2020-03-22 20:47:04 -07:00
Todd Gamblin
d9c5b7de10
bugfix: spack test should not output [+] for mock installs (#15609)
`spack test` has a spurious '[+] ' in the output:

```
lib/spack/spack/test/install.py .........[+] ......
```

Output is properly suppressed:

```
lib/spack/spack/test/install.py ...............
```
2020-03-22 15:46:54 -07:00
Patrick Gartung
25893f154f
Buildcache: attempt to build and install buildcaches in test environment (#15577)
* Put bindist.py on it's own branch

* Working on SL7 with python 3.6

* Flake8

* Put back clearing of compiler cache
2020-03-21 13:26:37 -05:00
Todd Gamblin
5df9dd2b48 Merge branch 'releases/v0.14' into develop 2020-03-20 23:12:45 -07:00
Andrew W Elble
e4d225043f
performance: add a verification file to the database (#14693)
Reading the database repeatedly can be quite slow.  We need a way to speed
up Spack when it reads the DB multiple times, but the DB has not been
modified between reads (which is nearly all the time).

- [x] Add a file containing a unique uuid that is regenerated at database
    write time. Use this uuid to suppress re-parsing the database
    contents if we know a previous uuid and the uuid has not changed.

- [x] Fix mutable_database fixture so that it resets the last seen
    verifier when it resets.

- [x] Enable not rereading the database immediately after a write. Make
    the tests reset the last seen verifier in between tests that use the
    database fixture.

- [x] make presence of uuid module optional
2020-03-20 17:05:51 -07:00
Patrick Gartung
e2125c26ce
Buildcache: add unit tests for normalized path functions in relocate.py (#15607) 2020-03-20 16:54:27 -05:00
Ryan Mast
76c9e6d871
fix: change typo dependnecies to dependencies (#15602) 2020-03-20 16:02:01 -05:00
Todd Gamblin
ff0abb9838 version bump: 0.14.1 2020-03-20 12:29:36 -07:00
Greg Becker
3826cdf139 multiprocessing: allow Spack to run uninterrupted in background (#14682)
Spack currently cannot run as a background process uninterrupted because some of the logging functions used in the install method (especially to create the dynamic verbosity toggle with the v key) cause the OS to issue a SIGTTOU to Spack when it's backgrounded.

This PR puts the necessary gatekeeping in place so that Spack doesn't do anything that will cause a signal to stop the process when operating as a background process.
2020-03-20 12:23:55 -07:00
Greg Becker
75fafcece9
multiprocessing: allow Spack to run uninterrupted in background (#14682)
Spack currently cannot run as a background process uninterrupted because some of the logging functions used in the install method (especially to create the dynamic verbosity toggle with the v key) cause the OS to issue a SIGTTOU to Spack when it's backgrounded.

This PR puts the necessary gatekeeping in place so that Spack doesn't do anything that will cause a signal to stop the process when operating as a background process.
2020-03-20 12:22:32 -07:00
Michael Kuhn
545fae8407
spack checksum: Use package's fetch_options (#15481)
This makes sure that a package's fetch_options are used when fetching
new versions to checksum. This allows working around problems with
slow servers or those requiring a cookie to be set.
2020-03-20 12:11:42 -07:00
Greg Becker
30b4704522 Cray bugfix: TERM missing while reading default target (#15381)
Bug: Spack hangs on some Cray machines

Reason: The TERM environment variable is necessary to run bash -lc "echo $CRAY_CPU_TARGET", but we run that command within env -i, which wipes the environment.

Fix: Manually forward the TERM environment variable to env -i /bin/bash -lc "echo $CRAY_CPU_TARGET"
2020-03-20 11:47:10 -07:00
Kai Germaschewski
09e13cf7cf Upstreams: don't write metadata directory to upstream DB (#15526)
When trying to use an upstream Spack repository, as of f2aca86 Spack
was attempting to write to the upstream DB based on a new metadata
directory added in that commit. Upstream DBs are read-only, so this
should not occur.

This adds a check to prevent Spack from writing to the upstream DB
2020-03-20 11:46:23 -07:00
Massimiliano Culpo
296d58ef6b Creating versions from urls doesn't modify class attributes (#15452)
fixes #15449

Before this PR a call to pkg.url_for_version was modifying
class attributes determining different results for subsequents
calls and an error when the urls was empty.
2020-03-20 11:45:40 -07:00
Greg Becker
ec720bf28d bugfix: fix install_missing_compilers option bug from v0.14.0 (#15416)
* bugfix: ensure bootstrapped compilers built before packages using the compiler
2020-03-20 11:44:59 -07:00
Todd Gamblin
1e42f0a545 bugfix: installer.py shouldn't be executable (#15386)
This is a minor permission fix on the new installer.py introduced in #13100.
2020-03-20 11:44:23 -07:00
Patrick Gartung
62683eb4bf Add function replace_prefix_nullterm for use on mach-o rpaths. (#15347)
This recovers the old behavior of replace_prefix_bin that was
modified to work with elf binaries by prefixing os.sep to new prefix
until length is the same as old prefix.
2020-03-20 11:43:54 -07:00
Massimiliano Culpo
901bed48ec ArchSpec: fix semantics of satisfies when not concrete and strict is true (#15319) 2020-03-20 11:42:22 -07:00
Tamara Dahlgren
1c8f792bb5 testing: increase installer coverage (#15237) 2020-03-20 11:40:52 -07:00
Tamara Dahlgren
9a1ce36e44 bugfix: resolve undefined source_pkg_dir failure (#15339) 2020-03-20 11:40:39 -07:00
Massimiliano Culpo
59a7963785 Bugfix: resolve StopIteration message attribute failure (#15341)
Testing the install StopIteration exception resulted in an attribute error:

AttributeError: 'StopIteration' object has no attribute 'message'

This PR adds a unit test and resolves that error.
2020-03-20 11:39:28 -07:00
Tamara Dahlgren
733f9f8cfa Recover coverage from subprocesses during unit tests (#15354)
* Recover coverage from subprocesses during unit tests
2020-03-20 11:38:28 -07:00
Massimiliano Culpo
fa0a5e44aa Correct pytest.raises matches to match (#15346) 2020-03-20 11:35:49 -07:00
Tamara Dahlgren
5406e1f43d bugfix: Add dependents when initializing spec from yaml (#15220)
The new build process, introduced in #13100 , relies on a spec's dependents in addition to their dependencies. Loading a spec from a yaml file was not initializing the dependents.

- [x] populate dependents when loading from yaml
2020-03-20 11:34:23 -07:00
Seth R. Johnson
f3a1a8c6fe Uniquify suffixes added to module names (#14920) 2020-03-20 11:33:07 -07:00
Tamara Dahlgren
b02981f10c bugfix: ensure proper dependency handling for package-only installs (#15197)
The distributed build PR (#13100) -- did not check the install status of dependencies when using the `--only package` option so would refuse to install a package with the claim that it had uninstalled dependencies whether that was the case or not.

- [x] add install status checks for the `--only package` case.
- [x] add initial set of tests
2020-03-20 11:23:28 -07:00
Andrew W Elble
654914d53e Fix for being able to 'spack load' packages that have been renamed. (#14348)
* Fix for being able to 'spack load' packages that have been renamed.

* tests: add test for 'spack load' of a installed, but renamed/deleted package
2020-03-20 11:21:40 -07:00
Michael Kuhn
3753424a87 modules: store configure args during build (#11084)
This change stores packages' configure arguments during build and makes
use of them while refreshing module files. This fixes problems such as in
#10716.
2020-03-20 11:16:39 -07:00
Greg Becker
32a3d59bfa fetch_strategy: remove vestigial code (#15431) 2020-03-20 11:14:37 -07:00
Dr. Christian Tacke
03945c2541
Show the packaga name for a missing patch sha256 (#15441)
When a patches sha256 is missing, also show the
packagename, so that analyzing is easier.
2020-03-20 11:39:04 -05:00
Greg Becker
e5f8b093a9
Cray bugfix: TERM missing while reading default target (#15381)
Bug: Spack hangs on some Cray machines

Reason: The TERM environment variable is necessary to run bash -lc "echo $CRAY_CPU_TARGET", but we run that command within env -i, which wipes the environment.

Fix: Manually forward the TERM environment variable to env -i /bin/bash -lc "echo $CRAY_CPU_TARGET"
2020-03-19 15:11:50 -07:00
Todd Gamblin
3255eaba0d refactor: spack.package.possible_dependencies() handles virtuals
- [x] move some logic for handling virtual packages from the `spack
  dependencies` command into `spack.package.possible_dependencies()`

- [x] rework possible dependencies tests so that expected and actual
  output are on the left/right respectively
2020-03-19 09:00:40 -07:00
Todd Gamblin
7cfa497912 bugfix: spack.package.possible_dependencies() should return virtuals
`spack.package.possible_dependencies()` was forgetting to pass the
`visited` dict to recursive calls; this fixes it
2020-03-19 09:00:40 -07:00
Patrick Gartung
8bffa57ac4
Buildcache: fix relocation of binaries with relative rpaths (#15558) 2020-03-18 22:37:09 -05:00
Kai Germaschewski
3df712a385
Upstreams: don't write metadata directory to upstream DB (#15526)
When trying to use an upstream Spack repository, as of f2aca86 Spack
was attempting to write to the upstream DB based on a new metadata
directory added in that commit. Upstream DBs are read-only, so this
should not occur.

This adds a check to prevent Spack from writing to the upstream DB
2020-03-18 16:41:18 -07:00
Sinan
056fc99676
Use python extend_path as pyqt sip fix (#15297)
* try extend path to solve PyQt5.sip not found issue

* disable private sip installation in sippackage class

* undo manual PyQt5 dir creation in py-sip site-packages dir

* fix typo

* fix typo

* also apply fix to PyQt4

* tidy up

* flake8 and tidy up

* tidy and undo hardcoding of python_include_dir

* replace hardcoded python inc dir

* fix minor issues

* rethink include dir variable name

* improve style

* add new versions

* implement new sip setup to qsci installation

* set sip-incdir correctly for the new setup

* setup extend_path thing before qsci python bindings

* take care of conflict

* flake8

* also extend for PyQt4

* improve style

* improve style

* SipPackage build sys should depend on py-sip

* consolidate extend_path fixes into SipPackage

* fix typo

* fix bugs

* flake8

* revert sip doc to pre-resource setup

* import os module

* flake8

Co-authored-by: Sinan81 <sbulut@3vgeomatics.com>
2020-03-18 13:19:27 -05:00
Patrick Gartung
be8841cbc5
Remove PatchelfError and change patchelf error message to a warning. (#15518) 2020-03-17 10:49:24 -05:00
Patrick Gartung
e48d24ee45
Warn only if link target is not relative and outside of the install prefix (#15512) 2020-03-16 18:43:11 -05:00
Patrick Gartung
3029dde7ec
When replacing path text in ELF binaries do not include null byte padding in search string (#15508) 2020-03-16 14:49:55 -05:00
Seth R. Johnson
a8706cc89b
CMakePackage: convert variants to CMake arguments (#14376)
Add a 'define_from_variant` helper function to CMake-based Spack
packages to convert package variants into CMake arguments. For
example:

  args.append('-DFOO=%s' % ('ON' if '+foo' in self.spec else 'OFF'))

can be replaced with:

  args.append(self.define_from_variant('foo'))

The following conversions are handled automatically:

* Flag variants will be converted to CMake booleans
* Multivalued variants will be converted to semicolon-separated strings
* Other variant values are converted to CMake string arguments

This also adds a 'define' helper method to convert any variable to
a CMake argument. It has the same conversion rules as
'define_from_variant' (but operates directly on values rather than
requiring the user to supply the name of a package variant).
2020-03-16 11:41:19 -07:00
Patrick Gartung
17e4df1e41
Buildcache: Install into non-default directory layouts (#13797)
* Buildcache: Install into non-default directory layouts

Store a dictionary mapping of original dependency prefixes to dependency hashes

Use the loaded spec to grab the new dependency prefixes in the new directory layout.

Map the original dependency prefixes to the new dependency prefixes using the dependency hashes.

Use the dependency prefixes map to replace original rpaths with new rpaths preserving the order.
For mach-o binaries, use the dependency prefixes map to replace the dependency library entires for libraries and executables and the replace the library id for libraries.

On Linux, patchelf is used to replace the rpaths of elf binaries.
On macOS, install_name_tool is used to replace the rpaths and  dependency libraries  of mach-o binaries and the id of mach-o libraries.
On Linux, macholib is used to replace the dependency libraries of mach-o binaries and the id of mach-o libraries.

Binary text with padding replacement is attempted for all binaries for the following paths:
spack layout root
spack prefix
sbang script location
dependency prefixes
package prefix
 Text replacement is attempted for all text files using the paths above.

Symbolic links to the absolute path of the package install prefix are replaced, all others produce warnings.
2020-03-16 08:42:23 -05:00
Michael Kuhn
14441e00dc
package: Add fetch_options variable (#15317)
PR #15212 added a new connect_timeout option that can be overridden
using fetch_options but had to specified per-version. This adds a new
per-package variable that can be used to override fetch_options for
all versions in the package. This includes connect_timeout as well
as 'cookie' (e.g. for the jdk package).

Packages can combine package-level fetch_options with per-version
fetch_options, in which case the version fetch_options completely
override the package-level fetch_options.

This commit includes tests for the added behavior.
2020-03-13 11:41:19 -07:00
Tamara Dahlgren
f2a13af43e
testing: increase installer coverage (#15237) 2020-03-12 21:20:20 +01:00
Massimiliano Culpo
59b6822a47
Creating versions from urls doesn't modify class attributes (#15452)
fixes #15449

Before this PR a call to pkg.url_for_version was modifying
class attributes determining different results for subsequents
calls and an error when the urls was empty.
2020-03-12 09:21:19 +01:00
Tamara Dahlgren
20c77cade5
bugfix: resolve undefined source_pkg_dir failure (#15339) 2020-03-11 11:39:23 +01:00
Greg Becker
299fa6b5ca
fetch_strategy: remove vestigial code (#15431) 2020-03-11 11:24:38 +01:00
Greg Becker
bbbee6700b
bugfix: fix install_missing_compilers option bug from v0.14.0 (#15416)
* bugfix: ensure bootstrapped compilers built before packages using the compiler
2020-03-10 10:35:20 -07:00
Christoph Junghans
577860761b
decompressor: add support for bz2 (#15424) 2020-03-10 10:46:45 -06:00
Patrick Gartung
c7dda38826
Revert to gzip as the default buildcache compression as bzip2 is not always available. (#15412)
* Revert to gzip as the default buildcache compression as bzip2 is not always available.

* Flake8
2020-03-09 16:46:54 -05:00
Todd Gamblin
49ec260a9a
bugfix: installer.py shouldn't be executable (#15386)
This is a minor permission fix on the new installer.py introduced in #13100.
2020-03-07 23:48:18 -08:00
Massimiliano Culpo
b444fd25bb
ArchSpec: fix semantics of satisfies when not concrete and strict is true (#15319) 2020-03-07 13:58:33 +01:00
Peter Scheibel
697719c181
Only use stable versions for public mirror (#15100)
* add --skip-unstable-versions option to 'spack mirror create' which skips sources/resource for packages if their version is not stable (i.e. if they are the head of a git branch rather than a fixed commit)

* '--skip-unstable-versions' should skip all VCS sources/resources, not just those which are not cachable
2020-03-07 13:38:08 +01:00
Andrew W Elble
5b44a65881
Fix for being able to 'spack load' packages that have been renamed. (#14348)
* Fix for being able to 'spack load' packages that have been renamed.

* tests: add test for 'spack load' of a installed, but renamed/deleted package
2020-03-06 16:29:01 -08:00
Chris Green
da5144793e
Allow overrides for spack.config set() and override(). (#14432)
Allows spack.config InternalConfigScope and Configuration.set() to
handle keys with trailing ':' to indicate replacement vs merge
behavior with respect to lower priority scopes.

Lists may now be replaced rather than merged (this behavior was
previously only available for dictionaries).

This commit adds tests for the new behavior.
2020-03-05 19:25:01 -08:00
Tamara Dahlgren
b2e7e7edaa
Recover coverage from subprocesses during unit tests (#15354)
* Recover coverage from subprocesses during unit tests
2020-03-05 16:54:29 -08:00
Patrick Gartung
820d147e08
Allow buildcaches keys to find public keys on the e4s mirror (#15361) 2020-03-05 15:15:40 -06:00
Massimiliano Culpo
752092f46a
Correct pytest.raises matches to match (#15346) 2020-03-05 11:16:02 +01:00
Massimiliano Culpo
d9626cca50
Bugfix: resolve StopIteration message attribute failure (#15341)
Testing the install StopIteration exception resulted in an attribute error:

AttributeError: 'StopIteration' object has no attribute 'message'

This PR adds a unit test and resolves that error.
2020-03-05 10:26:50 +01:00
Patrick Gartung
e2b3d52999
Add function replace_prefix_nullterm for use on mach-o rpaths. (#15347)
This recovers the old behavior of replace_prefix_bin that was
modified to work with elf binaries by prefixing os.sep to new prefix
until length is the same as old prefix.
2020-03-04 19:21:15 -06:00
Peter Scheibel
cf7dbbf65c
Remove DB conversion of old index.yaml (#15298)
Removed the code that was converting the old index.yaml format into
index.json. Since the change happened in #2189 it should be
considered safe to drop this (untested) code.
2020-03-04 16:39:10 -08:00
Patrick Gartung
3ea0e91533
use os.sep instead of null byte to pad replacement paths in binaries (#15338)
* use os.sep instead of null byte to pad replacement paths in binaries

* Prefix the pading os.sep's
2020-03-04 17:15:09 -06:00
Sergey Kosukhin
b472c13803
Fix FCFLAGS handling for Autotools packages (#14788)
Spack's fflags are meant for both f77 and fc. Therefore, they must
be passed as FFLAGS and FCFLAGS to the configure scripts of
Autotools-based packages.
2020-03-03 13:13:38 -08:00
Tamara Dahlgren
73f7301ec4
bugfix: ensure proper dependency handling for package-only installs (#15197)
The distributed build PR (#13100) -- did not check the install status of dependencies when using the `--only package` option so would refuse to install a package with the claim that it had uninstalled dependencies whether that was the case or not.

- [x] add install status checks for the `--only package` case.
- [x] add initial set of tests
2020-03-02 11:16:20 -08:00
Adam J. Stewart
513f9235c3
Fix detection of redhat enterprise compute node (#15253)
* Fix detection of redhat enterprise compute node

* Add comma

* Remove space
2020-02-28 11:27:15 -06:00
Michael Kuhn
f580b340f8 Add new timeout fetch_option
This allows packages to override the global connect_timeout.
2020-02-27 10:52:52 -08:00
Michael Kuhn
b7cfd05ef7 Generalize curl_options into fetch_options
This allows us to support higher-level concepts such as 'cookie' and
'timeout' without users having to specify curl options.
2020-02-27 10:52:52 -08:00
Michael Kuhn
7325c20794 config: Add a new option connect_timeout
connect_timeout can be used to increase the time Spack waits for the
server to answer. This can be used to work around slow connections or
servers.

Fixes #14700
2020-02-27 10:52:52 -08:00
Adam J. Stewart
6153eea2c2
CudaPackage: add support for Tesla K80 and older CUDA (#15031)
* CudaPackage: add support for Tesla K80 and older CUDA

* Flake8 fixes

* Fix cuda_arch when no arch is set

* Fine-tune cuda_arch=37,50 supported CUDA versions

* CUDA 6.5+ supports SM_37

* Add @svenevs as a maintainer
2020-02-27 12:16:20 -06:00
TZ
d6d095a868
Docs: "spack env" is in the meantime called "spack build-env" (#15233) 2020-02-27 09:13:09 +01:00
Tamara Dahlgren
ed15adbb9e
bugfix: Add dependents when initializing spec from yaml (#15220)
The new build process, introduced in #13100 , relies on a spec's dependents in addition to their dependencies. Loading a spec from a yaml file was not initializing the dependents.

- [x] populate dependents when loading from yaml
2020-02-26 18:49:29 -08:00
Seth R. Johnson
6c445a2c0f
Uniquify suffixes added to module names (#14920) 2020-02-26 18:03:28 +01:00
Glenn Johnson
a568db00b8
A few edits for the Basic Usage Doc page (#15215)
This PR corrects a few minor things and adds a note about colorized
output.
2020-02-26 10:03:03 +01:00
Patrick Gartung
ae87828520
buildcache cmd: add explicit message with default output dir for buildcaches. (#15090)
* Make -d directory a required option. Print messages about where buildcaches will be written.

* Add mutually exclusive required options

* spack commands --update-completion

* Apply @opadron's patch

* Update share/spack/spack-completion.bash

* Incorporate @opadron's suggestions
2020-02-25 17:49:25 -06:00
Omar Padron
00090f8f97
add --only option to buildcache create cmd (#14921)
* add --only option to buildcache create cmd

replaces the --no-deps option
2020-02-25 17:32:20 -05:00
Omar Padron
8d750db9de
remove catch-all exception handling in buildcache command (#15185)
* remove catch-all exception handling in buildcache command

* fix test
2020-02-25 14:10:50 -06:00
Patrick Gartung
676eb56ab2
Buildcache cmd: add install -o/--otherarch option for installing macOS buildcaches on linux (#15192)
* Buildcache command: add install option -o/--otherarch
This will allow matching specs from other archs, for example
installing macOS buildcaches on linux hosts.

* spack commands --update-completion
2020-02-25 11:01:59 -06:00
Michael Kuhn
45306206c7
docs: Fix tiny typo (#15181) 2020-02-24 10:58:21 -06:00
Michael Kuhn
94acd8f235
cmd/load: Fix usage output (#15180)
args.specs is a list, which results in output like this:
```
eval `spack load --sh ['libxml2', 'xz']`
```

We want this instead:
```
eval `spack load --sh libxml2 xz`
```
2020-02-24 09:46:41 -06:00
Michael Kuhn
a38eb70e30
modules: store configure args during build (#11084)
This change stores packages' configure arguments during build and makes
use of them while refreshing module files. This fixes problems such as in
#10716.
2020-02-24 15:34:57 +01:00
Todd Gamblin
5aa1739bfa Merge branch 'releases/v0.14' into develop 2020-02-23 17:32:12 -08:00
Todd Gamblin
388960f044 version bump: 0.14.0 2020-02-23 17:08:15 -08:00
Michael Kuhn
b935d88282
create: Mention that python dependency does not have to be added (#15173)
A generic python dependency is already added implicitly by the
PythonPackage class.
2020-02-23 10:22:50 -08:00
Massimiliano Culpo
82be8965f2
Emit a sensible error message if compiler's target is overly specific (#14888)
* Emit a sensible error message if compiler's target is overly specific

fixes #14798
fixes #13733

Compiler specifications require a generic architecture family as
their target. This commit improves the error message that is
displayed to users if they edit compilers.yaml and use an overly
specific name.
2020-02-21 14:50:54 -08:00
Tamara Dahlgren
38fc441a36
Updated installer module copyright (#15138)
Update the copyright for `installer.py`.
2020-02-20 16:55:42 -08:00
Tamara Dahlgren
a03b252522
Restore package-related unsigned binary changes from PR 11107 (#15134)
Restore package-related unsigned binary changes from PR 11107
2020-02-20 14:03:47 -08:00
Peter Scheibel
2e387ef585
Package hashing: fix detection of directives (#14763)
The hashing logic looks for function calls that are Spack directives.
It expects that when a Spack directive is used that it is referenced
directly by name, and that the directive function is not itself
retrieved by calling another function. When the hashing logic
encountered a function call where the function was determined
dynamically, it would fail (attempting to access a name attribute
that does not happen to exist in this case).

This updates the hashing logic to filter out function calls where the
function is determined dynamically when looking for uses of Spack
directives.
2020-02-20 13:45:58 -08:00
Patrick Gartung
dd0e18d7b8
Use get_spec in relocated _try_install_from_binary_cache (#15131)
* Use get_spec in relocated _try_install_from_binary_cache
2020-02-20 13:07:32 -08:00
Massimiliano Culpo
d1929b2ea7
Compilers require an exact match on version during concretization (#14752)
Spack now requires an exact match of the compiler version
requested by the user. A loose constraint can be given to
Spack by using a version range instead of a concrete version
(e.g. 4.5: instead of 4.5).
2020-02-20 12:20:12 -08:00
Dr. Christian Tacke
22a56a89c7
Use shutil.copy2 in install_tree (#15058)
Sometimes one needs to preserve the (relative order) of
mtimes on installed files.  So it's better to just copy
over all the metadata from the source tree to the install
tree. If permissions need fixing, that will be done anyway
afterwards.

One major use case are resource()s:
They're unpacked in one place and then copied to their
final place using install_tree(). If the resource is a
source tree using autoconf/automake, resetting mtimes
uncorrectly might force unwanted autoconf/etc calls.
2020-02-19 23:09:26 -06:00
Adam J. Stewart
7a60a04402
Docs: configure_args -> cmake_args (#15102) 2020-02-19 22:48:56 -06:00
Oliver Breitwieser
65133daad7
Fix relocate.mime_type if slashes in subtype (#11788)
If the mimetype returned from `file -h -b --mime-type` contains slashes
in its subtype, the tuple returned from `spack.relocate.mime_type` will
have a size larger than two, which leads to errors.

Change-Id: I31de477e69f114ffdc9ae122d00c573f5f749dbb
2020-02-19 17:30:17 -06:00
Patrick Gartung
14025e89f6
Buildcache: join rpaths returned by get_existing_elf_rpaths with ':'. (#15086)
This reproduces the behavior expected by patchelf_is_relocatable test.
2020-02-19 11:41:02 -06:00
Tamara Dahlgren
f2aca86502
Distributed builds (#13100)
Fixes #9394
Closes #13217.

## Background
Spack provides the ability to enable/disable parallel builds through two options: package `parallel` and configuration `build_jobs`.  This PR changes the algorithm to allow multiple, simultaneous processes to coordinate the installation of the same spec (and specs with overlapping dependencies.).

The `parallel` (boolean) property sets the default for its package though the value can be overridden in the `install` method.

Spack's current parallel builds are limited to build tools supporting `jobs` arguments (e.g., `Makefiles`).  The number of jobs actually used is calculated as`min(config:build_jobs, # cores, 16)`, which can be overridden in the package or on the command line (i.e., `spack install -j <# jobs>`).

This PR adds support for distributed (single- and multi-node) parallel builds.  The goals of this work include improving the efficiency of installing packages with many dependencies and reducing the repetition associated with concurrent installations of (dependency) packages.

## Approach
### File System Locks
Coordination between concurrent installs of overlapping packages to a Spack instance is accomplished through bottom-up dependency DAG processing and file system locks.  The runs can be a combination of interactive and batch processes affecting the same file system.  Exclusive prefix locks are required to install a package while shared prefix locks are required to check if the package is installed.

Failures are communicated through a separate exclusive prefix failure lock, for concurrent processes, combined with a persistent store, for separate, related build processes.  The resulting file contains the failing spec to facilitate manual debugging.

### Priority Queue
Management of dependency builds changed from reliance on recursion to use of a priority queue where the priority of a spec is based on the number of its remaining uninstalled dependencies.  

Using a queue required a change to dependency build exception handling with the most visible issue being that the `install` method *must* install something in the prefix.  Consequently, packages can no longer get away with an install method consisting of `pass`, for example.

## Caveats
- This still only parallelizes a single-rooted build.  Multi-rooted installs (e.g., for environments) are TBD in a future PR.

Tasks:
- [x] Adjust package lock timeout to correspond to value used in the demo
- [x] Adjust database lock timeout to reduce contention on startup of concurrent
    `spack install <spec>` calls
- [x] Replace (test) package's `install: pass` methods with file creation since post-install 
    `sanity_check_prefix` will otherwise error out with `Install failed .. Nothing was installed!`
- [x] Resolve remaining existing test failures
- [x] Respond to alalazo's initial feedback
- [x] Remove `bin/demo-locks.py`
- [x] Add new tests to address new coverage issues
- [x] Replace built-in package's `def install(..): pass` to "install" something
    (i.e., only `apple-libunwind`)
- [x] Increase code coverage
2020-02-19 00:04:22 -08:00
Patrick Gartung
6f95967e95
buildcache: Check for tar.bz2 and set tar.gz if not found (#15054)
* Check for tar.bz2 and set tar.gz if not found

* Move check for tarfile after it is extracted
2020-02-18 15:49:55 -06:00
Greg Becker
82f76c44a0
skip gpg tests when no gpg executable (#14935)
* skip gpg tests when no gpg executable

* flake
2020-02-18 09:20:14 -08:00
Adam J. Stewart
342200774b
spack extensions prints list of extendable packages (#14473)
* spack extensions prints list of extendable packages

* Update tab completion scripts
2020-02-17 17:41:47 -06:00
Patrick Gartung
baafa7ec84
Buildcache creation/extraction use temp tarfile to preserve hardlinks during copy to/from prefix. (#15003)
* Buildcache creation change the way prefix is copied to workdir.
* install_tree copies hardlinked files
* tarfile creates hardlinked files on extraction.
* create a temporary tarfile from prefix and extract it to workdir

* Use temp tarfile to move workdir to prefix to preserve hardlinks instead of copying
2020-02-14 16:10:28 -06:00
Paul
e65aa7569e
docs: fix typo in arch in build settings examples (#14998) 2020-02-14 19:06:10 +01:00
Massimiliano Culpo
8c05221bc6
spack compiler info: quick fix for failing command (#14928)
fixes #14927
2020-02-13 20:32:55 -06:00
Patrick Gartung
4dc67b79aa
Replace direct call to patchelf with get_existing_elf_rpaths which handles exceptions. (#14929)
* Replace direct call to patchelf with get_existing_elf_rpaths which handles exceptions.

* Remove unused patchelf definition.

* Convert to set.
2020-02-13 11:34:20 -06:00
Todd Gamblin
a7b43f1015 spack python: add -m option to run modules as scripts
It's often useful to run a module with `python -m`, e.g.:

    python -m pyinstrument script.py

Running a python script this way was hard, though, as `spack python` did
not have a similar `-m` option.  This PR adds a `-m` option to `spack
python` so that we can do things like this:

    spack python -m pyinstrument ./test.py

This makes it easy to write a script that uses a small part of Spack and
then profile it.  Previously thee easiest way to do this was to write a
custom Spack command, which is often overkill.
2020-02-12 16:45:41 -08:00
Todd Gamblin
c56c4b334d bugfix: spack -V should use working_dir() instead of git -C
- `git -C` doesn't work on git before 1.8.5
- `working_dir` gets us the same effect
2020-02-11 16:52:06 -08:00
Massimiliano Culpo
357786ce6b
Spack find: fix queries that specify dependencies (#14757)
Fixes #10019

If multiple instances of a package were installed in a single
instance of Spack, and they differed in terms of dependencies, then
"spack find" would not distinguish specs based on their dependencies.
For example if two instances of X were installed, one with Y and one
with Z, then "spack find X ^Y" would display both instances of X.
2020-02-10 11:22:21 -08:00
Todd Gamblin
6d2e6e1f4d Merge branch 'releases/v0.13' into develop 2020-02-09 15:51:39 -08:00
Todd Gamblin
a8d5c6ccf2 version bump: 0.13.4 2020-02-07 16:51:44 -06:00