Commit Graph

31139 Commits

Author SHA1 Message Date
Jordan Galby
ca77a3013f Print error when missing git (#40254)
Like a missing curl.
2023-10-03 16:53:50 +02:00
Harmen Stoppels
d3c0da48d9 Don't drop build deps on overwrite install (#40252)
If you `spack install x ^y` where `y` is a pure build dep of `x`, and
then uninstall `y`, and then `spack install --overwrite x ^y`, the build
fails because `y` is not re-installed.

Same can happen when you install a develop spec, run `spack gc`,
modify sources, and install again; develop specs rely on overwrite
install to work correctly.
2023-10-03 16:53:50 +02:00
Harmen Stoppels
26b8f4ffeb GHA: pin flake8 to 6.0.0 to avoid style change 2023-10-03 16:53:50 +02:00
Jordan Galby
9cb4e4534f Fix Spack freeze on install child process unexpected exit (#39015)
* Fix spack frozen on child process defunct

* Rename parent/child pipe to read/write to emphasize non-duplex mode
2023-10-03 16:53:50 +02:00
Jordan Galby
19fc944bcc Fix package.py error handling bug (#39017) 2023-10-03 16:53:50 +02:00
Harmen Stoppels
12cb071fe2 Fix broken semver regex (#39414) 2023-10-03 16:53:50 +02:00
Harmen Stoppels
0e905f5e64 Fix broken inode assertion (#39188) 2023-10-03 16:53:50 +02:00
Xavier Delaruelle
dd30f2dea3 modules: use curly braces to enclose value in Tcl modulefile (#38375)
Use curly braces instead of quotes to enclose value or text in Tcl
modulefile. Within curly braces Tcl special characters like [, ] or $
are treated verbatim whereas they are evaluated within quotes.

Curly braces is Tcl recommended way to enclose verbatim content [1].

Note: if curly braces charaters are used within content, they must be
balanced. This point has been checked against current repository and no
unbalanced curly braces has been spotted.

Fixes #24243

[1] https://wiki.tcl-lang.org/page/Tcl+Minimal+Escaping+Style
2023-10-03 16:53:50 +02:00
Harmen Stoppels
e27723d046 repo cache: use -inf default instead of 0 (#39214)
FastPackageChecker.modified_since should use a default number < 0

When the repo cache does not exist, Spack uses mtime 0. This causes the repo
cache not to be generated when the repo has mtime 0.

Some popular package managers such as spack use 0 mtime normalization for
reproducible tarballs. So when installing spack with spack from a buildcache, the
repo cache doesn't generate

Also add some typehints
2023-10-03 16:53:50 +02:00
Todd Gamblin
d7fcaef01e mypy: add more ignored modules to pyproject.toml (#38769)
`mypy` will check *all* imported packages, even optional dependencies outside your
project, and this can cause issues if you are targeting python versions *older* than the
one you're running in. `mypy` will report issues in the latest versions of dependencies
as errors even if installing on some older python would have installed an older version
of the dependency.

We saw this problem before with `numpy` in #34732. We've started seeing it with IPython
in #38704. This fixes the issue by exempting `IPython` and a number of other imports of
Spack's from `mypy` checking.
2023-10-03 16:53:50 +02:00
Massimiliano Culpo
f4cf4e468a Prevent "spack external find" to error out on wrong permissions (#38755)
fixes #38733
2023-10-03 16:53:50 +02:00
Harmen Stoppels
69fe0a5518 Fix multiple quadratic complexity issues in environments (#38771)
1. Fix O(n^2) iteration in `_get_overwrite_specs`
2. Early exit `get_by_hash` on full hash
3. Fix O(n^2) double lookup in `all_matching_specs` with hashes
4. Fix some legibility issues
2023-10-03 16:53:50 +02:00
Massimiliano Culpo
f8483aca0d Add CHANGELOG entry for v0.20.1 (#38836) 2023-10-03 16:53:50 +02:00
Massimiliano Culpo
6d5697cbe1 Set __version__ to v0.20.2.dev0 2023-10-03 16:53:50 +02:00
Harmen Stoppels
e8658d6493 Set version to v0.20.1 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
0a4bd29ce5 Change mirror urls on the backport PR 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
506b899676 Mark an unparse test xfail 2023-07-07 12:08:59 +02:00
Xavier Delaruelle
c2103b27f6 modules: ignore more Modules variables in from_sourcing_file (#38455)
Update list of excluded variables in `from_sourcing_file` function to
cover all variables specific to Environment Modules or Lmod. Add
specifically variables relative to the definition of `module()`, `ml()`
and `_module_raw()` Bash functions.

Fixes #13504
2023-07-07 12:08:59 +02:00
Xavier Delaruelle
1a2e845958 Add raw attribute to env.set command (#38465)
Update `env.set` command and underlying `SetEnv` object to add the `raw`
boolean attribute. `raw` is optional and set to False by default. When
set to True, value format is skipped for object when generating
environment modifications.

With this change it is now possible to define environment variable
whose value contains variable reference syntax (like `{foo}` or `{}`)
that should be set as-is.

Fixes #29578
2023-07-07 12:08:59 +02:00
Greg Becker
e5f270c8da show external status as [e] (#33792) 2023-07-07 12:08:59 +02:00
Gurkirat Singh
0fd224404a docs: add quotes around some values in a YAML example (#38412) 2023-07-07 12:08:59 +02:00
Xavier Delaruelle
215020f9bb modules: use depends-on to autoload module with Lmod on Tcl (#38347)
Update Tcl modulefile template to use the `depends-on` command to
autoload modules if Lmod is the current module tool.

Autoloading modules with `module load` command in Tcl modulefile does
not work well for Lmod at some extend. An attempt to unload then load
designated module is performed each time such command is encountered. It
may lead to a load storm that may not end correctly with large number of
module dependencies.

`depends-on` command should be used for Lmod instead of `module load`,
as it checks if module is already loaded, and does not attempt to reload
this module.

Lua modulefile template already uses `depends_on` command to autoload
dependencies. Thus it is already considered that to use Lmod with Spack,
it must support `depends_on` command (version 7.6+).

Environment Modules copes well with `module load` command to autoload
dependencies (version 3.2+). `depends-on` command is supported starting
version 5.1 (as an alias of `prereq-all` command) which was relased last
year.

This change introduces a test to determine if current module tool that
evaluates modulefile is Lmod. If so, autoload dependencies are defined
with `depends-on` command. Otherwise `module load` command is used.

Test is based on `LMOD_VERSION_MAJOR` environment variable, which is set
by Lmod starting version 5.1.

Fixes #36764
2023-07-07 12:08:59 +02:00
Xavier Delaruelle
b366cb3c90 modules: append trailing delimiter to MANPATH when set (#36678)
Update modulefile templates to append a trailing delimiter to MANPATH
environment variable, if the modulefile sets it.

With a trailing delimiter at ends of MANPATH's value, man will search
the system man pages after searching the specific paths set.

Using append-path/append_path to add this element, the module tool
ensures it is appended only once. When modulefile is unloaded, the
number of append attempt is decreased, thus the trailing delimiter is
removed only if this number equals 0.

Disclaimer: no path element should be appended to MANPATH by generated
modulefiles. It should always be prepended to ensure this variable's
value ends with the trailing delimiter.

Fixes #11355.
2023-07-07 12:08:59 +02:00
Peter Scheibel
e0bba8f4a3 pip is a pythonextension not a pythonpackage, and it turns out we werent doing our external surgery on things that inherited pythonextension (#38186) 2023-07-07 12:08:59 +02:00
Jonathon Anderson
60195d72c9 containerize: use an ENTRYPOINT script (#37769) 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
2008503a1f Fix compiler removal from command line (#38057)
* Improve lib/spack/spack/test/cmd/compiler.py

* Use "tmp_path" in the "mock_executable" fixture

* Return a pathlib.Path from mock_executable

* Fix mock_executable fixture on Windows

"mock_gcc" was very similar to mock_executable, so use the latter to reduce code duplication

* Remove wrong compiler cache, fix compiler removal

fixes #37996

_CACHE_CONFIG_FILES was both unneeded and wrong, if called
subsequently with different scopes.

Here we remove that cache, and we fix an issue with compiler
removal triggered by having the same compiler spec in multiple
scopes.
2023-07-07 12:08:59 +02:00
QuellynSnead
9df47aabdb libxcb/xcb-proto: Enable internal Python dependency (#37575)
In the past, Spack did not allow two different versions of the
same package within a DAG. That led to difficulties with packages
that still required Python 2 while other packages had already
switched to Python 3.

The libxcb and xcb-proto packages did not have Python 3 support
for a time. To get around this issue, Spack maintainers disabled
their dependency on an internal (i.e., Spack-provided) Python
(see #4145),forcing these packages to look for a system-provided
Python (see #7646).

This has worked for us all right, but with the arrival of our most
recent platform we seem to be missing the critical xcbgen Python
module on the system. Since most software has largely moved on to
Python 3 now, let's re-enable internal Spack dependencies for the
libxcb and xcb-proto packages.
2023-07-07 12:08:59 +02:00
Tiziano Müller
80e90b924a Bugfix: cray manifest parsing regression (#37909)
fa7719a changed syntax for specifying exact versions, which are
required for some compiler specs (including those read as part
of parsing a Cray manifest). This fixes that and also makes a
couple other improvements to manifest parsing.

* Instantiate compiler specs with exact versions (fixes #37893)
* fix slingshot network detection (CPE 22.10+ has libcxi.so
  in /usr/lib64)
* "spack external find": add arg to ignore default dir for cray
  manifests
2023-07-07 12:08:59 +02:00
Jonathon Anderson
c6ff664366 containers: don't install epel-release on Fedora (#37766) 2023-07-07 12:08:59 +02:00
Tamara Dahlgren
d27debd940 Bugfix/tests: add slash to test log message (#37874) 2023-07-07 12:08:59 +02:00
Tamara Dahlgren
c93b8bceb8 Bugfix/tests: write not append stand-alone test status (#37841) 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
f602c67606 Update RtD and Sphinx configuration (#38046) 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
3a082f0112 archspec: fix entry in the JSON file (#37793) 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
9fb25b7404 Memoize a few hot functions during module file generation (#37739) 2023-07-07 12:08:59 +02:00
Peter Scheibel
9924c92c40 Add explicit CMake .libs implementation that returns an empty list; same for .headers (#35816) 2023-07-07 12:08:59 +02:00
Massimiliano Culpo
16cb6ac1ed Simplify implementation of "get_compiler_config" (#37989) 2023-07-07 12:08:59 +02:00
Harmen Stoppels
5821746258 fix InternalConcretizerError msg (#37791) 2023-07-07 12:08:59 +02:00
Greg Becker
d860083b08 bugfix: env concretize after remove (#37877) 2023-07-07 12:08:59 +02:00
Harmen Stoppels
f2d3818d5c spack remove: fix traversal when user specs intersect (#37882)
drop unnecessary double loop over the matching user specs.
2023-07-07 12:08:59 +02:00
Harmen Stoppels
0052f330be Set version to v0.20.1-dev 2023-07-07 12:08:59 +02:00
Todd Gamblin
456db45c4a Update CHANGELOG.md for v0.20.0 2023-05-21 01:47:57 +02:00
Massimiliano Culpo
e493ab31c6 Set version to 0.20.0 2023-05-19 18:46:40 +02:00
Harmen Stoppels
e0f45b33e9 spack env create: generate a view when newly created env has concrete specs (#37799) 2023-05-19 18:46:40 +02:00
Massimiliano Culpo
bb61ecb9b9 lmod: allow core compiler to be specified with a version range (#37789)
Use CompilerSpec with satisfies instead of string equality tests

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-05-19 15:14:17 +02:00
Greg Becker
9694225b80 compiler specs: do not print '@=' when clear from context (#37787)
Ensure that spack compiler add/find/list and lists of concrete specs
print the compiler effectively as {compiler.name}{@compiler.version}.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-05-19 15:14:17 +02:00
Peter Scheibel
3b15e7bf41 Tk/Tcl packages: speed up file search (#35902) 2023-05-18 12:36:08 +02:00
Peter Scheibel
ac5f0cc340 Bugfix: allow preferred new versions from externals (#37747) 2023-05-18 12:36:08 +02:00
Harmen Stoppels
f67840511a lmod: fix build, bump patch version (#37744) 2023-05-18 12:36:08 +02:00
Massimiliano Culpo
bd9cfa3a47 Limit deepcopy to just the initial "all" section (#37718)
Modifications:
- [x] Limit the scope of the deepcopy when initializing module file writers
2023-05-18 12:36:08 +02:00
Scott Wittenburg
96c262b13e gitlab ci: no copy-only pipelines w/ deprecated config (#37720)
Make it clear that copy-only pipelines are not supported while still
using the deprecated ci config format. Also ensure that the deprecated
stack does not fail on spack pipelines for tags.
2023-05-18 12:36:08 +02:00