summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2017-10-30Auto install available pre-built packages from binary cache (#5242)scheibelp5-30/+62
* basic functionality to install spec from a binary cache when it's available; this spiders each cache for each package and could likely be more efficient by caching the results of the first check * add spec to db after installing from binary cache * cache (in memory) spec listings retrieved from binary caches * print a warning vs. failing when no mirrors are configured to retrieve pre-built Spack packages * make automatic retrieval of pre-built spack packages from mirrors optional * no code was using the links stored in the dictionary returned by get_specs, so this simplifies the logic to return only a set of specs * print package prefix after installing from binary cache * provide more information to user on install progress
2017-10-27Bugfix: from_list_url(). (#5780)Sergey Kosukhin2-1/+16
This fixes a bug in from_list_url where it was referring to a method which no longer exists. This also adds a test for the from_list_url function.
2017-10-26Package.extends: update semantics when package isn't concrete (#5600)Ben Boeckel1-1/+10
This updates the logic for Package.extends so that if the spec associated with the package is not concrete, it will report true if the package *could extend* the given spec; generally speaking a package could extend a spec as long as none of the details associated with its extendee spec conflict with the given spec. When the spec associated with the package is concrete, this function will only report whether the package *does extend* the given spec. When both the specs are concrete, the semantics are the same as before.
2017-10-26Buildcache: symlinks, externals, & install-checking (#5894)Patrick Gartung4-61/+62
* When creating a tar of a package for a build cache, symlinks are preserved (the corresponding path in the newly-created tarfile will be a symlink rather than a copy of the file) * Dont add external packages to a build cache * When installing from binary cache, don't create install prefix until verification is complete
2017-10-26Colorize "Installing pkg_name" (#5950)Ondřej Čertík1-1/+2
Now one can quickly visually see in the terminal which packages are installed and where each package begins and ends in the log.
2017-10-25Check for namespace-qualified packages in repo_for_pkg (#5787)scheibelp2-10/+88
* Fixes #5754 Previously when RepoPath.repo_for_pkg was invoked with a string, it did not check if the string included a namespace. Any namespace-qualified package provided as a string would not be found (at which point the behavior was to return the highest-precedence repository). * handle nested namespaces for packages specified as strings in repo_for_pkg * add preliminary repository tests * add test which replicates #5754 * refactor repo tests with fixtures * define repo_path equivalent at test-level scope for repo tests * add tests for unknown namespace/package * rename fixture function (no longer prefixed with 'test_')
2017-10-25Specify base branch for flake8 comparison (#5796)George Hartzell1-1/+6
Internally we work against a branch named 'llnl/develop', which mirrors the public repository's `develop` branch. It's useful to be able to run flake8 on our changes, using `llnl/develop` as the base branch instead of `develop`. Internally the flake8 subcommand generates the list of changes files using a hardcoded range of `develop...`. This makes the base of that range a command line option, with a default of `develop`. That lets us do this: ``` spack flake8 --base llnl/develop ``` which uses a range of `llnl/develop...`.
2017-10-24'spack install' can overwrite an existing installation (#5384)Massimiliano Culpo4-52/+274
'spack install' can now reinstall a spec even if it has dependents, via the --overwrite option. This option moves the current installation in a temporary directory. If the reinstallation is successful the temporary is removed, otherwise a rollback is performed.
2017-10-24Fix bug in spack flake8 when no files differ from develop (#5898)Todd Gamblin1-1/+4
2017-10-24do not use 'l' as a variable name, to appease new flake8 versionTodd Gamblin8-55/+53
- new E741 flake8 checks disallow 'l', 'O', and 'I' as variable names - rework parts of the code that use this, to be compliant - we could add exceptions for this, but we're trying to mostly keep up with PEP8 and we already have more than a few exceptions.
2017-10-24Fix bare 'except:' to placate errors in new flake8 version.Todd Gamblin12-21/+21
- fixes E722 errors from latest version of flake8 - requires us to not use 'bare except:' and catch BaseException instead
2017-10-24log tests use tmpdir properlyTodd Gamblin1-30/+35
2017-10-24fix bugs found with stricter flake8 rulesTodd Gamblin7-9/+17
- When you don't use wildcards, flake8 will find places where you used an undefined name. - This commit has all the bugfixes resulting from this static check.
2017-10-24remove wildcards from make spack core and packagesTodd Gamblin76-129/+195
- This removes all wildcard imports EXCEPT `from spack import *` in packages
2017-10-24flake8: no wildcards in core; only `import *` from spack in packagesTodd Gamblin2-20/+52
There are now separate flake8 configs for core vs. packages: - core has a smaller set of flake8 exceptions - packages allow `from spack import *` and module globals - Allows core to take advantage of static checking for undefined names - Allows packages to keep using Spack tricks like `from spack import *` and dependencies setting globals for dependents.
2017-10-24add --all option to `spack flake8`Todd Gamblin1-14/+41
- `-a`/`--all` causes flake8 to run on all files rather than just different ones.
2017-10-23package: remove bare except statements (#5896)scheibelp1-2/+2
2017-10-20getting_started.rst: removed tip suggesting the use of 2 Spack instances (#4061)Massimiliano Culpo1-13/+0
2017-10-20module-type argument defaults to 'tcl' instead of every known type (#5751)Massimiliano Culpo3-3/+6
fixes #5721 This is to solve the fact that lmod needs to be configured by the user (to specify a core compiler).
2017-10-20buildcache command updates (#5860)Patrick Gartung3-37/+159
* Add better spec matching to spack buildcache * skip download of spec.yaml and keys if they exist * autopep8
2017-10-20Update Getting Started docs to clarify that full Xcode suite is required for ↵Adam J. Stewart2-6/+79
qt (#4958) * Update Getting Started docs to clarify that full Xcode suite is required for qt * Better error message when only the command-line tools are installed
2017-10-19spack blame can take a path to a file in the Spack repo (#5793)Todd Gamblin2-7/+28
- Previously `spack blame` only worked for package names; now it works for paths as well, so developers can use it on core spack files.
2017-10-19Allow documentation to build in Python 3 (#5736)Adam J. Stewart1-7/+2
2017-10-17filter_file, don't remove absent backup file (#5733)George Hartzell1-1/+1
I'm tracking down a problem with the perl package that's been generating this error: ``` OSError: OSError: [Errno 2] No such file or directory: '/blah/blah/blah/lib/5.24.1/x86_64-linux/Config.pm~' ``` The real problem is upstream, but it's being masked by an exception raised in `filter_file`s finally block. In my case, `backup` is `False`. The backup is created around line 127, the `re.sub()` calls fails (working on that), the `except` block fires and moves the backup file back, then the finally block tries to remove the non-existent backup file. This change just avoids trying to remove the non-existent file.
2017-10-17Minor typos and corections (#5789)Michael F. Herbst1-2/+2
- The shell script uses arrays and hence only works on sophisticated shells and not the default `sh`. For clarity the shebang `#!/bin/bash` has been used instead.
2017-10-17Exercise more code paths in the git fetcher.Todd Gamblin1-7/+35
- This fakes out GitFetchStrategy to try code paths for different git versions. - This allows us to test code paths for old versions using a newer git version.
2017-10-17Spack tests no longer clutter var/spack/stageTodd Gamblin5-106/+153
- Tests use a session-scoped mock stage directory so as not to interfere with the real install. - Every test is forced to clean up after itself with an additional check. We now automatically assert that no new files have been added to `spack.stage_path` during each test. - This means that tests that fail installs now need to clean up their stages, but in all other cases the check is useful.
2017-10-17``Package.stage`` no longer implicitly makes stage directoryTodd Gamblin1-9/+9
- Be explicit about stage creation during the install process. - This avoids accidental creation of stages - e.g., during `spack install --fake`, stages were erroneously recreated after being destroyed
2017-10-17Spack tests no longer use the var/spack/stage directory.Todd Gamblin1-9/+17
- This prevents the main spack install from being clusttered by invocations of `spack test`. - This uses a session-scoped stage fixture to ensure tests don't interfere.
2017-10-17Spack core and tests no longer use `os.chdir()`Todd Gamblin14-450/+393
- Spack's core package interface was previously overly stateful, in that calling methods like `do_stage()` could change your working directory. - This removes Stage's `chdir` and `chdir_to_source` methods and replaces their usages with `with working_dir(stage.path)` and `with working_dir(stage.source_path)`, respectively. These ensure the original working directory is preserved. - This not only makes the API more usable, it makes the tests more deterministic, as previously a test could leave the current working directory in a bad state and cause subsequent tests to fail mysteriously.
2017-10-14Ensure that FileList makes it into the documentation (#5739)Adam J. Stewart1-0/+1
2017-10-13Clean up logic in Sepc.satisfies_dependencies()Todd Gamblin1-5/+9
- This puts in a fast path when there are no dependencies to satisfy. - Reduces time spent to concretize r-rminer by 2x, down to 5s from 10s
2017-10-13Remove single-root assertion from Spec.rootTodd Gamblin2-11/+6
- Assertion would search for root through all possible paths. - It's also really slow. - This isn't needed anymore. We're pretty good at ensuring single-rooted DAGs, and this assertion has never been thrown. - This shaves another 6 seconds off r-rminer concretization
2017-10-13Use list instead of OrderedDict to find virtual/external candidatesTodd Gamblin1-6/+3
- This reduces concretization time for r-rminer from over 1 minute to only 16 seconds. - OrderedDict ends up taking a *lot* of time to compare larger specs. - An OrderedDict isn't actually needed here. It's actually not possible to find duplicates, and we end up sorting the contents of the OrderedDict anyway.
2017-10-13avoid creating lots of dictionaries in traverse_edges()Todd Gamblin1-15/+14
- This is an optimization to the way traverse_edges iterates over successors. - Previous version called dependencies_dict(), which involved a lot of redundant work (creating dicts and calling caonical_deptype)
2017-10-13Don't redundantly check for providers of non-virtuals.Todd Gamblin1-0/+3
2017-10-13Cache compilers parsed from config filesTodd Gamblin1-29/+39
- Spack ends up constructing compilers frequently from YAML data. - This caches the result of parsing the compiler config - The logic in compilers/__init__.py could use a bigger cleanup, but this makes concretization much faster for now. - on macOS, this also ensures that xcrun is called only twice, as opposed to every time a new compiler object is constructed.
2017-10-13This fixes a bug in creating rpaths relative to $ORIGIN on linux. (#5726)Patrick Gartung3-29/+34
* This fixes a bug in creating rpaths relative to on linux. * fix for macOS as well * found in testing * flake8 * fix testing on macOS * flake8
2017-10-13Docker Workflow (#5582)Axel Huebl1-0/+143
This adds a workflow section on how to use spack on Docker. It provides an example on the best-practices I collected over the last months and circumvents the common pitfalls I tapped in. Works with MPI, CUDA, Modules, execution as root, etc. Background: Developed initially for PIConGPU.
2017-10-12various fixes for macOS high sierra (#5647)Denis Davydov1-1/+10
* various fixes for macOS high sierra * add macOS_version() helper function * flake8 fixes * update oce and trilinos * fix bison
2017-10-12Make --trusted default when running spack gpg list (#5678)David Hows2-1/+2
* Make --trusted default when running spack gpg list Currently running `spack gpg list` with no arguments returns nothing. You must supply either the `--trusted` or the `--signing` options. The idea here is to return some initial data to the user when the command is run. The alternative is to return an error, telling the user to select one of the two options. * Add an extra test case for the empty list command Fixes the issue with code coverage
2017-10-12Speed up concretization (#5716)Todd Gamblin4-17/+23
This isn't a rework of the concretizer but it speeds things up a LOT. The main culprits were: 1. Variant code, `provider_index`, and `concretize.py` were calling `spec.package` when they could use `spec.package_class` - `spec.package` looks up a package instance by `Spec`, which requires a (fast-ish but not that fast) DAG compare. - `spec.package_class` just looks up the package's class by name, and you should use this when all you need is metadata (most of the time). - not really clear that the current way packages are looked up is necessary -- we can consider refactoring that in the future. 2. `Repository.repo_for_pkg` parses a `str` argument into a `Spec` when called with one, via `@_autospec`, but this is not needed. - Add some faster code to handle strings directly and avoid parsing This speeds up concretization 3-9x in my limited tests. Still not super fast but much more bearable: Before: - `spack spec xsdk` took 33.6s - `spack spec dealii` took 1m39s After: - `spack spec xsdk` takes 6.8s - `spack spec dealii` takes 10.8s
2017-10-12Better install output (#5714)Todd Gamblin6-20/+17
* Do not call setup_package for fake installs - setup package could fail if ``setup_dependent_environment`` or other routines expected to use executables from dependencies - xpetsc and boost try to get python config variables in `setup_dependent_package`; this would cause them not to be fake-installable * Remove vestigial deptype_query argument to Spec.traverse() - The `deptype_query` argument isn't used anymore -- it's only passed around and causes confusion when calling traverse. - Get rid of it and just keep the `deptypes` argument * Don't print redundant messages when installing dependencies - `do_install()` was originally depth-first recursive, and printed "<pkg> already installed in ..." multiple times for packages as recursive calls encountered them. - For much cleaner output, use spec.traverse(order='post') to install dependencies instead
2017-10-10compilers/clang: add flang (#5503)Christoph Junghans3-10/+16
* compilers/clang: add flang * Update clang.py
2017-10-09Add package for aspell and ass't dictionaries (#3890)George Hartzell2-0/+59
* Add package for aspell and ass't dictionaries Add a package definition for aspell. Add a handful of dictionaries to convince myself that the support for a bunch of dictionaries works. * Flake8 cleanup * Use six's version of urlparse `urlparse` is not python3 friendly. This works around it (stolen from `.../cmd/md5.py`). * Fix incorrect trimming regexp * Clean up dictionary build - more parsimonious use of `which` (`make()` has already been made) - use `sh` instead of `bash` * Use a helper method to generate info for variants I figured out my issues with static methods. I *think* that it this is pythonic. * Convert aspell to an extendable package Convert aspell to be extendable and rework the dictionaries to be extensions. As it stands, there's a great deal of cut and paste in the dictionaries, I'll abstract that out next. The {de,}activate methods copy a great deal of code out of package.py. Perhaps there's a better way.... * Create AspellDictPackage and use it for the dictionaries Reduce the repeated code, pull it into a base class. I'm confused about why 'from spack import *' wasn't more useful in the base class. * Oops, -de & -es should be AspellDictPackages too * Typo: pakcage -> package * Address some commentary * Update copyright dates, 2016->2017
2017-10-09Fix setup for changes to dirty flag (#5592)becker332-3/+7
* Pass dirty arg through setup to setup_package
2017-10-06Don't check package.installed in _mark_concrete if value=True (#5634)scheibelp2-1/+18
* spec and spec.package.spec can refer to different objects in the database. When these two instances of spec differ in terms of the value of the 'concrete' property, Spec._mark_concrete can fail when checking Spec.package.installed (which requires package.spec to be concrete). This skips the check for spec.package.installed when _mark_concrete is called with 'True' (in other words, when the database is marking all specs as being concrete). * add test to confirm this fixes #5293
2017-10-05Fix formatting typo (#5622)Jimmy Tang1-1/+1
2017-10-05Don't change properties on already-installed packages (#5580)scheibelp2-0/+45
* edits to address issues where spack concretization attempts to set properties on already-installed specs * most added checks only need to check if the spec is concrete; they dont also need to check if the package is installed * add test to ensure that patches are not applied to an installed spec * add test to ensure that an error is detected when a dependent requests a dependency constraint which conflicts with a requested installed dependency
2017-10-04Identify the flag handlers feature as beta (#5609)becker331-0/+5
The flag-handling logic added in #4421 may change semantics, so this commit adds a warning to the documentation for this feature.