summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2024-05-08Bump removal version in deprecation messages (#44064)Massimiliano Culpo3-6/+6
2024-05-07Remove dead environment creation code (#44065)Tamara Dahlgren1-8/+0
2024-05-07build(deps): bump pygments from 2.17.2 to 2.18.0 in /lib/spack/docs (#44044)dependabot[bot]1-1/+1
Bumps [pygments](https://github.com/pygments/pygments) from 2.17.2 to 2.18.0. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](https://github.com/pygments/pygments/compare/2.17.2...2.18.0) --- updated-dependencies: - dependency-name: pygments dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07Include concrete environments with `include_concrete` (#33768)Richarda Butler8-42/+1104
Add the ability to include any number of (potentially nested) concrete environments, e.g.: ```yaml spack: specs: [] concretizer: unify: true include_concrete: - /path/to/environment1 - /path/to/environment2 ``` or, from the CLI: ```console $ spack env create myenv $ spack -e myenv add python $ spack -e myenv concretize $ spack env create --include-concrete myenv included_env ``` The contents of included concrete environments' spack.lock files are included in the environment's lock file at creation time. Any changes to included concrete environments are only reflected after the environment is re-concretized from the re-concretized included environments. - [x] Concretize included envs - [x] Save concrete specs in memory by hash - [x] Add included envs to combined env's lock file - [x] Add test - [x] Update documentation Co-authored-by: Kayla Butler <<butler59@llnl.gov> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.co m> Co-authored-by: Todd Gamblin <tgamblin@llnl.gov> Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-05-07Update the tutorial command to point to releases/v0.22 (#44056)Massimiliano Culpo1-1/+1
2024-05-07Remove spurious ASP debug lines (#44051)Massimiliano Culpo1-0/+3
2024-05-07certs: fix interpolation and disallow relative paths (#44030)psakievich5-64/+60
2024-05-07Warn users of the future removal of platform=cray (#43980)Massimiliano Culpo1-0/+6
2024-05-07llnl.util.tty.color._force_color: init in global scope (#44036)Harmen Stoppels2-18/+27
Currently SPACK_COLOR=always is not respected in the build process on macOS, because the global `_force_color` is re-evaluated in global scope during module setup, where it is always `None`. So, move global init bits from main.py to the module itself.
2024-05-07Respect requests when filtering reused specs (#44042)Massimiliano Culpo2-1/+54
Some specs which were excluded from reuse, are currently added back to the solve when we traverse dependencies of other reusable specs. This fixes the issue by keeping track of what we can explicitly reuse.
2024-05-06python: always use a venv (#40773)Harmen Stoppels12-293/+257
This commit adds a layer of indirection to improve build isolation with and without external Python, as well as usability of environment views. It adds `python-venv` as a dependency to all packages that `extends("python")`, which has the following advantages: 1. Build isolation: only `PYTHONPATH` is considered in builds, not user / system packages 2. Stable install layout: fixes the problem on Debian, RHEL and Fedora where external / system python produces `bin/local` subdirs in Spack install prefixes. 3. Environment views are Python virtual environments (and if you add `py-pip` things like `pip list` work) Views work whether they're symlink, hardlink or copy type. This commit additionally makes `spec["python"].command` return `spec["python-venv"].command`. The rationale is that packages in repos we do not own do not pass the underlying python to the build system, which could still result in incorrectly computed install layouts. Other attributes like `libs`, `headers` should be on `python` anyways and need no change.
2024-05-06Remove Fedora 37 and 38, Ubuntu 18 from CI (#44006)Massimiliano Culpo6-45/+7
2024-05-06clingo bootstrap: remove 3.12 patch and concretizer workarounds (#44028)Harmen Stoppels1-4/+0
2024-05-06bootstrap: lazy bootstrapping of clingo and GnuPG (#44026)Harmen Stoppels4-4/+12
Currently bootstrapping from source fails because clingo requires gnupg requires clingo. This commit stops eager bootstrapping. We don't need `patchelf` nor `gnupg` generally. They're bootstrapped when needed.
2024-05-06External package detection for compilers (#43464)Greg Becker6-48/+202
This creates shared infrastructure for compiler packages to implement the detailed search capabilities from the `spack compiler find` command for the `spack external find` command. After this commit, `spack compiler find` can be replaced with `spack external find --tag compiler`, with the exception of mixed toolchains.
2024-05-06Update vendored archspec to v0.2.4 (#44005)Massimiliano Culpo8-17/+77
2024-05-06`spack env create <env>`: dir if dir-like (#44024)Harmen Stoppels3-44/+53
A named env cannot contain `.` and `/`. So when a user runs `spack env create ./here` do not error but treat it as `spack env create -d ./here`. Also fix help string of `spack env create`, which seems to have been copied from `activate` incorrectly.
2024-05-06build(deps): bump black from 24.4.0 to 24.4.2 in /lib/spack/docs (#43878)dependabot[bot]1-1/+1
Bumps [black](https://github.com/psf/black) from 24.4.0 to 24.4.2. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.0...24.4.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-04build(deps): bump mypy from 1.9.0 to 1.10.0 in /lib/spack/docs (#43834)dependabot[bot]1-1/+1
Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.10.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-03concretizer args: --fresh-roots == --reuse-deps (#43988)Harmen Stoppels2-2/+9
Since reuse is the default now, `--reuse-deps` can be confusing, as it technically does not imply roots are fresh. So add `--fresh-roots`, which is also easier to discover when running `spack concretize --fre<tab>`
2024-05-02Spec.satisfies: fix a bug with concrete spec from JSON (#43968)Massimiliano Culpo2-3/+25
Fix a bug triggered by missing a virtual on some transitive edge, in a subdag of a pure build dependency.
2024-05-02docs: re-enable google analytics (#43974)Todd Gamblin1-0/+12
We recently switched to using the new ReadTheDocs with "addons". That includes its own analytics, which is nice, but we also want to continue using our GA4 analytics. Adding GA4 is no longer supported by RTD, so we have to add it manually. - [x] re-add the gtag to all pages, manually Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-05-02libc: detect ARM flavor (#43959)jdomke1-3/+3
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2024-05-02Ignore external packages when pushing to buildcache automatically ↵Adrien Bernede1-0/+4
(--autopush) (#43930)
2024-05-02Windows: auto-add WGL/SDK as externals (#43752)John W. Parent5-4/+77
Adds a pre-concretization check for the Windows SDK and WGL (Windows GL) packages as non-buildable externals. This is a redo of https://github.com/spack/spack/pull/43459, but makes sure to modify the configuration scope outside of the bootstrap scope: whichever is highest-precedence in the user's environment at the time the concretization runs, which should either be an env scope or the ~ scope. Adds pytest fixture mocking the check for WGL and WSDK as if they were present.
2024-05-01Allow more control over which specs are reused (#42782)Massimiliano Culpo4-54/+357
This PR gives users finer control over which specs are reused during concretization. The value of the `concretizer:reuse` config option now can take an object with the following properties: - `roots`: true if reusing roots, false if reusing just dependencies - `exclude`: list of constraints used to select reusable specs - `include`: list of constraints used to select reusable specs - `from`: allows to select the sources of reused specs ### Examples #### Reuse only specs compiled with GCC ```yaml concretizer: reuse: roots: true include: - "%gcc" ``` #### `openmpi` must be used from externals, and it must be the only external used ```yaml concretizer: reuse: roots: true from: - type: local exclude: - "openmpi" - type: buildcache exclude: - "openmpi" - type: external include: - "openmpi" ```
2024-05-01containers: add ubuntu 24.04 (#43881)Wouter Deconinck2-0/+10
* containers: add ubuntu 24.04 * containers: use python3-boto3 pkg instead of pip install
2024-05-01build(deps): bump pytest from 8.1.1 to 8.2.0 in /lib/spack/docs (#43908)dependabot[bot]1-1/+1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30PackageStillNeededError: add pkg that needs spec to exception msg (#43845)Wouter Deconinck1-1/+6
* PackageStillNeededError: add pkg that needs spec to exception msg * PackageStillNeededError: f-string with short fmt and hash * PackageStillNeededError: split long string
2024-04-30hack: drop glibc and musl in old concretizer (#43914)Harmen Stoppels1-1/+9
The old concretizer creates a cyclic graph when expanding virtuals for `iconv`, which is a bug. This hack drops glibc and musl as possible providers for `iconv` in the old concretizer to work around it.
2024-04-29compiler.py: fix early return (#43898)Harmen Stoppels2-7/+18
2024-04-29Run audits on windowsGregory Becker2-5/+5
Add debug log for external detection tests. The debug log is used to print which test is being executed. Skip version audit on Windows where appropriate
2024-04-29Fix concretization when installing missing compilers (#43876)Massimiliano Culpo2-2/+29
Restore the previous behavior when config:install_missing_compilers is True. The libc of the missing compiler is inferred from the Python process.
2024-04-27gcc: generate spec file and fix external libc default paths after install ↵Harmen Stoppels6-32/+103
from cache (#43839) Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-04-26containers: Add Fedora 40, 39 (#43847)Jonathon Anderson2-2/+30
2024-04-26ASP-based solver: update os compatibility for macOS (#43862)Massimiliano Culpo1-0/+2
2024-04-26[intel-oneap-*] no redistribution (#43826)Robert Cohn1-2/+2
2024-04-26spack audit externals: allow selecting platforms and checking extra ↵Massimiliano Culpo3-2/+95
attributes (#43782)
2024-04-26ldflags=* are compiler flags, not linker flags (#43820)Harmen Stoppels2-6/+8
We run `extend spack_flags_list SPACK_LDFLAGS` for `$mode in ld|ccld`. That's problematic, cause `ccld` needs `-Wl,--flag` whereas `ld` needs `--flag` directly. Only `-L` and `-l` are common to compiler & linker. In all build systems `LDFLAGS` is for the compiler not the linker, cause any linker flag `-x` can be passed as a compiler flag `-Wl,-x`, and there are many compiler flags that affect the linker invocation, like `-fopenmp`, `-fuse-ld=`, `-fsanitize=` etc. So don't pass `LDFLAGS` to the linker directly. This way users can set `ldflags: -Wl,--allow-shlib-undefined` in compilers.yaml to work around an issue where the linker tries to resolve the `libcuda.so.1` stub lib which cannot be located by design in `cuda`.
2024-04-25build_environment.py: expand SPACK_MANAGED_DIRS with realpath (#43844)Harmen Stoppels2-16/+19
2024-04-24clang.py: detect flang-new (#43815)Harmen Stoppels1-4/+5
If a flang-new exists, which is rather unlikely, it probably means the user wants it as a fortran compiler.
2024-04-24Add new `redistribute()` directive (#20185)Peter Scheibel9-62/+302
Some packages can't be redistributed in source or binary form. We need an explicit way to say that in a package. This adds a `redistribute()` directive so that package authors can write, e.g.: ```python redistribute(source=False, binary=False) ``` You can also do this conditionally with `when=`, as with other directives, e.g.: ```python # 12.0 and higher are proprietary redistribute(source=False, binary=False, when="@12.0:") # can't redistribute when we depend on some proprietary dependency redistribute(source=False, binary=False, when="^proprietary-dependency") ``` To prevent Spack from adding either their sources or binaries to public mirrors and build caches. You can still unconditionally add things *if* you run either: * `spack mirror create --private` * `spack buildcache push --private` But the default behavior for build caches is not to include non-redistributable packages in either mirrors or build caches. We have previously done this manually for our public buildcache, but with this we can start maintaining redistributability directly in packages. Caveats: currently the default for `redistribute()` is `True` for both `source` and `binary`, and you can only set either of them to `False` via this directive. - [x] add `redistribute()` directive - [x] add `redistribute_source` and `redistribute_binary` class methods to `PackageBase` - [x] add `--private` option to `spack mirror` - [x] add `--private` option to `spack buildcache push` - [x] test exclusion of packages from source mirror (both as a root and as a dependency) - [x] test exclusion of packages from binary mirror (both as a root and as a dependency)
2024-04-24Revert "Windows: add win-sdk/wgl externals during bootstrapping (#43459)" ↵John W. Parent2-40/+0
(#43819) This reverts commit 9e2558bd563af31355d83471f628a5d02656cdac.
2024-04-24libc: from current python process (#43787)Harmen Stoppels6-139/+193
If there's no compiler we currently don't have any external libc for the solver. This commit adds a fallback on libc from the current Python process, which works if it is dynamically linked. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-04-23Refactor to improve `spec format` speed (#43712)Todd Gamblin12-274/+230
When looking at where we spend our time in solver setup, I noticed a fair bit of time is spent in `Spec.format()`, and `Spec.format()` is a pretty old, slow, convoluted method. This PR does a number of things: - [x] Consolidate most of what was being done manually with a character loop and several regexes into a single regex. - [x] Precompile regexes where we keep them - [x] Remove the `transform=` argument to `Spec.format()` which was only used in one place in the code (modules) to uppercase env var names, but added a lot of complexity - [x] Avoid escaping and colorizing specs unless necessary - [x] Refactor a lot of the colorization logic to avoid unnecessary object construction - [x] Add type hints and remove some spots in the code where we were using nonexistent arguments to `format()`. - [x] Add trivial cases to `__str__` in `VariantMap` and `VersionList` to avoid sorting - [x] Avoid calling `isinstance()` in the main loop of `Spec.format()` - [x] Don't bother constructing a `string` representation for the result of `_prev_version` as it is only used for comparisons. In my timings (on all the specs formatted in a solve of `hdf5`), this is over 2.67x faster than the original `format()`, and it seems to reduce setup time by around a second (for `hdf5`).
2024-04-23concretizer: update `reuse:` default to True (#41302)Greg Becker4-7/+15
2024-04-23Remove import distro from packages and docs (#43772)Harmen Stoppels2-19/+13
2024-04-23Do not detect a compiler without a C compiler (#43778)Massimiliano Culpo2-2/+52
2024-04-22repo.py: drop deleted packages from provider cache (#43779)Harmen Stoppels1-6/+10
The reverse provider lookup may have stale entries for deleted packages, which used to cause errors. It's hard to invalidate those cache entries, so this commit simply drops entries w/o invalidating the cache. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-04-22Adjust severity of irreversible operations (#43721)Kyle Knoepfel1-2/+2