Commit graph

169 commits

Author SHA1 Message Date
Todd Gamblin
d45674c1cb
Spack can Use RHEL8's platform-python if nothing else is available. (#23857)
This adds RHEL8's `/usr/libexec/platform-python` to Spack's list of preferred
pythons. It will only be used if no other `python` is available in the `PATH`.

We have been testing with this python for a while now, and it seems to do all
that we need. If Spack one day isn't able to work with it, we'll take it out,
but for now it is useful to allow Spack to be used on RHEL8 without a dedicated
`python` installation.
2021-05-22 15:35:07 -07:00
Massimiliano Culpo
9e30e669d2
build tests: put an upper bound on the version of GCC being used (#23630) 2021-05-14 07:51:03 +00:00
dependabot[bot]
725bcd1e80
build(deps): bump actions/cache from 2.1.4 to 2.1.5 (#23584)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.4 to 2.1.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.4...v2.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 11:51:30 +02:00
Massimiliano Culpo
46088aa5da
qa: install clingo-cffi from pip (#23163)
Clingo has been released on PyPI, so there
are no more concerns on our CI depending
on pypy.test for installing the wheel.

Apparently we have parts of Spack which
are not compatible with kcov > 3.4
2021-04-22 09:35:17 +02:00
Massimiliano Culpo
06cd29ad58
QA: don't run build tests on each commit (#22430)
This applies the same rules on push to develop
that we use for PRs
2021-03-20 07:17:47 -07:00
Massimiliano Culpo
03e10b3cde
QA: reduce number of unit tests for jobs not in the matrix (#22426)
* QA: reduce number of unit tests for jobs not in the matrix

* Fixup for CentOS6 dependencies

* Put correct conditions back in place

* Add dependency on changes
2021-03-20 07:16:52 -07:00
Massimiliano Culpo
0209d15ffd
CI: treat push to develop in the same way as PRs (#22421) 2021-03-19 15:08:32 -07:00
Massimiliano Culpo
629f94b4e1
CI: drastically reduce the number of tests for package only PRs (#22410)
PRs that change only package recipes will only run tests under "package_sanity.py" and without coverage. This should result in a huge drop the cpu-time spent in CI for most PRs.
2021-03-19 11:04:53 -07:00
Massimiliano Culpo
2aab415f3d
The action to detect changes needs a repository to be checked out on push event (#22324) 2021-03-16 17:27:41 +00:00
Massimiliano Culpo
b304b4bdb0
Speed-up CI by reorganizing tests (#22247)
* unit tests: mark slow tests as "maybeslow"

This commit also removes the "network" marker and
marks every "network" test as "maybeslow". Tests
marked as db are maintained, but they're not slow
anymore.

* GA: require style tests to pass before running unit-tests

* GA: make MacOS unit tests fail fast

* GA: move all unit tests into the same workflow, run style tests as a prerequisite

All the unit tests have been moved into the same workflow so that a single
run of the dorny/paths-filter action can be used to ask for coverage based
on the files that have been changed in a PR. The basic idea is that for PRs
that introduce only changes to packages coverage is not necessary, this
resulting in a faster execution of the tests.

Also, for package only PRs slow unit tests are skipped.

Finally, MacOS and linux unit tests are now conditional on style tests passing
meaning that e.g. we won't waste a MacOS worker if we know that the PR has
flake8 issues.

* Addressed review comments

* Skipping slow tests on MacOS for package only recipes

* QA: make tests on changes correct before merging
2021-03-16 08:16:31 -07:00
Massimiliano Culpo
10e9e142b7
Bootstrap clingo from sources (#21446)
* Allow the bootstrapping of clingo from sources

Allow python builds with system python as external
for MacOS

* Ensure consistent configuration when bootstrapping clingo

This commit uses context managers to ensure we can
bootstrap clingo using a consistent configuration
regardless of the use case being managed.

* Github actions: test clingo with bootstrapping from sources

* Add command to inspect and clean the bootstrap store

 Prevent users to set the install tree root to the bootstrap store

* clingo: documented how to bootstrap from sources

Co-authored-by: Gregory Becker <becker33@llnl.gov>
2021-03-03 09:37:46 -08:00
Massimiliano Culpo
29201814cc
Run clingo-cffi tests in a container (#21913)
There clingo-cffi job has two issues to be solved:

1. It uses the default concretizer
2. It requires a package from https://test.pypi.org/simple/

The former can be fixed by setting the SPACK_TEST_SOLVER
environment variable to "clingo".

The latter though requires clingo-cffi to be pushed to a
more stable package index (since https://test.pypi.org/simple/
is meant as a scratch version of PyPI that can be wiped at
any time).

For the time being run the tests in a container. Switch back to
PyPI whenever a new official version of clingo will be released.
2021-02-24 12:33:14 -08:00
Josh Essman
93ed1a410c
Updates to support clingo-cffi (#20657)
* Support clingo when used with cffi

Clingo recently merged in a new Python module option based on cffi.

Compatibility with this module requires a few changes to spack - it does not automatically convert strings/ints/etc to Symbol and clingo.Symbol.string throws on failure.

manually convert str/int to clingo.Symbol types
catch stringify exceptions
add job for clingo-cffi to Spack CI
switch to potassco-vendored wheel for clingo-cffi CI
on_unsat argument when cffi
2021-02-23 23:46:37 +00:00
Chuck Atkins
2870cc4c92
Add RHEL8 Universal Base Image with platform-python to CI unit tests (#21655) 2021-02-16 13:49:05 -05:00
dependabot[bot]
652fef2c76
build(deps): bump actions/cache from v2 to v2.1.4 (#21529)
Bumps [actions/cache](https://github.com/actions/cache) from v2 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...26968a09c0ea4f3e233fdddbafd1166051a095f6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:57:45 +01:00
Adam J. Stewart
d14a6dc1f7
py-mypy: add v0.800 (#21386) 2021-02-04 10:00:03 -06:00
Massimiliano Culpo
3ae4a5d3cf qa: use dependabot to update Github Actions 2021-01-06 00:00:33 -08:00
Todd Gamblin
a8ccb8e116 copyrights: update all files with license headers for 2021
- [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files
- [x] update all licensed files to say 2013-2021 using
      `spack license update-copyright-year`
- [x] appease mypy with some additions to package.py that needed
      for oneapi.py
2021-01-02 12:12:00 -08:00
Tom Scogland
857749a9ba
add mypy to style checks; rename spack flake8 to spack style (#20384)
I lost my mind a bit after getting the completion stuff working and
decided to get Mypy working for spack as well. This adds a 
`.mypy.ini` that checks all of the spack and llnl modules, though
not yet packages, and fixes all of the identified missing types and
type issues for the spack library.

In addition to these changes, this includes:

* rename `spack flake8` to `spack style`

Aliases flake8 to style, and just runs flake8 as before, but with
a warning.  The style command runs both `flake8` and `mypy`,
in sequence. Added --no-<tool> options to turn off one or the
other, they are on by default.  Fixed two issues caught by the tools.

* stub typing module for python2.x

We don't support typing in Spack for python 2.x. To allow 2.x to
support `import typing` and `from typing import ...` without a
try/except dance to support old versions, this adds a stub module
*just* for python 2.x.  Doing it this way means we can only reliably
use all type hints in python3.7+, and mypi.ini has been updated to
reflect that.

* add non-default black check to spack style

This is a first step to requiring black.  It doesn't enforce it by
default, but it will check it if requested.  Currently enforcing the
line length of 79 since that's what flake8 requires, but it's a bit odd
for a black formatted project to be quite that narrow.  All settings are
in the style command since spack has no pyproject.toml and I don't
want to add one until more discussion happens. Also re-format
`style.py` since it no longer passed the black style check
with the new length.

* use style check in github action

Update the style and docs action to use `spack style`, adding in mypy
and black to the action even if it isn't running black right now.
2020-12-22 21:39:10 -08:00
Greg Becker
77b2e578ec
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.

Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.

This handles the following trickier aspects of testing with direct
support in Spack's package API:

- [x] Caching source or intermediate build files at build time for
      use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
      packages).

See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.

Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 02:39:02 -08:00
Massimiliano Culpo
0a56b7cfd6 Github actions: add CI for ASP based solver 2020-11-17 10:04:13 -08:00
Peter Scheibel
ca3b912703
run unit tests on 3.8 only for Mac OS vs. both 3.8 and 3.9 (#19889) 2020-11-12 13:22:41 -08:00
Peter Scheibel
bb42470211
macos: update build process to use spawn instead of fork (#18205)
Spack creates a separate process to do package installation. Different
operating systems and Python versions use different methods to create
it but up until Python 3.8 both Linux and Mac OS used "fork" (which
duplicates process memory, file descriptor table, etc.).

Python >= 3.8 on Mac OS prefers creating an entirely new process
(referred to as the "spawn" start method) because "fork" was found to
cause issues (in other words "spawn" is the default start method used
by multiprocessing.Process). Spack was dependent on the particular
behavior of fork to replicate process memory and transmit file
descriptors.

This PR refactors the Spack internals to support starting a child
process with the "spawn" method. To achieve this, it makes the
following changes:

- ensure that the package repository and other global state are
  transmitted to the child process
- ensure that file descriptors are transmitted to the child process in
  a way that works with multiprocessing and spawn
- make all the state needed for the build process and tests picklable
  (package, stage, etc.)
- move a number of locally-defined functions into global scope so that
  they can be pickled
- rework tests where needed to avoid using local functions

This PR also reworks sbang tests to work on macOS, where temporary
directories are deeper than the Linux sbang limit. We make the limit
platform-dependent (macOS supports 512-character shebangs)

See: #14102
2020-11-12 12:26:23 -08:00
Todd Gamblin
560beb098e
csh: don't require SPACK_ROOT for sourcing setup-env.csh (#18225)
Don't require SPACK_ROOT for sourcing setup-env.csh and make output more consistent
2020-10-23 18:54:34 -07:00
Adam J. Stewart
372ac4a073
Add testing for Python 3.9 (#19261) 2020-10-11 21:16:00 -07:00
Adam J. Stewart
cc136c27a9
Fix failing mpich build tests (#19259)
By default Spack uses the latest (highest version) GCC 
compiler available, which might change across updates
of the Github CI environment.

Since a C compiler is always installed and `mpich~fortran`
will result in faster build times, avoid building the FORTRAN
interface as part of the test.
2020-10-11 20:49:59 +02:00
Adam J. Stewart
d183d16abb
macOS CI: replace jupyter with jupyterlab (#19029) 2020-09-28 17:43:56 -07:00
Adam J. Stewart
443407cda5
Add new RubyPackage build system base class (#18199)
* Add new RubyPackage build system base class

* Ruby: add spack external find support

* Add build tests for RubyPackage
2020-09-02 16:26:36 -07:00
Rui Xue
d9b945f663
Mac OS: support Python >= 3.8 by using fork-based multiprocessing (#18124)
As detailed in https://bugs.python.org/issue33725, starting new
processes with 'fork' on Mac OS is not guaranteed to work in general.
As of Python 3.8 the default process spawning mechanism was changed
to avoid this issue.

Spack depends on the fork-based method to preserve file descriptors
transparently, to preserve global state, and to avoid pickling some
objects. An effort is underway to remove dependence on fork-based
process spawning (see #18205). In the meantime, this allows Spack to
run with Python 3.8 on Mac OS by explicitly choosing to use 'fork'.

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-09-02 00:15:39 -07:00
Massimiliano Culpo
b1133fab22 MacOS nightly builds: use Python 3.7 in CI
Nightly builds with MacOS started failing again
due to an upgrade of the default virtual environment
that now uses Python 3.8

This makes us hit #14102 and every build fails. This
commit should be reverted along with the fix to #14102.
2020-08-03 17:23:10 -07:00
Massimiliano Culpo
c65cde4cf8
Avoid update and upgrades to brew (#17815)
Ci is currently failing on brew update with the error:
```
Error: Cannot install bazelisk because conflicting formulae are installed.
  bazel: because Bazelisk replaces the bazel binary

Please `brew unlink bazel` before continuing.

Unlinking removes a formula's symlinks from /usr/local. You can
link the formula again after the install finishes. You can --force this
install, but the build may fail or cause obscure side effects in the
resulting software.
```
Avoiding:
```
$ brew update
$ brew upgrade
```
solves the issue by preventing the risk of conflicting formulae
2020-08-01 07:45:39 +02:00
Massimiliano Culpo
9dbad500bc
Move Python 2.6 unit tests to Github Actions (#17279)
* Run Python2.6 unit tests on Github Actions
* Skip url tests on Python 2.6 to reduce waiting times
* Skip foreground background tests on Python 2.6 to reduce waiting times
* Removed references to Travis in the documentation
* Deleted install_patchelf.sh (can be installed from repo on CentOS 6)
2020-07-31 15:01:12 -07:00
Massimiliano Culpo
3e1661a183 Use "fetch-depth: 0" to retrieve all history from remote 2020-07-29 11:23:34 -07:00
Massimiliano Culpo
c4f29c6384 Simplified YAML files for Github Actions workflows
Updated actions where needed
2020-07-29 11:23:34 -07:00
Massimiliano Culpo
1f7f076189 Group tests with similar duration together
Style and documentation tests take just a few minutes
to run. Since in Github actions one can't restart a single
job but needs to restart an entire workflow, here we group
tests with similar duration together.
2020-07-29 11:23:34 -07:00
Massimiliano Culpo
ab32799b52
Fix MacOS build tests (#17542)
* MacOS build tests

- Run on PR that modify the YAML file of the workflow
- Don't clone Spack, since we are in the Spack repo now

* Try to add opengl to configuration to build jupyter

* fixup
2020-07-20 17:25:42 -07:00
Todd Gamblin
11088df402 Remove references to master from CI
- [x] remove master from github actions
- [x] remove master from .travis.yml
- [x] make `develop` the default branch for `spack ci`
2020-07-06 11:39:19 -07:00
Massimiliano Culpo
a5eabfad91
Moved flake8, shell and documentation tests to Github Action (#17328)
* Move flake8 tests on Github Actions

* Move shell test to Github Actions

* Moved documentation build to Github Action

* Don't run coverage on Python 2.6

Since we get connection errors consistently on Travis
when trying to upload coverage results for Python 2.6,
avoid computing coverage entirely to speed-up tests.
2020-07-01 11:58:53 -05:00
Greg Becker
4433e4de2d
Use apple-clang for MacOS nightly tests (#17320) 2020-07-01 08:21:08 +02:00
Greg Becker
cec55577d4
run github workflows on release branches (#17317) 2020-06-30 18:10:10 -05:00
Massimiliano Culpo
239b709f97
Added unit tests to Github Actions (#16610)
* Added unit tests to Github Actions

* Set user e-mail and name for git tests to succeed

* Simplify setup.sh logic

* Replicate Travis script on Github Actions

* Update flags since '.' is not allowed

* Added badge, simplified workflow

* Remove pinning of coverage

* Remove unit tests run on Github Actions from Travis
2020-06-23 08:24:02 -05:00
Massimiliano Culpo
5fc88a7c65
Skip failing test on MacOS (#17072)
* Skip failing test on MacOS

* Update setup-python action and unpin coverage
2020-06-15 13:24:56 -05:00
Massimiliano Culpo
8c12030498 Fix MacOS tests on develop
The -u option allows to update the current head,
so tests won't fail if we are on develop
2020-05-09 17:41:57 -07:00
Axel Huebl
29105da445 macOS nightly: +1hr py-jupyter
check if failures ares actually a real timeout or an error that
just causes a hang.
2020-05-09 17:41:10 -07:00
Axel Huebl
2b234b7a66 macOS nightly: two cores
All GitHub actions provide two cores. Just make sure this does not
get oversubscribed with potentially visible additional physical
cores.
2020-05-09 17:41:10 -07:00
Massimiliano Culpo
05203ec3fb
Add unit test on MacOS using Github Actions (#14220)
- Remove macos tests from travis
- Add macos tests in github actions.
2020-05-09 13:35:14 -07:00
Axel Huebl
bf203383bd
macOS Package Builds (nightly) (#16345)
Add nightly builds for popular and commonly used packages on
macOS that should improve the onramp user experience if
working well.
2020-05-06 11:51:29 -07:00
Adam J. Stewart
93e22426a6
Don't run linux build tests for doc PRs (#15895) 2020-04-07 09:09:08 +02:00
Adam J. Stewart
34bce8f4a2
Simplify Build Error template (#15864) 2020-04-06 19:28:13 -05:00
Adam J. Stewart
75a2f8046a
Add commands to facilitate Spack/Python/OS reporting (#15834)
* Add --version arg to spack python command
* Add `spack debug report` command
2020-04-02 23:12:03 -07:00
Massimiliano Culpo
a22d52a67d
Minor updates to CI configuration (#15458)
* Check on Python versions uses action/checkout@v2
* Update the apt cache before installing system packages
2020-03-12 08:19:42 +01:00
Massimiliano Culpo
7e13c9a6a0 Remove "triage" label from feature request 2020-02-27 16:34:24 -08:00
Massimiliano Culpo
2fbc774c8b Use checkout v2 to avoid issues on retriggering 2020-02-27 16:34:24 -08:00
Massimiliano Culpo
89f4ce964b Improved the feature request template 2020-02-27 16:34:24 -08:00
Massimiliano Culpo
b6531a760b Improved the build error template 2020-02-27 16:34:24 -08:00
Massimiliano Culpo
d36100e429 Improved the bug report template 2020-02-27 16:34:24 -08:00
Todd Gamblin
9192f046d2 tests: rename checks in github actions
I usually want to look at the Travis CI output, but I currently have to
scroll down to see it. This renames checks to be a bit shorter and more
consistent with Travis's naming, and also so that actions appear lower
than travis and codecov in the list of checks.
2019-12-31 17:59:59 -08:00
Todd Gamblin
4af6303086
copyright: update copyright dates for 2020 (#14328) 2019-12-30 22:36:56 -08:00
Massimiliano Culpo
2aa8132afd Migrate build tests from Travis to Github Actions (#13967)
This PR moves build smoke tests from TravisCI and migrates them to Github Actions. The result is that build tests are performed in parallel with unit tests and they don't hog additional resources on Travis. The workflow will not run if a PR only changes packages in the built-in repository, but will always run on pushes to develop or master.

* Removed build tests from Travis and passed them to Github Actions
* Store ~/.ccache in Github Actions cache
* Add filters on paths and make sure this workflow don't run
* Use paths-ignore and exclude only files in the built-in repo
* Added a badge to README.md
2019-12-25 00:06:48 -08:00
Massimiliano Culpo
d333e14721 tests: check min required python version with vermin (#14289)
This commit removes the `python_version.py` unit test module
and the vendored dependencies `pyqver2.py` and `pyqver3.py`.
It substitutes them with an equivalent check done using
`vermin` that is run as a separate workflow via Github Actions.

This allows us to delete 2 vendored dependencies that are unmaintained
and substitutes them with a maintained tool.

Also, updates the list of vendored dependencies.
2019-12-24 09:28:33 -08:00
Peter Scheibel
a791234676 Revert "add maintainer review action to main.workflow" (#12316)
This reverts commit 54e3bc31f9.
2019-08-07 17:23:47 -07:00
Todd Gamblin
54e3bc31f9
add maintainer review action to main.workflow 2019-08-04 10:14:44 -07:00
Todd Gamblin
3179d98e12
actions: add maintainers as PR reviewers for their packages (#12269)
Use `spack pkg changed` and `spack maintainers` to figure out which
packages changed and who their maintainers are in a PR.

Add any maintainers to the PR as reviewers.
2019-08-03 21:48:19 -07:00
Todd Gamblin
9c37a4c948 meta: move CODE_OF_CONDUCT.md and CONTRIBUTING.md to .github
- Trying to reduce the number of top-level files in Spack.

- CODE_OF_CONDUCT.md can be referenced from the README.

- CONTRIBUTING.md is only used to display a message on pull requests, and
  it still does that when in .github.
2019-06-30 23:08:33 -07:00
Peter Scheibel
d8746d596e
bug report template: suggest --stacktrace instead of -s (#10548)
1137b18 removed the -s option from spack such that to see a stack
trace you must pass the --stacktrace option. The bug report templates
were not updated accordingly.
2019-02-07 21:06:57 -06:00
Massimiliano Culpo
e057500009
Added labels in github issue templates (#10128) 2018-12-19 09:56:26 +01:00
Andreas Baumbach
df172001cc fix numbering in build error template (#9030)
The original numbering was not incorrect markdown but this is easier to read.
2018-08-21 12:37:24 -04:00
Massimiliano Culpo
2cd3e3fa76 Introduce templates for specific issue types (#8842)
This replaces the single github issue-reporting template with templates for the
following types of issues:

* Build issues
* Spack command errors
* Feature request

Each template includes suggestions which are generally useful for the type of
issue encountered.
2018-08-20 15:24:42 -04:00
Todd Gamblin
6afe309fdf refactor: move issue_template.md to .github directory 2018-06-25 09:03:32 -07:00