Commit graph

148 commits

Author SHA1 Message Date
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
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
Bert Wesarg
c43689deb0 setup-env: Avoid different output format of ps (#9629)
setup-env includes a call to 'ps' to determine what shell is being
used. 'ps' can be instructed to use a different default output format
via the 'PS_FORMAT' env variable. Thus unset this variable before
calling 'ps'.
2018-10-29 11:16:55 -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
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
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
Todd Gamblin
5aa05b8ef4
travis: require sudo in an attempt to avoid build timeouts (#9327)
- Many container builds are timing out frequently during Spack tests in
  Travis CI.

- Travis recommends to try `sudo: required` to see whether this is an
  infrastructure issue or something else.

- added `sudo: required` to all Linux builds.

- added --verbose to `spack test` invocation so that we can see more
  easily what tests it's timing out on.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2018-09-24 14:55:36 -07:00
Matthias Diener
a1e08f009d Csh: fix load/use commands (#8971) 2018-08-14 09:28:43 +02:00
Micheal Quinn
203bd555a4 Fixing the addition curly brackets to conform to the rest of the templates usage of a literal curly bracket 2018-08-07 19:56:11 +02:00
Micheal Quinn
d163be6a13 Adding logic to the autoload if statement so it only fire if the module is being loaded. 2018-08-07 19:56:11 +02:00
Adam J. Stewart
7e0bd152b7 Generate coverage reports for all unit and build tests 2018-08-04 21:18:49 -07:00
Adam J. Stewart
4de301ebf2 Update bash completion with new spack arch flags 2018-08-03 11:32:08 -05: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
Michael Kuhn
53ddefa0df Fix shift warning on zsh (#8805)
When using zsh, trying to shift when there are no arguments left results
in warnings like this: spack:shift:22: shift count must be <= $#
2018-07-27 08:14:01 -05:00
Massimiliano Culpo
5b8b7a5873 The auto-completion file is now consistent with spack module 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
443d702971 spack load exits with 1 if module does not exist or is not installed
fixes #2215
fixes #2570
fixes #6676
fixes #7281
closes #3827

This PR reverts the use of `spack module loads` in favor of
`spack module find` when loading module files via Spack. After this PR
`spack load` will accept a single spec at a time, and will be able
to interpret correctly the `--dependencies` option.
2018-07-24 11:27:17 -07:00
Massimiliano Culpo
c0d9de240a Revert "Fix recursive module loading."
This reverts commit 732c24f603.
2018-07-24 11:27:17 -07:00
Patrick Gartung
c9147aad80 Remove extra Scientific Linux docker build left after merge. (#8770) 2018-07-22 16:46:26 -05:00
Adam J. Stewart
af8dde4dda shell: Add spack to PATH before calling spack in setup-env.csh (#8740) 2018-07-18 09:36:22 -07:00
Todd Gamblin
06418a3dcd
add spack --print-shell-vars to speed up setup-env.[c]sh (#8101)
- The setup-env.sh script currently makes two calls to spack, but it
  should only need to make one.

- Add a fast-path shell setup routine in `main.py` to allow the shell
  setup to happen in a single, fast call that doesn't load more than it
  needs to.

- This simplifies setup code, as it has to eval what Spack prints

- TODO: consider eventually making the whole setup script the output of a
  spack command
2018-07-16 15:43:44 -07:00
Omar Padron
911b6d7671 Docker dedupe (#8441)
* Add Dockerfile for Scientific Linux 7 (RHEL7 recompile)

* revert version change

* remove duplicate docker-related files
2018-06-26 07:37:28 -07:00
Patrick Gartung
bdd5aab8be Add Dockerfile for Scientific Linux 7 (RHEL7 recompile) (#8422)
* Add Dockerfile for Scientific Linux 7 (RHEL7 recompile)
2018-06-26 01:10:13 -07:00
Todd Gamblin
c4c1d37fcd refactor: move templates from root to share/spack
- This complies with the unix directory hierarchy standard (which Spack
  attempts to follow)
- Also unclutters the repo root directory.
2018-06-24 16:38:36 -07:00
Todd Gamblin
863ccd5e94 config: simplify configuration API to just get and set
- replace `spack.config.get_configuration()` with `spack.config.config()`

- replace `get_config`/`update_config` with `get`, `set`

- add a path syntax that can be used to refer to specific config options
  without firt getting the entire configuration dict

- update usages of `get_config` and `update_config` to use `get` and `set`
2018-05-17 14:10:30 -07:00
René Widera
caa0c5c687 environment shell: fix spack load (#7747)
Fix `spack load` with extended packe specifications those includes spaces.
Solved by using perfectly parameter forwarding via temporary array.

example:
```
$ spack install zlib
$ spack install zlib cppflags='-O3 -march=native'
$ spack install zlib cppflags='-O2 -march=native'

$ spack find -d -L -f zlib
==> 3 installed packages.
-- linux-linuxmint18-x86_64 / gcc@5.4.0 -------------------------
k5hg4kkxiutkfl6n53ogz5wnlbdrsdtf    zlib@1.2.11%gcc

mse2fyzdxciszdhiqi4b5kl6fxkps3fh    zlib@1.2.11%gcc cppflags="-O2 -march=native"

vrnvj2fikcbxqxrymctnlpmud7wbuahk    zlib@1.2.11%gcc cppflags="-O3 -march=native"

$ spack load zlib cppflags='-O3 -march=native'
==> Error: Unexpected token
['zlib', 'cppflags=-O3', '-march=native']
```
2018-04-24 13:43:32 -07:00
Adam J. Stewart
ef37cdb380
Autocomplete spack providers (#7783) 2018-04-17 09:33:04 -05:00
Massimiliano Culpo
fa07f95a71
Fixes conflicts in OSX nightly tests (#7732)
fixes #7593

Unit tests on OSX are trying to concretize mpileaks, and they fail due
to a conflict in the package:

"%gcc@7.2.0:" conflicts with "elfutils@0.163"

This solves the issue asking explicitly to concretize against
elfutils@1.170
2018-04-12 14:11:36 +02:00
scheibelp
5e758b979e
update tests: concretize mpileaks with gcc (#7635)
Fixes #7593

By default MacOS concretizes using the clang compiler. The unit tests
include a call to "spack spec mpileaks", which has elfutils as a
dependency; #7096 added a conflict in elfutils to avoid building
with clang, which lead to the MacOS unit tests to start failing.
This updates the concretization to force using gcc when concretizing
mpileaks.
2018-03-29 12:24:35 -07:00
Adam J. Stewart
4332e75986
Various updates to Spack's Bash completion (#7590)
* Various updates to Spack's Bash completion

* Equals sign messes up tab completion
2018-03-25 08:03:29 -05:00
Todd Gamblin
54f97d1dec
Update copyright on LLNL files for 2018. (#7592) 2018-03-24 12:13:52 -07:00
Massimiliano Culpo
94c22092a8
Save sources in a mirror and cache it in Travis (#7392) 2018-03-06 06:49:43 +01:00
Omar Padron
3a9cd2614e Docker-Based Developer Resource (#5871)
* add docker-based development resources

* incorporate feedback from @ax3l

* fix docs/improve ssh handling

* experiment with custom prompt

* add arch/fix missing core_compilers key

* add centos/minor tweaks

* make prompt experiment optional

* workaround problem with latest fedora docker image

* add docker documentation page to index toc

* try another documentation fix

* switch arch linux base to base/archlinux

* update the git urls in the Dockerfiles

* add opensuse

* switch CUSTOM_PROMPT variable to simply "PROMPT"
2018-02-27 00:36:14 -08:00
Massimiliano Culpo
621388e5ae
Restore multiprocessing in unit tests (#6949)
* Revert "Travis: use --concurrency=multiprocessing only on build tests (#6872)"

This reverts commit 596d463714.

* Removing 'coverage combine' in test script

According to what was discovered in #6887, one of the problems is
calling 'coverage combine' twice without the '-a' flag. This removes
the first call within our test scripts.
2018-01-20 16:10:25 +01:00
Adam J. Stewart
03ff2a32ae
Reduce verbosity of build tests (#6901) 2018-01-11 16:14:26 -06:00
Massimiliano Culpo
596d463714 Travis: use --concurrency=multiprocessing only on build tests (#6872)
On a local workstation, it seems that tracking multiple processes during
coverage may result in malformed coverage reports for unit tests and not
for build tests.

Given that multiple processes make a difference in coverage mainly for
build tests, try to disable the tracking for unit tests to see if we get
more stable coverage results.
2018-01-10 10:14:17 -06:00
Adam J. Stewart
5f6df40f3b Fix bash tab completion for spack install (#6868) 2018-01-10 13:51:04 +01:00
Massimiliano Culpo
9bffa96754 Reduce the calls to the python interpreter during initialization (#6312)
* Reduce the calls to the python interpreter during initialization

This should reduce the delay the users experience when sourcing the
setup file to activate shell support. It works by generating at once
all the commands that needs to evaluated (they are stored in
a string and later `eval`ed by the shell).

* setup_env.sh: changed `read` with an equivalent magic

For some reason `read` breaks when sourced from a running script.
Change the incantation we use to construct the unique python command
that will be evaluated.

* setup_env.sh: python command now constructed with `printf` for portability

This recovers the support for `zsh` that was broken in previous commits.
2017-11-15 17:38:40 -07:00
Massimiliano Culpo
fe889124eb SC17: reworked module file tutorial section (#5657)
* Reworked module file tutorial section

First draft for the SC17 update. This includes:

 - adding an introduction on module files + Spack's module
   generation blueprints
 - adding a set-up section and provide a docker image for easy set-up
 - updating all the relevant snippets
 - extending a bit some of the concepts that were already touched

* Added reference to #5582 + committed Dockerfiles

Also fixed a couple of typos spotted by Denis.

* module file tutorial: added section on template customization

* module file tutorial: fixed minor typos + rephrased a sentence

* module file tutorial: made explicit that Docker image comes with software

* module file tutorial: improved phrasing and layout.

Thanks Hartzell!

* module file tutorial: added vim and nano to editors

* module file tutorial: fixed typo

* Fixed typos

Thanks Adam!

* module file tutorial: updated Dockerfile + minor changes in introduction
2017-11-12 00:27:20 -08:00
Todd Gamblin
3a0324fe1a
add artisanal handcrafted SVG Spack logo. (#6165)
- This isn't one of those autogenerated SVGs from a drawing program!

- This is a completely re-traced, minimalist SVG file with clearly
  delineated pieces so that your favorite renderer can draw a Spack logo
  at whatever resolution you want.

- Included versions with text, as well.
2017-11-06 22:42:16 -08:00
Todd Gamblin
05fa302655
Replace github.com/llnl/spack with github.com/spack/spack (#6142)
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-11-04 17:08:04 -07:00
Michael Kuhn
f45916fad2 Set LANG= for _spack_fn_exists (#5475)
type's output can be localized, causing the grep to fail.
2017-09-26 12:28:50 -07:00
Matthew Scott Krafczyk
0bd838bd11 Remove echo statements from setup-env.sh
setup-env.sh adds the 'module' command to the user's environment
if it is not defined and if there is a Spack installation of
environment-modules available. This commit updates that logic to
perform these checks and updates quietly.
2017-09-14 18:49:25 -07:00
Christoph Junghans
80ac613391 Shell detection: filter preceding "-"
On OSX, the shell detection code may get a preceding dash, like
"-bash". This adds a filter to remove it.
2017-09-12 12:17:20 -07:00
Matthew Scott Krafczyk
f57559e4e2 Fix two bugs from the bootstrap update (#5312)
These were discovered with bash 4.1.2.

Add quotations around a variable to prevent the destruction of a
newline. Without this fix a conditional doesn't work properly.

Remove square brackets around a conditional meant to be evaluated based
on the return code of a command. This wasn't working properly with an
old bash.

Fix a typo.
2017-09-10 16:54:23 -10:00
Matthew Scott Krafczyk
51828dd982 Bootstrap environment-modules
Renames the existing bootstrap command to 'clone'. Repurposes
'spack bootstrap' to install packages that are useful to the
operation of Spack (for now this is just environment-modules).
For bash and ksh users running setup-env.sh, if a Spack-installed
instance of environment-modules is detected and environment modules
and dotkit are not externally available, Spack will define the 
'module' command in the user's shell to use the environment-modules
built by Spack.
2017-09-08 10:15:06 -07:00
Michael Kuhn
84ae7872d3 Update copyright notices for 2017 (#5295) 2017-09-06 17:44:16 -10:00
Matthew Scott Krafczyk
c94933343a Add --show-full-compiler option to 'spack find'
When 'spack find' is invoked with the '--show-full-compiler' option,
the compiler flags and version are shown for each spec that is found.
2017-08-28 10:35:46 -07:00
Christoph Junghans
fa1d0a8a4d Add --source option to spack install (#4102)
- -- source will copy source into prefix along with the package.
- added a test for --source, as well
2017-08-23 14:08:52 -07:00