summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2019-06-08concretization: don't apply build-dep constraints for installed packages ↵Peter Scheibel3-5/+85
(#11594) Spack currently tries to unify everything in the DAG, but this is too strict for build dependencies, where it is fine to build a dependency with a tool that conflicts with a version fo that tool for a dependent's build. To enable a workaround for conflicts among build dependencies, so that users can install in multiple steps to avoid these conflicts, make the following changes: * Dont apply package dependency constraints for build deps of installed packages * Avoid applying constraints for installed packages vs. concrete packages * Mark all dependencies of installed packages as visited in normalization method * don't remove dependency links for concrete specs in flat_dependencies Also add tests: * Update test to ensure that link dependencies of installed packages have constraints applied * Add test to check for proper handling of transitive dependencies (which is currently not the case)
2019-06-07spack list: latest version (JSON) (#11652)Axel Huebl4-1/+81
List the latest version of each package in JSON encoding. Preparation for consumption for a "spack badge" service.
2019-06-07Compiler search uses a pool of workers (#10190)Massimiliano Culpo17-302/+503
- spack.compilers.find_compilers now uses a multiprocess.pool.ThreadPool to execute system commands for the detection of compiler versions. - A few memoized functions have been introduced to avoid poking the filesystem multiple times for the same results. - Performance is much improved, and Spack no longer fork-bombs the system when doing a `compiler find`
2019-06-06commands: remove unused `spack list --format=rst` (#11651)Todd Gamblin2-79/+0
- We use `spack list --foramt=html` now, as it is much faster and doesn't make the docs build take forever. - Remove `spack list --format=rst` as it is no longer used.
2019-06-06bugfix: StageComposite must include the `expanded` property` (#11647)Todd Gamblin1-0/+4
2019-06-06tests: package_sanity now checks packages in 3rd-party repos (#11637)Jennifer Herting1-2/+1
2019-06-05tests: add extra coverage for fetch strategy testsTamara Dahlgren4-8/+142
2019-06-05stage: make `source_path` available before stage is builtTamara Dahlgren6-207/+535
- `stage.source_path` was previously overloaded; it returned `None` if it didn't exist and this was used by client code - we want to be able to know the `source_path` before it's created - make stage.source_path available before it exists. - use a well-known stage source path name, `$stage_path/src` that is available when `Stage` is instantiated but does not exist until it's "expanded" - client code can now use the variable before the stage is created. - client code can test whether the tarball is expanded by using the new `stage.expanded` property instead of testing whether `source_path` is `None` - add tests for the new source_path semantics
2019-06-05refactor: remove unused spack.stage._get_mirrors() functionTamara Dahlgren1-37/+24
2019-06-05tty: make tty.* print exception typesTamara Dahlgren15-26/+55
- make tty.msg, tty.info, etc. print the exception type and stringified message if the message argument is an exception. - simplify parts of the code that call tty.debug(str(e)) - add extra tty.debug statements in places where exceptions were previously ignored
2019-06-05clang: fix error messages in c11_flag, cxx17_flag (#11632)Justin S1-2/+2
2019-06-05graph: refactor static graphsTodd Gamblin4-100/+73
- `spack graph --static` (and `spack.graph.dot_graph`) now do the "right thing" and print the possible dependency graph of provided packages. - `spack graph --static` no longer concretizes specs, as it only relies on class level metadata - Previously the behavior was not consistent -- `spack graph --static` would graph possible dependencies of concrete specs, but would only include some of them. The new code properly pursues all possible dependencies, and allows traversing by different dependency types.
2019-06-05spack dependencies: support --deptype argumentTodd Gamblin4-10/+47
- `spack dependencies` can now take a --deptype argument to only traverse particular deptypes - add a new "common" argument for deptype in spack.cmd.common.arguments - Database.installed_relatives() can now also take a deptype argument - this is used by `spack dependencies --installed`
2019-06-05package: make possible_dependencies consider deptypesTodd Gamblin3-16/+93
- `PackageBase.possible_dependencies` now: - accepts a deptype param that controls dependency types traversed - returns a dict mapping possible depnames to their immediate possible dependencies (this lets you build a graph easily) - Add tests for PackageBaes
2019-06-05refactor: remove vestigial ALLOWED_URL_SCHEMES from package.pyTodd Gamblin1-4/+0
2019-06-05refactor: make Package.name consistent with other class attributesTodd Gamblin2-11/+18
- The 'name' attribute for packages was being set in DirectiveMeta, which wasn't consistent with other class properties (like fullname, etc.) - Move it to be a class property of `PackageMeta`, and add the corresponding property method wrapper on `PackageBase`
2019-06-05refactor: make PackageBase.possible_dependencies() a class method.Todd Gamblin1-4/+5
2019-06-05add C standard flags to compiler classes (#11618)Justin S7-0/+90
* add c99_flag, c11_flag to compiler class * implement c99_flag, c11_flag for gcc * implement c99_flag, c11_flag for arm * implement c99_flag for cce * implement c99_flag, c11_flag for clang * implement c99_flag, c11_flag for intel * implement c99_flag, c11_flag for xl
2019-06-04modules: set permissions based on package configuration (#11337)Greg Becker5-52/+99
Previously, module files were not set with the same permissions as the package installation. For world-readable packages, this would not cause a problem. For group readable packages, it does: ``` packages: mypackage: permissions: group: mygroup read: group write: group ``` In this case, the modulefile is unreadable by members of the group other than the one who installed it. Add logic to the modulefile writers to set the permissions based on the configuration in `packages.yaml`
2019-06-04Buildcache relocate.py error fix (#11616)Patrick Gartung1-0/+2
* Add a trailing / if file --mime does not return a mimetype with a / in it * Flake8
2019-05-31Build cache: relocate path to spack/bin/sbang in text files. (#11592)Patrick Gartung3-13/+35
* Build cache: relocate path to spack/bin/sbang in text files. * Found in testing. * update packaging test * Make sbang replacement including #!/bin/bash. Add an additional spack prefix replacement to fix stage directory references. * flake8 * Use buildinfo.get() so old buildcaches without buildinfo['spackprefix'] can be read.
2019-05-28Cap the maximum number of build jobs (#11373)Massimiliano Culpo5-16/+49
* config:build_jobs now controls the number of parallel jobs to spawn during builds, but cannot ever exceed the number of cores on the machine. * The default is set to 16 or the number of available cores, whatever is lowest. * Updated docs to reflect the changes done to limit parallel builds
2019-05-27docs: set gettext_uuid to False to reduce churn (#11567)Todd Gamblin2-1/+2
- `gettext_uuid=True` makes every commit update every .pot file in spack/localized-docs, and speeds up the internationalized doc build slightly. - Optimize for less repository churn, and use `python-levenshtein` to accelerate the build instead.
2019-05-27mirror create: non-zero return code (#8585)Axel Huebl1-0/+2
`mirror create` should return a non-zero return code if errors occured.
2019-05-26link_tree: add option to merge link trees with relative targetsTodd Gamblin2-40/+90
- previous version of link trees would only do absolute symlinks - this version can do relative links using merge(relative=True)
2019-05-26docs: make docs build relocatable for localized buildsTodd Gamblin21-50/+59
- make all Spack paths relative to a `_spack_root` symlink, so that we can easily relocate the docs build *outside* lib/spack/docs - set some useful defaults for gettext translation variables in conf.py - update `relativeinclude` and other references to the spack root in the RST files to use _spack_root
2019-05-26docs: remove legacy import for Sphinx 1.7Todd Gamblin1-6/+1
2019-05-26docs: match ReadTheDocs; use -W (warnings as errors) with SphinxTodd Gamblin1-1/+1
2019-05-26commands: add --update option to `spack list`Todd Gamblin5-96/+171
- Add a `--update FILE` option to `spack list` - Output is written to the file only if any package is newer than the file - Simplify the code in docs/conf.py using this new option
2019-05-26commands: Add --header and --update options to `spack commands`Todd Gamblin4-54/+143
The Spack documentation currently hard-codes some functionality in `conf.py`, which makes the doc build less "pluggable" for things like localized doc builds. In particular, we unconditionally generate an index of commands and a package list as part of the docs, but those should really only be done if things are not up to date. This commit does the following: - Add `--header` option to `spack commands` so that it can do the work of prepending text to its output. - Add `--update FILE` option to `spack commands` that makes it generate a new command index *only* if FILE is out of date w.r.t. commands in the Spack source. - Simplify code in `conf.py` to use these options and only update the command index when needed.
2019-05-26docs: Use HDF5 as the example package for `spack graph`Todd Gamblin2-13/+17
2019-05-24build env: simplify handling of parallel jobs (#11524)Massimiliano Culpo9-35/+97
This PR implements several refactors requested in #11373, specifically: - Config scopes are used to handle builtin defaults, command line overrides and package overrides (`parallel=False`) - `Package.make_jobs` attribute has been removed; `make_jobs` remains as a module-scope variable in the build environment. - The use of the argument `-j` has been rationalized across commands - move '-j'/'--jobs' argument into `spack.cmd.common.arguments` - Add unit tests to check that setting parallel jobs works as expected - add new test to ensure that build job setting is isolated to each build - Fix packages that used `Package.make_jobs` (i.e. `bazel`)
2019-05-23docs: truncate `spack list` output in basic usageTodd Gamblin1-3/+6
`spack list` output is very long and takes up a lot of space in the docs. Truncate it to just 10 lines and link to the package list page.
2019-05-21Add Fujitsu compiler to Spack. (#11287)t-karatsu6-4/+86
* Add Fujitsu compiler to Spack. * Fixes for flake8 * Chenges location of FCC to subdirectory called case-insensitive * Add compiler tests for Fujitsu compiler * Modify the logic of taking compiler version for new version of Fujitsu compiler
2019-05-20Make flake8 check spack script as well as .py files (#11513)Adam J. Stewart1-1/+1
* Make flake8 check bin/spack
2019-05-20Get Cray OS version from PrgEnv-cray (#10774)Mario Melara1-2/+2
The regex used for finding the Cray OS version from the PrgEnv-cray module was not exact and was at times pulling the version from other PrgEnv modules. This updates the regular expression to be more exact.
2019-05-18Typos: funciton, woudl, hm,... (#11511)George Hartzell1-3/+3
2019-05-18Execute modulecmd in bash shell (#11510)Mario Melara1-2/+4
Adds executable=/bin/bash into Popen. We discovered this bug while working in a csh/tsch environment. By executing with /bin/bash we ensure that the module command works.
2019-05-16Command extensions can import code from modules in root or cmd folder (#11209)Massimiliano Culpo4-4/+277
#8612 added command extensions to Spack: a command implemented in a separate directory. This improves the implementation by allowing the command to import additional utility code stored within the established directory structure for commands. This also: * Adds tests for command extensions * Documents command extensions (including the expected directory layout)
2019-05-17Allow command access to dump/pickle_environment from #8476 (#11434)Chris Green2-7/+56
* Allow command access to dump/pickle_environment from #8476
2019-05-15fix suite-sparse built with tbb from intel-parallel-studio (#11134)Denis Davydov1-1/+11
* fix suite-sparse built with tbb from intel-parallel-studio * intel: add tbb_headers, strip newline from cxx_lib * use property
2019-05-15Use `svn info --xml` instead of `svn info` to get svn revisions (#11466)Todd Gamblin2-14/+8
- `svn info` prints different results depending on the system locale - in particular, Japanese output doesn't contain "Revision:" - Change Spack code to use XML output instead of using the human output
2019-05-14Remove vestigial print statement in module logic (#11438)Greg Becker1-1/+0
Remove a vestigial print statement introduced in #8570
2019-05-10permissions: preserve suid and sgid bits (#10727)Greg Becker2-0/+46
* Don't overwrite suid/sgid bits when setting permissions * add tests for permission setting
2019-05-10Intel packages: multiple installs and optional scalapack libs (#11384)Glenn Johnson1-1/+5
Add fixes to support multiple installs and dependents using a subset of IntelPackage functionality. * Update IntelPackage to only return scalapack libraries if the root spec depends on MPI: scalapack requires MPI to be mentioned as a dependency in the DAG. Package builds using intel-mkl for its blas/lapack implementations but not for scalapack were failing to build. Ideally it would be possible to ask if any of the packages in the DAG are actually requesting the scalapack functionality provided by the IntelPackage and only return scalapack libs in that case, but that is not easily done at this time. Fixes #11314 Fixes #11289 * set HOME when the intel silent installer is run. This prevents the installer from using the ~/intel directory (which can cause conflicts for multiple installs of the same IntelPackage) Fixes #9713
2019-05-09modules: use new `module` function instead of `get_module_cmd` (#8570)Greg Becker8-248/+118
Use new `module` function instead of `get_module_cmd` Previously, Spack relied on either examining the bash `module()` function or using the `which` command to find the underlying executable for modules. More complicated module systems do not allow for the sort of simple analysis we were doing (see #6451). Spack now uses the `module` function directly and copies environment changes from the resulting subprocess back into Spack. This should provide a future-proof implementation for changes to the logic underlying the module system on various HPC systems.
2019-05-10make license check more-strictPeter Josef Scheibel2-39/+93
The license text is now expected to match almost exactly (not accounting for formatting in different file types (e.g. rst vs. bash script vs. python)
2019-05-08Hide some variables in spack-build.env fileSeth R Johnson1-2/+6
Don't arbitrarily reset PWD and OLDPWD when sourcing, as well as other session-specific IDs
2019-05-07Environment path sanitization and sourcing (#8476)Chris Green3-7/+208
Add two functions to the EnvironmentModifications object to help users sanitize environment variables in their package definitions: * deprioritize_system_paths: this keeps system paths in the environment variable but moves them to the end. * prune_duplicate_paths: remove any duplicate paths from the variable This includes testing for the new functions as well as for (previously-untested) old convenience functions for environment variable manipulation. This also adds special handling for bash functions so they will be defined when the exported environment file is sourced.
2019-05-04Binary caches on MacOS - allow expanded RPATHs (#11345)Patrick Gartung2-0/+37
Fixes #11335 Update the Spack compiler wrappers to add the headerpad_max_install_names linker flag on MacOS. This allows the install_name_tool to rewrite the RPATH entry of the binary to be longer if needed. This is primarily useful for creating and distributing binary caches of packages (i.e. using the "spack buildcache" command); binary caches created on MacOS before this commit may not successfully relocate (if the target root path is larger).