Skip to content
Snippets Groups Projects
  1. Jan 25, 2020
    • Michael Kuhn's avatar
      sbang: Fix perl binary detection · 95ddd3d6
      Michael Kuhn authored
      The perl binary can also be called `perlX.Y.Z` if using a development
      build or simply using the versioned binary.
      
      We were also dropping all sbang arguments, since `exec $interpreter_v`
      was only using the first element of the `interpreter_v` array.
      95ddd3d6
  2. Jan 22, 2020
    • Scott Wittenburg's avatar
      pipelines: `spack ci` command with env-based workflow (#12854) · 8283d87f
      Scott Wittenburg authored
      Rework Spack's continuous integration workflow to be environment-based.
      
      - Add the `spack ci` command, which replaces the many scripts in `bin/`
      
      - `spack ci` decouples the CI workflow from the spack instance:
        - CI is defined in a spack environment
        - environment is in its own (single) git repository, separate from Spack
        - spack instance used to run the pipeline is up to the user
        - A new `gitlab-ci` section in environments allows users to configure how
          specs in the environment should be mapped to runners
        - Compilers can be bootstrapped in the new pipeline workflow
      
      - Add extensive documentation on pipelines (see `pipelines.rst` for further details)
      - Add extensive tests for pipeline code
      8283d87f
  3. Dec 31, 2019
  4. Oct 22, 2019
    • Omar Padron's avatar
      fetching: S3 upload and download (#11117) · fd58c98b
      Omar Padron authored
      This extends Spack functionality so that it can fetch sources and binaries from-, push sources and binaries to-, and index the contents of- mirrors hosted on an S3 bucket.
      
      High level to-do list:
      
      - [x] Extend mirrors configuration to add support for `file://`, and `s3://` URLs.
      - [x] Ensure all fetching, pushing, and indexing operations work for `file://` URLs.
      - [x] Implement S3 source fetching
      - [x] Implement S3 binary mirror indexing
      - [x] Implement S3 binary package fetching
      - [x] Implement S3 source pushing
      - [x] Implement S3 binary package pushing
      
      Important details:
      
      * refactor URL handling to handle S3 URLs and mirror URLs more gracefully.
        - updated parse() to accept already-parsed URL objects.  an equivalent object
          is returned with any extra s3-related attributes intact.  Objects created with
          urllib can also be passed, and the additional s3 handling logic will still be applied.
      
      * update mirror schema/parsing (mirror can have separate fetch/push URLs)
      * implement s3_fetch_strategy/several utility changes
      * provide more feature-complete S3 fetching
      * update buildcache create command to support S3
      
      * Move the core logic for reading data from S3 out of the s3 fetch strategy and into
        the s3 URL handler.  The s3 fetch strategy now calls into `read_from_url()` Since
        read_from_url can now handle S3 URLs, the S3 fetch strategy is redundant.  It's
        not clear whether the ideal design is to have S3 fetching functionality in a fetch
        strategy, directly implemented in read_from_url, or both.
      
      * expanded what can be passed to `spack buildcache` via the -d flag: In addition
        to a directory on the local filesystem, the name of a configured mirror can be
        passed, or a push URL can be passed directly.
      fd58c98b
  5. Sep 29, 2019
    • Todd Gamblin's avatar
      prefer Python 3 to Python 2 for running Spack · 97980a8f
      Todd Gamblin authored
      The Python landscape is going to be changing in 2020, and Python 2 will
      be end of life. Spack should *prefer* Python 3 to Python 2 by default,
      but we still need to run on systems that only have Python2 available.
      
      This is trickier than it sounds, as on some systems, the `python` command
      is `python2`; on others it's `python3`, and RHEL8 doesn't even have the
      `python` command.  Instead, it makes you choose `python3` or
      `python2`. You can thus no longer make a simple shebang to handle all the
      cases.
      
      This commit makes the `spack` script bilingual.  It is still valid
      Python, but its shebang is `#!/bin/sh`, and it has a tiny bit of shell
      code at the beginning to pick the right python and execute itself with
      what it finds.
      
      This has a lot of advantages.  I think this will help ensure that Spack
      works well in Python3 -- there are cases where we've missed things
      because Python2 is still the default `python` on most systems.  Also,
      with this change, you do not lose the ability to execute the `spack`
      script directly with a python interpreter.  This is useful for forcing
      your own version of python, running coverage tools, and running profiling
      tools.  i.e., these will not break with this change:
      
      ```console
      $ python2 $(which spack) <args>
      $ coverage run $(which spack) <args>
      $ pyinstrument $(which spack) <args>
      ```
      
      These would not work if we split `spack` into a python file and a shell
      script (see #11783).  So, this gives us the best of both worlds.  We get
      to control our interpreter *and* remain a mostly pure python executable.
      97980a8f
  6. Sep 14, 2019
  7. May 19, 2019
  8. Feb 21, 2019
  9. Jan 01, 2019
  10. Nov 07, 2018
    • Massimiliano Culpo's avatar
      bugfix: work around ruamel.yaml vendoring issues (#9725) · a474d83d
      Massimiliano Culpo authored
      - Delete references to ruamel.yaml at Spack start-up, if they are present
      
      - ruamel.yaml generates a .pth file when installed via pip that has the
        effect of always preferring the version of this package installed at
        site scope (effectively preventing us from vendoring it).
      
      - This mechanism triggers when implicitly importing the 'site' module
        when the python interpreter is started. In this PR we explicitly delete
        references to 'ruamel.yaml' and 'ruamel' in sys.modules, if any, after
        we set 'sys.path' to search from the directory where we store vendored
        packages. This ensures that the imports after those statements will be
        done from our vendored version.
      
      - See #9206 for further details
      a474d83d
  11. Oct 17, 2018
  12. Aug 20, 2018
  13. Jul 15, 2018
    • Andreas Baumbach's avatar
      clean up of spack clean (#8610) · 79b407f5
      Andreas Baumbach authored
      * update help of `clean --all` to include `-p`
      * remove old orphaned `.pyc` removal
      * restrict removal or orphaned pyc files to `lib/spack` and `var/spack`
      79b407f5
  14. Mar 24, 2018
  15. Jan 16, 2018
    • Massimiliano Culpo's avatar
      Vendor ordereddict for python2.6 only (#6931) · 1fb38c9e
      Massimiliano Culpo authored
      * Vendor ordereddict for python2.6 only
      
      This commit substitutes the custom module 'ordereddict_backport' with
      the more known 'ordereddict' and vendors it only for python 2.6. Other
      supported versions of python will use 'collections.OrderedDict'.
      
      * Use absolute imports also for python 2.6
      
      See PEP-328 for more information on the subject
      
      * Added provenance of vendored ordereddict
      Unverified
      1fb38c9e
  16. Nov 05, 2017
  17. Sep 07, 2017
  18. Aug 18, 2017
    • healther's avatar
      sbang support: add node-js and fix lua · d6d2dff3
      healther authored
      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).
      d6d2dff3
  19. Jun 25, 2017
  20. Jun 14, 2017
  21. May 08, 2017
    • Todd Gamblin's avatar
      rework spack help (#3033) · ff3b5d88
      Todd Gamblin authored
      - Full help is now only generated lazily, when needed.
        - Executing specific commands doesn't require loading all of them.
        - All commands are only loaded if we need them for help.
      
      - There is now short and long help:
        - short help (spack help) shows only basic spack options
        - long help (spack help -a) shows all spack options
        - Both divide help on commands into high-level sections
      
      - Commands now specify attributes from which help is auto-generated:
        - description: used in help to describe the command.
        - section: help section
        - level: short or long
      
      - Clean up command descriptions
      
      - Add a `spack docs` command to open full documentation
        in the browser.
      
      - move `spack doc` command to `spack pydoc` for clarity
      
      - Add a `spack --spec` command to show documentation on 
        the spec syntax.
      ff3b5d88
  22. May 03, 2017
  23. May 01, 2017
    • Todd Gamblin's avatar
      Allow user to specify profile sort column on the command line. (#4056) · 094d47bf
      Todd Gamblin authored
      - Add -P <STAT> argument so that caller can specify a sort column for
        cProfile. Can specify multiple columns with commas. e.g.:
            spack -P cumtime,module
      
      - Add --lines option to Spack spec to control number of profile lines
        displayed
      
      - Sort by time by default (because it works in all Python versions)
      
      - Show sort column options in command help.
      
      - Do a short profile run in the unit tests.
      094d47bf
  24. Mar 31, 2017
    • Todd Gamblin's avatar
      Spack works with Python 3 · a8bcc23f
      Todd Gamblin authored
      - Update version guard in spack script to allow python 3
      - Update min required version in the docs
      a8bcc23f
    • Todd Gamblin's avatar
      Convert Python 2 idioms to Python 2/3-compatible ones. · 1d1a14db
      Todd Gamblin authored
      - convert print, StringIO, except as, octals, izip
      - convert print statement to print function
      - convert StringIO to six.StringIO
        - remove usage of csv reader in Spec, in favor of simple regex
        - csv reader only does byte strings
      - convert 0755 octal literals to 0o755
      - convert `except Foo, e` to `except Foo as e`
      - fix a few places `str` is used.
        - may need to switch everything to str later.
      - convert iteritems usages to use six.iteritems
      - fix urllib and HTMLParser
      - port metaclasses to use six.with_metaclass
      - More octal literal conversions for Python 2/3
      - Fix a new octal literal.
      - Convert `basestring` to `six.string_types`
      - Convert xrange -> range
      - Fix various issues with encoding, iteritems, and Python3 semantics.
      - Convert contextlib.nested to explicitly nexted context managers.
      - Convert use of filter() to list comprehensions.
      - Replace reduce() with list comprehensions.
      -  Clean up composite: replace inspect.ismethod() with callable()
      - Python 3 doesn't have "method" objects; inspect.ismethod returns False.
      - Need to use callable in Composite to make it work.
      - Update colify to use future division.
      - Fix zip() usages that need to be lists.
      - Python3: Use line-buffered logging instead of unbuffered.
      - Python3 raises an error with unbuffered I/O
        - See https://bugs.python.org/issue17404
      1d1a14db
    • Todd Gamblin's avatar
      Update externals to work with Python 3 · 0331b08c
      Todd Gamblin authored
      - Update YAML version to support Python 3
      - Python 3 support for ordereddict backport
      - Exclude Python3 YAML from version tests.
      - Vendor six into Spack.
      - Make Python version-check tests work with Python 3
      - Add ability to add version check exceptions with '# nopyqver' line
        comments.
      0331b08c
  25. Mar 03, 2017
  26. Jan 26, 2017
  27. Dec 29, 2016
    • Todd Gamblin's avatar
      Fix issues related to the switchover to pytest. (#2685) · d6390c15
      Todd Gamblin authored
      - Remove stale reference to `import nose` from `bin/spack` script.
      - Add `py` to externals (missing dependency for `pytest`)
      d6390c15
    • Massimiliano Culpo's avatar
      unit tests: replace nose with pytest (#2502) · 7ea10e76
      Massimiliano Culpo authored
      * Porting: substitute nose with ytest
      
      This huge commit substitutes nose with pytest as a testing system. Things done here:
      
      * deleted external/nose as it is no longer used
      * moved mock resources in their own directory 'test/mock/'
      * ported two tests (cmd/find, build_system) to pytest native syntax as an example
      * build_environment, log: used monkeypatch instead of try/catch
      * moved global mocking of fetch_cache to an auto-used fixture
      * moved global mocking from test/__init__.py to conftest.py
      * made `spack test` a wrapper around pytest
      * run-unit-tests: avoid running python 2.6 tests under coverage to speed them up
      * use `pytest --cov` instead of coverage run to cut down testing time
      
      * mock/packages_test: moved mock yaml configuration to files instead of leaving it in the code as string literals
      
      * concretize.py: ported tests to native pytest, reverted multiprocessing in pytest.ini as it was creating the wrong report for coveralls
      
      * conftest.py, fixtures: added docstrings
      
      * concretize_preferences.py: uses fixtures instead of subclassing MockPackagesTest
      
      * directory_layout.py: uses fixtures instead of subclassing MockPackagesTest
      
      * install.py: uses fixtures instead of subclassing MockPackagesTest
      
      * optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
      
      optional_deps.py: uses fixtures instead of subclassing MockPackagesTest
      
      * packages.py: uses fixtures instead of subclassing MockPackagesTest
      
      * provider_index.py: uses fixtures instead of subclassing MockPackagesTest
      
      * spec_yaml.py: uses fixtures instead of subclassing MockPackagesTest
      
      * multimethod.py: uses fixtures instead of subclassing MockPackagesTest
      
      * install.py: now uses mock_archive_url
      
      * git_fetch.py: uses fixtures instead of subclassing MockPackagesTest
      
      * hg_fetch.py: uses fixtures instead of subclassing MockPackagesTest
      
      * svn_fetch.py, mirror.py: uses fixtures instead of subclassing MockPackagesTest
      repo.py: deleted
      
      * test_compiler_cmd.py: uses fixtures instead of subclassing MockPackagesTest
      
      * cmd/module.py, cmd/uninstall.py: uses fixtures instead of subclassing MockDatabase
      
      * database.py: uses fixtures instead of subclassing MockDatabase, removed mock/database
      
      * pytest: uncluttering fixture implementations
      
      * database: changing the scope to 'module'
      
      * config.py: uses fixtures instead of subclassing MockPackagesTest
      
      * spec_dag.py, spec_semantics.py: uses fixtures instead of subclassing MockPackagesTest
      
      * stage.py: uses fixtures instead of subclassing MockPackagesTest. Removed mock directory
      
      * pytest: added docstrings to all the fixtures
      
      * pytest: final cleanup
      
      * build_system_guess.py: fixed naming and docstrings as suggested by @scheibelp
      
      * spec_syntax.py: added expected failure on parsing multiple specs closes #1976
      
      * Add pytest and pytest-cov to Spack externals.
      
      * Make `spack flake8` ignore externals.
      
      * run-unit-tests runs spack test and not pytest.
      
      * Remove all the special stuff for `spack test`
      
      - Remove `conftest.py` magic and all the special case stuff in `bin/spack`
      
      - Spack commands can optionally take unknown arguments, if they want to
        handle them.
      
      - `spack test` is now a command like the others.
      
      - `spack test` now just delegates its arguments to `pytest`, but it does
        it by receiving unknown arguments and NOT taking an explicit
        help argument.
      
      * Fix error in fixtures.
      
      * Improve `spack test` command a bit.
      
      - Now supports an approximation of the old simple interface
      - Also supports full pytest options if you want them.
      
      * Use external coverage instead of pytest-cov
      
      * Make coverage use parallel-mode.
      
      * change __init__.py docs to include pytest
      7ea10e76
  28. Dec 13, 2016
  29. Dec 05, 2016
    • Todd Gamblin's avatar
      Use JSON for the database instead of YAML. (#2189) · 41b8f31b
      Todd Gamblin authored
      * Use JSON for the database instead of YAML.
      
      - JSON is much faster than YAML *and* can preserve ordered keys.
        - 170x+ faster than Python YAML when using unordered dicts
        - 55x faster than Python YAML (both using OrderedDicts)
        - 8x faster than C YAML (with OrderedDicts)
      
      - JSON is built into Python, unlike C YAML, so doesn't add a dependency.
      - Don't need human readability for the package database.
      - JSON requires no major changes to the code -- same object model as YAML.
      - add to_json, from_json methods to spec.
      
      * Add tests to ensure JSON and YAML don't need to be ordered in DB.
      
      * Write index.json first time it's not found instead of requiring reindex.
      
      * flake8 bug.
      41b8f31b
  30. Nov 16, 2016
  31. Oct 31, 2016
    • Todd Gamblin's avatar
      Bugfix: '::' only worked on top-level key in config. · 8f21332f
      Todd Gamblin authored
      - generalized and fixed to work with any key in YAML file
      - simplified schema writing, as well
      - add more unit tests for the config system
      - Rename test/yaml.py to test/spack_yaml.py
        - Add test/yaml.pyc to ignored pyc files.
      8f21332f
  32. Oct 13, 2016
  33. Oct 12, 2016
  34. Sep 28, 2016
Loading