Commit graph

702 commits

Author SHA1 Message Date
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
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
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
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
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