summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2017-09-30Port CTest's log scraping logic to Spack (#5561)Todd Gamblin4-62/+387
- This steals the magic regular expressions that CTest uses to parse log files and addds them to Spack. See here: https://github.com/Kitware/CMake/blob/master/Source/CTest/cmCTestBuildHandler.cxx These are BSD licensed, so the port is in `externa/ctest_log_parser.py` - We currently use these to do better filtering of errors from build output. Plan is to use them to generate good CDash output.
2017-09-30Add testing for spack blame; refactor llnl.util testsTodd Gamblin7-23/+106
2017-09-30Add 'spack blame' command: shows contributors to packagesTodd Gamblin6-25/+280
`spack blame` prints out the contributors to a package. By modification time: ``` $ spack blame --time llvm LAST_COMMIT LINES % AUTHOR EMAIL 3 days ago 2 0.6 Andrey Prokopenko <andrey.prok@gmail.com> 3 weeks ago 125 34.7 Massimiliano Culpo <massimiliano.culpo@epfl.ch> 3 weeks ago 3 0.8 Peter Scheibel <scheibel1@llnl.gov> 2 months ago 21 5.8 Adam J. Stewart <ajstewart426@gmail.com> 2 months ago 1 0.3 Gregory Becker <becker33@llnl.gov> 3 months ago 116 32.2 Todd Gamblin <tgamblin@llnl.gov> 5 months ago 2 0.6 Jimmy Tang <jcftang@gmail.com> 5 months ago 6 1.7 Jean-Paul Pelteret <jppelteret@gmail.com> 7 months ago 65 18.1 Tom Scogland <tscogland@llnl.gov> 11 months ago 13 3.6 Kelly (KT) Thompson <kgt@lanl.gov> a year ago 1 0.3 Scott Pakin <pakin@lanl.gov> a year ago 3 0.8 Erik Schnetter <schnetter@gmail.com> 3 years ago 2 0.6 David Beckingsale <davidbeckingsale@gmail.com> 3 days ago 360 100.0 ``` Or by percent contribution: ``` $ spack blame --percent llvm LAST_COMMIT LINES % AUTHOR EMAIL 3 weeks ago 125 34.7 Massimiliano Culpo <massimiliano.culpo@epfl.ch> 3 months ago 116 32.2 Todd Gamblin <tgamblin@llnl.gov> 7 months ago 65 18.1 Tom Scogland <tscogland@llnl.gov> 2 months ago 21 5.8 Adam J. Stewart <ajstewart426@gmail.com> 11 months ago 13 3.6 Kelly (KT) Thompson <kgt@lanl.gov> 5 months ago 6 1.7 Jean-Paul Pelteret <jppelteret@gmail.com> 3 weeks ago 3 0.8 Peter Scheibel <scheibel1@llnl.gov> a year ago 3 0.8 Erik Schnetter <schnetter@gmail.com> 3 years ago 2 0.6 David Beckingsale <davidbeckingsale@gmail.com> 3 days ago 2 0.6 Andrey Prokopenko <andrey.prok@gmail.com> 5 months ago 2 0.6 Jimmy Tang <jcftang@gmail.com> 2 months ago 1 0.3 Gregory Becker <becker33@llnl.gov> a year ago 1 0.3 Scott Pakin <pakin@lanl.gov> 3 days ago 360 100.0 ```
2017-09-30Typo: file -> directory (#5560)George Hartzell1-1/+1
Mirrors are directories (that use `file://` URLS, not files.
2017-09-30Documentation for dependency patching.Todd Gamblin3-23/+189
2017-09-30Patches are hashed with specs, and can be associated with dependencies.Todd Gamblin13-155/+555
- A package can depend on a special patched version of its dependencies. - The `Spec` YAML (and therefore the hash) now includes the sha256 of the patch in the `Spec` YAML, which changes its hash. - The special patched version will be built separately from a "vanilla" version of the same package. - This allows packages to maintain patches on their dependencies without affecting either the dependency package or its dependents. This could previously be accomplished with special variants, but having to add variants means the hash of the dependency changes frequently when it really doesn't need to. This commit allows the hash to change *just* for dependencies that need patches. - Patching dependencies shouldn't be the common case, but some packages (qmcpack, hpctoolkit, openspeedshop) do this kind of thing and it makes the code structure mirror maintenance responsibilities. - Note that this commit means that adding or changing a patch on a package will change its hash. This is probably what *should* happen, but we haven't done it so far. - Only applies to `patch()` directives; `package.py` files (and their `patch()` functions) are not hashed, but we'd like to do that in the future. - The interface looks like this: `depends_on()` can optionally take a patch directive or a list of them: depends_on(<spec>, patches=patch(..., when=<cond>), when=<cond>) # or depends_on(<spec>, patches=[patch(..., when=<cond>), patch(..., when=<cond>)], when=<cond>) - Previously, the `patch()` directive only took an `md5` parameter. Now it only takes a `sha256` parameter. We restrict this because we want to be consistent about which hash is used in the `Spec`. - A side effect of hashing patches is that *compressed* patches fetched from URLs now need *two* checksums: one for the downloaded archive and one for the content of the patch itself. Patches fetched uncompressed only need a checksum for the patch. Rationale: - we include the content of the *patch* in the spec hash, as that is the checksum we can do consistently for patches included in Spack's source and patches fetched remotely, both compressed and uncompressed. - we *still* need the patch of the downloaded archive, because we want to verify the download *before* handing it off to tar, unzip, or another decompressor. Not doing so is a security risk and leaves users exposed to any arbitrary code execution vulnerabilities in compression tools.
2017-09-30add spack flake8 exception for long checksumsTodd Gamblin1-2/+2
2017-09-30Clean up exceptions and function names in directives.Todd Gamblin1-41/+23
- Functions returned by directives were all called `_execute`, which made reading stack traces hard because you couldn't tell what directive a frame came from. - renamed them all to `_execute_<directive>` - Exceptions in directives were only really used in one or two places -- get rid of the boilerplate init functions and let the callsite specify the message.
2017-09-30Consolidate some web-spidering commands in spack.util.webTodd Gamblin6-116/+118
- move `spack.cmd.checksum.get_checksums` to `spack.util.web.spider_checksums` - move `spack.error.NoNetworkError` to `spack.util.web.NoNetworkError` since it is only used there.
2017-09-30Disable duplicate cross-reference warnings in Sphinx.Todd Gamblin1-0/+14
2017-09-30Refactor Package dependency metadataTodd Gamblin14-123/+217
- Previously, dependencies and dependency_types were stored as separate dicts on Package. - This means a package can only depend on another in one specific way, which is usually but not always true. - Prior code unioned dependency types statically across dependencies on the same package. - New code stores dependency relationships as their own object, with a spec constraint and a set of dependency types per relationship. - Dependency types are now more precise - There is now room to add more information to dependency relationships. - New Dependency class lives in dependency.py, along with deptype definitions that used to live in spack.spec. Move deptype definitions to spack.dependency
2017-09-30Patch.apply() shouldn't affect working directory of caller.Todd Gamblin1-11/+12
2017-09-30Only print "no patches needed" if there were no patches.Todd Gamblin1-1/+5
2017-09-29Add test deptype (#5132)scheibelp9-11/+181
* Add '--test=all' and '--test=root' options to test either the root or the root and all dependencies. * add a test dependency type that is only used when --test is enabled. * test dependencies are not added to the spec, but they are provided in the test environment.
2017-09-29modules: specialized configure_options for external packages (#5543)Massimiliano Culpo2-2/+20
closes #5473 Prior to this PR we were not exiting early for external packages, which caused the `configure_options` property of the contexts to fail with e.g. a key error because the DAG gets truncated for them. More importantly Spack configure options don't make any sense for externals. Now we exit early, and leave a message in the module file clarifying that this package has been installed outside of Spack.
2017-09-25module files: system paths are excluded from path inspection (#5460)Massimiliano Culpo4-11/+72
closes #5201 Currently, if a user sets an external package to have a prefix that is one of the system paths (like '/usr') the module files that are generated will prepend '/usr/bin' to 'PATH', etc. This is particularly nasty at the time when a module file is unloaded, and e.g. paths like '/usr/bin' will be discarded from PATH. This PR solves the issue skipping system paths when a prefix inspection is made to generate module files.
2017-09-21Prefer later versions of compilers by default (#5234)scheibelp3-24/+18
* Prefer later versions of compilers by default * update test to make it less fragile
2017-09-20update Blas/Lapack section of packaging guide (#5383)Denis Davydov1-12/+41
2017-09-19Modulefiles generated with a template engine (#3183)Massimiliano Culpo94-1775/+15845
* Module files now are generated using a template engine refers #2902 #3173 jinja2 has been hooked into Spack. The python module `modules.py` has been splitted into several modules under the python package `spack/modules`. Unit tests stressing module file generation have been refactored accordingly. The module file generator for Lmod has been extended to multi-providers and deeper hierarchies. * Improved the support for templates in module files. Added an entry in `config.yaml` (`template_dirs`) to list all the directories where Spack could find templates for `jinja2`. Module file generators have a simple override mechanism to override template selection ('modules.yaml' beats 'package.py' beats 'default'). * Added jinja2 and MarkupSafe to vendored packages. * Spec.concretize() sets mutual spec-package references The correct place to set the mutual references between spec and package objects at the end of concretization. After a call to concretize we should now be ensured that spec is the same object as spec.package.spec. Code in `build_environment.py` that was performing the same operation has been turned into an assertion to be defensive on the new behavior. * Improved code and data layout for modules and related tests. Common fixtures related to module file generation have been extracted in `conftest.py`. All the mock configurations for module files have been extracted from python code and have been put into their own yaml file. Added a `context_property` decorator for the template engine, to make it easy to define dictionaries out of properties. The default for `verbose` in `modules.yaml` is now False instead of True. * Extendable module file contexts + short description from docstring The contexts that are used in conjunction with `jinja2` templates to generate module files can now be extended from package.py and modules.yaml. Module files generators now infer the short description from package.py docstring (and as you may expect it's the first paragraph) * 'module refresh' regenerates all modules by default `module refresh` without `--module-type` specified tries to regenerate all known module types. The same holds true for `module rm` Configure options used at build time are extracted and written into the module files where possible. * Fixed python3 compatibility, tests for Lmod and Tcl. Added test for exceptional paths of execution when generating Lmod module files. Fixed a few compatibility issues with python3. Fixed a bug in Tcl with naming_scheme and autoload + unit tests * Updated module file tutorial docs. Fixed a few typos in docstrings. The reference section for module files has been reorganized. The idea is to have only three topics at the highest level: - shell support + spack load/unload use/unuse - module file generation (a.k.a. APIs + modules.yaml) - module file maintenance (spack module refresh/rm) Module file generation will cover the entries in modules.yaml Also: - Licenses have been updated to include NOTICE and extended to 2017 - docstrings have been reformatted according to Google style * Removed redundant arguments to RPackage and WafPackage. All the callbacks in `RPackage` and `WafPackage` that are not build phases have been modified not to accept a `spec` and a `prefix` argument. This permits to leverage the common `configure_args` signature to insert by default the configuration arguments into the generated module files. I think it's preferable to handling those packages differently than `AutotoolsPackage`. Besides only one package seems to override one of these methods. * Fixed broken indentation + improved resiliency of refresh Fixed broken indentation in `spack module refresh` (probably a rebase gone silently wrong?). Filter the writers for blacklisted specs before searching for name clashes. An error with a single writer will not stop regeneration, but instead will print a warning and continue the command.
2017-09-17Add --show-log-on-error option to `spack install`Todd Gamblin4-14/+59
- converted `log_path` and `env_path` to properties of PackageBase. - InstallErrors in build_environment are now annotated with the package that caused them, in the 'pkg' attribute. - Add `--show-log-on-error` option to `spack install` that catches InstallErrors and prints the log to stderr if it exists. Note that adding a reference to the Pakcage allows a lot of stuff currently handled by do_install() and build_environment to be handled externally.
2017-09-17Remove redundant dest arguments in install.pyTodd Gamblin1-8/+8
2017-09-17Fix log error parsing bug introduced in c830eda0e (#5387)Todd Gamblin2-3/+3
- '\b' in regular expression needs to be in a raw string (r'\b') - Regression test that would've caught this was unintentionally disabled - This fixes the string and the test
2017-09-17Filter system paths from CMAKE_PREFIX_PATH (#5385)Pramod S Kumbhar1-0/+2
2017-09-16Improve external package location detection algorithm. (#5145)Kelly (KT) Thompson2-1/+8
Also inspect `PATH` to help locate an external package and provide a test for getting path from module's PATH. Fixes #5141
2017-09-16set CMAKE_PREFIX_PATH for cmake packages (#5364)Denis Davydov1-0/+5
* cmake: set CMAKE_PREFIX_PATH * cmake: use build/link immediate dependencies to construct CMAKE_PREFIX_PATH
2017-09-12Force reference consistency between Spec & PackageMassimiliano Culpo2-13/+23
The correct place to set the mutual references between spec and package objects is at the end of concretization. After a call to concretize we should now be ensured that spec is the same object as spec.package.spec. Code in `build_environment.py` that was performing the same operation has been turned into an assertion to be defensive on the new behavior.
2017-09-11clean up concreteness detectionTodd Gamblin3-99/+27
- Fixes bugs where concretization would fail due to an erroneously cached _concrete attribute. - Ripped out a bunch of code in spec.py that isn't needed/valid anymore: - The various concrete() methods on different types of Specs would attempt to statically compute whether the Spec was concrete. - This dates back to when DAGs were simpler and there were no optional dependencies. It's actually NOT possible to compute statically whether a Spec is concrete now. The ONLY way you know is if it goes through concretization and is marked concrete once that completes. - This commit removes all simple concreteness checks and relies only on the _concrete attribute. This should make thinking about concreteness simpler. - Fixed a couple places where Specs need to be marked concrete explicitly. - Specs read from files and Specs that are destructively copied from concrete Specs now need to be marked concrete explicitly. - These spots may previously have "worked", but they were brittle and should be explcitly marked anyway.
2017-09-11bugfix: concrete dependencies are now copied properly.Todd Gamblin1-25/+44
- Dependencies in concrete specs did not previously have their cache fields (_concrete, _normal, etc.) preserved. - _dup and _dup_deps weren't passing each other enough information to preserve concreteness properly, so only the root was properly preserved. - cached concreteness is now preserved properly for the entire DAG, not just the root. - added method docs.
2017-09-11Simplify logic in Spec.normalize()Todd Gamblin1-4/+4
2017-09-11Preserve original stack trace for UnsatisfiableSpecErrorTodd Gamblin1-3/+4
2017-09-11'with_or_without' accepts bool variantsMassimiliano Culpo2-36/+151
Fixes #4112 This commit extends the support of the AutotoolsPackage methods `with_or_without` and `enable_or_disable` to bool-valued variants. It also defines for those functions a convenience short-cut if the activation parameter is the prefix of a spec (like in `--with-{pkg}={prefix}`). This commit also includes: * Updates to viennarna and adios accordingly: they have been modified to use `enable_or_disable` and `with_or_without` * Improved docstrings in `autotools.py`. Raise `KeyError` if name is not a variant.
2017-09-09Fix name detection in HeaderList and LibraryList (#5118)Adam J. Stewart2-34/+68
* Fix name detection in HeaderList and LibraryList * Add support for CUDA header files
2017-09-08Bootstrap environment-modulesMatthew Scott Krafczyk4-112/+233
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-07dump environment in sourceable form (#5301)Rob Latham1-1/+1
First, quote the environment variable values. Second, export the variables. sorry, this is bourn-shell syntax. Happy to consider a shell-independent way to do this, but spack is already using sh-like "env=value"
2017-09-06Update copyright notices for 2017 (#5295)Michael Kuhn232-232/+232
2017-09-05Added support for querying by tags (#4786)Massimiliano Culpo9-127/+518
* Added support to query packages by tags. - The querying commands `spack list`, `spack find` and `spack info` have been modified to support querying by tags. Tests have been added to check that the feature is working correctly under what should be the most frequent use cases. * Refactored Repo class to make insertion of new file caches easier. - Added the class FastPackageChecker. This class is a Mapping from package names to stat info, that gets memoized for faster access. - Extracted the creation of a ProviderIndex to its own factory function. * Added a cache file for tags. - Following what was done for providers, a TagIndex class has been added. This class can serialize and deserialize objects from json. Repo and RepoPath have a new method 'packages_with_tags', that uses the TagIndex to compute a list of package names that have all the tags passed as arguments. On Ubuntu 14.04 the effect if the cache reduces the time for spack list from ~3sec. to ~0.3sec. after the cache has been built. * Fixed colorization of `spack info`
2017-09-05Fixed bug in `spack env` due to missing argument. (#5280)Massimiliano Culpo3-7/+58
This command broke after #5109. It was using the default value for the "dirty" argument in `setup_package`. Now it adopts the same logic as in `spack install`. Changed help for '--clean' and '--dirty'. Improved coverage of spack env.
2017-09-01Set default cmake build_type to Release for llvmscheibelp1-1/+1
Override CMake "build_type" variant to default to "Release" for llvm package.
2017-08-31Patch directive allows non-archives (#5197)Massimiliano Culpo5-1/+100
- Don't expand downloaded patch file if it is not gzipped/tar'd/zipped/etc.
2017-08-30add optional maintainers property to package (#5230)Denis Davydov2-0/+9
* add optional package maintainers
2017-08-30Slightly better error matching when parsing spack logs (#5236)Andrey Prokopenko1-1/+1
2017-08-29Added unit tests for Spec.__init__ exceptional pathsalalazo1-0/+11
2017-08-29Fixed bug in Spec._dup, updated docstringalalazo1-7/+17
The private method `Spec._dup` was missing a line (when setting compiler flags the parent spec was not set to `self`). This resulted in an inconsistent state of the duplicated Spec. This problem has been fixed here. The docstring of `Spec._dup` has been updated.
2017-08-29Make Spec construction simpler (#5227)Todd Gamblin1-27/+26
2017-08-28Add --show-full-compiler option to 'spack find'Matthew Scott Krafczyk2-2/+12
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-25Removed default value for 'dirty' function argument. (#5109)Massimiliano Culpo1-3/+3
This change is done to avoid inconsistencies during refactoring. The rationale is that functions at different levels in the call stack all define a default for the 'dirty' argument. This PR removes the default value for all the functions except the top-level one (`PackageBase.do_install`). In this way not defining 'dirty' will result in an error, instead of the default value being used. This will reduce the risk of having an inconsistent behavior after a refactoring.
2017-08-25Fix copyright years in spack create template (#5203)Michael Kuhn1-1/+1
2017-08-25Improve Ubuntu arch detection (#2649)Michael Kuhn1-1/+6
Ubuntu uses a YY.{04,10} release scheme, where YY.04 is not necessarily binary-compatible with YY.10.
2017-08-25Link extra_rpaths from compilers.yaml at build time (#5211)scheibelp1-0/+2
2017-08-25patch config.guess for any ppc64le arch (#5215)Gregory Lee1-1/+1