summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2017-08-20Preserve verbosity across installs when 'v' is pressed.Todd Gamblin3-66/+159
- 'v' toggle was previously only good for the current install. - subsequent installs needed user to press 'v' again. - 'v' state is now preserved across dependency installs.
2017-08-20Fix exit call in `SpackError.die()`Todd Gamblin1-3/+3
- Previously we would use `os._exit()` in to avoid Spack error handling in the parent process when build processes failed. This isn't necessary anymore since build processes propagate their exceptions to the parent process. - Use `sys.exit` instead of `os._exit`. This has the advantage of automatically flushing output streams on quit, so output from child processes is not lost when Spack exits.
2017-08-20Rework output redirection in Spack.Todd Gamblin5-237/+267
- Simplify interface to log_output. New interface requires only one context handler instead of two. Before: with log_output('logfile.txt') as log_redirection: with log_redirection: # do things ... output will be logged After: with log_output('logfile.txt'): # do things ... output will be logged If you also want the output to be echoed to ``stdout``, use the `echo` parameter:: with log_output('logfile.txt', echo=True): # do things ... output will be logged and printed out And, if you just want to echo *some* stuff from the parent, use ``force_echo``: with log_output('logfile.txt', echo=False) as logger: # do things ... output will be logged with logger.force_echo(): # things here will be echoed *and* logged A key difference between this and the previous implementation is that *everything* in the context handler is logged. Previously, things like `Executing phase 'configure'` would not be logged, only output to the screen, so understanding phases in the build log was difficult. - The implementation of `log_output()` is different in two major ways: 1. This implementation avoids race cases by using only one pipe (before we had a multiprocessing pipe and a unix pipe). The logger daemon stops naturally when the input stream is closed, which avoids a race in the previous implementation where we'd miss some lines of output because the parent would shut the daemon down before it was done with all output. 2. Instead of turning output redirection on and off, which prevented some things from being logged, this version uses control characters in the output stream to enable/disable forced echoing. We're using the time-honored xon and xoff codes, which tell the daemon to echo anything between them AND write it to the log. This is how `logger.force_echo()` works. - Fix places where output could get stuck in buffers by flushing more aggressively. This makes the output printed to the terminal the same as that which would be printed through a pipe to `cat` or to a file. Previously these could be weirdly different, and some output would be missing when redirecting Spack to a file or pipe. - Simplify input and color handling in both `build_environment.fork()` and `llnl.util.tty.log.log_output()`. Neither requires an input_stream parameter anymore; we assume stdin will be forwarded if possible. - remove `llnl.util.lang.duplicate_stream()` and remove associated monkey-patching in tests, as these aren't needed if you just check whether stdin is a tty and has a fileno attribute.
2017-08-20Make SpackCommand a bit more testableTodd Gamblin1-5/+15
- add fail_on_error argument - record exception and return code when the command fails
2017-08-20Fix issue with color formatting regular expression. (#5171)Todd Gamblin1-19/+20
- Fix issue with color formatting regular expression. - _separators regex in spec.py could be constructed such that '^' came first in the character matcher, e.g. '[^@#/]'. This inverts the match and causes transient KeyErrors. - Fixed to escape all characters in the constructed regex. - This bug comes up in Python3 due to its more randomized hash iteration order, but it could probably also happen in a Python 2 implementation. - also clean up variable docstrings in spec.py
2017-08-19Make test_inspect_path work on Mac OS X without XCode (#5168)Todd Gamblin1-2/+8
- Mac OS X Sierra has no /usr/include by default - Instead of assuming there's an include directory in /usr, mock up a directory that looks like we expect.
2017-08-18sbang support: add node-js and fix luahealther1-1/+8
This adds sbang hook support for node-js and fixes the sbang filter for lua (the character class exclusion was swallowing newlines and reporting a false positive if lua was mentioned anywhere in the file).
2017-08-17Docs: Travis-CI Workflow (#5133)Axel Huebl1-0/+78
* Docs: Travis-CI Workflow Add a workflow how to use spack on Travis-CI. Future Work: depending if and how we can simplify 5101: add a multi-compiler, multi-C++-standard, multi-software build matrix example * Fix Typos
2017-08-17Colorize spack info. Adds prominence to preferred version. (#4994)Massimiliano Culpo2-33/+117
* Colorize spack info. Adds prominence to preferred version. fixes #2708 This uses 'llnl.util.tty.color' to colorize the output of 'spack info'. It also displays versions in the order the concretizer would choose them and shows the preferred in a line on its own and in bold. * Modified output according to Adam and Denis reviews. Section titles are not bold + black, but bold + blue. Added a new section named "Preferred version", which prints the preferred version in bold characters. * Further modifications according to Adam and Denis reviews. After "Homepage:" we now have a single space. Removed newline after each variant. Preferred version is not in bold fonts anymore. Added a simple test that just runs the command.
2017-08-17Improved error message for unsatisfiable specs (#5113)Massimiliano Culpo1-4/+13
* Improved error message for unsatisfiable specs. fixes #5066 This PR improves the error message for unsatisfiable specs by showing in tree format both the spec that cannot satisfy the constraint and the spec that asked for that constraint. After that follows a readable error message.
2017-08-17Relaxed constraints on config.yaml structure (#5115)Massimiliano Culpo1-1/+0
This PR allows additional unused properties at the top-level of the config.yaml file. Having these properties permits to use two different versions of Spack, one of which adds a new property, without receiving error messages due to the presence of this new property in a configuration cache stored in the user's home.
2017-08-16buildcache fixes: index.html & unsigned installsPatrick Gartung1-20/+21
This fixes a syntax error in the index.html file generated by the "spack buildcache" command when creating build caches. This also fixes support for installing unsigned binaries.
2017-08-16Add tab completion & update docs for buildcacheAdam J. Stewart2-67/+91
This adds tab completion and fixes some formatting issues in the documentation for the "spack buildcache" command.
2017-08-16Add better generator support to CMakePackage (#4988)Adam J. Stewart2-8/+65
* Add better generator support to CMakePackage * List valid CMake generators on error
2017-08-16Refactor IntelInstaller into IntelPackage base class (#4300)Adam J. Stewart9-112/+366
* Refactor IntelInstaller into IntelPackage base class * Move license attributes from __init__ to class-level * Flake8 fixes: remove unused imports * Fix logic that writes the silent.cfg file * More specific version numbers for Intel MPI * Rework logic that selects components to install * Final changes necessary to get intel package working * Various updates to intel-parallel-studio * Add latest version of every Intel package * Add environment variables for Intel packages * Update env vars for intel package * Finalize components for intel-parallel-studio package Adds a +tbb variant to intel-parallel-studio. The tbb package was renamed to intel-tbb. Now both intel-tbb and intel-parallel-studio+tbb provide tbb. * Overhaul environment variables set by intel-parallel-studio * Point dependent packages to the correct MPI wrappers * Never default to intel-parallel-studio * Gather env vars by sourcing setup scripts * Use mpiicc instead of mpicc when using Intel compiler * Undo change to ARCH * Add changes from intel-mpi to intel-parallel-studio * Add comment explaining mpicc vs mpiicc * Prepend env vars containing 'PATH' or separators * Flake8 fix * Fix bugs in from_sourcing_file * Indentation fix * Prepend, not set if contains separator * Fix license symlinking broken by changes to intel-parallel-studio * Use comments instead of docstrings to document attributes * Flake8 fixes * Use a set instead of a list to prevent duplicate components * Fix MKL and MPI library linking directories * Remove +all variant from intel-parallel-studio * It is not possible to build with MKL, GCC, and OpenMP at this time * Found a workaround for locating GCC libraries * Typos and variable names * Fix initialization of empty LibraryList
2017-08-14Create, install and relocate tarballs of installed packagesPatrick Gartung6-0/+1426
Adds the "buildcache" command to spack. The buildcache command is used to create gpg signatures for archives of installed spack packages; the signatures and archives are placed together in a directory that can be added to a spack mirror. A user can retrieve the archives from a mirror and verify their integrity using the buildcache command. It is often the case that the user's Spack instance is located in a different path compared to the Spack instance used to generate the package archive and signature, so this includes logic to relocate the RPATHs generated by Spack.
2017-08-14Added a custom action for --clean and --dirty. (#5081)Massimiliano Culpo3-9/+52
The action `CleanOrDirtyAction` has been added. It sets the default value for `dest` to `spack.dirty`, and changes it according to the flags passed via command line. Added unit tests to check that the arguments are parsed correctly. Removed lines in `PackageBase` that were setting the default value of dirty according to what was in the configuration.
2017-08-14Decode process stream only for python3scheibelp1-2/+17
Popen.communicate outputs a str object for python2 and a bytes object for python3. This updates the Executable.__call__ function to call .decode on the output of Popen.communicate only for python3. This ensures that Executable.__call__ returns a str for python2 and python3.
2017-08-11patch: get correct package directory for a given packageMassimiliano Culpo1-3/+15
fixes #4236 fixes #5002 When a package is defined in more than one repository, RepoPath.dirname_for_package_name may return the path to either definition. This sidesteps that ambiguity by accessing the module associated with the package definition.
2017-08-09bugfix for module_cmd (#5038)becker332-2/+2
* bugfix for modulecmd when bash is symlinked to sh * update test to make sure module_cmd can interpret sh
2017-08-09Merged 'purge' command with 'clean' and deleted 'purge' (#4970)Massimiliano Culpo6-89/+129
* Merged 'purge' command with 'clean'. Deleted 'purge'. fixes #2942 'spack purge' has been merged with 'spack clean'. Documentation has been updated accordingly. The 'clean' and 'purge' behavior are not mutually exclusive, and they log brief information to tty while they go. * Fixed a wrong reference to spack clean in the docs * Added tests for 'spack clean'. Updated bash completion.
2017-08-09Bugfixes for compiler detection on the Cray platform. (#3075)Sergey Kosukhin6-8/+81
* Typo fixes in docstrings. * Let OS classes know if the paths they get were explicitly specified by user. * Fixed regexp for cray compiler version matching. * Replaced LinuxDistro with CrayFrontend for the Cray platform's frontend.
2017-08-07Variant satisfaction for indirect dependenciesscheibelp3-1/+17
Fixes #4898 Constraints that were supposed to be conditionally activated for specified values of a single-valued variant were being activated unconditionally in the case that the variant was associated with an implicit dependency. For example if X->Y->Z and Y places a conditional constraint on Z for a given single-valued variant on Y, then it would have been applied unconditionally when concretizing X.
2017-08-05Various fixes to package name URL parsing (#4978)Adam J. Stewart3-0/+5
2017-08-05Massive conversion from Package to CMakePackage (#4975)Adam J. Stewart1-0/+1
2017-08-04Add a SConsPackage base class (#4936)Adam J. Stewart5-7/+104
* Add a SConsPackage base class * Make Matlab extendable * Most dependencies are actually required * Cantera requires older version of fmt
2017-08-04Make CMake the default build system (#4862)Adam J. Stewart1-1/+3
2017-08-04Add a QMakePackage base class (#4925)Adam J. Stewart7-13/+122
* Add a QMakePackage base class * Fix sqlite linking bug in qt-creator * Add latest version of qt-creator * Add latest version of qwt * Use raw strings for regular expressions * Increase minimum required version of qt * Add comment about specific version of sqlite required * Fixes for latest version of qwt and qt-creator * Older versions of Qwt only work with older versions of Qt
2017-08-03Fix trailing whitespace at the end of headers.cpp_flags (#4957)Adam J. Stewart1-16/+77
2017-08-03Fix crashes when running spack install under nohup (#4926)George Hartzell1-2/+10
* Fix crashes when running spack install under nohup Fixes #4919 For reasons that I do not entire understand, duplicate_stream() throws an '[Errno 22] Invalid argument' exception when it tries to `os.fdopen()` the duplicated file descriptor generated by `os.dup(original.fileno())`. See spack/llnl/util/lang.py, line 394-ish. This happens when run under `nohup`, which supposedly has hooked `stdin` to `/dev/null`. It seems like opening and using `devnull` on the `input_stream` in this situation is a reasonable way to handle the problem. * Be more specific about error being handled. Only catch the specific error that happens when trying to dup the stdin that nohup provides. Catching e as a StandardErorr and then `type(e).__name__` tells me that it's an OSError. Printing e.errno tells me that it's 22 Double checking tells me that 22 is EINVAL. Phew.
2017-08-03Account for hyphens in package names when searching for libraries. (#4948)Sergey Kosukhin1-1/+12
2017-08-01Fix color bug in Spec.format() introduced by #3013Todd Gamblin1-6/+3
2017-08-01Add `spack dependencies` command and tests for it and dependents.Todd Gamblin7-15/+261
2017-08-01document and make `display_specs` more versatileTodd Gamblin2-14/+48
2017-08-01Fix issue with case check and `spack -m`Todd Gamblin1-1/+5
2017-08-01Refactor installed_dependents -> installed_relativesTodd Gamblin4-15/+34
2017-08-01Package.possible_dependencies() descends into virtuals.Todd Gamblin1-1/+10
2017-08-01Add --transitive option to `spack dependents`Todd Gamblin2-8/+18
2017-08-01spack dependents lists possible dependencies by default.Todd Gamblin1-25/+37
2017-08-01Remove last vestiges of "special" deptypes.Todd Gamblin4-36/+64
- Remove `special_types` dict in spec.py, as only 'all' is still used - Still allow 'all' to be used as a deptype - Simplify `canonical_deptype` function - Clean up args in spack graph - Add tests
2017-08-01Remove unused code.Todd Gamblin1-4/+0
2017-08-01Add --all argument to `spack dependents`Todd Gamblin1-6/+56
--all causes spack dependents to list all possible dependents for a package, rather than actual dependents for an installed spec.
2017-07-31Clarify docs on using a hash in a spec (#4908)Adam J. Stewart1-7/+36
2017-07-31Fix preference for X.Y version when mixed with X.Y.Z versions (#4922)scheibelp2-1/+14
For packages which contain a mix of versions with formats X.Y and X.Y.Z, if the user entered an X.Y version as a preference in packages.yaml, Spack would get confused and favor any version A.B.Z where X=A and Y=B. In the case where there is a mix of these version types, this commit updates preferences so Spack will favor an exact match.
2017-07-31Add --color=[always|never|auto] argument; fix color when piping (#3013)paulhopkins13-44/+103
* Disable spec colorization when redirecting stdout and add command line flag to re-enable * Add command line `--color` flag to control output colorization * Add options to `llnl.util.tty.color` to allow color to be auto/always/never * Add `Spec.cformat()` function to be used when `format()` should have auto-coloring
2017-07-26Improve version detection for URLs with dynamic after version (#4902)Adam J. Stewart2-1/+4
2017-07-25Add universal build_type variant to CMakePackage (#4797)Adam J. Stewart1-15/+8
* Add universal build_type variant to CMakePackage * Override build_type in some packages with different possible values * Remove reference to no longer existent debug variant * Update CBTF packages with new build_type variant * Keep note on build size of LLVM
2017-07-25fix config.guess patch for ppc64le (#4858)Gregory Lee1-15/+3
* fix config.guess patch for ppc64le * explicit patch for config.guess not required
2017-07-24Change Version formatting properties and functions to return Version objects ↵Adam J. Stewart3-21/+132
(#4834) * Change version.up_to() to return Version() object * Add unit tests for Version.up_to() * Fix packages that expected up_to() to return a string * Ensure that up_to() preserves separator characters * Use version indexing instead of up_to * Make all Version formatting properties return Version objects * Update docs * Tests need to test string representation
2017-07-22Make testing spack commands simpler (#4868)Todd Gamblin10-388/+296
Adds SpackCommand class allowing Spack commands to be easily in Python Example usage: from spack.main import SpackCommand info = SpackCommand('info') out, err = info('mpich') print(info.returncode) This allows easier testing of Spack commands. Also: * Simplify command tests * Simplify mocking in command tests. * Simplify module command test * Simplify python command test * Simplify uninstall command test * Simplify url command test * SpackCommand uses more compatible output redirection