Commit graph

2747 commits

Author SHA1 Message Date
Massimiliano Culpo
f7c0e24f0a 'spack install': make conflict messages as verbose as 'spack spec' (#6436)
"spack spec" was providing helpful error information about conflicts
that was missing from "spack install", this updates "spack install"
to provide the same information.
2017-11-30 10:41:24 -08:00
David Lukes
27b929bfe2 Improve docstring of spack.directives.extend (#6485)
The original docstring had confusing wording re: what is going to
symlinked and where when using the `extend` directive, and how exactly
the symlinking is performed (not automatically on install, but using
`spack activate`). See #5559.
2017-11-29 14:30:42 -08:00
Adam J. Stewart
e01a16b992 Remove spack md5 and sha256 commands (#6428) 2017-11-28 13:41:46 -08:00
healther
dc8f587b61 add path to package.py in case of a syntax error (#6458) 2017-11-28 13:32:21 -08:00
Massimiliano Culpo
f6ead27b5b spack spec: don't show normalize + no hash for non concrete specs (#6417)
Showing "Normalize" on output doesn't give users additional information,
as this step is essentially an implementation detail of concretization.
This PR skips it and shows just the input spec and the concretized one.

Printing partial hashes for input spec has been disabled.
2017-11-28 09:03:32 -08:00
Adam J. Stewart
257d968259 Use long flag in spack help message (#6429) 2017-11-26 06:14:47 -07:00
Michael Kuhn
5bbbfe9446 Introduce virtual dependency pkgconfig (#5198)
There are two providers, pkgconf and pkg-config, with the former being
the default provider.
2017-11-23 08:05:38 -07:00
Adam J. Stewart
1b3b262776 Remove spack extensions from list of known issues (#6405) 2017-11-22 02:31:56 +01:00
Denis Davydov
34da07db9b dealii: add cuda_arch variant via CudaPackage (#6070) 2017-11-19 12:39:13 -07:00
Christoph Junghans
7da8a02cbf
git grep --files-with-matches github.com/llnl/spack | xargs sed -i '/github.com/s@llnl/spack@spack/spack@' (#6329) 2017-11-15 16:46:39 -07:00
scheibelp
b9be9519e8
Fix truncated error messages in directives (#6320)
Fixes #6299

Error messages in 'directives' were split across multiple lines and not
properly concatenated, which led to truncated messages.
2017-11-15 10:33:59 -08:00
Todd Gamblin
9c93c4a42b
Update tutorial slide links. (#6276) 2017-11-13 07:52:43 -07:00
becker33
9b80f2fd38 basics tutorial: output updated (#6267)
* basics tutorial: output updated through gcc

* finished update for basics tutorial

* missed two lines

* doc error fix
2017-11-13 00:12:23 -07:00
Todd Gamblin
24d636eb30
Updates to build systems tutorial (#6273)
* Get rid of period in command

* formatting

* fix header

* Change GNU Make to Make

* Add variants
2017-11-13 00:11:55 -07:00
Mario Melara
2f1cbb5caa Add build systems tutorial for SC17 (#6125)
* First draft for SC17 build systems portion

Added tutorial_buildsystems.rst file as well as example files under
the tutorial/ directory.

* Remove floating `

* Add requested changes, and examples of subclasses

Added in the requested changes to the documentation. Also added in
information about the subclasses and the defaults that they provide.
Also fixed some phrasing issues, formatting and punctuation.

* Flake8 fixes and new files for classes

Made flake8 fixes to pass tests and also added files to demonstrate code
in the classes.

* Minor edits

Edits in formatting and made some sentence changes

* Flake8 fixes

More flake8 fixes

* Flake8 fix

* Change section order on tutorial and minor edits

Placed the section at the appropriate section for the tutorial and then
added some minor edits that were requested.

* Add requested changes and more details

Added more details to Cmake, Makefile and Python Packages.

* Fixed formatting and minor edits

* Fix doc build error
2017-11-12 23:24:18 -07:00
Adam J. Stewart
9db7eaade8 Last minute edits to the Configuration Tutorial (#6271) 2017-11-12 23:14:44 -07:00
becker33
b77acd0896 Add configuration tutorial for SC17 (#6141) 2017-11-12 20:12:57 -07:00
Matthew LeGendre
265c30b943 Update packaging tutorial (#6270)
* Allow types and 'any' in variant definitions.

- Previously variant values had to be a tuple or a callable predicate.

- This allows 'any' as shorthand for `lambda x: True` and type objects
  as shorthand for "any value of this type".

- Makes variant definitions more readable, keeps lambdas out of
  packages for common cases.

* Update packaging tutorial

* Fix bad file reference in packaging tutorial
2017-11-12 20:09:12 -07:00
becker33
b09341d861 binary packages: do post install hooks (#6269) 2017-11-12 17:57:10 -07:00
Massimiliano Culpo
1ab703448d SC17: advanced packaging tutorial (#6148)
* First draft of the advanced packaging tutorial

* advanced packaging tutorial: improved phrasing

Thanks Denis and Hartzell!

* Fixed typos + reworded a couple of sentences
2017-11-12 00:27:57 -08:00
Massimiliano Culpo
fe889124eb SC17: reworked module file tutorial section (#5657)
* Reworked module file tutorial section

First draft for the SC17 update. This includes:

 - adding an introduction on module files + Spack's module
   generation blueprints
 - adding a set-up section and provide a docker image for easy set-up
 - updating all the relevant snippets
 - extending a bit some of the concepts that were already touched

* Added reference to #5582 + committed Dockerfiles

Also fixed a couple of typos spotted by Denis.

* module file tutorial: added section on template customization

* module file tutorial: fixed minor typos + rephrased a sentence

* module file tutorial: made explicit that Docker image comes with software

* module file tutorial: improved phrasing and layout.

Thanks Hartzell!

* module file tutorial: added vim and nano to editors

* module file tutorial: fixed typo

* Fixed typos

Thanks Adam!

* module file tutorial: updated Dockerfile + minor changes in introduction
2017-11-12 00:27:20 -08:00
becker33
1008975bc0 Don't include build-only dependencies in build cache hash (#6262) 2017-11-11 20:54:17 -08:00
scheibelp
8c458a856f
Group flags and values separated by space (#6169)
Fixes #6154

For compiler options which set values using the syntax "-flag value"
(with a space between the flag and the flag's value) the flag and
value were treated as separate and reordered. This updates Spack's
logic to treat the flag and value as a single unit, even if there is
a space between them. It assumes that all flags are prefixed with
"-" and that all flag values are not.
2017-11-10 16:33:50 -08:00
Patrick Gartung
124b5fc296 deal with case where symbolic links are copied (#6178)
* deal with case where symbolic links are copied

* Suggested changes
2017-11-09 14:38:12 -08:00
Patrick Gartung
1484a94b1e spack buildcache: symlink and relative RPATH fixes (#6140)
* Skip rewriting files that are links (this also avoids issues with parsing
  the output of the 'file' command for symlinks)
* Fail rather than warn for several gpg signing issues (e.g. if there is no
  key available to sign with)
* Installation with 'buildcache install' only retrieves link and run
  dependencies (this matches 'buildcache create' which only creates tarballs
  of link/run dependencies)
* Don't rewrite RPATHs for a binary if the binary cached package was created
  with relative RPATHs
* Refactor relocate_binary to operate on multiple binaries (given as a
  collection of paths). This was likewise done for relocate_text and
  make_binary_relative
2017-11-09 10:53:34 -08:00
Todd Gamblin
3a0324fe1a
add artisanal handcrafted SVG Spack logo. (#6165)
- This isn't one of those autogenerated SVGs from a drawing program!

- This is a completely re-traced, minimalist SVG file with clearly
  delineated pieces so that your favorite renderer can draw a Spack logo
  at whatever resolution you want.

- Included versions with text, as well.
2017-11-06 22:42:16 -08:00
Johann Klähn
ac3a807f58 Fix spack view hardlink (#6130)
Fix a typo in "spack view hardlink" introduced in #5415
("os.hardlink" does not exist).
2017-11-06 19:19:27 -08:00
Michael Kuhn
ca73103dac Introduce static_to_shared_library function (#6092)
The static_to_shared_library function takes an existing static library
and produces a shared library based on it.
2017-11-06 17:21:46 -07:00
Axel Huebl
54bb28ccb0 Docs: MPI as Root (#6156)
New versions of OpenMPI need `--allow-run-as-root` for
running as root:
  http://www.open-mpi.de/doc/v2.0/man1/mpirun.1.php#toc22
2017-11-06 13:03:46 -08:00
scheibelp
31c5467f56
Add back help placeholder for "spack load" (#6127)
Fixes #6126

#3183 removed the print_help function from the "modules" module.
This adds it back so that if a user invokes 'spack load foo' without
having sourced an environment setup script, they will be prompted
to do so. This also improves the placeholder message to tell the 
user to invoke 'spack' as shell function rather than as an executable.
2017-11-06 11:03:36 -08:00
Todd Gamblin
05fa302655
Replace github.com/llnl/spack with github.com/spack/spack (#6142)
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-11-04 17:08:04 -07:00
Johann Klähn
3fc8a71afb Fix restaging of resources (#5681)
Part of the resource staging process is to place downloaded/expanded
files in the root stage. This was not happening when a resource stage
was restaged.
2017-11-03 11:29:43 -07:00
Todd Gamblin
12f0725e9f spack fetch: don't fetch externals. (#6124)
Fixes #6123

spack fetch shouldn't attempt to fetch external deps when invoked
with --dependencies.
2017-11-03 10:15:15 -07:00
Michael Kuhn
bd7d61325f Configure user for mock Git repository (#6128)
If user.useConfigOnly is set globally and no name or e-mail is
configured, the git_fetch tests fail.
2017-11-02 21:43:28 -07:00
Ben Boeckel
0f896e921f test_activations: also test perl activations 2017-11-02 18:45:40 -07:00
Peter Scheibel
3a2a0c9ad4 test_activations: test Python's extension logic 2017-11-02 18:45:40 -07:00
Peter Scheibel
dde93c01cf spec: support a test prefix
This is used in tests to test real packages without actually building
and installing them.
2017-11-02 18:45:40 -07:00
Ben Boeckel
d5a3d9d20e view: test conflicting packages in views 2017-11-02 18:45:40 -07:00
Ben Boeckel
13b669de8e view: test that extension paths exist 2017-11-02 18:45:40 -07:00
Ben Boeckel
a06c6b0366 filesystem_view: reject packages with activations
If there are extensions that are globally activated, reject adding them
to a view. Those extensions should not be implicitly activated.
2017-11-02 18:45:40 -07:00
Ben Boeckel
26724688b1 view: test viewing external packages 2017-11-02 18:45:40 -07:00
Ben Boeckel
ea62347c46 view: add a test for extension activation 2017-11-02 18:45:40 -07:00
Ben Boeckel
4511d9d924 extensions: support only showing a subset of information 2017-11-02 18:45:40 -07:00
Ben Boeckel
b7ec870c3b extensions: support acting on a view
This allows extensions to be (de)activated and queried within a view
rather than only acting on the global installation.
2017-11-02 18:45:40 -07:00
Oliver Breitwieser
db529f5b61 view: use the FilesystemView abstraction for creating views 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
af42c24ef5 view: fix some docstrings for arguments 2017-11-02 18:45:40 -07:00
Ben Boeckel
9a39efd966 filesystem_view: do not link external packages 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
538d855e1b filesystem_view: add a class to handle a view via a Yaml description 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
21dc31a4a1 package: support removing dependencies when deactivating 2017-11-02 18:45:40 -07:00
Ben Boeckel
f50ddeed9f conftest: mock out spack.store.extensions as well 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
078f85a125 views: support querying view layouts as well
This abstracts out the layout in use between the global installations
and a specific view.
2017-11-02 18:45:40 -07:00
Oliver Breitwieser
00a893aa79 link_tree: support choosing the link function
This can be used to make hardlinks rather than symlinks.
2017-11-02 18:45:40 -07:00
Oliver Breitwieser
9024ddcf05 link_tree: support ignoring conflicts 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
20cd82dc56 directory_layout: add a YamlExtensionsLayout class
This uses a view to query extensions.
2017-11-02 18:45:40 -07:00
Oliver Breitwieser
94c0740a88 link_tree: only remove matching files when unmerging 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
b9e8402104 directory_layout: factor out an ExtensionsLayout class 2017-11-02 18:45:40 -07:00
Ben Boeckel
650ca7db9e extensions: add an installed_extensions_for method 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
56bafdc282 database: rename installed_extensions_for
Views support activating packages, so rename the method because it will
soon query what is activated versus what is installed.
2017-11-02 18:45:40 -07:00
Oliver Breitwieser
70d3558596 package: support verbosity when activating 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
af0cf2d3c6 package: rename activated to is_activated
This allows the activation code to be later given parameters.
2017-11-02 18:45:40 -07:00
Ben Boeckel
f31b47c353 cmd/test: fix a typo in a comment 2017-11-02 18:45:40 -07:00
Ben Boeckel
6f9bf197a5 spec_yaml: fix a typo 2017-11-02 18:45:40 -07:00
Oliver Breitwieser
28cc077ef6 view: fix a typo 2017-11-02 18:45:40 -07:00
Ben Boeckel
76305038ef determine full compiler version for gcc-7
Fixes #5778.

Spack uses 'gcc -dumpversion' to determine the full version of gcc.
'gcc -dumpversion' no longer gives the full version on gcc 7.2.0.
'gcc -dumpfullversion' is required instead. This PR detects when
'gcc -dumpversion' gives a truncated version of '7' and in that
case retrieves the full version with 'gcc -dumpfullversion'
2017-11-02 18:44:10 -07:00
Todd Gamblin
c96f2e50a6
Only use XCode clang wrappers for packages that set use_xcode=True (#6077) 2017-11-02 09:19:23 -07:00
scheibelp
3eb59f6932
update filename used for cc wrapper invocation debug log (#5837)
The name of the debug log written by the cc compiler wrapper was given
by Spec.short_spec, which includes the architecture. Somewhere along
the line Spec.format started adding spaces around the architecture
property so the filename started including spaces; the cc wrapper
script appears to ignore this, so files like spack-cc-bzip2-....in.log
(which record the wrapped compiler invocations) were not being
generated. This uses a different format string from the spec to
generate the wrapper log file names (which does not include spaces).
2017-11-01 20:11:00 -07:00
scheibelp
60a485591c Fix user specs which include already-installed packages (#5939)
* when a user-provided spec refers to an already-installed package, packages with patches applied were causing validation errors based on the recorded variants in the package's class

* avoid checks on all reserved variants (not just 'patches')
2017-11-01 18:44:31 -07:00
scheibelp
e5b8312de3 Auto install available pre-built packages from binary cache (#5242)
* 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-30 14:16:46 -07:00
Sergey Kosukhin
5ebddcd5e3 Bugfix: from_list_url(). (#5780)
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-27 17:41:41 -07:00
Ben Boeckel
bd6378a6d2 Package.extends: update semantics when package isn't concrete (#5600)
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-26 13:12:32 -07:00
Patrick Gartung
8e47b17a4d Buildcache: symlinks, externals, & install-checking (#5894)
* 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-26 11:06:59 -07:00
Ondřej Čertík
aa750f12de Colorize "Installing pkg_name" (#5950)
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-26 00:06:56 +02:00
scheibelp
dcdd16b35e Check for namespace-qualified packages in repo_for_pkg (#5787)
* 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-25 21:08:03 +02:00
George Hartzell
b43064190c Specify base branch for flake8 comparison (#5796)
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-25 14:30:22 +02:00
Massimiliano Culpo
8b7d2d0f24 'spack install' can overwrite an existing installation (#5384)
'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-24 12:32:30 -07:00
Todd Gamblin
3f68cc2ba7 Fix bug in spack flake8 when no files differ from develop (#5898) 2017-10-24 11:29:18 +02:00
Todd Gamblin
6b5ca38723 do not use 'l' as a variable name, to appease new flake8 version
- 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-24 10:05:36 +02:00
Todd Gamblin
5449884b2e Fix bare 'except:' to placate errors in new flake8 version.
- fixes E722 errors from latest version of flake8
- requires us to not use 'bare except:' and catch BaseException instead
2017-10-24 10:05:36 +02:00
Todd Gamblin
b98fc48273 log tests use tmpdir properly 2017-10-24 10:05:36 +02:00
Todd Gamblin
0bb1eb32f2 fix bugs found with stricter flake8 rules
- 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-24 10:05:36 +02:00
Todd Gamblin
7dd79094b0 remove wildcards from make spack core and packages
- This removes all wildcard imports EXCEPT `from spack import *` in packages
2017-10-24 10:05:36 +02:00
Todd Gamblin
7757ebc0bc flake8: no wildcards in core; only import * from spack in packages
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-24 10:05:36 +02:00
Todd Gamblin
78e22940c2 add --all option to spack flake8
- `-a`/`--all` causes flake8 to run on all files rather than just
  different ones.
2017-10-24 10:05:36 +02:00
scheibelp
e660611a87 package: remove bare except statements (#5896) 2017-10-23 19:28:53 -07:00
Massimiliano Culpo
3e7680e24a getting_started.rst: removed tip suggesting the use of 2 Spack instances (#4061) 2017-10-20 21:09:08 -07:00
Massimiliano Culpo
3afc6770f0 module-type argument defaults to 'tcl' instead of every known type (#5751)
fixes #5721

This is to solve the fact that lmod needs to be configured
by the user (to specify a core compiler).
2017-10-20 20:41:25 -07:00
Patrick Gartung
a8ee2a912b buildcache command updates (#5860)
* Add better spec matching to spack buildcache

* skip download of spec.yaml and keys if they exist

* autopep8
2017-10-20 20:33:01 -07:00
Adam J. Stewart
2570dfb4d9 Update Getting Started docs to clarify that full Xcode suite is required for 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-20 17:31:12 -07:00
Todd Gamblin
4dac4736e7 spack blame can take a path to a file in the Spack repo (#5793)
- 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-19 14:27:15 -07:00
Adam J. Stewart
a1c19f8389 Allow documentation to build in Python 3 (#5736) 2017-10-19 00:26:04 -07:00
George Hartzell
464e558aea filter_file, don't remove absent backup file (#5733)
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-17 11:26:05 -07:00
Michael F. Herbst
1952a92820 Minor typos and corections (#5789)
- 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-17 01:36:03 -07:00
Todd Gamblin
100fb1e6ee Exercise more code paths in the git fetcher.
- 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-17 01:26:31 -07:00
Todd Gamblin
d14816cbaf Spack tests no longer clutter var/spack/stage
- 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 01:26:31 -07:00
Todd Gamblin
44bebd7a8f `Package.stage` no longer implicitly makes stage directory
- 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-17 01:26:31 -07:00
Todd Gamblin
894a1a73a4 Spack tests no longer use the var/spack/stage directory.
- 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-17 01:26:31 -07:00
Todd Gamblin
c14f2dc7b4 Spack core and tests no longer use os.chdir()
- 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-17 01:26:31 -07:00
Adam J. Stewart
6f9036c858 Ensure that FileList makes it into the documentation (#5739) 2017-10-14 06:20:39 +02:00
Todd Gamblin
1ba4c1af63 Clean up logic in Sepc.satisfies_dependencies()
- 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-13 19:46:57 -07:00
Todd Gamblin
afc99ca516 Remove single-root assertion from Spec.root
- 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-13 19:46:57 -07:00
Todd Gamblin
3f091fb6db Use list instead of OrderedDict to find virtual/external candidates
- 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-13 19:46:57 -07:00
Todd Gamblin
f58c503091 avoid creating lots of dictionaries in traverse_edges()
- 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-13 19:46:57 -07:00
Todd Gamblin
9ccaf6474d Don't redundantly check for providers of non-virtuals. 2017-10-13 19:46:57 -07:00
Todd Gamblin
55f85f2307 Cache compilers parsed from config files
- 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-13 19:46:57 -07:00
Patrick Gartung
2e1aa0a5e9 This fixes a bug in creating rpaths relative to $ORIGIN on linux. (#5726)
* 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-13 19:13:07 -07:00
Axel Huebl
e17765db39 Docker Workflow (#5582)
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-13 12:17:20 -07:00
Denis Davydov
1b53e82348 various fixes for macOS high sierra (#5647)
* various fixes for macOS high sierra

* add macOS_version() helper function

* flake8 fixes

* update oce and trilinos

* fix bison
2017-10-12 11:41:57 -07:00
David Hows
0dad5b3ee5 Make --trusted default when running spack gpg list (#5678)
* 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-12 11:14:48 -07:00
Todd Gamblin
65b38764ae Speed up concretization (#5716)
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-12 09:52:38 -07:00
Todd Gamblin
b5e136b729 Better install output (#5714)
* 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-12 00:49:59 -07:00
Christoph Junghans
cb7628c9a4 compilers/clang: add flang (#5503)
* compilers/clang: add flang

* Update clang.py
2017-10-10 13:52:10 -07:00
George Hartzell
0d1c36e559 Add package for aspell and ass't dictionaries (#3890)
* 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-09 14:14:19 -07:00
becker33
5d13f236b4 Fix setup for changes to dirty flag (#5592)
* Pass dirty arg through setup to setup_package
2017-10-09 10:01:55 -07:00
scheibelp
b08d457dfd Don't check package.installed in _mark_concrete if value=True (#5634)
* 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-06 14:23:28 -07:00
Jimmy Tang
c6e7fb25a4 Fix formatting typo (#5622) 2017-10-05 10:58:51 -07:00
scheibelp
6243a28da1 Don't change properties on already-installed packages (#5580)
* 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-05 10:33:04 -07:00
becker33
04a4ac68d5 Identify the flag handlers feature as beta (#5609)
The flag-handling logic added in #4421 may change semantics, so this
commit adds a warning to the documentation for this feature.
2017-10-04 18:32:13 -07:00
becker33
328ab328be Fix module loads (#5599)
Fixes #5455

All methods within setup_package use an EnvironmentModifications object
to control the environment. Those modifications are applied at the end
of setup_package. Module loads for the build environment need to be
done after the rest of the environment modifications are applied, as
otherwise Spack may unset variables set by those modules (for example
LD_LIBRARY_PATH).
2017-10-04 18:25:55 -07:00
Massimiliano Culpo
3556eaae7e module files: restricted token expansion + case sensitivity (#5474)
closes #2884
closes #4684

In #1848 we decided to use `Spec.format` to expand certain tokens in
the module file naming scheme or in the environment variable name.
Not all the tokens that are allowed in `Spec.format` make sense in
module file generation. This PR restricts the set of tokens that can
be used, and adds tests to check that the intended behavior is respected.

Additionally, the names of environment variables set/modified by module
files were, up to now, always uppercase. There are packages though that
require case sensitive variable names to honor certain behaviors (e.g.
OpenMPI). This PR restricts the uppercase transformation in variable
names to `Spec.format` tokens.
2017-10-04 18:14:06 -07:00
scheibelp
395000c385 spec.patches: fix dictionary reference (#5608)
This fixes a loop that was iterating through the keys of a dictionary
when it was intending to use the values.
2017-10-04 17:14:58 -07:00
Massimiliano Culpo
5fa1191d17 Hotfix: maintain patch order while fixing hash
fixes #5587

In trying to preserve patch ordering, #5476 made equality inconsistent
for the added 'patches' variant. This commit maintains the original
weak ordering of patch applications while preserving consistency of
comparisons. The ordering DOES NOT enter the hashing mechanism. It's
supposed to be a hotfix, while we think of a cleaner and more-permanent
solution.
2017-10-04 11:39:25 -07:00
scheibelp
f53be46186 wrap generator with collection to avoid exhausting it with single iteration (#5586) 2017-10-03 16:47:07 -07:00
Christoph Junghans
d22ee8f993 patch: add workdir option (#5501)
* patch: add working_dir option
* added documentation
2017-10-02 22:56:43 -07:00
Todd Gamblin
29ca18e348 Port CTest's log scraping logic to Spack (#5561)
- 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-30 22:39:21 -07:00
Todd Gamblin
8648e2cda5 Add testing for spack blame; refactor llnl.util tests 2017-09-30 16:31:56 -07:00
Todd Gamblin
41a2652ef2 Add 'spack blame' command: shows contributors to packages
`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-30 16:31:56 -07:00
George Hartzell
46d5901770 Typo: file -> directory (#5560)
Mirrors are directories (that use `file://` URLS, not files.
2017-09-30 14:32:07 -07:00
Todd Gamblin
96d2488e0c Documentation for dependency patching. 2017-09-30 02:06:59 -07:00
Todd Gamblin
4f8c7d57eb Patches are hashed with specs, and can be associated with dependencies.
- 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-30 02:06:59 -07:00
Todd Gamblin
14c141a410 add spack flake8 exception for long checksums 2017-09-30 02:06:59 -07:00
Todd Gamblin
bf610a379f Clean up exceptions and function names in directives.
- 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-30 02:06:59 -07:00
Todd Gamblin
94d85d842c Consolidate some web-spidering commands in spack.util.web
- 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-30 02:06:59 -07:00
Todd Gamblin
2198a0e229 Disable duplicate cross-reference warnings in Sphinx. 2017-09-30 02:06:59 -07:00
Todd Gamblin
0e8bb9ec5e Refactor Package dependency metadata
- 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-30 02:06:59 -07:00
Todd Gamblin
a3cb6b61ea Patch.apply() shouldn't affect working directory of caller. 2017-09-30 02:06:59 -07:00
Todd Gamblin
29ce69f3ed Only print "no patches needed" if there were no patches. 2017-09-30 02:06:59 -07:00
scheibelp
9e7faff6c9 Add test deptype (#5132)
* 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-29 22:08:15 -07:00
Massimiliano Culpo
554937780b modules: specialized configure_options for external packages (#5543)
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-29 09:23:13 -07:00
Massimiliano Culpo
8864d145e9 module files: system paths are excluded from path inspection (#5460)
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-25 09:47:50 -07:00
scheibelp
45a8c03bdf Prefer later versions of compilers by default (#5234)
* Prefer later versions of compilers by default

* update test to make it less fragile
2017-09-21 17:16:19 -07:00
Denis Davydov
234e00e84c update Blas/Lapack section of packaging guide (#5383) 2017-09-20 15:40:20 -07:00
Massimiliano Culpo
b1d129e681 Modulefiles generated with a template engine (#3183)
* 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-19 12:34:20 -07:00
Todd Gamblin
c7a789e2d6 Add --show-log-on-error option to spack install
- 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-17 18:52:25 -07:00
Todd Gamblin
742cd7f127 Remove redundant dest arguments in install.py 2017-09-17 18:52:25 -07:00
Todd Gamblin
eb0ea7697a Fix log error parsing bug introduced in c830eda0e (#5387)
- '\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-17 15:31:32 -07:00
Pramod S Kumbhar
9aafe21b63 Filter system paths from CMAKE_PREFIX_PATH (#5385) 2017-09-17 14:47:16 +02:00
Kelly (KT) Thompson
0558fd640e Improve external package location detection algorithm. (#5145)
Also inspect `PATH` to help locate an external package and provide a test for
getting path from module's PATH.

Fixes #5141
2017-09-16 13:26:29 -07:00
Denis Davydov
f710a520e5 set CMAKE_PREFIX_PATH for cmake packages (#5364)
* cmake: set CMAKE_PREFIX_PATH

* cmake: use build/link immediate dependencies to construct CMAKE_PREFIX_PATH
2017-09-16 13:14:03 -07:00
Massimiliano Culpo
90d50a0cee Force reference consistency between Spec & Package
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-12 12:10:31 -07:00
Todd Gamblin
f8f1c308c9 clean up concreteness detection
- 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-11 17:13:21 -07:00