Commit graph

901 commits

Author SHA1 Message Date
Todd Gamblin
0d4b77a24b revert accidental print statements. 2015-12-22 17:02:14 -08:00
Todd Gamblin
2b89d9b1db More consistent URL parsing when finding versions.
Versions found by wildcard URLs are different from versions found by
parse_version, etc.  The wildcards are constructed more haphazardly
than the very specific URL patterns in url.py, so they can get things
wrong.  e.g., for this URL:

    https://software.lanl.gov/MeshTools/trac/attachment/wiki/WikiStart/mstk-2.25rc1.tgz

We miss the 'rc' and only return 2.25r as the version if we ONLY use
URL wildcards.

Future: Maybe use the regexes from url.py to scrape web pages, and
then compare them for similarity with the original URL, instead of
trying to make a structured wildcard URL pattern?  This might yield
better results.
2015-12-22 16:59:00 -08:00
Todd Gamblin
b1d40efd99 Merge pull request #261 from LLNL/features/prefer-versions-in-packages
Add ability to prefer particular versions in packages.
2015-12-22 08:25:52 -08:00
Todd Gamblin
157e42de22 Merge pull request #264 from nolta/typos
fix a few comment typos
2015-12-22 07:56:54 -08:00
Todd Gamblin
792b033255 Slightly more robust tmp directory search.
- remove getcwd() check (seems arbitrary -- if users set their TMPDIR
  to this why stop them?)

- try a number of common locations and try per-user directories in
  them first.
2015-12-22 07:54:25 -08:00
Mike Nolta
61f07b0c4d fix a few comment typos 2015-12-21 19:24:16 -05:00
Mike Nolta
2ba6bb21fb fix #249 (tmp spack-stage directories conflict) 2015-12-21 18:50:58 -05:00
Todd Gamblin
fe0fdf60b4 Add ability to prefer particular versions in packages.
- Adding `preferred=True` to a version directive will change its sort
  order in concretization.

- This provides us a rudimentary ability to keep the Spack stack
  stable as new versions are added.

- Having multiple stacks will come next, but this at least allows us
  to specify default versions of things instead of always taking the
  newest.
2015-12-21 15:35:47 -08:00
Todd Gamblin
73ea15db8e Merge pull request #208 from epfl-scitas/features/resource_directive
resource directive : implementation + clang / llvm use case
2015-12-21 10:34:16 -08:00
Todd Gamblin
dccfcd10f7 Merge pull request #255 from LLNL/bugfix/254-libtool-compiler-name-issues
Fix #254: libtool & distutils want certain compiler names.
2015-12-20 16:56:59 -08:00
Todd Gamblin
1b086c928c Merge pull request #227 from trws/fetch-deps
fetch: add options to fetch missing or all deps
2015-12-19 21:02:42 -08:00
Todd Gamblin
9edba18489 Merge pull request #230 from nolta/fix-env-mod-sys-type
fix environment module path when $SYS_TYPE isn't defined
2015-12-19 20:59:13 -08:00
Todd Gamblin
32f96b5c73 Fix stale code in python version test so that it actually works. 2015-12-19 20:04:00 -08:00
Mike Nolta
429e15c4a6 spack python: add -c option
Allows passing program in as a string. Example:

    $ spack python -c 'print 2+3'
    5

Also imports spack module by default into the environment.
2015-12-19 16:32:17 -05:00
Gregory Lee
df5dc1c9bb Merge pull request #253 from LLNL/bugfix/244-uninstall-errors
Bugfix/244 uninstall errors
2015-12-19 08:06:36 -08:00
Todd Gamblin
7cc4d88726 Fix #254: libtool & distutils want certain compiler names.
This changes the compiler wrappers so that they are called by the same
name as the wrapped compiler.  Many builds make assumptions about
compiler names, and we need the spack compilers to be recognizable so
that build systems will get their flags right.

This adds per-compiler subdirectories to lib/spack/spack/env directory
that contain symlinks to cc for the C, C++, F77, and F90
compilers. The build now sets CC, CXX, F77, and F90 to point to these
links instead of to the generically named cc, c++, f77, and f90
wrappers.
2015-12-19 02:06:47 -08:00
Todd Gamblin
52e3364efa Fix #244: errors on uninstall
- Extension logic didn't take conditional deps into account.

- Extension methods now check for whether the extnesion is
  in the extendee map AND whether the dependency is actually present
  in the spec yet.
2015-12-18 22:24:35 -08:00
Todd Gamblin
b7e926eef6 minor formatting. 2015-12-18 22:24:22 -08:00
Todd Gamblin
ce8bd20944 Fix import error. 2015-12-18 22:23:51 -08:00
Todd Gamblin
abd3d3946d Format to 80 char width. 2015-12-18 19:23:45 -08:00
Gregory Lee
9cab88071b Merge pull request #239 from LLNL/bugfix/238-db-specs-not-concrete
Fix #238: Database specs need to be concrete when read in as well.
2015-12-16 11:37:51 -08:00
Mike Nolta
82aa366adf minor comment tweak in modules.py 2015-12-16 11:43:07 -05:00
Todd Gamblin
2f9ee88408 Fix #238: Database specs need to be concrete when read in as well. 2015-12-15 17:15:37 -08:00
Todd Gamblin
6e074a196a Fix #206: need to make deps AND root concrete when read in. 2015-12-14 21:06:32 -08:00
Todd Gamblin
afbd0e77d0 Make internal hash dep sort order match external one. 2015-12-11 16:47:34 -08:00
Todd Gamblin
3dd6cbc556 Fix #217: update spec_dag test for new _cmp_key. 2015-12-11 13:07:20 -08:00
Todd Gamblin
6ee2eb21dd Fix #217: Use MUCH faster hashing, reduce number of DAG copies.
This changes the hash algorithm so that it does much less object
allocation and copying, and so that it is correct.

The old version of `_cmp_key()` would call `sorted_deps`, which would
call `flat_dependencies` to get a list of dependencies so that it
could sort them in alphabetical order.  This isn't necessary in the
`_cmp_key()`, and in fact we want more DAG structure than that to be
included in the `_cmp_key()`.

