Commit graph

3441 commits

Author SHA1 Message Date
Greg Becker
f242f5f8a9 Features: Improve Spec format strings (#10556)
* Update spec format to simpler syntax, maintain backwards compatibility
* Switch to new spec.format method throughout internals
* update package files for new format strings
* documentation and minor code cleanup. removed nonsensical variant sigils
2019-04-17 18:21:40 -07:00
Satish Balay
7280f21397 Add ftn to lib/spack/env (#11180)
Fixes #11070 #11010

Spack attempts to intercede on behalf of all compiler invocations for
a build. This involves adding its wrappers to PATH. Cray systems
include a "ftn" executable and Spack was only redirecting this call
when the Spec was built with cce. This updates the compiler wrappers
to add "ftn" in all cases.
2019-04-17 13:12:25 -07:00
Peter Scheibel
ef8b5c73ce
don't record 'view: True' in environment config (#11182)
The default (implied) behavior for all environments, as of ea1de6b,
is that an environment will maintain a view in a location of its
choosing. ea1de6b explicitly recorded all three possible states of
maintaining a view:

 1. Maintain a view, and let the environment decide where to put it
    (default)
 2. Maintain a view, and let the user decide
 3. Don't maintain a view

This commit updates the config writer so that for case [1], nothing
will be written to the config.yaml. This will not change any existing
behavior, it just serves to keep the config more compact.
2019-04-16 19:08:10 -07:00
Adam J. Stewart
dbfa928cdb Add unit tests for Cray compiler detection (#11191) 2019-04-16 10:01:42 +02:00
Greg Becker
5f74f22dc6 Bugfix: Install missing compilers for dependency packages (#11175)
Compilers are treated separately from other dependencies in Spack.
#10761 added the option to automatically install compilers when a
package specifies using a compiler that is not available in Spack.
However, this did not work correctly for dependency packages (it
would only build a compiler for the root of an install DAG). This
commit enables the building of compilers for dependency packages.
2019-04-15 17:41:15 -07:00
Massimiliano Culpo
263d8a818a Updated Sphinx configuration (#11165) 2019-04-11 14:38:52 -07:00
Denis Davydov
177b7f111a intel: optionally take gcc executable from cflags (#11136) 2019-04-11 12:33:59 -07:00
Peter Scheibel
ea1de6b941 Maintain a view for an environment (#10017)
Environments are nowm by default, created with views.  When activated, if an environment includes a view, this view will be added to `PATH`, `CPATH`, and other shell variables to expose the Spack environment in the user's shell.

Example:

```
spack env create e1 #by default this will maintain a view in the directory Spack maintains for the env
spack env create e1 --with-view=/abs/path/to/anywhere
spack env create e1 --without-view
```

The `spack.yaml` manifest file now looks like this:

```
spack:
  specs:
  - python
  view: true #or false, or a string
```

These commands can be used to control the view configuration for the active environment, without hand-editing the `spack.yaml` file:

```
spack env view enable
spack env view envable /abs/path/to/anywhere
spack env view disable
```

Views are automatically updated when specs are installed to an environment. A view only maintains one copy of any package. An environment may refer to a package multiple times, in particular if it appears as a dependency. This PR establishes a prioritization for which environment specs are added to views: a spec has higher priority if it was concretized first. This does not necessarily exactly match the order in which specs were added, for example, given `X->Z` and `Y->Z'`:

```
spack env activate e1
spack add X
spack install Y # immediately concretizes and installs Y and Z'
spack install # concretizes X and Z
```

In this case `Z'` will be favored over `Z`. 

Specs in the environment must be concrete and installed to be added to the view, so there is another minor ordering effect: by default the view maintained for the environment ignores file conflicts between packages. If packages are not installed in order, and there are file conflicts, then the version chosen depends on the order.

Both ordering issues are avoided if `spack install`/`spack add` and `spack install <spec>` are not mixed.
2019-04-10 16:00:12 -07:00
Mario Melara
a1db22ba1a Unload altd and darshan (#11162) 2019-04-10 13:19:41 -07:00
Peter Scheibel
c1f8fdd5df
Add documentation for chaining Spack instances (#11152)
Add documentation for the Spack chain feature added in #8772
2019-04-10 11:54:13 -07:00
George Hartzell
0256766ab9 Typo: Unkown -> Unknown (#11150) 2019-04-09 18:36:45 -05:00
Denis Davydov
1f1ea2c859 intel: consolidate libs() in the base class (#11143)
* intel: consolidate libs() in the base class

* white space

* flake8
2019-04-09 13:54:21 -07:00
Scott Wittenburg
3616617804 Allow spack install to take either cdash stamp or track (#11106)
When providing a track, the cdash reporter will format the stamp
itself, as it has always done, and register the build during the
package installation process.  When providing a stamp, it should
first be formatted as cdash expects, and then cdash will be sure
to report results to same build id which was registered manually
elsewhere.
2019-04-06 15:30:34 -07:00
Greg Becker
8a17282001 Fix reading externals from old databases (#11118)
* Update Spec.prefix to have special case for 'None' in database path; regression test
* Update in database reader rather than spec
* Change assertion to conditional + raise
* Added test for concrete check in Spec.prefix
2019-04-05 14:58:57 -07:00
Michael Kuhn
320e00276f Fix module_parsing test (#11087)
The module_parsing test checks whether the module function is available
by looking for the string 'not found'. If the user has set a different
locale, the test can assume that the module function is available when
it actually is not.
2019-04-05 11:26:40 -07:00
Tim Fuller
a9ae507152 Fix directory layout using namespace (#11076)
Directory layouts using ${NAMESPACE} were broken. This addresses that
and adds a test to prevent regression.
2019-04-02 17:47:57 -07:00
Tristan Carel
4793242158 spack repo add: fix error message when `packages' directory is missing (#11031) 2019-04-02 17:05:57 -07:00
Massimiliano Culpo
a1255b61c0 Added tests on compiler's version detection (#10931)
* Split get_compiler_version into two functions:
  get_compiler_version_output runs the compiler with the relevant
  option to print the version; extract_version_from_output determines
  the version by examining this output. This makes it easier to test
  the customized version detection for each compiler. Users can
  customize this by overriding the following:
  * version_argument: this is the argument that tells the compiler to
    print its version. It assumes that the compiler will report its
	version if invoked with a single option (like "--version")
  * version_regex: the regular expression used to extract the version
    from the compiler argument. This assumes that a regular
	expression is sufficient to extract the version, and that the
	version can be extracted from a single capture group (Spack uses
	the first capture group)
  * default_version: allows you to completely override all version
    detection logic
  * get_compiler_version_output: if getting the compiler to report
    its version is more complex than invoking it with a single arg
  * extract_version_from_output: if it is difficult to define a regex
    that can be used to extract the version from the output
* Added tests for version detection of most compilers
* Removed redundant code from xl_r compiler class (by inheriting
  from xl compiler definition)
2019-04-02 12:52:47 -07:00
Massimiliano Culpo
e3f00750e8 Update llnl.util.lang.memoized so that Sphinx can extract signature (#11055)
Replace the original implementation of the "memoized" decorator with
an implementation that exposes the docstring and arguments of the
wrapped function. This is achieved using functools.wraps.
2019-03-29 17:11:44 -07:00
Denis Davydov
def5b23763 add libs property to IntelMkl and IntelParallelStudio (#10993)
* add libs property to IntelMkl and IntelParallelStudio
* fix scalapack_libs when MPI is provided by intel-parallel-studio
2019-03-29 13:01:43 -07:00
Massimiliano Culpo
0a006351c8 Spack can be extended with external commands (#8612)
This provides a mechanism to implement a new Spack command in a
separate directory, and with a small configuration change point Spack
to the new command.

To register the command, the directory must be added to the
"extensions" section of config.yaml. The command directory name must
have the prefix "spack-", and have the following layout:

  spack-X/
    pytest.ini #optional, for testing
    X/
	  cmd/
	    name-of-command1.py
	    name-of-command2.py
	    ...
    tests/ #optional
      conftest.py
	  test_name-of-command1.py
    templates/ #optional jinja templates, if needed

And in config.yaml:

  config:
    extensions:
      - /path/to/spack-X

If the extension includes tests, you can run them via spack by adding
the --extension option, like "spack test --extension=X"
2019-03-28 16:56:36 -07:00
Peter Scheibel
a6511fbafc Consistent patch ordering (#10879)
* preserve the order in which patches are applied by packages (in spite of grouping them by 'when')

* add tests confirming patch order
2019-03-28 11:25:44 -07:00
Peter Scheibel
99f35c3338 spack chain (#8772)
* initial work to make use of an 'upstream' spack installation: this uses the DB of the upstream installation to check if a package is installed

* need to query upstream dbs when adding new record to local db

* prevent reindexing upstream DBs

* set prefix on specs read from DB based on path stored in install record

* check that Spack does not install packages that are recorded as installed in an upstream db

* externals do not add their path to install records - need to use 'external_path' to get path of upstream externals

* views need to check for upstream installations when linking metadata

* package and spec now calculate upstream installation properties on-demand themselves rather than depending on concretization to set these properties up-front. The added tests for upstream installations don't work with this new strategy so they need to be updated

* only refresh modules for local specs (not those in upstream packages); optionally generate local module files for packages installed upstream

* when a user tries to locate a module file for a package installed upstream, tell them to use the upstream spack instance to locate it

* support recursive upstream databases (allow upstream databases to use their own upstream databases)

* separate upstream config into separate file with its own schema; each entry now also includes a name

* metadata_dir is no longer customizable on a per-instance basis for YamlDirectoryLayout

* treat metadata_dir as an instance variable but dont set it from kwargs; this follows several other hardcoded variables which must be consistent between upstream and downstream DBs. Also update DirectoryLayout.metadata_path to work entirely with Spec.prefix, since Spec.prefix is set from the DB when available (so metadata_path was duplicating that logic)
2019-03-27 13:06:46 -07:00
Mario Melara
298a55b28f Replace previous bash command to new one (#7005)
Prevents infinite recursion caused by sourcing `setup-env.sh` in bashrc
2019-03-27 10:26:52 -07:00
Chris Green
e88c1d585c Move CMakePackage build directory to base stage directory (#8431)
Change the location of the CMake build area from the staged source
directory to the stage base directory.

This change allows CMake packages to refer to the build directory in
setup_environment (e.g. if tests need to have a directory in PATH):
Staging happens after the call to setup_environment(), and if the
stage area does not exist, then spec.stage.source_path returns None.

To accommodate this change, archived files (like config.log for
Autotools packages) are archived relative to the stage base directory
rather than the expanded source directory.

Other packages (those not using CMake) will still use the staged
source directory as the default working directory for builds (and
will still be unable to reference this directory in
setup_environment())
2019-03-26 17:40:49 -05:00
ajw1980
e5b86c5527 Retrieve environment-modules prefix based on architecture (#10975)
When multiple instances of environment-modules were installed with
different architectures, Spack was not retrieving the installation
appropriate for the current architecture when finding the module
prefix.
2019-03-26 15:23:17 -05:00
Seth R. Johnson
844ca31894 Use 'shlex' to split default Executable arguments (#10929)
This allows shell commands for `spack edit` to be executed correctly if
they have quoted arguments.
2019-03-26 14:02:32 -05:00
Massimiliano Culpo
89b9880719 Add regression marker to pytest.ini (#11011) 2019-03-26 12:04:36 -05:00
Nichols A. Romero
66172f80f3 Fixed some issues with CUDA-Intel compiler conflicts. (#10924)
* Fixed some issues with CUDA-Intel compiler conflicts.

* Comment about expressing CUDA-compiler conflicts.

* More precise conflicts and also add support for Intel 19.0
2019-03-26 15:31:56 +01:00
Shahzeb Siddiqui
724acb6421 typo in documentation (#10976) 2019-03-21 14:29:40 -05:00
George Hartzell
aa1e70aab1 Minor commentary correction, TCL -> lmod (#10951) 2019-03-21 11:17:41 +01:00
Stephen McDowell
70e436e932 prevent UnboundLocalError when sourcing files (#10950)
Patch extracted from #7536 courtesy of @mgsternberg
2019-03-21 11:08:29 +01:00
Chris Green
9ad02685d9 Fix help text for --no-checksum. (#10932) 2019-03-19 15:02:06 -05:00
Adam J. Stewart
4e6285a19b
Ensure that every package has a description (#10896) 2019-03-14 20:49:07 -05:00
Chris Green
9b51fb09f1 Support VISUAL environment variable for editing. (#10898)
If the user has set the environment variable VISUAL, it will be used
in preference to EDITOR for all Spack editing activities. If VISUAL
is not set or fails (perhaps due to a lack of graphical editing
capabilities),EDITOR will be used instead. We fall back to one of
several common editors if neither bears fruit.

This feature has been tailored to:

* Provide identical behavior to the previous implementation in the
  case that VISUAL is not set.
* Not require any change to code utilizing the editor feature.
* Follow usual UNIX behavior concerning VISUAL and EDITOR.
2019-03-14 16:16:26 -05:00
Tristan Carel
c3662492de Do not use string module to be compatible with python 3 (#248) (#10667)
`string.find` is not part of Python 3 anymore.
2019-03-12 20:34:47 -05:00
Justin Stanley
2bea940e43 find_versions_of_archive: expand link search (#10758) 2019-03-12 20:19:46 -05:00
Nick Forrington
6bda37f542 Fix clearing EnvironmentModifications with python2 (#10791)
* Fix clearing EnvironmentModifications with python2

* Add EnvironmentModifications::clear unit test

Use re-assignment rather than del to clear array

* Fix flake issues
2019-03-12 20:12:51 -05:00
Shahzeb Siddiqui
d20b5ce2ec format change and typo in doc (#10848) 2019-03-11 13:19:13 -05:00
Massimiliano Culpo
a42fd7f276 Improved detection of Clang versions (#10316)
Fixes #10191

* Add more regular expressions to detect clang versions that were
  not being picked up
* Add a test for parsing versions from the output of Clang (this
  does not run Clang, but rather uses example outputs from Clang)
* Separate Clang version parsing into its own method (to make it
  easier to test)
2019-03-11 13:15:34 -05:00
Michael Kuhn
a1c91f3c07 Fix find_headers to also look for C++ headers and Fortran modules (#10798)
Currently, only C headers are considered, causing build failures for
packages depending on, e.g., netcdf-fortran and xerces-c. Additionally,
the regex used to look for the include path component did not consider
word boundaries, causing false matches.
2019-03-08 21:06:22 -06:00
Greg Becker
f4d4322a41
Create option to build compilers as needed (#10761)
* Create option to build missing compilers and add them to config before installing packages that use them
* Clean up kwarg passing for do_install, put compiler bootstrapping in separate method
2019-03-07 17:30:48 -08:00
Adam J. Stewart
f7223e54ed Make is a required dependency of Spack (#10386)
Update documentation on getting started to mention that a "make"
executable is required to build packages with Spack.
2019-03-06 19:46:54 -06:00
Patrick Gartung
1d4289afdd
This fixes a problem where the placeholder path was not in the first rpath entry.
* Rework of buildcache creation and install prefix checking using the functions introduced in
https://github.com/spack/spack/pull/9199

Instead of replacing rpaths with placeholder and then checking strings, make use of the functions
relocate.is_recocatable and relocate.is_file_relocatable to decide if a package needs the allow-root option.

This fixes a problem where the placeholder path was not in the first rpath entry. This was seen in c++ libraries and binaries because the compiler was outside the spack install base path and always appears first in the rpath.

Instead of checking the first rpath entry, all rpaths have the placeholder path and the old install path (if it exists) replaced with the new install path.

* flake8
2019-03-01 07:47:26 -06:00
Massimiliano Culpo
e3af8ed454 Added a sub-command to show if packages are relocatable (#9199)
* Added the `spack buildcache preview` sub-command

This is similar to `spack spec -I` but highlights which nodes in a DAG
are relocatable and which are not.

spec.tree has been generalized a little to accept a status function,
instead of always showing the install status

The current implementation works only for ELF, and needs to be
generalized to other platforms.

* Added a test to check if an executable is relocatable or not

This test requires a few commands to be present in the environment.
Currently it will run only under python 3.7 (which uses Xenial instead
of Trusty).

* Added tests for the 'buildcache preview' command.

* Fixed codebase after rebase

* Fixed the list of apt addons for Python 3.7 in travis.yaml

* Only check ELF executables and shared libraries. Skip checking virtual or external packages. (#229)

* Fixed flake8 issues

* Add handling for macOS mach binaries (#231)
2019-02-28 15:36:47 -06:00
Michael Kuhn
617c1a3706 Fix shell integration with environment-modules@4 (#10736) 2019-02-28 13:22:44 +01:00
Adam J. Stewart
a25edb51a9 Fix 'make test' detection when LANG is not in English (#10499) 2019-02-27 14:01:50 -06:00
Massimiliano Culpo
7eec038690
Update environment-modules package (#10717)
The environment modules package has been updated to include 
versions up to 4.0.0. The url of the package and the homepage
have been updated accordingly.

The `spack bootstrap` command now builds version 3.2.10 of
the environment-modules package, and will do until #10708 
is fixed.
2019-02-27 14:00:46 +01:00
Massimiliano Culpo
42386dbe94 Use Package.headers for -I options (#10623)
This restores the use of Package.headers when computing -I options
for building a package that was added in #8136 and reverted in
#10604. #8136 used utility logic that located all header files in
an installation prefix, and calculated the -I options as the
immediate roots containing those header files.

In some cases, for a package containing a directory structure like

  prefix/
    include/
	  ex1.h
	  subdir/
	    ex2.h

dependents may expect to include ex2.h relative to 'include', and
adding 'prefix/include/subdir' as a -I was causing errors,
in particular if ex2.h has the same name as a system header.

This updates header utility logic to by default return the base
"include" directory when it exists, rather than subdirectories.
It also makes it possible for package implementers to override
Package.headers to return the subdirectory when it is required
(for example with libxml2).
2019-02-26 12:42:30 -06:00
Daniel Topa
c832479c65 Add libhio v1.4.1.3, 1.4.1.1 (#10699)
- Switch all libhio tarball listings to sha256 checksums
- Correct typo in alert message in /lib/spack/spack/util/module_cmd.py: fucntion -> function

https://github.com/hpc/libhio/releases
Released 2019-02-01

Verification builds on LANL Darwin:

**Intel Xeon**
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                40
On-line CPU(s) list:   0-39
Thread(s) per core:    2
Core(s) per socket:    10
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz
Stepping:              2
CPU MHz:               1198.779
CPU max MHz:           3300.0000
CPU min MHz:           1200.0000
BogoMIPS:              5193.70
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              25600K
NUMA node0 CPU(s):     0-9,20-29
NUMA node1 CPU(s):     10-19,30-39
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts
`
[+] /scratch/users/dantopa/new-spack/strawman.pr.libhio/opt/spack/linux-centos7-x86_64/gcc-4.8.5/libhio-1.4.1.3-s4fnmesfp65trhks5qi3it5p73ssfpsp
[+] /scratch/users/dantopa/new-spack/strawman.pr.libhio/opt/spack/linux-centos7-x86_64/gcc-4.8.5/libhio-1.4.1.2-fkgh5vqpijvwqywffmokgmsglqxwfrtl
`

**Arm**
Architecture:          aarch64
Byte Order:            Little Endian
CPU(s):                256
On-line CPU(s) list:   0-255
Thread(s) per core:    4
Core(s) per socket:    32
Socket(s):             2
NUMA node(s):          2
Model:                 0
BogoMIPS:              400.00
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              32768K
NUMA node0 CPU(s):     0-127
NUMA node1 CPU(s):     128-255
Flags:                 fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
`
[+] /scratch/users/dantopa/new-spack/strawman.pr.libhio/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/libhio-1.4.1.3-q6nnwiy6bi7ktnghdsngwamom23zpmgy
[+] /scratch/users/dantopa/new-spack/strawman.pr.libhio/opt/spack/linux-rhel7-aarch64/gcc-4.8.5/libhio-1.4.1.2-y6nwovff3qbdy242zc4x2toloz6xpcvm
`

2019-02-25

Signed-off-by: Daniel Topa <dantopa@lanl.gov>
2019-02-26 09:56:20 +01:00
Adam J. Stewart
a75a6ee1b7 Add /hash to spack help --spec (#10691)
* Add /hash to spack help --spec
* Make /hash gray, add ^/hash
2019-02-25 16:20:28 -08:00
Peter Scheibel
98f1c9a291
CPATH warning: downgrade to debug message (#10675)
Spack warns users when a dependency package updates CPATH. This
warning message is generating bug reports and alarm in cases where
there is no problem. For now this downgrades the warning message to
the debug level, so it only shows up if something goes wrong for the
user and they ask for more information from Spack.
2019-02-21 17:26:38 -06:00
Scott Wittenburg
5600c9f0d9 release workflow: Add build scripts for jobs and means to upload pkgs 2019-02-21 15:37:35 -06:00
Scott Wittenburg
a6e8e889b2 release workflow: Add spack command for generating the .gitlab-ci.yml
This spack command adds a new schema for a file which describes the
builder containers available, along with the compilers availabe on
each builder.  The release-jobs command then generates the .gitlab-ci.yml
file by first expanding the release spec set, concretizing each spec
(in an appropriate docker container if --this-machine-only argument is
not provided on command line), and then combining and staging all the
concrete specs as jobs to be run by gitlab.
2019-02-21 15:37:35 -06:00
Scott Wittenburg
fce1c4133f buildcache: Add sub-commands needed by release workflow
Adds four new sub-commands to the buildcache command:

1. save-yaml: Takes a root spec and a list of dependent spec names,
along with a directory in which to save yaml files, and writes out
the full spec.yaml for each of the dependent specs.  This only needs
to concretize the root spec once, then indexes it with the names of
the dependent specs.

2. check: Checks a spec (via either an abstract spec or via a full
spec.yaml) against remote mirror to see if it needs to be rebuilt.
Comparies full_hash stored on remote mirror with full_hash computed
locally to determine whether spec needs to be rebuilt.  Can also
generate list of specs to check against remote mirror by expanding
the set of release specs expressed in etc/spack/defaults/release.yaml.

3. get-buildcache-name: Makes it possible to attempt to read directly
the spec.yaml file on a remote or local mirror by providing the path
where the file should live based on concretizing the spec.

4. download: Downloads all buildcache files associated with a spec
on a remote mirror, including any .spack, .spec, and .cdashid files
that might exist.  Puts the files into the local path provided on
the command line, and organizes them in the same hierarchy found on
the remote mirror

This commit also refactors lib/spack/spack/util/web.py to expose
functionality allowing other modules to read data from a url.
2019-02-21 15:37:35 -06:00
Todd Gamblin
be4b95ee30 add CombinatorialSpecSet class for taking cross-products of Specs.
- add CombinatorialSpecSet in spack.util.spec_set module.
  - class is iterable and encaspulated YAML parsing and validation.

- Adjust YAML format to be more generic
  - YAML spec-set format now has a `matrix` section, which can contain
    multiple lists of specs, generated different ways. Including:
    - specs: a raw list of specs.
    - packages: a list of package names and versions
    - compilers: a list of compiler names and versions

  - All of the elements of `matrix` are dimensions for the build matrix;
    we take the cartesian product of these lists of specs to generate a
    build matrix.  This means we can add things like [^mpich, ^openmpi]
    to get builds with different MPI versions.  It also means we can
    multiply the build matrix out with lots of different parameters.

- Add a schema format for spec-sets
2019-02-21 15:37:35 -06:00
Peter Scheibel
32ba471816
Dependency libs: filter system paths and always add lib dir (#10622)
Fixes #10617
Fixes #10624
Closes: #10619

#8136 dependended entirely on spec.libs to retrieve library directories
from dependencies. By default this function only retrieves libraries if
their name is something like lib<package> (e.g. "libfoo.so" for a
package called "Foo"). This unconditionally adds lib/lib64 directories
for each dependency as link/rpath directories. 

This also filters system paths from link/rpaths/include directories and
removes duplicated paths that #8136 could add.
2019-02-15 17:21:35 -06:00
Javier Cervantes
9b1690641b Fix bug getting specs from build caches (#9600) 2019-02-15 13:33:49 -06:00
Scott Wittenburg
75487dca44 CDash: allow installing from spec.yaml (#10565)
If the -f <specyamlfile> argument to install is used (rather than
providing package specs on the command line), CDash throws an exception
due to missing the installation command (the packages targeted for
install).  This fixes that behavior so CDash reporting succeeds in
either case.
2019-02-14 17:43:53 -06:00
Massimiliano Culpo
1ec0d4feb3 Removed pkg.headers.directories from the include list (#10604)
fixes #10601

Due to a bug this attribute is wrong for packages that use directories
as namespaces. For instance it will add "<boost-prefix>/include/boost"
instead of "<boost-prefix>/include" to the include path.

As a minor addition a few loops in the compiler wrappers have been
simplified.
2019-02-14 08:35:41 -08:00
Peter Scheibel
8ca384875e
Dynamic library/include paths (#8136)
Fixes #7855
Closes #8070
Closes #2645

When searching for library directories (e.g. to add "-L" arguments to
the compiler wrapper) Spack was only trying the "lib/" and "lib64/"
directories for each dependency install prefix; this missed cases
where packages would install libraries to subdirectories and also was
not customizable. This PR makes use of the ".headers" and ".libs"
properties for more-advanced location of header/library directories.
Since packages can override the default behavior of ".headers" and
".libs", it also allows package writers to customize.

The following environment variables which used to be set by Spack
for a package build have been removed:

* Remove SPACK_PREFIX and SPACK_DEPENDENCIES environment variables as
  they are no-longer used
* Remove SPACK_INSTALL environment variable: it was not used before
  this PR
2019-02-13 17:38:14 -06:00
abernede
89727ba4e7 Bug Fix in permission setter (#10584)
* fix permission setter

Fix a typo in islink test when applied to files.

* os.walk explicitly set not to follow links

The algorithm strongly rely on not following links.
2019-02-13 11:18:36 -08:00
sknigh
a76c50d1ee Allow tty output to be timestamped (#10554)
* Spack debug output now includes microsecond-granularity timestamps.
* Timestamps can also be enabled with the `--timestamp` command line argument.
2019-02-13 10:14:35 -08:00
Matthias Wolf
861dd06bd1 enh: allow time like HH:MM in date strings. (#10034) 2019-02-13 11:05:00 +01:00
George Hartzell
f65a1155e1 Enhancement to module autoload documentation (#10310)
* Note that `none` is the default for lmod autoload

Save a bit of confusion by *explicitly* pointing out that `none` is
the default value for autoload in the lmod module file generator.

* Add a tip re building software externally

Add a tip about using `autoload: all` when building packages outside
of the tree that use artifacts (e.g. libraries, includes) within the
tree.
2019-02-12 22:02:13 +01:00
Chris Green
05f565356f Allow secondary generators when building with CMake. (#9324)
CMake supports the notion of secondary generators which provide extra
information to (e.g.) IDEs over and above that normally provided by
the primary generator. Spack only supports the 'Unix Makefiles' and
'Ninja' primary generators but was not parsing out the primary
generator when a secondary generator was also included (e.g. for
a generator attribute like 'Codeblocks - Ninja'). This adds a regex
for extracting the primary generator for validation.

Since the secondary generator is irrelevant to a Spack build, it is
passed on to CMake without further validation.
2019-02-12 12:39:19 -06:00
Denis Davydov
5623ac3d6b CudaPackage: fix wrong version range (#10551) 2019-02-08 16:32:43 +01:00
Massimiliano Culpo
58f1dc037a log-parse: fix error message when no error lines are found (#10543) 2019-02-07 12:19:19 -06:00
Mario Melara
5bc71f07dd Add x86_64 as target to cray platform (#10369)
Add x86_64 as a target for the Cray platform, and also designate it
as the default front_end target.
2019-02-06 17:49:00 -06:00
Nichols A. Romero
5394f0016a CUDA compiler conflicts for Linux (#10460)
* CUDA compiler conflicts for Linux.

* Add Volta and Turing GPUs.

* Add mandatory conflict for Volta and Turing GPUs.

* Revert "CUDA compiler conflicts for Linux."

This reverts commit 7d4ff654ac53aad272c59e9f7f8bb3fbb32bcec4.

* Compiler conflicts introduced from previous commit into CUDA packaged moved and integrated into CUDA build system.

* More conversative with compiler conflicts for cuda 10.0.130, since I don't know what will happen with future cuda 10.x releases.

* Correct off-by-one errors in clang conflicts for x86_64 Linux.

* No restrictions on Apple Clang compiler until we are able to distinguish Xcode clang from github clang more easily. Note to fix this in the future.

* Change comment to clarify that github clang refers to LLVM clang.

* Fix and simplify index range.

* Fix overlapping conflicts for CUDA 10.0.130

* Removed extra ^cuda from conflict.
2019-02-06 17:09:52 +01:00
Peter Scheibel
b2c2cbadcd
debug output includes modulecmd output (#9476)
Debug output now includes the output of modulecmd executions. Only
output module content when a failure occurs; always report when a
module is loaded/unloaded.
2019-01-29 17:41:15 -06:00
Peter Scheibel
5abf29c971
Environments: fix bug for install of external packages (#10437)
"spack install" will install all packages added to the current
environment. When this included external packages, the environment
update would fail because it would attempt to copy log files that
were only generated if Spack handled the install itself. This skips
that step for external packages.
2019-01-24 21:29:21 -06:00
Greg Becker
98e0b5b0db
Allow spack install --overwrite for nonexistent or multiple packages (#9201)
* Allow overwrite nonexistent and multiple packages

initial implementation
give one prompt to users instead of a prompt per spec
testing

* flake

* bugfix: install overwrite check each spec against installed

* python3 compliance for filter/map
2019-01-24 12:10:32 -08:00
Todd Gamblin
618741fce2 tutorial: update tutorial materials for ECP19 2019-01-14 01:03:38 -06:00
Gregory Becker
dc005f3ff1 version bump: v0.12.1 2019-01-13 14:26:39 -08:00
Adam J. Stewart
dc6dca3c36 cc: clean up cray compilers, fix issues with case-insensitive filesystems (#10323)
* Remove Cray CC compilers causing problems on case-insensitive filesystems
* cray -> cce
* Ensure that compiler-specific directory comes first in build-env
* Point to compiler-specific symlinks
2019-01-12 17:37:20 -08:00
Greg Becker
c63c4a048c Binary caching bugfix: symlink relocation (#10073)
Binary caches of packages with absolute symlinks had broken symlinks.
As a stopgap measure, #9747 addressed this by replacing symlinks with
copies of files when creating binary cached packages.

This reverts #9747 and instead, either relative-izes the symlink or
rewrites the target. If the binary cache is created using '--rel' (as
in "spack buildcache create --rel...") then absolute symlinks will be
replaced with relative symlinks (in addition to making RPATHs relative
as before); otherwise they are rewritten (when the binary cache is
unpacked and installed).
2019-01-11 14:52:01 -08:00
Matthias Wolf
3c6d484150 enh: buildcache list should behave similar to find (#10052)
The current output of buildcache list is very verbose and I feel like
some details are getting lost. By making the output similar to find, I
think users will be able to get a better overview of what is stored in
the cache.
2019-01-11 13:57:10 -08:00
Denis Davydov
f4bda74b30 dealii: fix concretization of xsdk package (#10288)
* dealii: fix concretization of xsdk package

* tests: add concretization tests for deal.II and xSDK, which are often broken due to limitations in the concretizer

* use pytest.mark.parametrize
2019-01-11 10:07:28 -08:00
Adam J. Stewart
72a41a4918 spack versions: only list safe versions (#10004)
* spack versions: only list safe versions
* Add unit tests for spack versions -s
2019-01-10 00:32:47 -08:00
Greg Becker
450b0e3059 Allow combinatorial projections in views (#9679)
Allow customizing views with Spec-formatted directory structure

Allow views to specify projections that are more complicated than
merging every package into a single shared prefix. This will allow
sites to configure a view for the way they want to present packages
to their users; for example this can be used to create a prefix for
each package but omit the DAG hash from the path.

This includes a new YAML format file for specifying the simplified
prefix for a spec in a view. This configuration allows the use of
different prefix formats for different specs (i.e. specs depending
on MPI can include the MPI implementation in the prefix).
Documentation on usage of the view projection configuration is
included.

Depending on the projection configuration, paths are not guaranteed
to be unique and it may not be possible to add multiple installs of
a package to a view.
2019-01-09 17:39:35 -08:00
Greg Becker
f5bb93c75b tutorial basics section: fix gcc install version (#10298) 2019-01-09 17:37:37 -06:00
Owen Solberg
c48b0a13b9 bug fix: copy permissions when staging (#10285)
Fixes #10284

#10152 replaced shutil.move with llnl's copy and copy_tree for
resources. This did not copy permissions so led to later failures
if an executable was copied (e.g. a configure script). This uses
install/install_tree instead, which preserve permissions.
2019-01-08 17:56:16 -08:00
Srinath Vadlamani
4fdd3b6794 Armcompiler (#9840)
* Initial compiler support

* added arm.py

* Changed licence to Arm suggested header

* Changed licence to the same as clang.py
Main author of file is Nick Forrington <Nick.Forrington@arm.com>
Minor changes by Srinath Vadlamani <srinath.vadlamani@arm.com>

* compilers: add arm compiler detection to Spack

- added arm.py with support for detecting `armclang` and `armflang`

Co-authored-by: Srinath Vadlamani <srinath.vadlamani@arm.com>

* Changed to using get get_compiler_version

* linking to general cc for arm compiler

* For arm compiler add CFLAGS to use compiler-rt rtlib.

* Escape for special characters in rexep

* Cleaned up for Flake8 to pass.

* libcompiler-rt should be part of the LDFLAGS not CFLAGS

* fixed m4 when using clang to used LDFLAGS.  Fixed comments for arm.py to display compiler --version output with # NOAQ for flakes pass.

* added arm compilers

* proper linked names
2019-01-08 16:31:25 -08:00
Peter Josef Scheibel
9f79995718 For spec-file-based installs, store the initial spec read from the file as the abstract spec 2019-01-07 20:40:34 -08:00
Massimiliano Culpo
c4521535e7 Multi-valued variants: better support for combinations (#9481)
This enforces conventions that allow for correct handling of
multi-valued variants where specifying no value is an option,
and adds convenience functionality for specifying multi-valued
variants with conflicting sets of values. This also adds a notion
of "feature values" for variants, which are those that are understood
by the build system (e.g. those that would appear as configure
options). In more detail:

* Add documentation on variants to the packaging guide
* Forbid usage of '' or None as a possible variant value, in
  particular as a default. To indicate choosing no value, the user
  must explicitly define an option like 'none'. Without this,
  multi-valued variants with default set to None were not parsable
  from the command line (Fixes #6314)
* Add "disjoint_sets" function to support the declaration of
  multi-valued variants with conflicting sets of options. For example
  a variant "foo" with possible values "a", "b", and "c" where "c"
  is exclusive of the other values ("foo=a,b" and "foo=c" are
  valid but "foo=a,c" is not).
* Add "any_combination_of" function to support the declaration of
  multi-valued variants where it is valid to choose none of the
  values. This automatically defines "none" as an option (exclusive
  with all other choices); this value does not appear when iterating
  over the variant's values, for example in "with_or_without" (which
  constructs autotools option strings from variant values).
* The "disjoint_sets" and "any_combination_of" methods return an
  object which tracks the possible values. It is also possible to
  indicate that some of these values do not correspond to options
  understood by the package's build system, such that methods like
  "with_or_without" will not define options for those values (this
  occurs automatically for "none")
* Add documentation for usage of new functions for specifying
  multi-valued variants
2019-01-04 19:02:34 -08:00
Peter Josef Scheibel
64deda1b0c Add tests for expanding/non-expanding resources 2019-01-04 17:04:28 -08:00
Michael Kuhn
41ef02ee10 stage: fix resources being deleted from local cache (#10152)
Non-expanded resources were being deleted from the cache on account
of two behaviors:

* ResourceStage was moving files rather than copying them, and uses
  "os.path.realpath" to resolve symlinks
* CacheFetchStrategy creates a symlink to a cached resource rather
  than copying it

This alters the first behavior: ResourceStage now copies the file
rather than moving it.
2019-01-04 17:04:28 -08:00
Ben Zwick
7d9dbc5fd2 Add missing code block (#10243)
Otherwise the `--` in `--dot` is rendered as a single en-dash.
2019-01-03 09:41:14 -06:00
Michael Kuhn
802dc4a03a patch: split up fetch and clean into separate methods (#10150)
"mirror create" was invoking a package's do_patch method in order to
retrieve and archive URL patches. If a package implements a "patch"
method, this is also called as part of do_patch; this failed when the
package-specific implementation referred to environment variables
that are only available at the time the package is built
(e.g. "spack_cc").

This change introduces fetch and clean methods for patches. They are
no-ops for FilePatch but perform the appropriate actions for
UrlPatch. This allows "mirror create" to invoke do_fetch, which does
not call the package's patch method.
2019-01-02 11:44:50 -08:00
Massimiliano Culpo
8540d5390e
Removed an extra comma after a dict literal (#10236)
The extra comma was turning a dict into a tuple, and caused errors
during validation of the schema.
2019-01-02 01:15:15 +01:00
Todd Gamblin
5425a3dad4 flake8: fix flake8 issues with invalid escapes
- in many files, regular strings were used in places where raw strings
  should've been used.

- convert these to raw strings and get rid of new flake8 errors
2019-01-01 00:44:28 -08:00
Todd Gamblin
6f50cd52ed copyright: update license headers for 2013-2019 copyright. 2019-01-01 00:44:28 -08:00
Todd Gamblin
e82992ae32 license: license command prints sorted, non-redundant results
- spack license command now ignores symlinks

- spack license list-files now prints sorted output, and checks for files
  we've already seen.
2019-01-01 00:44:28 -08:00
Massimiliano Culpo
3b8b13809e Improve validation of modules.yaml (#9878)
This PR improves the validation of `modules.yaml` by introducing a custom validator that checks if an attribute listed in `properties` or `patternProperties` is a valid spec. This new check applied to the test case in #9857 gives:

```console
$ spack install szip
==> Error: /home/mculpo/.spack/linux/modules.yaml:5: "^python@2.7@" is an invalid spec [Invalid version specifier]
```

Details: 
* Moved the set-up of a custom validator class to spack.schema
  * In Spack we use `jsonschema` to validate configuration files 
    against a schema. We also need custom validators to enforce
    writing default values within "properties" or "patternProperties"
    attributes.

  * Currently, validators were customized at the place of use and with the
    recent introduction of environments that meant we were setting-up and
    using 2 different validator classes in two different modules.

  * This commit moves the set-up of a custom validator class in the
    `spack.schema` module and refactors the code in `spack.config` and
    `spack.environments` to use it.

* Added a custom validator to check if an attribute is a valid spec
  * Added a custom validator that can be used on objects, which yields an
    error if the attribute is not a valid spec.

* Updated the schema for modules.yaml

* Updated modules.yaml to fix a few inconsistencies:
  - a few attributes were not tested properly using 'anyOf'
  - suffixes has been updated to also check that the attribute is a spec
  - hierarchical_scheme has been updated to hierarchy

* Removed $ref from every schema
  * $ref is not composable or particularly legible
  * Use python dicts and regular old variables instead.
2019-01-01 00:11:49 -08:00
Todd Gamblin
2e3303abd0 bugfix: nested directives were broken in python 3
- The nested directive implementation was broken for python 3

- directive results were not properly removed from the directive list
  when it was processed in the DirectiveMeta metaclass.

- the issue was that remove_directives only descended into a list or
  tuple, but in Python3, the initial value passed to the function is a
  view of dictionary values.

- make it a list to fix things, and add a regression test.
2018-12-30 00:19:08 -08:00
Todd Gamblin
d763e92141 commands: add spack resource command to inspect downloadable files
- currently just looks at patches
  - allows you to find out which package applied a patch to a spec

- intended to work with tarballs and resources in the future.

- add tab completion for `spack resource` and subcommands
2018-12-30 00:19:08 -08:00
Todd Gamblin
d2db978c7f tests: add a test to make sure that patched specs can be round-tripped
- previously, if a concrete sub-DAG with patched specs was written out
  and read back in, its patches would not be found because the dependent
  that patched it was no longer in the DAG.

- Add a test to ensure that the PatchCache handles this case.

- Also add tests to ensure that patch objects are properly created from
  Specs -- previously we only checked that the patches were on the Spec.
2018-12-30 00:19:08 -08:00
Todd Gamblin
d3ee6c977b patches: add a per-repository patch index
- this fixes a bug where if we save a concretized sug-DAG where a package
  had been patched by a dependent, and the dependent was not in the DAG,
  we would not read in all patches correctly.

- Rather than looking up patches in the DAG, we look them up globally
  from an index created from the entire repository.

- The patch cache is a bit tricky for several reasons:

  - we have to cache information from packages, specifically, the patch
    level and working directory.

  - FilePatches need to know which package owns them, so that they can
    figure out where the patch lives.  The repo can change locations from
    run to run, so we have to store relative paths and restore them when
    the cache is reloaded.

  - Patch files can change underneath the cache, because repo indexes
    only update on package changes.  We currently punt on this -- there
    are stub methods for needs_update() that will need to check patch
    files when packages are loaded.  There isn't an easy way to do this
    at global indexing time without making the FastPackageChecker a lot
    slower.  This is TBD for a future commit.

  - Currently, the same patch can only be used one way in a package. That
    is, if it appears twice with different level/working_dir settings,
    bad things will happen.  There's no package that current uses the
    same patch two different ways, so we've punted on this as well, but
    we may need to fix this in the future by moving a lot of the metdata
    (level, working dir) to the spec, and *only* caching sha256sums in
    the PatchCache.  That would require some much more complicated tweaks
    to the Spec, so we're holding off on that til later.

- This required patches to be refactored somewhat -- the difference
  between a UrlPatch and a FilePatch is still not particularly clean.
2018-12-30 00:19:08 -08:00
Todd Gamblin
a9b69fa902 ProviderIndex uses json instead of YAML
- indexes should use json, not YAML, to optimize for speed
- only use YAML in human-editable files
- this makes ProviderIndex consistent with other indexes
2018-12-30 00:19:08 -08:00
Todd Gamblin
c1d7adaaac repo: refactor indexes to be more extensible
- virtual provider cache and tags were previously generated by nearly
  identical but separate methods.

- factor out an Indexer interface for updating repository caches, and
  provide implementations for each type of index (TagIndex,
  ProviderIndex) so that more can be added if needed.

- Among other things, this allows all indexes to be updated at once.
  This is an advantage because loading package files is the real
  overhead, and building the indexes once the packages are loaded is
  trivial. We avoid extra bulk read-ins by generating all package indexes
  at once.

- This can be extended for dependents (reverse dependencies) and patches
  later.
2018-12-30 00:19:08 -08:00
Todd Gamblin
527ff860f0 patches: clean up patch.py, directives, and package class properties
- cleanup patch.py:
  - make patch.py constructors more understandable
  - loosen coupling of patch.py with package

- in Package: make package_dir, module, and namespace class properties

  - These were previously instance properties and couldn't be called from
    directives, e.g. in patch.create()

  - make them class properties so that they can be used in class definition

  - also add some instance properties to delegate to class properties so
    that prior usage on Package objects still works
2018-12-30 00:19:08 -08:00
Massimiliano Culpo
28fd1baa86 tests: run 'test_compiler_add' serially in Python 2 (#10127)
* Don't spawn processes during python 2.6/2.7 'test_compiler_add' unit tests
* Travis seems to choke on the excessive parallelism in `compiler find`
2018-12-25 23:47:46 -08:00
Denis Davydov
39b23d277b environment: ignore invalid files names in var/spack/environments (#10198) 2018-12-25 22:22:21 -08:00
Todd Gamblin
35dd929651
bugfix: handle unicode properly in spack.util.executable (#10186)
- When returning string output, use text_type and decode utf-8 in Python
  2 instead of using `str`

- This properly handles unicode, whereas before we would pass bad strings
  to colify in `spack blame` when reading git output

- add a test that round-trips some unicode through an Executable object
2018-12-23 23:59:58 -08:00
Elsa Gonsiorowski, PhD
74a5d92f07 Remove /nfs/tmp2 from default build_stage locations (#10170)
* Remove /nfs/tmp2 from default configuration
* /nfs/tmp2 is going away from LC... and doesn’t exist for the rest of the world.
* update documentation to remove /nfs/tmp2 as well
2018-12-21 02:03:54 -08:00
Zack Galbreath
b90f619037 Performance improvements for CDash reporter
* Record build output as an array of lines rather than concatenating to a
  single large string.
* Use string.find to avoid running re.search on every line of output.
2018-12-20 09:23:08 -08:00
Zack Galbreath
6355ee208c Include accurate build time in CDash report 2018-12-20 09:23:08 -08:00
Zack Galbreath
8d0872083c Report current git commit of Spack to CDash
When using the CDash reporter, upload a Update.xml file that
indicates the hash of Spack's current git commit.
2018-12-20 09:23:08 -08:00
Scott Wittenburg
7217b4a4b9 Make sure to urlencode cdash submit parameters 2018-12-20 09:23:08 -08:00
Zack Galbreath
aed9a532c6 Get buildId from CDash at submit time
Pass extra data when submitting to CDash.  If CDash responds with a buildId,
construct and display helpful URL that links to the uploaded report.
2018-12-20 09:23:08 -08:00
Zack Galbreath
738d2bd77a Allow more customization for CDash reporter
Add new command line arguments to `spack install` that allow users
to set the build name, site name, and track in their CDash report.
2018-12-20 09:23:08 -08:00
Zack Galbreath
0bae6626a4 Avoid UnboundLocalError
Make sure cdash_phase is defined before referring to it.
2018-12-20 09:23:08 -08:00
Todd Gamblin
207c37759c env: all commands that disambiguate specs should be env-aware
- some commands were missed in the rollout of spack environments

- this makes all commands that need to disambiguate specs restrict the
  disambiguation to installed packages in the active environment, as
  users would expect
2018-12-19 17:49:51 -08:00
Michael Kuhn
67ab73d381 fetch_strategy: improve GitFetchStrategy (#10153)
Currently, only the Git repsository's URL shows up in the `spack info`
output, which makes it hard to distinguish different versions:
```
Safe versions:
    develop    [git] https://github.com/LLNL/H5Z-ZFP.git
    0.8.0      [git] https://github.com/LLNL/H5Z-ZFP.git
    0.7.0      [git] https://github.com/LLNL/H5Z-ZFP.git
```

This change adds additional information as shown when cloning a Git
repository:
```
Safe versions:
    develop    [git] https://github.com/LLNL/H5Z-ZFP.git on branch master
    0.8.0      [git] https://github.com/LLNL/H5Z-ZFP.git at commit af165c4
    0.7.0      [git] https://github.com/LLNL/H5Z-ZFP.git at commit 58ac811
```
2018-12-19 14:33:58 -08:00
Adam J. Stewart
c1a99bf8ec
Add additional info to MesonPackage docs (#10133)
* Add additional info to MesonPackage docs

* No Pygments lexer for Meson code, default to none
2018-12-18 21:51:42 -06:00
Adam J. Stewart
2d0ddd5d11
Add help messages to spack gpg subcommands (#10117) 2018-12-17 13:02:51 -06:00
Adam J. Stewart
d5d64bdf3b
spack buildcache: --allow_root -> --allow-root (#10115) 2018-12-17 13:02:28 -06:00
Peter Scheibel
0217a651c8 mirrors: patches are now properly added to mirrors (#8993)
* This fixes a number of bugs:

  * Patches were not properly downloaded and added to mirrors.

  * Mirror create didn't respect `list_url` in packages

  * Update the `spack mirror` command to add all packages in the
    concretized DAG (where originally it only added the package specified
    by the user). This is required in order to collect patches that are specified
    by dependents. Example:
      * if X->Y and X requires a patch on Y called Pxy, then Pxy will only
        be discovered if you create a mirror with X.

  * replace confusing --one-version-per-spec option for `spack mirror create`
    with --versions-per-spec; support retrieving multiple versions for 
    concrete specs

* Implementation details:

  * `spack mirror create` now uses regular staging logic to download files 
    into a mirror, instead of reimplementing it in `add_single_spec`.

  * use a separate resource caching object to keep track of new
    resources and already-existing resources; also accepts storing
    resources retrieved from a cache (unlike the local cache)

  * mirror cache object now stores resources that are considered
    non-cachable, like (e.g. the tip of a branch);

  * the 'create' function of the mirror module no longer traverses
    dependencies since this was already handled by the 'mirror' command; 

  * Change handling of `--no-checksum`:

    * now that 'mirror create' uses stages, the mirror tests disable
      checksums when creating the mirror

    * remove `no_checksum` argument from library functions - this is now
      handled at the Spack-command-level (like for 'spack install')
2018-12-16 10:15:22 -08:00
Adam J. Stewart
1424830378 spack pkg add: add help message (#10116) 2018-12-15 11:44:37 +01:00
Greg Becker
d2d0ab06b7 Fix spack package inheritance for module variables (#10097)
* we weren't properly setting module variables for the root package in a DAG -- just for transitive dependencies.
2018-12-14 08:37:22 -08:00
Adam J. Stewart
ad046402b6 Make downloads from list_url deterministic (#10047) 2018-12-10 14:36:55 +01:00
Gregory Becker
b072c9b457 multimethod: slight refactoring, documentation for code review 2018-12-06 15:48:23 -08:00
Gregory Becker
2621af41d1 fix MRO for multimethod.__call__ using iterative algorithm.
Add tests MRO for inherited multimethods with multiple inheritance
Add tests for inherited and overridden multimethods
2018-12-06 15:48:23 -08:00
Todd Gamblin
43d94d4a30 tests: fully parametrize multimethod test
- all multimethod tests are now run for both `multimethod` and
  `multimethod-inheritor`

- do this with a parameterized fixture (pkg_name) that runs the same
  tests on both
2018-12-06 15:48:23 -08:00
Todd Gamblin
61b859193d multimethod uses Spec() instead of parse_anonymous_spec()
- simplify logic in multimethod
- remove the requirement of multimethod invocations to walk up the stack.
2018-12-06 15:48:23 -08:00
Todd Gamblin
88cb11758b spec: refactor and clean up Spec initialization
- Since early Spack versions, the SpecParser has (weirdly) been
  responsible for initializing Spec fields.

- This refactors initialization to take place in Spec.__init__, as it
  probably should have originally.

- This makes the code easier to read, the parser easier to understand,
  and removes the use of __new__ in the parser to initialize the Spec.

- This also makes it possible to make a completely empty Spec with
  `Spec()` -- this is an abstract Spec that will match anything.
2018-12-06 15:48:23 -08:00
Gregory Becker
7bb7b94666 Added test for multimethod inheritance 2018-12-06 15:48:23 -08:00
Peter Scheibel
34f64f1f3f improved constraint conflict error message (#9975) 2018-12-04 14:19:57 +01:00
Massimiliano Culpo
e998a399da Injected flags have a consistent order (#9960)
Fixes #9908

Spack was assembling flags in a manner that could in different
orderings for repeated concretizations of the same spec and config
2018-11-28 10:23:38 -08:00
Scott Wittenburg
33b112a60d Expose option to save all dependencies when writing spec.yaml (#9965) 2018-11-27 17:13:39 -08:00
Denis Davydov
abd7b185f7 intel-mkl: fix usage of openmp_libs and tbb_libs (#9863)
* intel-mkl: fix usage of openmp_libs and tbb_libs
* intel-mkl: remove trailing whitespace from openmp lib
2018-11-16 10:25:15 -08:00
Adam J. Stewart
b771b4015a Fix bugs in Modules Tutorial (#9821)
Found a couple bugs while trying to copy and paste the exact
tutorial content.
2018-11-13 09:31:09 -06:00
Adam J. Stewart
7bca5b9c61 Fix typos in Build Systems Tutorial (#9822) 2018-11-12 18:32:13 -06:00
Todd Gamblin
2efaf1b6f7 docs: update tutorial slide link for SC18 2018-11-12 09:44:47 -06:00
Todd Gamblin
d079a5c73e version bump: v0.12.0 2018-11-12 06:04:17 -06:00
Todd Gamblin
f92349ff8c docs: add environments tutorial
- tutorial goes through three sections:
  - installing and uninstalling environments
  - dealing with many specs
  - spack.yaml and spack.lock and workflows
2018-11-12 05:57:08 -06:00
Adam J. Stewart
a1676ab012 Updates to Configuration Tutorial for SC18 (#9811)
* Updates to Configuration Tutorial for SC18

* Suggested rewording
2018-11-11 22:50:59 -08:00
Adam J. Stewart
71561f9d2b Consistent capitalization of Build Caches docs for SC18 (#9810) 2018-11-11 21:13:01 -08:00
Adam J. Stewart
49c66db2fa Minor changes to Build Settings docs (#9808) 2018-11-11 21:12:37 -08:00
Adam J. Stewart
c227e1f02e Minor changes to Basic Settings docs for SC18 (#9809)
Grammar/spelling issues
2018-11-11 23:10:05 -06:00
Greg Becker
dfd0e96508 Update basic usage and modules tutorial (#9807)
* "spack install" now uses cache by default, update examples accordingly
* Replace some example packages with others
* Packing tutorial reference to "spack env" replaced with "spack build-env"
* Command line prompts in examples are shortened
* Example output (including paths) are updated to be more relevant to training environment
2018-11-11 22:58:50 -06:00
Peter Scheibel
2a5d5fda26
Advanced packaging tutorial: reorganize for binary caches (#9804)
Update all examples that need an MPI provider to build with MPICH; reorganize so that fixing MPICH (as part of environment section) comes first in the tutorial (most examples in the tutorial use an MPI provider).
2018-11-11 21:31:51 -06:00
Todd Gamblin
a8e8d80750 env: uninstall just removes specs that are still needed by other envs
- previously, uninstall would complain if a spec was needed by an
  environment.

- Now, we analyze dependents and dependent environments and simply remove
  (not uninstall) specs that are needed by environments
2018-11-11 18:32:24 -06:00
Todd Gamblin
87aec4134d bugfix: preserve abstract specs when installing an environment
- `spack install` was setting the root to be the concrete spec
- abstract spec is now preserved
2018-11-11 18:32:24 -06:00
Todd Gamblin
0f2bfd7492 env: fix display of concretized specs in spack find
- fix highlighting of roots in concretized specs in `spack find`
- tighten up the `spack find` output in environments
2018-11-11 18:32:24 -06:00
Todd Gamblin
8d92fd6640 env: make spack config edit and spack config get environment-aware
- with no arguments, these commands will now edit or dump the
  environment's `spack.yaml` file.

- users may not know where named environments live

- this makes it convenient for users to get to the spack.yaml
  configuration file for their named environment.
2018-11-11 18:32:24 -06:00
Todd Gamblin
25f8abb963 bugfix: make defaults consistent --use-cache and --no-cache (#9803) 2018-11-11 17:18:21 -06:00
Mario Melara
7d98c73e40 Update buildsystem tut (#9795)
* Update Makefile to use property methods ("build_targets"/"install_targets")
  to demonstrate their usage
* Fix highlighting
* Change cbench example to ESMF:
  CBench package file was changed and no longer uses the example shown in
  the old docs
2018-11-11 14:21:54 -06:00
Adam J. Stewart
d366e642e4 Updates to Configuration Files docs for SC18 (#9801)
Scopes added with -C are now referred to as "custom scopes"
rather than "command line scopes". "command line scope" now refers
to specific config options that are set on the command line (like
"--insecure")
2018-11-11 10:57:46 -08:00
Todd Gamblin
6141ae49fd
install: add --use-cache back so that existing tooling does not break (#9797)
- default is still to use the cache, but we've added back the
  `--use-cache` argument so that scripts that used it are still correct.

- `--no-cache` is stil present and is mutually exclusive with `--use-cache`
2018-11-09 16:41:48 -08:00
Nichols A. Romero
236b34f3df Introduce fftw-api virtual package for Intel-MKL and FFTW (#9618)
* Introduce FFTW2 and FFT3 providers for Intel-MKL and FFTW Spack packages.

* make fftw default package for fftw-api virtual package

* virtual package test assertion now provides location of default virtual packages.

* Change name of virtual package to fftw-api and used versioned interface.
2018-11-09 08:16:11 -08:00
Greg Becker
988d37757f buildcache: update spack install to use build cache by default (#9772) 2018-11-09 00:59:28 -08:00
Todd Gamblin
423d3e75ab env: clean up command access to the active environment
- all commands (except `spack find`, through `ConstraintAction`) now go
  through get_env() to get the active environment

- ev.active was hard to read -- and the name wasn't descriptive.
  - rename it to _active_environment to be more descriptive and to strongly
    indicate that spack.environment manages it
2018-11-09 00:31:24 -08:00
Todd Gamblin
562482d9cc env: only add concrete attribute to abstract specs
- to aovid changing spec hashes drastically, only add this attribute to
  differentiated abstract specs.

- othherwise assume that read-in specs are concrete
2018-11-09 00:31:24 -08:00
Todd Gamblin
13164b114a env: make environment search more consistent; simplify code
- spack.yaml files in the current directory were picked up inconsistently
  -- make this a sure thing by moving that logic into find_environment()
  and moving find_environment() to main()

- simplify arguments to Spack command:
  - remove short args for infrequently used commands (--pdb/-D, -P, -s)
  - `spack -D` now forces an env with a directory
2018-11-09 00:31:24 -08:00
Todd Gamblin
3f68d8c53a externals: bugfix in ruamel for ordereddict in Python 2.6
- args weren't being delegated properly from CommentedMap to OrderedDict
2018-11-09 00:31:24 -08:00
Todd Gamblin
62f8ea1a75 env: rename EnvError to SpackEnvironmentError 2018-11-09 00:31:24 -08:00
Todd Gamblin
13aca774e3 bugfix: preserve patch ordering when specs are copied
- The `Spec` class maintains a special `_patches_in_order_of_appearance`
  attribute on patch variants, but it is was preserved when specs are
  copied.

- This caused issues for some builds

- Add special logic to `Spec` to preserve this variant on copy

- TODO: in the long term we should get rid of the special variant and
  make it the responsibility of one of the variant classes.
2018-11-09 00:31:24 -08:00
Todd Gamblin
a41bce2148 fix bad regular expressions and docstrings with '\' 2018-11-09 00:31:24 -08:00
Todd Gamblin
1137b183e3 commands: rework command categories and arguments
- split 'environment' section into 'environments' and 'modules'
- move location to 'query packages' section
- move cd to developer section

- --env-dir no longer has a short optino (was -E)
- -E now means "run without an environment" (no longer same as --env-dir)
- -D now means "run with this directory environment"
- remove short options for may infrequently used top-level commands
2018-11-09 00:31:24 -08:00
Todd Gamblin
efad7ac81b env: consolidate most of spack env status into spack find
- `spack env status` used to show install status; consolidate that into
  `spack find`.

- `spack env status` will still print out whether there is an active
  environment
2018-11-09 00:31:24 -08:00
Todd Gamblin
26a55ff749 env: move env uninstall into spack uninstall
- uninstall now:
  - restricts its spec search to the current environment
  - removes uninstalled specs from the current environment
  - reports envs that still need specs you're trying to uninstall

- removed spack env uninstall command
- updated tests
2018-11-09 00:31:24 -08:00
Todd Gamblin
7136274f4b env: move spack env stage into spack stage command 2018-11-09 00:31:24 -08:00
Todd Gamblin
e62506571f env: spack env destroy is now spack env remove 2018-11-09 00:31:24 -08:00
Todd Gamblin
8b549f664c env: move add, remove, and concretize to top-level commands 2018-11-09 00:31:24 -08:00
Todd Gamblin
e63b45b293 env: moved all spack env install functionality into spack install
- moved get_env from cmd/env.py to environment.py

- spack install will now install into the active environment when no
  arguments are provided.  It looks:
  1. at the command line
  2. for a local spack.yaml file
  3. for any currently activated environment
2018-11-09 00:31:24 -08:00
Todd Gamblin
08e4720ed9 env: remove all -e arguments on subcommands
- add and remove now require an active environment
- update tests to use with <ENV> instead of -e
2018-11-09 00:31:24 -08:00
Todd Gamblin
d483e6e17b env: currently activated environment cannot be destroyed 2018-11-09 00:31:24 -08:00
Todd Gamblin
40af955b94 env: prevent any active environments from interfering with tests
- ensure that `SPACK_ENV` is unset before tests
- ensure that `spack.environment.active` is deactivated if set
2018-11-09 00:31:24 -08:00
Todd Gamblin
c27b78ee36 env: remove upgrade() and relocate() for now
- these won't be in the first release of environments
- they'll be added back in later
2018-11-09 00:31:24 -08:00
Todd Gamblin
36623a27fd env: add test to ensure config precedence is high-to-low 2018-11-09 00:31:24 -08:00
Todd Gamblin
66aa3426ac env: make install_status output more concise 2018-11-09 00:31:24 -08:00
Todd Gamblin
a1818f971f env: environments can be named or created in directories
- `spack env create <name>` works as before

- `spack env create <path>` now works as well -- environments can be
  created in their own directories outside of Spack.

- `spack install` will look for a `spack.yaml` file in the current
  directory, and will install the entire project from the environment

- The Environment class has been refactored so that it does not depend on
  the internal Spack environment root; it just takes a path and operates
  on an environment in that path (so internal and external envs are
  handled the same)

- The named environment interface has been hoisted to the
  spack.environment module level.

- env.yaml is now spack.yaml in all places.  It was easier to go with one
  name for these files than to try to handle logic for both env.yaml and
  spack.yaml.
2018-11-09 00:31:24 -08:00
Todd Gamblin
9fb37dfd76 env: spack install SPEC installs into currently active environment.
- install will now add (if necessary), concretize, and install a single
  spec into the active environment.
2018-11-09 00:31:24 -08:00
Todd Gamblin
3fd9fc8994 env: spack env install automatically concretizes specs 2018-11-09 00:31:24 -08:00
Todd Gamblin
d14f7b82bb env: add spack env activate/deactivate and shell support
- `spack env activate foo`: sets SPACK_ENV to the current active env name

- `spack env deactivate`: unsets SPACK_ENV, deactivates the environment

- added support to setup_env.sh and setup_env.csh

- other env commands work properly with SPACK_ENV, as with an environment
  arguments.

- command-line --env arguments take precedence over the active
  environment, if given.
2018-11-09 00:31:24 -08:00
Todd Gamblin
15c5c36eaf env: bugfix: spack env list won't fail if var/spack/environments doesn't exist 2018-11-09 00:31:24 -08:00
Todd Gamblin
ce230fa3f4 env: rework environments
- env.yaml is now meaningful; it contains authoritative user specs

  - concretize diffs user specs in env.yaml and env.json to allow user to
    add/remove by simply updating env.yaml

  - comments are preserved when env.yaml is updated by add/unadd

  - env.yaml can contain configuration and include external configuration
    either from merged files or from config scopes

  - there is only one file format to remember (env.yaml, no separate init
    format)

- env.json is now env.lock, and it stores the *last* user specs to be
  concretized, along with full provenance.
  - internal structure was modified slightly for readability
  - env.lock contains a _meta section with metadata, in case needed

- added more tests for environments

- env commands follow Spack conventions; no more `spack env foo install`
2018-11-09 00:31:24 -08:00
Todd Gamblin
6af5dfbbc2 config: allow env.yaml to contain configuration in a single file
- add `SingleFileScope` to configuration, which allows us to pull config
  sections from a single file.

- update `env.yaml` and tests to ensure that the env.yaml schema works
  when pulling configurtion from the env file.
2018-11-09 00:31:24 -08:00
Todd Gamblin
9ee2623486 env: rename spack env list to spack env status 2018-11-09 00:31:24 -08:00
Todd Gamblin
c19000038b schemas: rework schemas so that they can be included from other files
- Each schema now has a top-level `properties` and `schema` attribute.

- The `properties` is a fragment that can be included in other
  jsonschemas, via Python, not via '$ref'

- Th `schema` is a complete `jsonschema` with `title` and `$schema`
  properties.
2018-11-09 00:31:24 -08:00
Todd Gamblin
83323f4e71 bugfix: Avoid KeyError in compilers.yaml version check 2018-11-09 00:31:24 -08:00
Todd Gamblin
84140c6cd3 env: add -e as global spack argument, make spack -e <env> spec work
- add -E/--exact-env instead of --use-env-repo
- simplify env handling in `spack find`
2018-11-09 00:31:24 -08:00
Todd Gamblin
180d804615 env: add --env argument to spack location 2018-11-09 00:31:24 -08:00
Todd Gamblin
47e60d5ef8 env: add --env argument to spack find
- add a common argument for `-e/--env`
- modify the database to support queries on subsets of hashes
- allow `spack find` to be filtered by hashes in an environment
2018-11-09 00:31:24 -08:00
Todd Gamblin
ea7648ff84 bugfix: identical specs with different DAG hashes don't shadow each other
- logic used in `spack find` was hiding duplicate installations if their
  hashes were different

- short hash doesn't work in this scenario, since specs are structurally
  identical

- ConstraintAction always works on a DB query, so use the DAG hash to
  ensure uniqueness
2018-11-09 00:31:24 -08:00
Todd Gamblin
3e94c4d573 env: move main Environment class and logic to spack.environment
- `spack.environment` is now the home for most of the infrastructure
   around Spack environments

- refactor `cmd/env.py` to use everything from spack.environment

- refactor the cmd/env test to use pytest and fixtures
2018-11-09 00:31:24 -08:00
Todd Gamblin
0e60fcccfb utils: merge spack.environment into spack.util.environment
- `spack.util.environment` is the new home for routines that modify
  environment variables.

- This is to make room for `spack.environment` to contain new routines
  for dealing with spack environments
2018-11-09 00:31:24 -08:00
Todd Gamblin
cd075b04d2 env: refactor imports in cmd/env.py and tests 2018-11-09 00:31:24 -08:00
Todd Gamblin
b738b7b05b env: refactor subparsers in env.py
- Instead of one method with all parsers, each subcommand gets two
  functions: `setup_<cmd>_parser()` and `environment_<cmd>()`

- the `setup_parser()` and `env()` functions now generate the parser
  based on these and a list of subcommands.

- it is now easier to associate the arguments with the subcommand.
2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
31cb2041c3 env: add spack env command, along with env.yaml schema and tests
Co-authored-by: Elizabeth Fischer <rpf2116@columbia.edu>
2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
4b2f51d063 env: preserve command_line as the scope of highest precedence
Co-authored-by: Elizabeth Fischer <rpf2116@columbia.edu>
2018-11-09 00:31:24 -08:00
Elizabeth Fischer
d1cce990cd env: refactor common arguments 2018-11-09 00:31:24 -08:00
Elizabeth Fischer
037457adc9 specs: save/restore concrete & patches when exporting/importing Specs 2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
7f224b616d specs: _concrete should never be cleared when copying Specs 2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
acdb391931 specs: add convenience function for reading spec dependencies from node dict 2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
4daa164fbf specs: allow writing full spec (including build deps) to dict 2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
e6c6ab64b8 env: rename 'spack env' command to 'spack build-env' 2018-11-09 00:31:24 -08:00
Peter Josef Scheibel
bb8da72f0c env: renamed 'environment' test 2018-11-09 00:31:24 -08:00
Peter Scheibel
7d97e8b067 New repo for advanced packaging tutorial (#9711)
* modified tutorial packages

* update hint in hdf5 tutorial file (typo for suggested argument)

* add repo.yaml to tutorial repository

* update tutorial docs to refer user to tutorial package repository

* flake edits

* recommend site scope vs. defaults

* you don't specify the repo's name when adding a repo, just the path
2018-11-06 19:57:32 -08:00
Peter Scheibel
058cf81312 Binary caching: remove symlinks, copy files instead (#9747)
* omit symlinks and create file copies when making a binary cache of a package

* unrelated flake edits involving regexes that recent flake is now angry about
2018-11-06 19:56:03 -08:00
Zack Galbreath
30eda8b837 cdash: report clean results to CDash server (#9564)
* Record stdout for packages without errors

  Previously our reporter only stored stdout if something went wrong
  while installing a package.  This prevented us from properly reporting
  on steps where everything went as expected.

* More robustly report all phases to CDash

  Previously if a phase generated no output it would not be reported to CDash.
  For example, consider the following output:

    ==> Executing phase: 'configure'
    ==> Executing phase: 'build'

  This would not generate a report for the configure phase. Now it does.

* Add test case for CDash reporting clean builds

* Fix default directory for CDash reports

  The default 'cdash_report' directory name was getting overwritten
  by 'junit-report'.

* Upload the build phase first to CDash

  Older versions of CDash expect Build.xml to be the first file uploaded
  for any given build.

* Define cdash_phase before referring to it
2018-11-06 16:09:47 -08:00
Massimiliano Culpo
05779d911f Adapted the code of the non-daemonic pool to recent python versions
fixes #9739

The non-daemonic pool relies heavily on implementation details of the
multiprocessing package. In this commit we provide an implementation
that fits recent python versions.
2018-11-06 16:02:37 -08:00
Nick Forrington
9f5865a68d compilers: add arm compiler detection to Spack
- added arm.py with support for detecting `armclang` and `armflang`

Co-authored-by: Srinath Vadlamani <srinath.vadlamani@arm.com>
2018-11-02 12:53:50 -07:00
Tim Fuller
fc25ba1b22 Parse the ${NAMESPACE} format string in a spec's format method. (#9686)
This allows installing software on a namespace basis by including ${NAMESPACE} in `install_path_scheme`. e.g.,

```
cat ~/.spack/config.yaml
config:
  install_path_scheme:
      "${ARCHITECTURE}/${NAMESPACE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}"
```
2018-10-31 20:07:07 -07:00
Satish Balay
fb849a4b7f static_to_shared_library: separate options from option values (#9690)
The 'static_to_shared_library' function takes a compiler Executable,
which is intended to be invoked with a list of arguments; the
arguments must be separated from their values in the list, given
the way that 'Executable.__call__' invokes the underlying executable.
'static_to_shared_library' was not doing this, which this commit fixes.
2018-10-31 12:49:04 -07:00
Todd Gamblin
2912cf3e17
compilers: update clang fortran compiler wrapper selection (#9678)
Clang has support for using different fortran compilers with the Clang executable.

Spack includes logic to select a compiler wrapper symlink which refers to the fortran executable (since some build systems depend on the name of the compiler, e.g. 'gfortran' or 'flang').

This selection was previously based on the architecture, and chose incorrectly in some situations (e.g. for clang/gfortran on Linux). This replaces architecture-based wrapper selection with a selection that is based on the name of the Fortran compiler executable.
2018-10-30 23:00:43 -07:00
Levi Baber
72fa122101 tests: add test for FIXME boilerplate to package_sanity (#9285)
* package_sanity: add test_no_fixme
* cleanup & better assert message
2018-10-30 13:44:25 -07:00
Todd Gamblin
b27fbfb379
config: spack config blame now colors filenames in config output (#9656)
- it was hard to distinguish all-gray filenames
- added rotating colors to `spack config blame`
2018-10-26 22:19:11 -07:00
Omar Padron
aa1c814c75 docker: unite Dockerfiles; auto-deploy images to DockerHub (#9329)
* Unite Dockerfiles - add build/run/push scripts
* update docker documentation
* update .travis.yml
* switch to using a preprocessor on Dockerfiles
* skip building docker images on pull requests
* update files with copyright info
* tweak when travis builds for docker files are done
2018-10-26 10:15:05 -07:00
Massimiliano Culpo
da537d2211
Fix autoload of direct dependencies for python (#9630)
fixes #9624

merge_config_rules was using `strict=False` to check if a spec
satisfies a constraint, which loosely translates to "this spec has
no conflict with the constraint, so I can potentially add it to the
spec". We want instead `strict=True` which means "the spec satisfies
the constraint right now".
2018-10-25 23:56:03 +02:00
Todd Gamblin
a1f90d5b8c
bugfix: use OS default permissions for mkdirp when mode is not provided (#9604)
- #8773 made the default mode 0o777, which is what's documented but
   mkdirp actually takes the OS default or umask by default

- revert to the Python default by default, and only set the mode when
  asked explicitly.
2018-10-24 11:36:41 -07:00
Javier Cervantes
02f67b5c16 Fix typo in help message (#9599) 2018-10-24 12:40:35 +02:00
Satish Balay
79e25032e8 Bug fix: Module PATH check (#9574)
#9100 added a warning message when a path extracted from a module file
did not appear to be a valid filesystem path. This check was applied
to a variable which could be a list of paths, which would erroneously
trigger the warning. This commit updates the check to run at the
actual point where the path has been extracted.
2018-10-22 18:10:49 -07:00
Todd Gamblin
ccd5a5fb7b license: exclude ignored files from the license check (#9578)
Previously, if you built the docs, you'd get license errors for
generated .rst files. This removes them from the list of licensed
files.
2018-10-22 11:13:30 -07:00
Michael Kuhn
7070d9fcd4 Allow setting language of compiler messages (#9486)
* Add a build_language config.yaml option which controls the language
  of compiler messages
* build_language defaults to "C", in which case the compiler messages
  will be in English. This allows Spack log parsing to detect and
  highlight error messages (since the regular expressions to find
  error messages are in English)
* The user can use the default language in their environment by setting
  the build_language config variable to null or ''
2018-10-18 12:55:58 -07:00
Todd Gamblin
e2e0b5df1c relicense: add spack license command
- `spack license list-files`: list all files that should have license headers
- `spack license list-lgpl`:  list files still under LGPL-2.1
- `spack license verify`:     check that license headers are correct

- Added `spack license verify` to style tests
2018-10-17 14:42:06 -07:00
Todd Gamblin
7cb5638516 relicense: add Apache2/MIT header to spack create 2018-10-17 14:42:06 -07:00
Todd Gamblin
eea786f4e8 relicense: replace LGPL headers with Apache-2.0/MIT SPDX headers
- remove the old LGPL license headers from all files in Spack
- add SPDX headers to all files
  - core and most packages are (Apache-2.0 OR MIT)
  - a very small number of remaining packages are LGPL-2.1-only
2018-10-17 14:42:06 -07:00
Mark W. Krentel
e5e8d89ad9 docs: add note about compilers with modules (#9520)
compilers.yaml can track a module that is needed for a compiler, but
Spack does not fill this in automatically. This adds a note to the
documentation informing the user how to do this.
2018-10-16 15:34:22 -07:00
Michael Kuhn
cc6e765d28 meson: explicitly add --libdir (#9504)
If we do not specify libdir explicitly, Meson chooses something like
lib/x86_64-linux-gnu, which causes problems when trying to find libraries
and pkg-config files.
2018-10-15 11:14:59 -07:00
Peter Scheibel
6977d933c8
buildcache install: generate modules (#9509)
Spack packages installed using spack buildcache were not running
post-install hooks, which create module files and manage licenses
(if necessary).

This was already occurring for Spack packages installed with
spack install --use-cache
2018-10-12 10:43:06 -07:00
Greg Becker
d1a5113cfe permissions: add permission configuration to packages.yaml (#8773)
Spack can now be configured to assign permissions to the files installed by a package.

In the `packages.yaml` file under `permissions`, the attributes `read`, `write`, and `group` control the package permissions. These attributes can be set per-package, or for all packages under `all`. If permissions are set under `all` and for a specific package, the package-specific settings take precedence.  The `read` and `write` attributes take one of `user`, `group`, and `world`.

   packages:
    all:
      permissions:
        write: group
        group: spack
    my_app:
      permissions:
        read: group
        group: my_team
2018-10-11 14:29:07 -07:00
Zack Galbreath
bc8bb9dfaf Make CDash reporting easier to use (#9357)
* Better default CLI arguments for CDash reporting

--log-format=cdash is now implied if you specify the --cdash-upload-url
option to spack install.

We also now default to writing CTest XML files to cdash_report/ when using
the CDash reporter if no --log-file argument was specified.

* Improved documentation on how to use the CDash reporter
2018-10-10 22:29:14 -07:00
Greg Becker
ca0d9ae7f0
Make builtin flag handlers available in package scope (#8668)
* Push default flag handlers into module scope

* Preserve backwards compatibility of builtin flag handler names

Ensure Spack continues to work for packages using the `Package.env_flags` idiom and equivalent.

* update docs and tests to match

* Update packages to match new syntax
2018-10-09 15:18:31 -07:00
Greg Becker
97d0dd2390
Update Spack on Cray docs for singularity platform=linux workaround (#9398) 2018-10-02 14:58:40 -07:00
Peter Scheibel
28f6a4a095
Module path parsing: CRAY_LD_LIBRARY_PATH and PACKAGE_DIR (#9374)
Fix two bugs with module file parsing:

* Detection of the CRAY_LD_LIBRARY_PATH variable was broken by #9100.
  This fixes it and adds a test for it.
* For module names like "foo-bar/1.0", the associated PACKAGE_DIR
  environment variable name would be "FOO_BAR_DIR", but Spack was not
  parsing the components and not converting "-" to "_"
2018-09-27 19:40:22 -07:00
Peter Scheibel
28c0dd9148
Increase and customize lock timeouts (#9219)
Fixes #9166

This is intended to reduce errors related to lock timeouts by making
the following changes:

* Improves error reporting when acquiring a lock fails (addressing
  #9166) - there is no longer an attempt to release the lock if an
  acquire fails
* By default locks taken on individual packages no longer have a
  timeout. This allows multiple spack instances to install overlapping
  dependency DAGs. For debugging purposes, a timeout can be added by
  setting 'package_lock_timeout' in config.yaml
* Reduces the polling frequency when trying to acquire a lock, to
  reduce impact in the case where NFS is overtaxed. A simple
  adaptive strategy is implemented, which starts with a polling
  interval of .1 seconds and quickly increases to .5 seconds
  (originally it would poll up to 10^5 times per second).
  A test is added to check the polling interval generation logic.
* The timeout for Spack's whole-database lock (e.g. for managing
  information about installed packages) is increased from 60s to
  120s
* Users can configure the whole-database lock timeout using the
  'db_lock_timout' setting in config.yaml

Generally, Spack locks (those created using spack.llnl.util.lock.Lock)
now have no timeout by default

This does not address implementations of NFS that do not support file
locking, or detect cases where services that may be required
(nfslock/statd) aren't running.

Users may want to be able to more-aggressively release locks when
they know they are the only one using their Spack instance, and they
encounter lock errors after a crash (e.g. a remote terminal disconnect
mentioned in #8915).
2018-09-25 18:58:51 -07:00
Denis Davydov
d2bd5177da macos: add mojave (#9322) 2018-09-24 12:20:49 -07:00
scheibelp
95850a7a5e
report error if failed process captures stderr (#9293)
When a Spack Executable was configured to capture stderr and the
process failed, the error messages of the process were discarded.
This made it difficult to understand why the process failed. The
exception is now updated to include the stderr of the process when
the Executable captures stderr.
2018-09-19 17:29:15 -07:00
Adam J. Stewart
133dd7a4ac Fix version parsing for cistem package (#9260)
Adds 'code' to the list of suffixes that are excluded from version
parsing of URLs, such that if a URL contains the string
'cistem-1.0.0-beta-source-code', a version X will substitute in to
produce a URL with cistem-X-source-code ('source' was already excluded).
The 'cistem' package version is updated to make use of this (and fix
a fetching bug with the cistem package). A unit test is added to check
this parsing case.
2018-09-18 19:29:18 -07:00
scheibelp
22fbb3dba7
Bug fix: module file path parsing (#9100)
Improve Spack's parsing of module show to eliminate some false
positives (e.g. accepting MODULEPATH when it is in fact looking for
PATH). This makes the following changes:

* Updates the pattern searching for several paths to avoid the case
  where they are prefixes of unwanted paths
* Adds a warning message when an extracted path doesn't exist (which
  may help catch future module parsing bugs faster)
* Adds a test with the content mentioned in #9083
2018-09-12 18:15:31 -07:00
Michael Kuhn
add0c8fe11 test: Make flag_handlers tests use mock repo (#9132)
Without this change, openssl's new perl dependency makes the tests fail.
2018-09-06 18:41:26 +02:00
becker33
f6fff8f343 Spack environment updates take precedence (#9107)
Spack originally handled environment modifications in the following
order:

 1. clear environment variables
    (unless Spack was invoked with --dirty)
 2. apply spack-specific environment variable updates,
    including variables set by Spack core like CC/PKG_CONFIG_PATH
	and those set by installed dependencies (e.g. in
	setup_dependent_environment)
 3. load all external/compiler modules

1 and 2 were done together. This splits 1 into its own function and
imposes the following order for environment modifications:

 1. clear environment variables
 2. load all external/compiler modules
 3. apply spack-specific environment variable updates

As a result, prepend-path actions taken by Spack (or installed Spack
dependencies) take precedence over prepend-path actions from compiler
and external modules. Additionally, when Spack (or a package
dependency) sets/unsets an environment variable, that will override
the actions of external/compiler modules.
2018-09-05 17:28:39 -07:00
Sergey Kosukhin
f9617b2ad8 Extended set of environment modification commands. (#8996) 2018-09-05 10:56:45 -07:00
Chris Green
dd27662b40 Enable testing in parallel when using CMake. (#8484)
* Add 'extra_env' argument to Executable.__call__: this will be added
  to the environment but does not affect whether the current
  environment is reused. If 'env' is not set, then the current
  environment is copied and the variables from 'extra_env' are added
  to it.
* MakeExecutable can take a 'jobs_env' parameter that specifies the
  name of an environment variable used to set the level of parallelism.
  This is added to 'extra_env' (so does not affect whether the current
  environment is reused).
* CMake-based Spack packages set 'jobs_env' when executing the 'test'
  target for make and ninja (which does not use -j)
2018-09-04 11:37:19 -07:00
Adam J. Stewart
0ca69fef42 Better warning message when fetching non-existent URL 2018-09-03 20:42:01 -07:00
Michael Sternberg
d95fdc8441 Update instructions to initialize Spack-global license files (#8991)
* Suggest adding contents before the explanatory comment to avoid
  issue #6534
* Mention that the license file may not need to be edited
2018-08-29 22:04:14 -07:00
Michael Sternberg
a86f22d755 Intel prefixes (#7469)
Consolidate prefix calculation logic for intel packages into the
IntelPackage class.

Add documentation on installing Intel packages with Spack an
(alternatively) adding them as external packages in Spack.
2018-08-29 21:09:34 -07:00
Andreas Baumbach
5aded248a5 spack view suggests -I option for merge conflict (#9035) 2018-08-29 13:10:55 -04:00
Andreas Baumbach
7d61ef5078 import spack load error message (#9088)
It now additionally prints spec hash and options
2018-08-27 21:26:24 -04:00
Massimiliano Culpo
6f5a68a58d Moved functions returning default scopes to spack.config
The functions returning the default scope to be modified or listed
have been moved from spack.cmd to spack.config.

Lmod now writes the guessed core compiler in the default modify scope
instead of the 'site' scope.
2018-08-27 14:49:50 -07:00
Massimiliano Culpo
8ecf5ae2ee Spack can guess lmod core compilers, if none is already present
closes #8916

Currently Spack ends with an error if asked to write lmod modules files
and the 'core_compilers' entry is not found in `modules.yaml`. After
this PR an attempt will be made to guess that entry and the site
configuration file will be updated accordingly.

This is similar to what Spack already does to guess compilers on first
run.
2018-08-27 14:49:50 -07:00
Adam J. Stewart
cc01e89d6b
Update to latest version of pytest and dependencies (#9087)
* Update to latest version of pytest and dependencies

* Fix bug in installation tests
2018-08-25 14:12:46 -05:00
Todd Gamblin
3c292de6bd bugfix: 'submodules' attribute should imply git fetch
- 'submodules' wasn't properly declared as an optional attribute for git
  fetcher

- add it and add a test.
2018-08-25 10:20:39 -07:00
Todd Gamblin
3f0e6d04e0 commands: add spack url stats command
This command prints out stats about all package versions, like so:

$ spack url stats
==> 6070 total versions for 2827 packages:
------------------------------------
url                    5411    89.1%
  schemes
    https              3822    70.6%
    http               1527    28.2%
    ftp                  27     0.5%
    file                 35     0.6%
  checksums
    sha512                6     0.1%
    sha256              163     3.0%
    sha1                 81     1.5%
    md5                5161    95.4%
------------------------------------
svn                       3     0.0%
------------------------------------
hg                        5     0.1%
------------------------------------
go                        1     0.0%
------------------------------------
git                     650    10.7%
  security
    no commit           384    59.1%
    commit              266    40.9%
------------------------------------
2018-08-25 10:20:39 -07:00
Todd Gamblin
82820efe37 Remove Python 3.3 from testing.
- Support for Python 3.3 isn't really needed, as nothing uses it as the
  default system Python, and nearly everyone will have a newer Python 3
  version installed.
2018-08-24 16:22:37 -07:00
Adam J. Stewart
5e8a9ddaed More consistent colored messages from activate/deactivate (#9036)
* More consistent colored messages from activate/deactivate

* Make 'activating' the default, make 'activated' the debug
2018-08-22 22:09:51 -07:00
Massimiliano Culpo
85f84aabed Added a new target message to comply with newer versions of GNU Make (#9068)
#fixes 9067

Unit tests were failing on a system with GNU Make v 4.1
2018-08-22 09:32:25 -05:00
Todd Gamblin
c0855d9bd5 tests: add tests for warnings in build output
- add tests for build warnings and error messages
- simplify some code in build environment with plural() function
2018-08-21 21:21:53 -07:00
Adam J. Stewart
0b0887f48f Display warnings if no errors are found in build log 2018-08-21 21:21:53 -07:00
Adam J. Stewart
f97550e149 Fix error caused by missing spack-build.out build log 2018-08-21 14:16:50 -07:00
Todd Gamblin
63004e3de1 yaml: use ruamel.yaml instead of pyyaml
- ruamel.yaml allows round-tripping comments from/to files
- ruamel.yaml is single-source, python2/python3 compatible
2018-08-20 16:36:04 -07:00
Adam J. Stewart
2e8a820afd Even better Makefile target parsing (#8819)
#8223 replaced regex-based makefile target parsing with an invocation of
"make -q". #8818 discovered that "make -q" can result in an error for some
packages.

Also, the "make -q" strategy relied on interpreting the error code, which only
worked for GNU Make and not BSD Make (which was deemed acceptable at
the time). As an added bonus, this implementation ignores the exit code and
instead parses STDERR for any indications that the target does not exist; this
works for both GNU Make and BSD Make.

#8223 also updated ninja target detection to use "ninja -t targets". This does
not change that behavior but makes it more-explicit with "ninja -t targets all"

This also adds tests for detection of "make" and "ninja" targets.
2018-08-20 17:42:28 -04:00
scheibelp
638cc64571
install_tree: symlink handling and add 'ignore' option (#9019)
Fixes #9001

#8289 added support for install_tree and copy_tree to merge into an existing
directory structure. However, it did not properly handle relative symlinks and
also removed support for the 'ignore' keyword. Additionally, some of the tests
were overly-strict when checking the permissions on the copied files.

This updates the install_tree/copy_tree methods and their tests:

* copy_tree/install_tree now preserve relative link targets (if the symlink in the
  source directory structure is relative, the symlink created in the destination
  will be relative)
* Added support for 'ignore' argument back to copy_tree/install_tree (removed
  in #8289). It is no longer the object output by shutil.ignore_patterns: you pass a
  function that accepts a path relative to the source and returns whether that
  path should be copied.
* The openfoam packages (currently the only ones making use of the 'ignore'
  argument) are updated for the new API
* When a symlink target is absolute, copy_tree and install_tree now rewrite the
  source prefix to be the destination prefix
* copy_tree tests no longer check permissions: copy_tree doesn't enforce
  anything about permissions so its tests don't check for that
* install_tree tests no longer check for exact permission matching since it can add
  file permissions
2018-08-17 22:08:38 -04:00
Todd Gamblin
39c9bbfbbb imports: spack uses importlib instead of imp when available
- `imp` is deprecated and seems to have started having some weird
  issues on certain Linux versions.
  - In particular, the file argument to `load_source` is ignored on
    arch linux with Python 3.7.

- `imp` is the only way to do imports in 2.6, so we'll keep it around for
  now and use it if importlib won't work.

- `importlib` is the new import system, and it allows us to get
  lower-level access to the import implementation.

- This consolidates all import logic into `spack.util.imp`, and make it
  use `importlib` if it's avialable.
2018-08-16 16:00:44 -07:00
Adam J. Stewart
ac6d929897 Fix spack versions behavior when no URL (#8967)
* Fix spack versions behavior when no URL
* Unit test packages without URLs or safe versions
2018-08-16 08:42:23 -07:00
Adam J. Stewart
73c978ddd9 install_tree, copy_tree can install into existing directory structures (#8289)
Replace use of `shutil.copytree` with `copy_tree` and `install_tree` functions in `llnl.util.filesystem`.

- `copy_tree` copies without setting permissions.  It should be used to copy files around in the build directory.
- `install_tree` copies files and sets permissions.  It should be used to copy files into the installation directory.
- `install` and `copy` are analogous single-file functions.
- add more extensive tests for these functions
- update packages to use these functions.
2018-08-15 09:30:09 -07:00
Todd Gamblin
62026ce302 tests: make the dependency patching test more complete
- dependency patching test didn't attempt to apply patches; just to see
  whether they were on the spec.

- it applies the patch now and verifies that that patch was applied.
2018-08-14 14:33:50 -07:00
Tom Merrick
b1182741d4 Branch with the meson build-system (#8467)
* Branch with the meson build-system

* Fix build_environment for dual loads and add create code

* Add documentation

* Fixed option list

* Update build_system_guess for meson

* Fixed documentation errors

* Added meson to build and configure and updated documentation

* fix typos
2018-08-10 12:52:09 -05:00
Scott Wittenburg
2278c65d0a spec: make full_hash look like dag_hash (#8911) 2018-08-09 09:00:49 -07:00
Todd Gamblin
ed79d6a11b bugfix: cc handles spaces in flag variables properly
- cc cleanup caused a parsing regression in flag handling

- We added proper quoting to array expansions, but flag variables were
  never actually converted to arrays. Old code relied on this.

This commit:
- Adds reads to convert flags to arrays.
- Makes the cc test check for improper space handling to prevent future
  regressions.
2018-08-09 08:00:22 -07:00
Todd Gamblin
bb5d83890d cc: refactor flag adding so that it's not in reverse order
- flags were prepended in reverse order to args, but this makes it hard
  to see what order they'll be in on the final command line.

- add them in the order they'll appear to make cc easier to maintain.

- simplify code for assembling the command line

- fix separator used in SPACK_SYSTEM_DIRS test
2018-08-08 01:51:51 -07:00
Todd Gamblin
4210f839e2 cc: restore ccache support in the wrapper, add a regression test
- Add back ccache support to the wrapper.
- Add a regression test to make sure ccache is working properly.
2018-08-08 01:51:51 -07:00
Todd Gamblin
62089d43ef cc: run shellcheck linter on the cc compiler script, minor cleanup
- This corrects most of the issues found by shellcheck

- This also uses ':' as the delimiter for SPACK_SYSTEM_DIRS, for
  consistency with other variables.
2018-08-08 01:51:51 -07:00
Todd Gamblin
b84067f6db cc: don't use sed to filter system directories
- filtering using sed causes most builds to slow down quite a bit, as the
  compiler wrapper has to run sed many times, and *it* runs many times

- do the system directory parsing directly in bash
2018-08-08 01:51:51 -07:00
Todd Gamblin
0e81f6cba5 refactor: clean up and fix the cc test
- Add tests to ensure that RPATHs are not added in cc mode, which can
  cause some builds to fail.

- Change cc.py to use pytest style

- Instead of writing out all the flags, break the flags down into
  variables so that it's easy to read what each test is supposed to
  check. This should make cc.py more maintainable in the future.
2018-08-08 01:51:51 -07:00
Todd Gamblin
c8fb9b5479 bugfix: cc should not add -L or -Wl,-rpath in compile-only mode
- Adding -L and -Wl,-rpath to compile-only command lines ("cc mode" or
  "-c") causes clang (if not also other compilers) to emit warnings that
  confuse configure systems.

- Clang will print warnings about unused command-line arguments.

- This fix ensures that -L and -Wl,-rpath are not added if the compile
  line is just building an object file with -c

- This also cleans up the cc script in several places.
2018-08-08 01:51:51 -07:00
Gregory Becker
683c7fbf3b Restore cc: package search paths come before dependency paths (#4692)
Spack currently prepends include paths, library paths, and rpaths to the
compile line.  This causes problems when a header or library in the package
has the same name as one exported by one of its dependencies.  The
*dependency's* header will be preferred over the package's, which is not
what most builds expect.  This also breaks some of our production codes.

This restores the original cc behavior (from *very* early Spack) of parsing
compiler arguments out by type (`-L`, `-I`, `-Wl,-rpath`) and reconstituting
the full command at the end.

`<includes> <other_args> <library dirs> <rpaths>`

This differs from the original behavior in one significant way, though: it
*appends* the library arguments so that dependency libraries do not shadow
those in the build.

This is safe because semantics aren't affected by *interleaving* `-I`, `-L`,
and `-Wl,-rpath` arguments with others, only with each other (so the order of
two `-L` args affects the search path, but we search for all libraries on the
command line using the same search path).

We preserve the following:
1. Any system directory in the paths will be listed last.
2. The root package's include/library/RPATH flags come before flags of the
   same type for any dependency.
3. Order will be preserved within flags passed by the build (except system
   paths, which are moved to be last)
4. Flags for dependencies will appear between the root flags and the system
   flags, and the flags for any dependency will come before those for *its*
   dependencies (this is for completeness -- we already guarantee this in
   `build_environment.py`)
2018-08-08 01:51:51 -07:00
cedricchevalier19
3301e21f06 Fix performance issue when compiling. (#8828)
* Fix performance issue when compiling.

Spack was doing active wait when compiling, spoiling one core.
My fix consists in not setting any timeout for select, instead of
the previous 0 second.

* Fix comments about select.select timeout
2018-08-07 09:13:07 -07:00
Paul Chelarescu
6ef2eb8f7e libstdc++ detection uses os.path.realpath instead of os.readlink (#8865) 2018-08-06 22:30:29 -07:00
Adam J. Stewart
5f10d9239b Remove default variant bug from list of known issues (#8900) 2018-08-06 16:56:45 -04:00
George Hartzell
4e985051c0 Docstring typo: builing -> building (#8896) 2018-08-06 13:36:57 -04:00
Todd Gamblin
5cc2309330 revert cd9691de5 (#4692) while we work on a fix. 2018-08-04 20:31:55 -07:00
Todd Gamblin
b5071312c4 spack spec: no extra newline with --yaml; error with no specs
- `spack spec` now returns an error if given no specs

- removed superfluous trailing newline from `spack spec --yaml` output
  (only one newline now)
2018-08-03 15:18:34 -05:00
Adam J. Stewart
4f76e80925 Add spack arch --operating-system and --target flags 2018-08-03 11:32:08 -05:00
Todd Gamblin
43c77ac3cb libdwarf: remove use of hide_files()
- This was a nasty workaround due to the way our compiler wrappers used
  to work.  We don't want to have to modify our elfutils installation to
  install libdwarf.

- Since cd9691de5, we no longer need this because the package will always
  come before dependencies in our include order.
2018-08-02 19:00:52 -07:00
becker33
cd9691de53 cc: package search paths come before dependency paths (#4692)
Spack currently prepends include paths, library paths, and rpaths to the compile line.  This causes problems when a header or library in the package has the same name as one exported by one of its dependencies.  The *dependency's* header will be preferred over the package's, which is not what most builds expect.  This also breaks some of our production codes.

This restores the original cc behavior (from *very* early Spack) of parsing compiler arguments out by type (`-L`, `-I`, `-Wl,-rpath`) and reconstituting the full command at the end.

`<includes> <other_args> <library dirs> <rpaths>`

This differs from the original behavior in one significant way, though: it *appends* the library arguments so that dependency libraries do not shadow those in the build. 

This is safe because semantics aren't affected by *interleaving* `-I`, `-L`, and `-Wl,-rpath` arguments with others, only with each other (so the order fo two `-L` args affects the search path, but we search for all libraries on the command line using the same search path).

We preserve the following:
1. Any system directory in the paths will be listed last.
2. The root package's include/library/RPATH flags come before flags of the same type for any dependency.
3. Order will be preserved within flags passed by the build (except system paths, which are moved to be last)
4. Flags for dependencies will appear between the root flags and the system flags, and the flags for any dependency will come before those for *its* dependencies (this is for completeness -- we already guarantee this in `build_environment.py`)
2018-08-01 15:48:00 -07:00
Holly
38062a8abc docs: minor text changes (#8858) 2018-08-01 13:59:51 -07:00
Stephen Herbein
de60e9d582 lmod: fix use of custom separator in prepend_path etc. (#8737)
fixes #8736
2018-08-01 12:58:54 +02:00
Stephen Herbein
cdbc545793 docs: update spack view argument synatx (#8839)
The `--dependencies` and `--exclude` flags are now arguments to the `spack view`
comand rather than the `spack view symlink` command.
2018-07-31 10:41:41 -07:00
Todd Gamblin
2c45c3c5b3
spec: Spec.tree() merges deptypes when only covering nodes (#8821)
- previously, output could be confusing when deptypes were only shown for
  one dependent when a node had *multiple* dependents

- also fix default coverage of `Spec.tree()`: it previously defaulted to
  cover only build and link dependencies, but this is a holdover from
  when those were the only types.
2018-07-29 11:54:20 -07:00
Massimiliano Culpo
1fd9574353 Fixed a typo in the docs (the docker image to pull was wrong) (#8814) 2018-07-27 09:56:01 -05:00
Adam J. Stewart
7902f3eb49 Add docs on new top-level VCS attributes 2018-07-25 23:10:10 -07:00
Todd Gamblin
5f00056490 tests: convert mirror test to pytest with free functions. 2018-07-25 23:10:10 -07:00
Todd Gamblin
020c34e136 tests: add checks and tests for consistent version() arguments
- Previously, Spack didn't check the arguments you put in version()
  directives.

- So, you could do something like this, where there are arguments for a
  URL fetcher AND for a git fetcher:

  version('1.0', md5='abc123', git='https://foo.bar', commit='feda2343')

- Now, we check the arguments before constructing a fetcher, to ensure
  that each package has *only* arguments for a single type of fetcher.

- Also added `test_package_version_consistency()` to the `package_sanity`
  test, so that all builtin packages are required to have valid
  `version()` directives.
2018-07-25 23:10:10 -07:00
Todd Gamblin
6f7eaecfa0 tests: correct name of check_db to check_repo
- this test is checking the package *repository*, not the database.
2018-07-25 23:10:10 -07:00
Todd Gamblin
773cfe088f core: differentiate package-level fetch URLs by args to version()
- packagers can specify two top-level fetch URLs if one is `url`
  - e.g., `url` and `git` or `url` and `svn`

- allow only one VCS fetcher so we can differentiate between URL and VCS.

- also clean up fetcher logic and class structure
2018-07-25 23:10:10 -07:00
Todd Gamblin
04aec9d6f8 core: add check for conflicting top-level fetch attributes in packages
- ensure that packages can't have more than one of git, hg, svn, or url
2018-07-25 23:10:10 -07:00
Todd Gamblin
6837da2ad7 style: clean up exception definitions in package.py 2018-07-25 23:10:10 -07:00
Todd Gamblin
498d8cf04b core: fixes and tests for handling of fetcher attributes in packages
- Packages can remove the top-level `url` attribute and still work

- These are now legal:
  - Packages with *only* version-specific URLs (even with gaps)

  - Packages with a top-level git/hg/svn attribute and `version`
    directives for that.

- If a package has both a top-level hg/git/svn attribute AND a top-level
  url attribute, the url attribute takes precedence.
2018-07-25 23:10:10 -07:00
Adam J. Stewart
5792a805fc core: quick fix for packages without URLs
Some packages do not have a `url` and are instead downloaded via `git`,
`hg`, or `svn`. Some packages like `spectrum-mpi` cannot be downloaded at
all, and are placeholder packages for system installations. Previously,
`__init__()` in `PackageBase` crashed if a package did not have a `url`
attribute defined.

I hacked this section of code out, but I have no idea what the
repercussions of that are.
2018-07-25 23:10:10 -07:00
Adam J. Stewart
13c52066a5 Fix order of regexes reported by spack url summary 2018-07-24 21:02:28 -07:00
Todd Gamblin
656e935e50 core: make spack.util.crypto initialization less expensive.
- This hard-codes the hash lengths rather than computing them on import.

- Also cleans up the code in `spack.util.crypto` to make it easier to
  understand.
2018-07-24 18:35:02 -07:00
Todd Gamblin
674eb00e53
bugfix: spack module -m error message (#8794)
Fix this output error:

```
$ spack -m module loads mpileaks
==> Error: `spack module loads -m t -m c -m l ...` has been moved. Try this instead:

    $ spack module t loads mpileaks
    $ spack module c loads mpileaks
    $ spack module l loads mpileaks
```
2018-07-24 16:12:47 -07:00
Massimiliano Culpo
6bb2256043 Die with a meaningful error if a deprecated command is used
In case a deprecated form of the module command is used, the program
will exit non-zero and print an informative error message suggesting
which command should be used instead.
2018-07-24 11:27:17 -07:00
Massimiliano Culpo
35cef16974 Grouped all the module commands under spack module
As requested in the review all the commands meant to manage module
files have been grouped under the `spack module` command.

Unit tests have been refactored to match the new command structure.
2018-07-24 11:27:17 -07:00
Massimiliano Culpo
7cbe1aedb7 module file tutorial: rebuilt docker image and updated the script 2018-07-24 11:27:17 -07:00
Massimiliano Culpo
576f0c98d2 Added --dependencies to the help text of spack load
fixes #6321
2018-07-24 11:27:17 -07:00