summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2018-07-09Add ccache support (#3761)Christoph Junghans4-1/+37
If the user sets "ccache: true" in spack's config.yaml, Spack will use an available ccache executable when compiling c/c++ code. This feature is disabled by default (i.e. "ccache: false") and the documentation is updated with how to enable ccache support
2018-07-08fix typo in help of `spack clone` prefix is singular (#8658)Andreas Baumbach1-1/+1
Change-Id: I3bfe5b4ba497fae57d5382502ea9a1b054688fdb
2018-07-06Clear up a bit of modules/dotkit confusion (#8650)George Hartzell1-5/+7
`use` is an overloaded word between dotkit, modules and spack. Add additional words to make the distinction clear in the docs.
2018-06-29Removed duplicate word (#8609)Paul Chelarescu1-1/+1
2018-06-26views: packages can customize how they're added to views (#7152)scheibelp21-307/+794
Functional updates: - `python` now creates a copy of the `python` binaries when it is added to a view - Python extensions (packages which subclass `PythonPackage`) rewrite their shebang lines to refer to python in the view - Python packages in the same namespace will not generate conflicts if both have `...lib/site-packages/namespace-example/__init__.py` - These `__init__` files will also remain when removing any package in the namespace until the last package in the namespace is removed Generally (Updated 2/16): - Any package can define `add_files_to_view` to customize how it is added to a view (and at the moment custom definitions are included for `python` and `PythonPackage`) - Likewise any package can define `remove_files_from_view` to customize which files are removed (e.g. you don't always want to remove the namespace `__init__`) - Any package can define `view_file_conflicts` to customize what it considers a merge conflict - Global activations are handled like views (where the view root is the spec prefix of the extendee) - Benefit: filesystem-management aspects of activating extensions are now placed in views (e.g. now one can hardlink a global activation) - Benefit: overriding `Package.activate` is more straightforward (see `Python.activate`) - Complication: extension packages which have special-purpose logic *only* when activated outside of the extendee prefix must check for this in their `add_files_to_view` method (see `PythonPackage`) - `LinkTree` is refactored to have separate methods for copying a directory structure and for copying files (since it was found that generally packages may want to alter how files are copied but still wanted to copy directories in the same way) TODOs (updated 2/20): - [x] additional testing (there is some unit testing added at this point but more would be useful) - [x] refactor or reorganize `LinkTree` methods: currently there is a separate set of methods for replicating just the directory structure without the files, and a set for replicating everything - [x] Right now external views (i.e. those not used for global activations) call `view.add_extension`, but global activations do not to avoid some extra work that goes into maintaining external views. I'm not sure if addressing that needs to be done here but I'd like to clarify it in the comments (UPDATE: for now I have added a TODO and in my opinion this can be merged now and the refactor handled later) - [x] Several method descriptions (e.g. for `Package.activate`) are out of date and reference a distinction between global activations and views, they need to be updated - [x] Update aspell package activations
2018-06-26bugfix: fix macos incompatibility in lock test (#8573)Todd Gamblin3-16/+29
- Spack was assuming that a group with gid == current uid would always exist. - This was breaking the travis build for macos. - also fix issue with the DB tarball test finding coverage filesx
2018-06-25refactor: move pytest.ini and top-level conftest.py to lib/spack/spack/testTodd Gamblin3-1/+36
- removes two files from root of repository - `spack test` still works fine to run tests
2018-06-24refactor: move templates from root to share/spackTodd Gamblin3-15/+16
- This complies with the unix directory hierarchy standard (which Spack attempts to follow) - Also unclutters the repo root directory.
2018-06-24tests: test file/line attribution in config errorsTodd Gamblin3-30/+140
2018-06-24tests: add a test for `spack debug` commandTodd Gamblin3-2/+66
2018-06-24tests: test html output for `spack list`Todd Gamblin1-62/+37
- make list test use SpackCommand - convert to pytest - add a test for HTML output
2018-06-24Add `spack -H` shortcut for `spack help --all`Todd Gamblin1-18/+17
- I keep typing this based on `spack test -h` and `spack test -H` - This finally makes my fingers happy
2018-06-22Fix version detection for gcc@8 (#8511)Michael Kuhn1-2/+2
2018-06-20pytest: add _pytest/_version.py and LICENSETodd Gamblin4-1/+49
- pytest was not reporing the correct version from pytest.__version__. It reported 'unknown' - this fixes issues on some systems where system-installed pytest plugins would try to use the version and convert it to an int
2018-06-20externals: move spack.util.ordereddict to external/ordereddict_backportTodd Gamblin5-8/+5
2018-06-18Allow docs to be built with Sphinx 1.7.1+ (#8500)Adam J. Stewart1-1/+7
* Allow docs to be built with Sphinx 1.7.1+ * Allow docs to be built with Sphinx 2.0+
2018-06-17There's only one 'u' in "configuration" (#8498)George Hartzell1-1/+1
2018-06-17docs: remove vendored sphinx_rtd_theme (#8496)Todd Gamblin29-1124/+4
2018-06-14Update the clang compiler definition to use IBM XL Fortran compiler (#8389)Dan FitzGerald1-2/+6
on CORAL systems (linux-rhel7-ppc64le).
2018-06-12Add trailing slash when spidering URLs for versions (#8429)Adam J. Stewart1-0/+7
By default, if a package does not specify a list_url and does not download from a common repository, Spack runs dirname on the package URL. Given a URL like https://root.cern.ch/download/root_v6.09.02.source.tar.gz, this returns https://root.cern.ch/download. However, https://root.cern.ch/download gives a 404, while https://root.cern.ch/download/ works just fine. Note that some servers *don't* work with a trailing slash, so this tries with and without the slash. This will double the number of URLs searched but the slowdown should only affect the "spack versions" command.
2018-06-08compiler flags: add cxx98 standard support (#7601)Chris Green8-50/+285
The following improvements are made to cxx standard support (e.g. compiler.cxxNN_flag functions) in compilers: * Add cxx98_flag property * Add support for throwing an exception when a flag is not supported (previously if a flag was not supported the application was terminated with tty.die) * The name of the flag associated with e.g. c++14 standard support changes for different compiler versions (e.g. c++1y vs c++14). This makes a few corrections on what flag to return for which version. * Added tests to confirm that versions report expected flags for various c++ standards (or raise an exception for versions that don't provide a given cxx standard) Note that if a given cxx standard is the default, the associated flag property will return ""; cxx98 is assumed to be the default standard so this is the behavior for the associated property in the base compiler class. Package changes: * Improvements to the boost spec to take advantage of the improved standard flag facility. * Update the clingo spec to catch the new exception rather than look for an empty flag to indicate non-support (which is not part of the compiler flag API)
2018-06-07add python cache removal to `spack clean` (#8419)healther1-4/+24
Remove .pyc and .pyo files along with __pycache__directory if the user provides the -p/--python-cache option to "spack clean"
2018-06-06Fix bug where patches specified by dependents were not applied (#8272)scheibelp2-12/+13
Fixes #7885 #7193 added the patches_to_apply function to collect patches which are then applied in Package.do_patch. However this only collects patches that are associated with the Package object and does not include Spec-related patches (which are applied by dependents, added in #5476). Spec.patches already collects patches from the package as well as those applied by dependents, so the Package.patches_to_apply function isn't necessary. All uses of Package.patches_to_apply are replaced with Package.spec.patches. This also updates Package.content_hash to require the associated spec to be concrete: Spec.patches is only set after concretization. Before this PR, it was possible for Package.content_hash to be valid before concretizing the associated Spec if all patches were associated with the Package (vs. being applied by dependents). This behavior was unreliable though so the change is unlikely to be disruptive.
2018-06-05Preserve Spack CC/FC/F77/CXX settings when loading modules (#8346)Massimiliano Culpo4-15/+110
Fixes #8345 Spack environment modifications are applied before modules are loaded; this includes settings to CC, FC, F77, and CXX, which point to the Spack compiler wrappers. If the loaded modules set CC, this overrides the Spack compiler wrappers. This PR adds a context manager to preserve the values of CC etc. that are set by Spack: any effects on the CC, FC, F77, and CXX variables from modules are undone and their original values are restored.
2018-06-04pybind11: test functionality (#8304)Axel Huebl1-0/+2
* pybind11: test support Add a test functionality to pybind11. * CMake: test also on "make check" Some projects use non-CTest manual targets for tests.
2018-06-02Less sensitive error detection in build logs (#8278)Adam J. Stewart1-5/+2
* Less sensitive error detection in build logs * Fix test_log_parser unit test
2018-06-02Don't duplicate Python error messages (#8270)Adam J. Stewart1-1/+1
2018-06-02Fix coloring of error messages containing '}' symbol (#8277)Adam J. Stewart3-11/+30
2018-06-02Fix package error message line numbers (#8271)Adam J. Stewart1-12/+20
Line numbers were reported as zero-indexed, but we need to adjust.
2018-06-01Skip external specs when creating mirrors (#8084)Massimiliano Culpo2-5/+47
fixes #8083 External specs are supposed to be installed already, so there's no need to try to download a tarball for them.
2018-06-01Typo: an -> and (#8350)George Hartzell1-1/+1
2018-06-01extend Prefix class with join() member to support dynamic directories (#8329)Denis Davydov3-2/+44
* extend Prefix class with join() member to support dynamic directories * add more tests for Prefix.join() * more tests for Prefix.join() * add docstring * add example to docstring of Prefix class * cleanup Prefix.join() tests * use Prefix.join() in Packaging Guide
2018-05-31binary caching: skip check if old and new paths are identical (#8281)George Hartzell1-0/+2
Fixes #8217 Trying to relocate a distribution when the new and old paths are equal leads to failure, because the test that ensures that no unrelocated bits are left over always fails. As an example, this occurs if a user installs a package, generates a binary with it using 'spack buildcache', uninstalls it, and then attempts to reinstall into the same spack installation using the generated binary package. This updates the relocation check to accept the presence of the old prefix in binaries if the package is being reinstalled into its original location.
2018-05-31improve Advanced Compiler Configuration part of tutorial (#8325)Denis Davydov1-2/+21
2018-05-30more-flexible user-specified dependency constraints (#8162)scheibelp3-17/+80
* allow user to constrain dependencies that are added conditionally * remove check for not-visited deps from normalize, move it to concretize. The check now runs after the concretization loop completes (so an error is only reported if the user-mentioned spec doesnt appear anywhere in the dag) * remove separate full_spec_deps variable; rename spec_deps to all_spec_deps to clarify that it merges user-specified dependencies with derived dependencies * add unit test to confirm new functionality
2018-05-30config: add `spack config blame` command (#8081)Todd Gamblin5-10/+339
- `spack config blame` is similar to `spack config get`, but it prints out the config file and line number that each line of the merged configuration came from. - This is a debugging tool for understanding where Spack config settings come from. - add tests for config blame
2018-05-30Document specs with multiple version ranges (#8284)Adam J. Stewart1-0/+8
2018-05-24Fix missing spack.compiler import (#8240)Michael Kuhn1-0/+1
Fixes: #8258 #8090 altered import behavior so that import spack no longer provides access to many other Spack modules. This addresses a case which depended on the prior behavior and was not updated as part of #8090. This particular import error only came up when users were setting compiler flags on specs. See also: #8194
2018-05-22CUDA 9.2 (#8238)Axel Huebl1-4/+7
Add the latest CUDA release, v9.2 and updated CUDA Compatibility Matrix
2018-05-21Add info about haveged to gpg/randomness note (#8227)George Hartzell1-3/+18
2018-05-20URL parsing: strip x86-64 from filename (#8200)Adam J. Stewart2-2/+4
2018-05-19fix leftover references to spack.<symbol>Todd Gamblin10-24/+19
- there were some leftover spack.* names being used after we removed globals and moved everything in the top-level namespace to spack.pkgkit - point those references to their new homes
2018-05-18imports: remove unnecessary `import spack` statementsTodd Gamblin26-47/+33
- remove most `import spack` statements, except for files that need `spack_version` - import spack is no longer sufficient to use submodules (e.g. spack.directives). - these submodules must be imported directly. Update references accordingly.
2018-05-18init: move symbols in `spack` to `spack.pkgkit`Todd Gamblin9-122/+137
- Spack packages were originally expected to call `from spack import *` themselves, but it has become difficult to manage imports in the Spack core. - the top-level namespace polluted by package symbols, and it's not possible to avoid circular dependencies and unnecessary module loads in the core, given all the stuff the packages need. - This makes the top-level `spack` package essentially empty, save for a version tuple and a version string, and `from spack import *` is now essentially a no-op. - The common routines and directives that packages need are now in `spack.pkgkit`, and the import system forces packages to automatically include this so that old packages that call `from spack import *` will continue to work without modification. - Since `from spack import *` is no longer required, we could consider removing ``from spack import *`` from packages in the future and shifting to ``from spack.pkgkit import *``, but we can wait a while to do this.
2018-05-18locks: add configuration and command-line options to enable/disable locks ↵Todd Gamblin10-54/+311
(#7692) - spack.util.lock behaves the same as llnl.util.lock, but Lock._lock and Lock._unlock do nothing. - can be disabled with a control variable. - configuration options can enable/disable locking: - `locks` option in spack configuration controls whether Spack will use filesystem locks or not. - `-l` and `-L` command-line options can force-disable or force-enable locking. - Spack will check for group- and world-writability before disabling locks, and it will not allow a group- or world-writable instance to have locks disabled. - update documentation
2018-05-17make check_for_compiler_existence an instance variableTodd Gamblin3-18/+16
2018-05-17use os.path.join instead of join_path in coreTodd Gamblin34-156/+141
- Spack core has long used llnl.util.filesystem.join_path, but os.path.join is pretty much the same thing, and is more efficient. - Use os.path.join in the core Spack code from now on.
2018-05-17Convert lazy singleton functions to Singleton objectTodd Gamblin61-537/+498
- simplify the singleton pattern across the codebase - reduce lines of code needed for crufty initialization - reduce functions that need to mess with a global - Singletons whose semantics changed: - spack.store.store() -> spack.store - spack.repo.path() -> spack.repo.path - spack.config.config() -> spack.config.config - spack.caches.fetch_cache() -> spack.caches.fetch_cache - spack.caches.misc_cache() -> spack.caches.misc_cache
2018-05-17init: make spack.cmd.all_commands lazyTodd Gamblin5-11/+27
- `spack.cmd.all_commands` does a directory listing on `lib/spack/spack/cmd`, regardless of whether it is needed - make this lazy so that the directory listing won't happen unless it's necessary.
2018-05-17init: only imoprt jsonschema if neededTodd Gamblin1-9/+10
- It turns out that jsonschema is one of the more expensive imports. - move imports of jsonschema into functions to avoid the performance hits for calls that don't need config.