The new version constructs a tuple without copying the Spec DAG, and
the tuple contains hashes of sub-DAGs that are computed recursively
in-place.  This is way faster than the previous algorithm and reduces
the numebr of copies significantly. It is also a correct DAG hash.

Example timing and copy counts for the different hashing algorithms
we've tried:

Original (wrong) Spec hash:
```
106,170 copies
real    0m5.024s
user    0m4.949s
sys     0m0.104s
```

Spec hash using YAML `dag_hash()`:
```
3,794 copies
real    0m5.024s
user    0m4.949s
sys     0m0.104s

New no-copy, no-YAML hash:
```
3,594 copies
real    0m2.543s
user    0m2.435s
sys     0m0.104s
```

So now we have a hash that is correct AND faster.

The remaining ~3k copies happen mostly during concretization, and as
all packages are initially loaded.  I believe this is because Spack
currently has to load all packages to figure out virtual dependency
information; it could also be becasue there ar a lot of lookups of
partial specs in concretize.  I can investigate this further.
2015-12-11 12:40:27 -08:00
Todd Gamblin
7526a89463 Fix #217: Make package cache use DAG hash instead of sorted deps.
- Gets rid of last vestige of old-style specs.
- Uses new hashing for lookup
2015-12-11 02:17:17 -08:00
Tom Scogland
281a869ef6 fix path resolution for mirror packages, especially with dependency fetching 2015-12-10 09:24:01 -08:00
Tom Scogland
786f4cd2c2 add dependency fetching to mirror creation 2015-12-10 08:32:51 -08:00
Tom Scogland
25f2b01a3c fetch: add options to fetch missing or all deps
Small additions to fetch to make it easier to fetch all files necessary for a
build on a system without network connectivity.
2015-12-10 07:27:06 -08:00
alalazo
20e67bc5e6 clang : solve the issue with missing default include paths for OpenMP and libc++
resource : support for finer grained linking of resources
2015-12-09 17:15:26 +01:00
Todd Gamblin
537451f0b1 bugfix: doc build needed additional sys.path due to externals change. 2015-12-09 01:32:12 -08:00
Todd Gamblin
c41b9b7ddc Change github.com/scalability-llnl to github.com/llnl everywhere. 2015-12-09 01:24:15 -08:00
Peter Scheibel
530e049d4a Added nose 1.3.7 source along with with the lgpl license (renamed from lgpl.txt
to LICENSE)
2015-12-04 17:55:20 -08:00
Massimiliano Culpo
50bd4d2e4e mirror : deals correctly with variants that optionally enable resources (if they are archive URLs) 2015-12-03 11:21:11 +01:00
Massimiliano Culpo
39a3cfd4d9 reource directive accepts 'basename' keyword
llvm : libc++ variant
2015-12-02 12:24:37 +01:00
Massimiliano Culpo
4b2168ab8e resources : added missing check after fetch 2015-12-02 10:13:39 +01:00
Massimiliano Culpo
b85dccca92 resources : added error handling for destination keyword on resource directive 2015-12-01 15:12:26 +01:00
Massimiliano Culpo
d3d9b5401b resources : changed name of stage folder 2015-12-01 13:26:44 +01:00
Massimiliano Culpo
a075d581ef resource : fetch strategy constructed from kwargs instead or hardcoded URLFetchStrategy 2015-12-01 12:56:46 +01:00
Todd Gamblin
dfcf567de0 Add a cleaned up repo command. 2015-11-28 19:00:24 -08:00
Todd Gamblin
73ef06018e Integrate namespace attribute into spec, spec DAG, spec YAML. 2015-11-28 16:26:23 -08:00
Todd Gamblin
7383bd393e Fixed bug #42: problem with satisfies() for virtual dependencies.
- _cross_provider_maps() had suffered some bit rot (map returned was
  ill-formed but still worked for cases with one vdep)

- ProviderIndex.satisfies() was only checking whether the result map
  was non-empty.  It should check whether all common vdeps are *in*
  the result map, as that indicates there is *some* way to satisfy
  *all* of them.  We were checking whether there was some way to
  satisfy *any one* of them, which is wrong.

- Above would cause a problem when there is more than one vdep provider.

- Added test that covers this case.

- Added `constrained()` method to Spec. Analogous to `normalized()`:
  `constrain():constrained() :: normalize():normalized()`
2015-11-27 23:06:18 -08:00
Todd Gamblin
763d850a0e Add tests for importing packages directly.
Added test for, e.g.:

    import spack.pkg.builtin.mock.mpich
    import spack.pkg.builtin.mock.mpich as mpich
    from spack.pkg.builtin.mock.mpich import Mpich

Among others.  These ensure that direct package imports work so that
packages can be extended.
2015-11-26 14:23:12 -08:00
Todd Gamblin
89d5127900 New, cleaner package repository structure.
Package repositories now look like this:

    top-level-dir/
        repo.yaml
        packages/
            libelf/
                package.py
            mpich/
                package.py
            ...

This leaves room at the top level for additional metadata, source,
per-repo configs, indexes, etc., and it makes it easy to see that
something is a spack repo (just look for repo.yaml and packages).
2015-11-26 14:19:27 -08:00
Massimiliano Culpo
1fe626ec7c resource directive : sketch of implementation + clang / llvm use case 2015-11-26 17:53:33 +01:00
Peter Scheibel
fc96f62794 Updated documentation/naming in tally_plugin to reflect that the count of the
total number of tests run excludes skipped tests
2015-11-25 18:08:17 -08:00
Peter Scheibel
d50a18d9eb XML output for unit tests is now enabled with an option (disabled by default) 2015-11-25 17:10:45 -08:00
Peter Scheibel
60f7756626 Executable.__call__ original semantics were to avoid redirecting process output
to the output stream if return_output was set. This branch undid that and this
commit restores those semantics.
2015-11-25 12:28:43 -08:00
Todd Gamblin
04f032d6e3 Rename spack.db -> spack.repo
Making distinction between install database and package repositories clearer.
2015-11-25 10:01:44 -08:00
Todd Gamblin
e6d232bfef Rename packages.py to repository.py, PackageFinder to RepoPath. 2015-11-25 09:58:10 -08:00
Peter Scheibel
18dea24df8 Use the xunit nose plugin to generate JUnit XML test results from Spack's unit
tests.
2015-11-24 19:08:37 -08:00
Peter Scheibel
0adf93853d Update log_output to handle cases where sys.stdout/stderr streams do not have
an associated file descriptor (e.g. holds for nose tests where sys.stdout is
assigned to a StringIO object)
2015-11-24 17:58:17 -08:00
Peter Scheibel
5081ba6802 It appears the same test object was returned multiple times for different
unit tests, so tracking tests with sets wouldn't work unless I extracted the
details relevant to the particular test. For now a simple count will work so
using a set was unnecessary anyways.
2015-11-24 10:45:07 -08:00
Peter Scheibel
70049185a5 Activation of Tally plugin to count tests. It doesn't appear to be actually
counting the individual unit tests correctly so I need to chase that down.
2015-11-24 10:39:42 -08:00
Peter Scheibel
099fa1df34 Use nose to run unit tests.
1. Adding a plugin to keep track of the total number of tests run as well as the
number of tests with failures/errors.
2. Some nose plugins (including xunit which will be added in a future commit)
assign stdout to a stream object that does not have a .fileno attribute.
spack.util.executable.Executable now avoids passing stdout to subprocess (and
always uses subprocess.PIPE)

TODO:
1. Still need to figure out how to activate the plugin (as of now it is
being ignored by nose). Newer versions of nose appear to make this simpler
(e.g. the "addplugins" argument to nose.run)
2. Need to include new version of nose in order to use xunit
2015-11-23 18:59:48 -08:00
Todd Gamblin
cf3d236b9f Merge branch 'scheibelp-features/externaldeps' into develop 2015-11-23 17:50:49 -08:00
Todd Gamblin
1447fd0a12 Merge pull request #160 from SteVwonder/stevwonder/develop
Fixed -l flag for 'spack extensions'
2015-11-23 15:50:18 -08:00
Todd Gamblin
8c06b92225 Working PackageFinder / Repo 2015-11-22 20:28:59 -08:00
Tom Scogland
5e93dd6592 modified warning to reference spack clean
clean --dist has been removed, command fixed to something that works.
2015-11-20 11:49:46 -08:00
Todd Gamblin
38fdd063d9 Fix and move NamespaceTrie to spack.util.naming
- fix up routines in namespace trie.
- trie can now hold intermediate elements.
- trie now has a test case.
2015-11-12 15:17:39 -08:00
Todd Gamblin
72c9604bcb Small fix to prevent this test from interfering with others. 2015-11-12 15:17:09 -08:00
Todd Gamblin
55662eca69 Merge branch 'develop' into mplegendre-multi_pkgsrc_roots
Conflicts:
	lib/spack/spack/__init__.py
	lib/spack/spack/directives.py
	lib/spack/spack/packages.py
2015-11-12 15:16:06 -08:00
Stephen Herbein
9c30e0210b Fixed -l flag for 'spack extensions' 2015-11-12 08:15:38 -08:00
Peter Scheibel
6d7b26d4e0 Insert lib/spack/external into sys.path. This avoids cases where the system
python install and lib/spack/external have the same library installed. This
requires modifying the names of some modules in lib/spack/external in cases
where both the system python and backported features of future python versions
(i.e. after 2.6) are used (previously distinguished by "from external import X"
and "import X").
2015-11-11 18:04:22 -08:00
Todd Gamblin
0d993947ee Fix SPACK-93, SPACK-94, GitHub #150
- `remove_prefix` was modified to remove from the DB, but the package
  may not have been added to the DB yet when `remove_prefix` is called
  from `cleanup`.

- Made `remove_prefix` a pure utility function (it just removes the prefix)

- Added `installed_db.remove()` call only after the `remove_prefix` in
  `uninstall`.
2015-11-04 16:44:33 -08:00
Todd Gamblin
339da1da3d Make architecture reflect OS *and* machine. Use Python's platform module. 2015-11-04 07:46:17 -08:00
Massimiliano Culpo
6db2a58008 Fixed typo : write_lock() -> write_transaction() 2015-10-30 07:42:58 +01:00
Todd Gamblin
a1c42c2753 Merge Greg Becker's build database support into develop. 2015-10-29 02:22:20 -07:00
Todd Gamblin
671faa4b99 Merge pull request #124 from scheibelp/features/testinstall-cmd
Features/testinstall cmd
2015-10-29 00:16:52 -07:00
Todd Gamblin
ed0c80e1cb Merge pull request #145 from markcmiller86/v-char-bugfix
generalize one of the cases to handle many more kinds of formatting o…
2015-10-29 00:02:01 -07:00
Todd Gamblin
fec6674597 Merge pull request #139 from mathstuf/use-uname-for-arch
architecture: use uname if available
2015-10-29 00:01:30 -07:00
miller86
21e9d5c5c3 generalize one of the cases to handle many more kinds of formatting options 2015-10-27 17:05:27 -07:00
Todd Gamblin
a58ae0c5d0 Build database working with simple transaction support; all tests passing. 2015-10-27 16:36:44 -07:00
Todd Gamblin
bf8479bec6 Fix stupid lock bug.
- Code simplification ignored case where exception was raised.
- If LockError was raised, read and write counts were incremented erroneously.
- updated lock test.
2015-10-27 16:34:26 -07:00
Peter Scheibel
50d0a2643b Not all package stages have an archive file (e.g. source code repos) but all of
them do have a source_path: use this instead to check whether the package
resources were successfully retrieved.
2015-10-27 13:34:46 -07:00
Todd Gamblin
af7b96c14a Lock acquires return True/False depending on whether they got POSIX lock. 2015-10-27 00:35:06 -07:00
Ben Boeckel
6c9b10f73d architecture: remove custom mac_type method 2015-10-26 18:55:10 -04:00
Ben Boeckel
17a58ee0a9 architecture: use uname if available 2015-10-26 18:54:04 -04:00
Peter Scheibel
3b554c709b Fetch errors were also terminating runs of test-install with system exit, so
stage.fetch() was updated to raise a FetchError instead of calling tty.die().
Output is the same for spack install in case of a fetch error.
2015-10-26 15:26:08 -07:00
Ben Boeckel
9d90cb6962 python: use the setdefault method on dict
It allows more concise code and skips some key lookups.
2015-10-26 17:38:19 -04:00
Peter Scheibel
9576860f8c Making SpackError reference consistent. 2015-10-26 14:27:44 -07:00
Peter Scheibel
6a16040462 Automatically create a 'test-output' directory in the current directory if no
output path is specified. Test output files are placed in this directory.
Furthermore the filenames now have the prefix "test" (but otherwise are the
string representation of the spec ID as before).
2015-10-26 11:58:52 -07:00
Todd Gamblin
ead8ac58c6 Working Lock class, now uses POSIX fcntl locks, extensive unit test.
- llnl.util.lock now uses fcntl.lockf instead of flock
  - purported to have more NFS compatibility.

- Added an extensive test case for locks.
  - tests acquiring, releasing, upgrading, timeouts, shared, & exclusive cases.
2015-10-24 19:57:43 -07:00
Todd Gamblin
908a93a470 Add a multiprocess Barrier class to use for testing parallel code. 2015-10-24 19:54:52 -07:00
Peter Scheibel
cc0ee3dc29 The HTML number conversion regex operating against a byte string will only
convert individual bytes, so therefore incorrectly converts utf-8 encoded
characters. Decoding byte strings to unicode objects results in correct HTML
number encodings.
2015-10-23 20:56:06 -07:00
Peter Scheibel
d76c923623 1. Rename CommandError -> InstallError
2. InstallError now subclasses SpackError vs. StandardError (so it is now
handled by the spack shell script)
2015-10-23 16:18:06 -07:00
Peter Scheibel
ea872f8098 1. Added CommandError exception to build_environment
2. The parent of a failed child process in build_environment.fork no longer
calls sys.exit - instead it raises a CommandError (from [1])
3. test-install command now attempts to install all packages even if one fails
2015-10-22 17:44:16 -07:00
Peter Scheibel
246423b4b4 Generate test results (designated as skipped) for parents of failed dependencies 2015-10-22 16:00:03 -07:00
Todd Gamblin
b6833f08df Merge pull request #129 from mathstuf/separate-prefix
spack: split spack_root from prefix
2015-10-21 16:04:36 -04:00
Todd Gamblin
3c788147ca Add Spack logo. 2015-10-18 19:14:40 -07:00
Todd Gamblin
7598612b86 Better info variant output. 2015-10-17 17:34:39 -07:00
Peter Scheibel
39f0f000f8 Created unit test for core logic in test-install command. 2015-10-15 22:02:14 -07:00
Peter Scheibel
6cd976d036 Better description for test-install command 2015-10-15 20:13:08 -07:00
Peter Scheibel
49b91235bb Minor edit for clarity (generate output for single top level spec vs. iterating
through collection of size 1)
2015-10-15 19:59:57 -07:00
Peter Scheibel
82ed1bc343 Originally I enforced specifying 1 top-level package with the test-install
command by having it consume exactly 1 positional argument (i.e. by removing
"nargs=argparse.REMAINDER") but this does not work when configuring dependencies
of a top-level package (which show up as additional positional args). Instead
now there is an explicit check to ensure there is only 1 top-level package.
2015-10-15 19:38:47 -07:00
Peter Scheibel
e451421db3 1. Specifying the output file path for test-install is now an option (vs. an
argument). The default path is [package id].xml in the CWD where test-install
is called from.

2. Fixed a bug with package.build_log_path (which was added in this branch).

3. keep_stage for package.do_install is now set. This allows uninstalling and
reinstalling packages without (re) downloading them.
2015-10-15 19:22:36 -07:00
Peter Scheibel
4997f0fe57 Move logic for tracking the build log into package.py (since that is what is
managing the build log) and expose as package.build_log_path.
2015-10-15 12:44:02 -07:00
Peter Scheibel
c985ad7644 Update test failure output: don't include the entire build log, just lines which
mention errors (or if no such lines can be found, output the last 10 lines from
the log).
2015-10-15 12:23:56 -07:00
Peter Scheibel
b9bf0b942c Use spec.traverse vs. recursive function.
Also even though I calculated which installs are new (e.g. vs. packages that
have already been installed by a previous command) I forgot to make use of that
in create_test_output (so I was always generating test output even if a package
had been installed before running the test-install command).

Note to avoid confusion: the 'handled' variable (removed in this commit) did not
serve the same purpose as 'newInstalls': it was originally required because the
recursive approach would visit the same dependency twice if more than one
package depended on it.
2015-10-15 11:52:08 -07:00
Peter Scheibel
f2b4341ad6 Always run with verbose output (so eliminate it as an option). Also remove other
commented options.
2015-10-15 10:45:03 -07:00
Peter Scheibel
11861fb8d7 Changing name of file requires changing function name to be invoked as a command 2015-10-15 10:35:42 -07:00
Peter Scheibel
e3d703b80f Change name of file to conform to conventions. 2015-10-15 10:33:39 -07:00
Peter Scheibel
2ae7839b66 Edit function names to conform to naming conventions. 2015-10-15 10:26:13 -07:00
Peter Scheibel
0d66362cee Only install 1 top-level package with testinstall. Otherwise if multiple
packages are specified and a prior one fails, it will prevent any of the others
from succeeding (and generating test output) even if they don't share
dependencies.
2015-10-15 10:17:08 -07:00
Ben Boeckel
3ce85b2270 spack: split spack_root from prefix
A foundation for allowing runtime configuring of the prefix.
2015-10-15 09:27:05 -04:00
Peter Scheibel
71dcf8833c Make sure to generate output for dependencies as if they were separate tests:
the original intent was to generate output as if each package was a unit test,
but I noticed that I was only generating test output for top-level packages.
2015-10-13 19:02:41 -07:00
Peter Scheibel
1ce6d8b627 Add spec YAML format to test output. 2015-10-13 10:41:47 -07:00
Todd Gamblin
d16095c856 Add forgotten file from previous commit. 2015-10-13 10:35:19 -07:00
Peter Scheibel
9f56d9c807 Don't create test output for any package that was already installed. 2015-10-12 20:56:03 -07:00
Peter Scheibel
6cd22e5786 1. Added Junit XML format
2. Specify output to a file vs. a directory
3. Use [1] and [2] to write an XML file tracking success of package installs in
Junit XML format
2015-10-12 20:49:23 -07:00
Peter Scheibel
b7249d66b3 Adding command testinstall. See "spack testinstall -h" for documentation.
Still need to add output formatting (in a commonly parse-able format like Junit
or TAP). May want to adjust how the build log is accessed in case of a build
failure.
2015-10-12 19:18:31 -07:00
Todd Gamblin
2c81875019 Fix bug in colify color handling. 2015-10-12 14:44:41 -07:00
Matthew LeGendre
fac4428766 Documentation for external packages. 2015-10-05 14:04:33 -07:00
Matthew LeGendre
18f0b24a7f Add tests for spack external dependencies, plus fixes for issues found by those tests. 2015-10-05 11:37:36 -07:00
Matthew LeGendre
e4d2ba30b5 Fix failure in spack.test.config.ConfigTest from incorrect compiler config merging 2015-10-05 11:37:36 -07:00
Matthew LeGendre
650c9d4e36 Allow spack to build against external non-spack-installed packages. 2015-10-05 11:37:36 -07:00
Matthew LeGendre
53d70fff01 Fix type error with YAML config when merging lists from different configs. 2015-10-05 11:36:06 -07:00
Matthew LeGendre
53cde110b1 Update Spack mirror command to match docs 2015-10-05 11:36:06 -07:00
Matthew LeGendre
987cd9e78f Update docs for YAML configuration files and preferred concretization 2015-10-05 11:36:06 -07:00
Matthew LeGendre
ee68a76a19 Bug fixes from testing spack preferred packages 2015-10-05 11:36:06 -07:00
Matthew LeGendre
8d7b7e5d5d Use preferred package rules when concretize'ing specs 2015-10-05 11:36:06 -07:00
Matthew LeGendre
b5c597b318 Allow specs to be sorted based on preferred packages, versions, compilers, variants and dependencies. 2015-10-05 11:36:05 -07:00
Matthew LeGendre
59f89dd3be Allow long names in format string variables 2015-10-05 11:36:05 -07:00
Gregory Becker
5fda7daf57 an ordered database test 2015-09-27 17:54:24 -07:00
Todd Gamblin
8818f4ac5e Remove enabled variants from install prefix.
- these make the prefix too long in many cases.
- users can figure out which install is which by querying.
2015-09-27 17:01:35 -07:00
Todd Gamblin
adbd393c39 Remove special characters (@, %, +, ~, etc) from stage name 2015-09-27 17:01:35 -07:00
Todd Gamblin
d0e22b2240 Add ref counting to database. This does not handle removal properly yet. 2015-09-18 11:40:05 -07:00
Todd Gamblin
fb73979345 Allow custom timeout for database locking. 2015-09-17 16:09:59 -07:00
Todd Gamblin
e17ad6a684 Simplify lock context managers. 2015-09-17 01:05:19 -07:00
Todd Gamblin
6dff42be09 WIP for Matt's branch 2015-09-17 00:21:33 -07:00
Todd Gamblin
ccf311c9c6 Several changes to DB implementation.
1. Database stores a file version, so we can add to it in the future.
2. Database indexed by hashes and not numerical indexes.
3. Specs built by database have consistent hashes and it's checked.
4. minor naming and whitespace changes.
2015-09-17 00:16:12 -07:00
Gregory Becker
cd23d2eaa2 Added spack fsck and re-read from glob if the database file does not exist. Allows older versions to smoothly upgrade to the database. 2015-09-15 14:20:19 -07:00
Gregory Becker
9c8e46dc22 Added conservative locking to the spack commands that access the database at _index 2015-09-03 09:21:19 -07:00
Gregory Becker
c3246ee8ba Removed incorrect stage removal code from cleanup() in do_install() 2015-08-31 09:46:55 -07:00
Gregory Becker
f406fcb843 Fixed several issues from code review
Most importantly wrote the Lock, Read_Lock_Instance, and Write_Lock_Instance classes in lock.py
Updated the locking in database.py
TODO: Lock on larger areas
2015-08-31 09:38:38 -07:00
Todd Gamblin
c5c9ada7b0 Fix for GitHub #95
develop: compiler clang@unknown created for /usr/bin/clang-format
https://github.com/scalability-llnl/spack/issues/95
2015-08-27 02:04:58 -07:00
Gregory Becker
9345e78779 Fixed inaccurate comment in spec.py 2015-08-25 16:31:09 -07:00
Gregory Becker
ce8df65d7b Eliminated unnecessary differences in pull request 2015-08-25 16:28:55 -07:00
Gregory Becker
e32c59f805 Fixed file locking. Fix is slightly ugly (lock integer added) but it gets the job done
It avoids having to spin simply on the OSError.
2015-08-25 15:32:45 -07:00
Gregory Becker
4a2bd1753a Added dependency indices to database, ensuring correctly reconstructed specs from database
Began work on file locking, currently commented out.
2015-08-25 15:11:18 -07:00
Todd Gamblin
360b307f68 Save progress. import gov.llnl.spack.mpich works. 2015-08-24 09:14:16 -07:00
Gregory Becker
fb1874165b Eliminated all calls that relied on finding all packages in the opt directory
Replaced them all with references to the database

Implemented caching in the database. The database now only re-reads data
if the database file exists and was changed since this file last wrote to it.

Added the installed_db field to the spack instance

Left the call to all_specs from testdirectory_layout.py for now.
2015-08-21 17:00:39 -07:00
Gregory Becker
55f68bb2b0 Added hashes to the database 2015-08-21 13:04:27 -07:00
Gregory Becker
1da56e5290 Added a database of installed packages.
No methods use the database so far.

Also, a bug fix:
      Previous version did not remove the staging directory on a failed install
      This led to spack refusing to uninstall dependencies of the failed install
      Added to cleanup() to blow away the staging directory on failed install.
2015-08-21 11:32:12 -07:00
Todd Gamblin
a2f2e6a4ff Save changes to external repo integration 2015-08-16 12:54:02 -07:00
Todd Gamblin
92f398a897 Better @memoized decorator. 2015-08-16 12:50:39 -07:00
Todd Gamblin
da98b07624 Add more options to spack edit 2015-08-16 12:50:39 -07:00
Matthew LeGendre
e58ee88a63 Add 'spack packagerepo create' command 2015-08-16 12:50:39 -07:00
Matthew LeGendre
7ea328659f Record package repo origins in .spec files 2015-08-16 12:50:39 -07:00
Matthew LeGendre
c7b8d09c7f Add packagerepos to spack, allowing for creating multiple package repositories. 2015-08-16 12:48:32 -07:00
Todd Gamblin
6f75f5bd6a Merge pull request #88 from trws/git_depth_attempt
adding a fallback on failure with git --depth
2015-08-12 23:59:13 -07:00
Todd Gamblin
1792115b4d Use absolute paths to spack compiler wrappers in CC/CXX/F77/FC 2015-08-04 09:57:06 -07:00
Tom Scogland
9174c06598 adding a fallback on failure with git --depth
Certain remote protocols don't support the `--depth` option.  Since this can't
be checked by URL type or in any sane way locally, this version attempts to
clone git repositories with the --depth option, and if that fails attempts the
clone again without it.
2015-07-27 14:03:04 -07:00
Todd Gamblin
27ca697b43 Add Python version test to detect {} in version strings.
- {} is not compatible with Python 2.6
2015-07-24 14:22:28 -07:00
Todd Gamblin
1e2f421faa Fix Python 2.6 compatibility issue. 2015-07-23 17:01:55 -07:00
Todd Gamblin
19123b4c48 Fix ProviderIndex.update(), which didn't remove stale providers. 2015-07-16 01:41:11 -07:00
Todd Gamblin
e097696390 Update concretize to check for more changes and iterate further. 2015-07-16 01:12:11 -07:00
Todd Gamblin
9087f26537 Fix mangled error message. 2015-07-14 23:59:03 -07:00
Todd Gamblin
0d308ca30f Fix regression of install -j. 2015-07-14 23:45:58 -07:00
Todd Gamblin
9d1f8f6bfd Add test to check packages for Python2.6 compatibility, as well as core. 2015-07-13 18:37:48 +00:00
Florent Pruvost
5acd7cad9a add env. var. in modules: LIBRARY_PATH and PKG_CONFIG_PATH 2015-07-02 02:12:10 -07:00
Todd Gamblin
6892d7189f Merge branch 'features/toggle-build-output' into develop 2015-07-02 00:51:03 -07:00
Todd Gamblin
b3e34be972 Better python template for 'spack create' 2015-07-02 00:39:33 -07:00
Todd Gamblin
edfcac32c3 Fix bug in uninstall (regression in 0fc3b58) 2015-06-20 21:46:52 -07:00
Todd Gamblin
6ed5dd7427 log_output now allows echo to be toggled wtih 'v' key 2015-06-20 20:20:28 -07:00
Todd Gamblin
cfb883646f Fix for git pull --tags when using git 1.7.1
- Added `ignore_errors` option to `Executable.__call__`
- Can avoid raising errors on *specific* error return values.
2015-06-13 17:52:00 -07:00
Tom Scogland
0b5ca25358 Fix for repos with many tags
Ensures all tags are ready before checkout, using `--branch` if possible and
an extra pull if that is not available.  Also adds `--depth 1` to create
shallow clones if the git version is sufficient.

Fixes #64.
2015-06-13 15:29:55 -07:00
Tom Scogland
277df08676 removing vestigial lines from a previous commit 2015-06-13 14:10:45 -07:00
Tom Scogland
d92ac2a6b2 Small ruby enhancement and tmuxinator package
It is currently less painful to pull the source from github, compile it into a
gem, then install the gem, than it is to download a gem and install it.  This
still lacks an activation mechanism, but `spack use tmuxinator` is functional.
2015-06-11 13:51:53 -07:00
Todd Gamblin
0a92349f90 Try a little harder in concretize_version() -- concretize unsafe versions too.
- This can result in the user being prompted to download an unsafe
  version.

- Avoids overly strict errors when something *could* be satisfiable
  but we don't know about hte version.
2015-06-07 15:40:01 -07:00
Todd Gamblin
3f3ceb24c4 Add some comments b/c I didn't understand my own test. 2015-06-07 15:39:40 -07:00
Todd Gamblin
0fc3b58890 SPACK-38: Allow specs to be indexed by virtual dependencies.
- The following now work differently:

      spec['mpi']
      spec['blas']

  This can return a spec for openmpi, mpich, mvapich, etc., EVEN if
  the spec is already concretized.  This means that in a package that
  `depends_on('mpi')`, you can do `spec['mpi']` to see what it was
  concretized to.  This should simplify MPI and BLAS packages.

      'mpi' in spec
      'blas' in spec

  Previously, if the spec had been concretized, these would be `False`
  because there was not a dependency in the DAG with either of these
  names. These will now be `True` even if the spec has been
  concretized.  So, e.g., this will print "YES"

      s = Spec('callpath ^mpich')
      if 'mpi' in spec:
          print "YES"

- Similarly, this will be True:

      Spec('mpich').satisfies('mpi')

- Because of the way virtual dependencies are currently implemented,
  the above required some fiddling around with `package.py` so that it
  would never call `Spec.__contains__` (and result in endless
  recursion).

- This should be fixed by allowing virutal dependnecies to have their
  own package class.
  - This would allow a quicker check for vdeps, without a call to
    `all_packages`.
  - For the time being, `package.py` shouldn't call `__contains__`
2015-06-07 15:36:53 -07:00
Todd Gamblin
eb9859ce75 Executables now have a useful __str__ function. 2015-06-06 16:15:52 -07:00
Todd Gamblin
53feb12ea0 Cleanup and consolidate error handling 2015-06-06 15:50:01 -07:00
Todd Gamblin
5d7a6c0c46 Add FileFilter convenience class to llnl.util.filesystem. 2015-06-06 15:26:48 -07:00
Saravan Pantham
454d06c25c Removed autosave files from previous commit. 2015-06-06 15:26:37 -07:00
Saravan Pantham
c174fe6199 Fixed BLAS and Lapack installations 2015-06-06 15:26:31 -07:00
Todd Gamblin
d19538af07 Fix #48: Ignore hidden files when deciding how to stage.
- Expanding archvies like MAGMA 1.6.2 creates extra hidden files that
  confuse Spack's staging mechanism.

- Added a special case to ignore hidden files when checking whether
  the tarball exploded.
2015-06-01 10:25:58 -07:00
Todd Gamblin
123778dec2 Add -S/--stages option to spack cd/spack location.
- can now change dir to top-level stage
2015-06-01 09:56:35 -07:00
Todd Gamblin
16c2588635 Fix #46: make(parallel=False) regression.
- Added some tests to make sure this stays in place.
2015-05-31 13:03:30 -07:00
Todd Gamblin
ea7b65e2f2 SPACK-69: spack install now logs build output to install directory.
- spack install suppresses build output by default.
  - use install -v to show build output on the console too

- package.py uses log_output context to redirect output and log it to a file
  - filters color codes out of output written to file
  - optionally echos to the terminal

- YAML directory layout knows about its build log.
  - can get path to install build log to from directory layout
  - Package.install now copies the build log to $prefix/.spack/build.out

- Error message from failed install execution now includes build log location
2015-05-29 17:22:33 -07:00
Todd Gamblin
92c21d7134 debug instead of info logging in llnl.util.filesystem 2015-05-29 17:21:30 -07:00
Todd Gamblin
0035100186 SPACK-69: Add context manager to fork and log output in a with block. 2015-05-29 17:20:08 -07:00
Todd Gamblin
9b40d93fc2 Add ability to force color mode even if terminal is NOT a tty 2015-05-29 17:19:03 -07:00
Todd Gamblin
ceecd2ce41 Add ability to test whether tty verbose or debug is enabled. 2015-05-29 17:18:33 -07:00
Todd Gamblin
5676cb0dd1 Add spack find -L to show full hashes. 2015-05-28 17:13:57 -07:00
Todd Gamblin
8cbae642cc Fix bug in spack edit -c 2015-05-28 17:13:23 -07:00
Todd Gamblin
6f8f1bf7af Fix #34: Spack doesn't stop when dep fails to build.
- Fixes regression introduced by #30
- Child process needs to exit on error
2015-05-27 20:27:48 -07:00
Todd Gamblin
c622337802 Remove redundancy: convert with closing(open(...)) to with open(...) 2015-05-18 17:11:03 -07:00
Todd Gamblin
f813d823a1 Merge branch 'features/optional-deps' into develop
This includes:
- Much better variant support (+debug/-debug)
- Optional dependency support (depends_on(... , when='<condition>')
- New config file format (YAML in ~/.spack)
- New Spec format (YAML in $prefix/.spack/spec.yaml)
2015-05-18 16:16:20 -07:00
Matthew LeGendre
46b91ddf57 YAML config files for compilers and mirrors 2015-05-18 16:01:21 -07:00
Todd Gamblin
09151785b3 SPACK-87: enable disabled git fetch tests. 2015-05-18 11:32:15 -07:00
Todd Gamblin
b2f46c703d Fix SPACK-87: Tag checkout fails for older git versions. 2015-05-18 11:26:32 -07:00
Todd Gamblin
cd1ca36488 SPACK-41: More tests to ensure that constrain() reports changes. 2015-05-12 15:48:57 -07:00
Todd Gamblin
805122c789 SPACK-41: bugfix for nonconvergent normalize()
- constrain() wasn't reporting changes properly.
2015-05-12 14:52:46 -07:00
Todd Gamblin
095ff1cb4a Add debug handler to print a stacktrace on Ctrl-C in debug mode. 2015-05-12 14:52:41 -07:00
Todd Gamblin
c44db0133f Fix SPACK-41: Optional deps work with complex condition chains. 2015-05-12 11:45:48 -07:00
Todd Gamblin
cd5fa128c5 Work on SPACK-41: Optional dependencies work for simple conditions.
- Can depend conditionally based on variant, compiler, arch, deps, etc
  - normalize() is not iterative yet: no chaining depends_ons
  - really need a SAT solver, but iterative will at least handle
    simple cases.

- Added "strict" option to Spec.satisfies()
  - strict checks that ALL of other's constraints are met (not just
    the ones self shares)
  - Consider splitting these out into two methods: could_satisfy() and
    satisfies()
    - didn't do this yet as it would require changing code that uses
      satisfies()

- Changed semantics of __contains__ to use strict satisfaction (SPACK-56)

- Added tests for optional dependencies.

- The constrain() method on Specs, compilers, versions, etc. now
  returns whether the spec changed as a result of the call.
2015-05-12 09:56:59 -07:00
Todd Gamblin
ef9deeccd1 Merge branch 'features/yaml-spec' into features/optional-deps 2015-05-10 19:28:47 -07:00
Todd Gamblin
09fff39990 Merge remote-tracking branch 'origin/features/variants' into features/optional-deps 2015-05-10 18:59:56 -07:00
Todd Gamblin
13ff1a9bf6 Remove debug print in link_tree 2015-05-10 18:53:09 -07:00
Todd Gamblin
b4a26c496c Better hash output in find. 2015-05-10 18:48:42 -07:00
Todd Gamblin
43e5465592 Fix bug in directory layout hidden files() 2015-05-10 17:56:27 -07:00
Todd Gamblin
3c49487424 Doc tweak.
- add LLNL release number to new RTD theme.
2015-05-10 13:11:03 -07:00
Todd Gamblin
25af6478c5 Fix SPACK-67: 'spack help stage' was broken.
- remove spurious mutually exclusive group from subparser.
2015-05-10 12:46:33 -07:00
Todd Gamblin
793b842f99 tests for variant concretization 2015-05-10 12:28:25 -07:00
Todd Gamblin
535c1fac87 SPACK-56: fix Variant concretization.
- Variant concretization is tricky:

  - During concretization, a spec without variants (e.g., mpich) means
    "don't care".  So, Spec('mpich').satisfies('mpich+debug') is true
    because it *could* still be built that way.

  - After concretization, a spec without a particular variant means
    "don't know", as that wasn't part of the spec, so the opposite
    relationship is true.  Assume 'spec' is already installed:

      spec.satisfies('mpich+debug')

    this is false beacuse the `debug` variant didn't exist when spec
    was built, so we can't satisfy the explicit request for +debug.
2015-05-10 12:25:07 -07:00
Todd Gamblin
3b1898b8e4 Fix SPACK-40: Finish adding variant directive.
- Variants are now declarable in packages using the variant() directive.
- Variants are checked - you can't just ask for a random variant, it has to be declared.
- conditional logic (@when, if, '+debug' in spec, etc.) still required in package to
  implement variant.
2015-05-10 12:24:03 -07:00
Todd Gamblin
c105a8d42a Small updates to directives. 2015-05-10 12:24:03 -07:00
Todd Gamblin
1f8ce403dc Modularize directives. Now each directive specifies its storage. 2015-05-10 12:24:03 -07:00
Todd Gamblin
0944ba120c relations are now "directives", and code is cleaned up. 2015-05-10 12:24:03 -07:00
Todd Gamblin
5d2ee893c4 Remove TODOs for full DAG information.
- specs on disk now include full DAG info
- no need for normalize() kludges() anymore.
2015-05-10 11:45:12 -07:00
Todd Gamblin
29e833dfef extensions file now in YAML format 2015-05-10 02:56:50 -07:00
Todd Gamblin
2f3b0481de YamlDirectoryLayout now working. 2015-05-09 16:35:02 -05:00
Todd Gamblin
9412fc8083 restore some disabled git tests. 2015-05-09 16:12:04 -05:00
Todd Gamblin
8e87b2176a Updated Sphinx RTD documentation theme supports 4 levels 2015-05-09 13:35:05 -05:00
Todd Gamblin
d6a5266976 Fix 'ç' in François's name. 2015-05-09 13:30:09 -05:00
François Bissey
3cfbc0520a Basic support for IBM XL compilers 2015-05-07 01:54:18 -05:00
Todd Gamblin
42c88aa3ca Merge branch 'features/diy' into develop 2015-05-07 01:53:26 -05:00
Todd Gamblin
1d0975bac6 Bugfixes for yaml specs. 2015-05-05 14:24:46 -07:00
Todd Gamblin
d687962b74 Add test for YAML specs. 2015-05-05 13:18:44 -07:00
Todd Gamblin
53e8e44a8b Make YAML specs more human readable. 2015-05-05 13:06:41 -07:00
Todd Gamblin
278e70e533 Specs to/from YAML are working. 2015-04-29 01:47:09 -07:00
Todd Gamblin
13132c6b97 Add YAML to Spack. 2015-04-28 23:15:13 -07:00
Todd Gamblin
5c04b3c480 Fix for GitHub #30 and SPACK-70. 2015-04-14 15:11:41 -07:00
Todd Gamblin
8b14a46201 documentation updates 2015-04-14 15:11:01 -07:00
Todd Gamblin
314120212d Complete diy command. 2015-04-08 00:22:46 -07:00
Todd Gamblin
5077a2a343 Add a DIY stage class. 2015-04-08 00:22:34 -07:00
Todd Gamblin
ab40d0b1a4 Factor edit_package function out of edit command. 2015-04-08 00:22:07 -07:00
Todd Gamblin
c4a6d04131 Start of DIY command. 2015-04-08 00:20:53 -07:00
Todd Gamblin
203fd861aa Allow spack install -j to throttle make jobs. 2015-04-07 22:21:19 -07:00
Todd Gamblin
ad62b93df9 Merge pull request #23 from mplegendre/rpath_cleanup
Only convert -L<path> to -Wl,-rpath,<path> in compiler scripts if <path>...
2015-03-27 14:14:49 -07:00
Matthew LeGendre
a4cce9eb69 Only convert -L<path> to -Wl,-rpath,<path> in compiler scripts if <path> points into the spack install area
This specifically fixes problems with building gcc, as build and system directories were turning in in gcc library rpaths.
2015-03-27 13:58:57 -07:00
Todd Gamblin
8364f0404c Add some options to spec command. 2015-03-24 08:40:45 -07:00
Todd Gamblin
af92250c7e Add google analytics to docs. 2015-03-15 00:08:58 -07:00
Todd Gamblin
f97966d63a SPACK-18: simpler build error messages
Suppress python stack trace on build error UNLESS in debug mode (spack -d).
Now spack shows errors with a single red arrow, and it's easier to find the actual build output.
2015-03-12 23:50:07 -07:00
Todd Gamblin
132aa690d8 Remove superfluous env scripts (avoid specifically named ones). 2015-03-12 10:39:26 -07:00
Todd Gamblin
560f2c299a Add install_tree, force_symlink helper functions. 2015-03-12 10:32:29 -07:00
Todd Gamblin
0394adcf8d Minor doc tweak. 2015-02-25 10:41:12 -08:00
Todd Gamblin
5eb7e46654 Spell check docs 2015-02-24 10:26:26 -08:00
Todd Gamblin
447e295947 SPACK-62: fix for site docs. 2015-02-24 02:45:21 -08:00
Todd Gamblin
daa38d2ff4 SPACK-59: Documentation updates, bugfix in fetching. 2015-02-24 02:45:07 -08:00
Todd Gamblin
049808a34f Merge remote-tracking branch 'origin/features/SPACK-46' into develop
Conflicts:
	lib/spack/docs/packaging_guide.rst
2015-02-23 10:46:58 -08:00
Todd Gamblin
daef78f538 Update packaging documentataion. 2015-02-23 10:31:22 -08:00
Todd Gamblin
5699cbb597 Fix SPACK-60: 0.8.15 basic docs. 2015-02-23 01:23:30 -08:00
Todd Gamblin
6dab133d9f Same package add icon on mac and linux. 2015-02-23 01:23:30 -08:00
Todd Gamblin
d49c98188a Add an override to colify so we can set terminal dimensions. 2015-02-23 01:23:30 -08:00
Todd Gamblin
02e316e772 Convert ValueErrors to SpackError subclass. 2015-02-18 16:45:54 -08:00