Compare commits
5 Commits
bugfix/env
...
v0.19.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bb8b4f9979 | ||
![]() |
fc7a16e77e | ||
![]() |
e633e57297 | ||
![]() |
7b74fab12f | ||
![]() |
005c7cd353 |
@@ -1,5 +1,3 @@
|
|||||||
# .git-blame-ignore-revs
|
# .git-blame-ignore-revs
|
||||||
# Formatted entire codebase with black 23
|
# Formatted entire codebase with black
|
||||||
603569e321013a1a63a637813c94c2834d0a0023
|
|
||||||
# Formatted entire codebase with black 22
|
|
||||||
f52f6e99dbf1131886a80112b8c79dfc414afb7c
|
f52f6e99dbf1131886a80112b8c79dfc414afb7c
|
||||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,4 +1,3 @@
|
|||||||
*.py diff=python
|
*.py diff=python
|
||||||
*.lp linguist-language=Prolog
|
*.lp linguist-language=Prolog
|
||||||
lib/spack/external/* linguist-vendored
|
lib/spack/external/* linguist-vendored
|
||||||
*.bat text eol=crlf
|
|
6
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
6
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: "\U0001F38A Feature request"
|
name: "\U0001F38A Feature request"
|
||||||
description: Suggest adding a feature that is not yet in Spack
|
description: Suggest adding a feature that is not yet in Spack
|
||||||
labels: [feature]
|
labels: [feature]
|
||||||
body:
|
body:
|
||||||
@@ -29,11 +29,13 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: General information
|
label: General information
|
||||||
options:
|
options:
|
||||||
|
- label: I have run `spack --version` and reported the version of Spack
|
||||||
|
required: true
|
||||||
- label: I have searched the issues of this repo and believe this is not a duplicate
|
- label: I have searched the issues of this repo and believe this is not a duplicate
|
||||||
required: true
|
required: true
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on [our Slack](https://slack.spack.io/) first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on [our Slack](https://slack.spack.io/) first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.
|
||||||
|
|
||||||
Other than that, thanks for taking the time to contribute to Spack!
|
Other than that, thanks for taking the time to contribute to Spack!
|
||||||
|
4
.github/workflows/audit.yaml
vendored
4
.github/workflows/audit.yaml
vendored
@@ -19,8 +19,8 @@ jobs:
|
|||||||
package-audits:
|
package-audits:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{inputs.python_version}}
|
python-version: ${{inputs.python_version}}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
|
24
.github/workflows/bootstrap.yml
vendored
24
.github/workflows/bootstrap.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
make patch unzip which xz python3 python3-devel tree \
|
make patch unzip which xz python3 python3-devel tree \
|
||||||
cmake bison bison-devel libstdc++-static
|
cmake bison bison-devel libstdc++-static
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup non-root user
|
- name: Setup non-root user
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
make patch unzip xz-utils python3 python3-dev tree \
|
make patch unzip xz-utils python3 python3-dev tree \
|
||||||
cmake bison
|
cmake bison
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup non-root user
|
- name: Setup non-root user
|
||||||
@@ -99,7 +99,7 @@ jobs:
|
|||||||
bzip2 curl file g++ gcc gfortran git gnupg2 gzip \
|
bzip2 curl file g++ gcc gfortran git gnupg2 gzip \
|
||||||
make patch unzip xz-utils python3 python3-dev tree
|
make patch unzip xz-utils python3 python3-dev tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup non-root user
|
- name: Setup non-root user
|
||||||
@@ -133,7 +133,7 @@ jobs:
|
|||||||
make patch unzip which xz python3 python3-devel tree \
|
make patch unzip which xz python3 python3-devel tree \
|
||||||
cmake bison
|
cmake bison
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup repo
|
- name: Setup repo
|
||||||
@@ -158,7 +158,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
brew install cmake bison@2.7 tree
|
brew install cmake bison@2.7 tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
@@ -179,7 +179,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
brew install tree
|
brew install tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
@@ -204,7 +204,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup repo
|
- name: Setup repo
|
||||||
@@ -214,7 +214,7 @@ jobs:
|
|||||||
- name: Bootstrap clingo
|
- name: Bootstrap clingo
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
for ver in '3.6' '3.7' '3.8' '3.9' '3.10' ; do
|
for ver in '2.7' '3.6' '3.7' '3.8' '3.9' '3.10' ; do
|
||||||
not_found=1
|
not_found=1
|
||||||
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
ver_dir="$(find $RUNNER_TOOL_CACHE/Python -wholename "*/${ver}.*/*/bin" | grep . || true)"
|
||||||
echo "Testing $ver_dir"
|
echo "Testing $ver_dir"
|
||||||
@@ -247,7 +247,7 @@ jobs:
|
|||||||
bzip2 curl file g++ gcc patchelf gfortran git gzip \
|
bzip2 curl file g++ gcc patchelf gfortran git gzip \
|
||||||
make patch unzip xz-utils python3 python3-dev tree
|
make patch unzip xz-utils python3 python3-dev tree
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup non-root user
|
- name: Setup non-root user
|
||||||
@@ -283,7 +283,7 @@ jobs:
|
|||||||
make patch unzip xz-utils python3 python3-dev tree \
|
make patch unzip xz-utils python3 python3-dev tree \
|
||||||
gawk
|
gawk
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup non-root user
|
- name: Setup non-root user
|
||||||
@@ -316,7 +316,7 @@ jobs:
|
|||||||
# Remove GnuPG since we want to bootstrap it
|
# Remove GnuPG since we want to bootstrap it
|
||||||
sudo rm -rf /usr/local/bin/gpg
|
sudo rm -rf /usr/local/bin/gpg
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
- name: Bootstrap GnuPG
|
- name: Bootstrap GnuPG
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
@@ -333,7 +333,7 @@ jobs:
|
|||||||
# Remove GnuPG since we want to bootstrap it
|
# Remove GnuPG since we want to bootstrap it
|
||||||
sudo rm -rf /usr/local/bin/gpg
|
sudo rm -rf /usr/local/bin/gpg
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
- name: Bootstrap GnuPG
|
- name: Bootstrap GnuPG
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
|
8
.github/workflows/build-containers.yml
vendored
8
.github/workflows/build-containers.yml
vendored
@@ -50,7 +50,7 @@ jobs:
|
|||||||
if: github.repository == 'spack/spack'
|
if: github.repository == 'spack/spack'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
|
|
||||||
- name: Set Container Tag Normal (Nightly)
|
- name: Set Container Tag Normal (Nightly)
|
||||||
run: |
|
run: |
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload Dockerfile
|
- name: Upload Dockerfile
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
with:
|
with:
|
||||||
name: dockerfiles
|
name: dockerfiles
|
||||||
path: dockerfiles
|
path: dockerfiles
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # @v1
|
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # @v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # @v1
|
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # @v1
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # @v1
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # @v1
|
||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build & Deploy ${{ matrix.dockerfile[0] }}
|
- name: Build & Deploy ${{ matrix.dockerfile[0] }}
|
||||||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # @v2
|
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # @v2
|
||||||
with:
|
with:
|
||||||
context: dockerfiles/${{ matrix.dockerfile[0] }}
|
context: dockerfiles/${{ matrix.dockerfile[0] }}
|
||||||
platforms: ${{ matrix.dockerfile[1] }}
|
platforms: ${{ matrix.dockerfile[1] }}
|
||||||
|
10
.github/workflows/ci.yaml
vendored
10
.github/workflows/ci.yaml
vendored
@@ -20,6 +20,12 @@ jobs:
|
|||||||
uses: ./.github/workflows/valid-style.yml
|
uses: ./.github/workflows/valid-style.yml
|
||||||
with:
|
with:
|
||||||
with_coverage: ${{ needs.changes.outputs.core }}
|
with_coverage: ${{ needs.changes.outputs.core }}
|
||||||
|
audit-ancient-python:
|
||||||
|
uses: ./.github/workflows/audit.yaml
|
||||||
|
needs: [ changes ]
|
||||||
|
with:
|
||||||
|
with_coverage: ${{ needs.changes.outputs.core }}
|
||||||
|
python_version: 2.7
|
||||||
all-prechecks:
|
all-prechecks:
|
||||||
needs: [ prechecks ]
|
needs: [ prechecks ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -35,7 +41,7 @@ jobs:
|
|||||||
core: ${{ steps.filter.outputs.core }}
|
core: ${{ steps.filter.outputs.core }}
|
||||||
packages: ${{ steps.filter.outputs.packages }}
|
packages: ${{ steps.filter.outputs.packages }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -79,7 +85,7 @@ jobs:
|
|||||||
needs: [ prechecks ]
|
needs: [ prechecks ]
|
||||||
uses: ./.github/workflows/windows_python.yml
|
uses: ./.github/workflows/windows_python.yml
|
||||||
all:
|
all:
|
||||||
needs: [ windows, unit-tests, bootstrap ]
|
needs: [ windows, unit-tests, bootstrap, audit-ancient-python ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
|
8
.github/workflows/setup_git.ps1
vendored
8
.github/workflows/setup_git.ps1
vendored
@@ -1,9 +1,15 @@
|
|||||||
# (c) 2022 Lawrence Livermore National Laboratory
|
# (c) 2021 Lawrence Livermore National Laboratory
|
||||||
|
|
||||||
|
Set-Location spack
|
||||||
|
|
||||||
git config --global user.email "spack@example.com"
|
git config --global user.email "spack@example.com"
|
||||||
git config --global user.name "Test User"
|
git config --global user.name "Test User"
|
||||||
git config --global core.longpaths true
|
git config --global core.longpaths true
|
||||||
|
|
||||||
|
# See https://github.com/git/git/security/advisories/GHSA-3wp6-j8xr-qw85 (CVE-2022-39253)
|
||||||
|
# This is needed to let some fixture in our unit-test suite run
|
||||||
|
git config --global protocol.file.allow always
|
||||||
|
|
||||||
if ($(git branch --show-current) -ne "develop")
|
if ($(git branch --show-current) -ne "develop")
|
||||||
{
|
{
|
||||||
git branch develop origin/develop
|
git branch develop origin/develop
|
||||||
|
4
.github/workflows/setup_git.sh
vendored
4
.github/workflows/setup_git.sh
vendored
@@ -2,6 +2,10 @@
|
|||||||
git config --global user.email "spack@example.com"
|
git config --global user.email "spack@example.com"
|
||||||
git config --global user.name "Test User"
|
git config --global user.name "Test User"
|
||||||
|
|
||||||
|
# See https://github.com/git/git/security/advisories/GHSA-3wp6-j8xr-qw85 (CVE-2022-39253)
|
||||||
|
# This is needed to let some fixture in our unit-test suite run
|
||||||
|
git config --global protocol.file.allow always
|
||||||
|
|
||||||
# create a local pr base branch
|
# create a local pr base branch
|
||||||
if [[ -n $GITHUB_BASE_REF ]]; then
|
if [[ -n $GITHUB_BASE_REF ]]; then
|
||||||
git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
|
git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}"
|
||||||
|
64
.github/workflows/unit_tests.yaml
vendored
64
.github/workflows/unit_tests.yaml
vendored
@@ -11,46 +11,39 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
# Run unit tests with different configurations on linux
|
# Run unit tests with different configurations on linux
|
||||||
ubuntu:
|
ubuntu:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
|
||||||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
|
|
||||||
concretizer: ['clingo']
|
concretizer: ['clingo']
|
||||||
on_develop:
|
on_develop:
|
||||||
- ${{ github.ref == 'refs/heads/develop' }}
|
- ${{ github.ref == 'refs/heads/develop' }}
|
||||||
include:
|
include:
|
||||||
- python-version: '3.11'
|
- python-version: 2.7
|
||||||
os: ubuntu-latest
|
|
||||||
concretizer: original
|
concretizer: original
|
||||||
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||||
- python-version: '3.6'
|
- python-version: '3.11'
|
||||||
os: ubuntu-20.04
|
concretizer: original
|
||||||
concretizer: clingo
|
|
||||||
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
on_develop: ${{ github.ref == 'refs/heads/develop' }}
|
||||||
exclude:
|
exclude:
|
||||||
- python-version: '3.7'
|
- python-version: '3.7'
|
||||||
os: ubuntu-latest
|
|
||||||
concretizer: 'clingo'
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.8'
|
- python-version: '3.8'
|
||||||
os: ubuntu-latest
|
|
||||||
concretizer: 'clingo'
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.9'
|
- python-version: '3.9'
|
||||||
os: ubuntu-latest
|
|
||||||
concretizer: 'clingo'
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
- python-version: '3.10'
|
- python-version: '3.10'
|
||||||
os: ubuntu-latest
|
|
||||||
concretizer: 'clingo'
|
concretizer: 'clingo'
|
||||||
on_develop: false
|
on_develop: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -59,11 +52,24 @@ jobs:
|
|||||||
# Needed for unit tests
|
# Needed for unit tests
|
||||||
sudo apt-get -y install \
|
sudo apt-get -y install \
|
||||||
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
|
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
|
||||||
cmake bison libbison-dev kcov
|
patchelf cmake bison libbison-dev kcov
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip six setuptools pytest codecov[toml] pytest-xdist pytest-cov
|
pip install --upgrade pip six setuptools pytest codecov[toml] pytest-xdist
|
||||||
pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black"
|
# Install pytest-cov only on recent Python, to avoid stalling on Python 2.7 due
|
||||||
|
# to bugs on an unmaintained version of the package when used with xdist.
|
||||||
|
if [[ ${{ matrix.python-version }} != "2.7" ]]; then
|
||||||
|
pip install --upgrade pytest-cov
|
||||||
|
fi
|
||||||
|
# ensure style checks are not skipped in unit tests for python >= 3.6
|
||||||
|
# note that true/false (i.e., 1/0) are opposite in conditions in python and bash
|
||||||
|
if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then
|
||||||
|
pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click==8.0.4" "black<=21.12b0"
|
||||||
|
fi
|
||||||
|
- name: Pin pathlib for Python 2.7
|
||||||
|
if: ${{ matrix.python-version == 2.7 }}
|
||||||
|
run: |
|
||||||
|
pip install -U pathlib2==2.3.6 toml
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
@@ -76,7 +82,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
. share/spack/setup-env.sh
|
. share/spack/setup-env.sh
|
||||||
spack bootstrap disable spack-install
|
spack bootstrap disable spack-install
|
||||||
spack bootstrap now
|
|
||||||
spack -v solve zlib
|
spack -v solve zlib
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
env:
|
env:
|
||||||
@@ -84,7 +89,7 @@ jobs:
|
|||||||
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
|
||||||
SPACK_TEST_PARALLEL: 2
|
SPACK_TEST_PARALLEL: 2
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
UNIT_TEST_COVERAGE: ${{ matrix.python-version == '3.11' }}
|
UNIT_TEST_COVERAGE: ${{ (matrix.python-version == '3.11') }}
|
||||||
run: |
|
run: |
|
||||||
share/spack/qa/run-unit-tests
|
share/spack/qa/run-unit-tests
|
||||||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
@@ -94,10 +99,10 @@ jobs:
|
|||||||
shell:
|
shell:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
@@ -133,7 +138,7 @@ jobs:
|
|||||||
dnf install -y \
|
dnf install -y \
|
||||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
||||||
make patch tcl unzip which xz
|
make patch tcl unzip which xz
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
- name: Setup repo and non-root user
|
- name: Setup repo and non-root user
|
||||||
run: |
|
run: |
|
||||||
git --version
|
git --version
|
||||||
@@ -145,22 +150,25 @@ jobs:
|
|||||||
shell: runuser -u spack-test -- bash {0}
|
shell: runuser -u spack-test -- bash {0}
|
||||||
run: |
|
run: |
|
||||||
source share/spack/setup-env.sh
|
source share/spack/setup-env.sh
|
||||||
spack -d bootstrap now --dev
|
spack -d solve zlib
|
||||||
spack unit-test -k 'not cvs and not svn and not hg' -x --verbose
|
spack unit-test -k 'not cvs and not svn and not hg' -x --verbose
|
||||||
# Test for the clingo based solver (using clingo-cffi)
|
# Test for the clingo based solver (using clingo-cffi)
|
||||||
clingo-cffi:
|
clingo-cffi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- name: Install System packages
|
- name: Install System packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build kcov
|
# Needed for unit tests
|
||||||
|
sudo apt-get -y install \
|
||||||
|
coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \
|
||||||
|
patchelf kcov
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip six setuptools pytest codecov coverage[toml] pytest-cov clingo pytest-xdist
|
pip install --upgrade pip six setuptools pytest codecov coverage[toml] pytest-cov clingo pytest-xdist
|
||||||
@@ -185,10 +193,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10"]
|
python-version: ["3.10"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
|
39
.github/workflows/valid-style.yml
vendored
39
.github/workflows/valid-style.yml
vendored
@@ -18,8 +18,8 @@ jobs:
|
|||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
@@ -28,23 +28,23 @@ jobs:
|
|||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install --upgrade vermin
|
pip install --upgrade vermin
|
||||||
- name: vermin (Spack's Core)
|
- name: vermin (Spack's Core)
|
||||||
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
|
run: vermin --backport argparse --violations --backport typing -t=2.7- -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/
|
||||||
- name: vermin (Repositories)
|
- name: vermin (Repositories)
|
||||||
run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv var/spack/repos
|
run: vermin --backport argparse --violations --backport typing -t=2.7- -t=3.6- -vvv var/spack/repos
|
||||||
# Run style checks on the files that have been changed
|
# Run style checks on the files that have been changed
|
||||||
style:
|
style:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # @v2
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # @v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip six setuptools types-six black==23.1.0 mypy isort clingo flake8
|
python3 -m pip install --upgrade pip six setuptools types-six click==8.0.2 'black==21.12b0' mypy isort clingo flake8
|
||||||
- name: Setup git configuration
|
- name: Setup git configuration
|
||||||
run: |
|
run: |
|
||||||
# Need this for the git tests to succeed.
|
# Need this for the git tests to succeed.
|
||||||
@@ -58,28 +58,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
with_coverage: ${{ inputs.with_coverage }}
|
with_coverage: ${{ inputs.with_coverage }}
|
||||||
python_version: '3.11'
|
python_version: '3.11'
|
||||||
# Check that spack can bootstrap the development environment on Python 3.6 - RHEL8
|
|
||||||
bootstrap-dev-rhel8:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: registry.access.redhat.com/ubi8/ubi
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
dnf install -y \
|
|
||||||
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
|
|
||||||
make patch tcl unzip which xz
|
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
|
|
||||||
- name: Setup repo and non-root user
|
|
||||||
run: |
|
|
||||||
git --version
|
|
||||||
git fetch --unshallow
|
|
||||||
. .github/workflows/setup_git.sh
|
|
||||||
useradd spack-test
|
|
||||||
chown -R spack-test .
|
|
||||||
- name: Bootstrap Spack development environment
|
|
||||||
shell: runuser -u spack-test -- bash {0}
|
|
||||||
run: |
|
|
||||||
source share/spack/setup-env.sh
|
|
||||||
spack -d bootstrap now --dev
|
|
||||||
spack style -t black
|
|
||||||
spack unit-test -V
|
|
||||||
|
175
.github/workflows/windows_python.yml
vendored
175
.github/workflows/windows_python.yml
vendored
@@ -10,15 +10,15 @@ concurrency:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell:
|
shell:
|
||||||
powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0}
|
powershell Invoke-Expression -Command ".\share\spack\qa\windows_test_setup.ps1"; {0}
|
||||||
jobs:
|
jobs:
|
||||||
unit-tests:
|
unit-tests:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
@@ -26,11 +26,13 @@ jobs:
|
|||||||
python -m pip install --upgrade pip six pywin32 setuptools codecov pytest-cov clingo
|
python -m pip install --upgrade pip six pywin32 setuptools codecov pytest-cov clingo
|
||||||
- name: Create local develop
|
- name: Create local develop
|
||||||
run: |
|
run: |
|
||||||
./.github/workflows/setup_git.ps1
|
.\spack\.github\workflows\setup_git.ps1
|
||||||
- name: Unit Test
|
- name: Unit Test
|
||||||
run: |
|
run: |
|
||||||
|
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||||
|
cd spack
|
||||||
|
dir
|
||||||
spack unit-test -x --verbose --cov --cov-config=pyproject.toml --ignore=lib/spack/spack/test/cmd
|
spack unit-test -x --verbose --cov --cov-config=pyproject.toml --ignore=lib/spack/spack/test/cmd
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
coverage combine -a
|
coverage combine -a
|
||||||
coverage xml
|
coverage xml
|
||||||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
@@ -39,10 +41,10 @@ jobs:
|
|||||||
unit-tests-cmd:
|
unit-tests-cmd:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
@@ -50,11 +52,12 @@ jobs:
|
|||||||
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage pytest-cov clingo
|
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage pytest-cov clingo
|
||||||
- name: Create local develop
|
- name: Create local develop
|
||||||
run: |
|
run: |
|
||||||
./.github/workflows/setup_git.ps1
|
.\spack\.github\workflows\setup_git.ps1
|
||||||
- name: Command Unit Test
|
- name: Command Unit Test
|
||||||
run: |
|
run: |
|
||||||
|
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||||
|
cd spack
|
||||||
spack unit-test -x --verbose --cov --cov-config=pyproject.toml lib/spack/spack/test/cmd
|
spack unit-test -x --verbose --cov --cov-config=pyproject.toml lib/spack/spack/test/cmd
|
||||||
./share/spack/qa/validate_last_exit.ps1
|
|
||||||
coverage combine -a
|
coverage combine -a
|
||||||
coverage xml
|
coverage xml
|
||||||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||||
@@ -63,10 +66,10 @@ jobs:
|
|||||||
build-abseil:
|
build-abseil:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
- name: Install Python packages
|
- name: Install Python packages
|
||||||
@@ -75,81 +78,81 @@ jobs:
|
|||||||
- name: Build Test
|
- name: Build Test
|
||||||
run: |
|
run: |
|
||||||
spack compiler find
|
spack compiler find
|
||||||
|
echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
|
||||||
spack external find cmake
|
spack external find cmake
|
||||||
spack external find ninja
|
spack external find ninja
|
||||||
spack -d install abseil-cpp
|
spack -d install abseil-cpp
|
||||||
# TODO: johnwparent - reduce the size of the installer operations
|
make-installer:
|
||||||
# make-installer:
|
runs-on: windows-latest
|
||||||
# runs-on: windows-latest
|
steps:
|
||||||
# steps:
|
- name: Disable Windows Symlinks
|
||||||
# - name: Disable Windows Symlinks
|
run: |
|
||||||
# run: |
|
git config --global core.symlinks false
|
||||||
# git config --global core.symlinks false
|
shell:
|
||||||
# shell:
|
powershell
|
||||||
# powershell
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||||
# - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
|
with:
|
||||||
# with:
|
fetch-depth: 0
|
||||||
# fetch-depth: 0
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
|
||||||
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
with:
|
||||||
# with:
|
python-version: 3.9
|
||||||
# python-version: 3.9
|
- name: Install Python packages
|
||||||
# - name: Install Python packages
|
run: |
|
||||||
# run: |
|
python -m pip install --upgrade pip six pywin32 setuptools
|
||||||
# python -m pip install --upgrade pip six pywin32 setuptools
|
- name: Add Light and Candle to Path
|
||||||
# - name: Add Light and Candle to Path
|
run: |
|
||||||
# run: |
|
$env:WIX >> $GITHUB_PATH
|
||||||
# $env:WIX >> $GITHUB_PATH
|
- name: Run Installer
|
||||||
# - name: Run Installer
|
run: |
|
||||||
# run: |
|
.\spack\share\spack\qa\setup_spack.ps1
|
||||||
# ./share/spack/qa/setup_spack_installer.ps1
|
spack make-installer -s spack -g SILENT pkg
|
||||||
# spack make-installer -s . -g SILENT pkg
|
echo "installer_root=$((pwd).Path)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# echo "installer_root=$((pwd).Path)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
env:
|
||||||
# env:
|
ProgressPreference: SilentlyContinue
|
||||||
# ProgressPreference: SilentlyContinue
|
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
# - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
with:
|
||||||
# with:
|
name: Windows Spack Installer Bundle
|
||||||
# name: Windows Spack Installer Bundle
|
path: ${{ env.installer_root }}\pkg\Spack.exe
|
||||||
# path: ${{ env.installer_root }}\pkg\Spack.exe
|
- uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
||||||
# - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb
|
with:
|
||||||
# with:
|
name: Windows Spack Installer
|
||||||
# name: Windows Spack Installer
|
path: ${{ env.installer_root}}\pkg\Spack.msi
|
||||||
# path: ${{ env.installer_root}}\pkg\Spack.msi
|
execute-installer:
|
||||||
# execute-installer:
|
needs: make-installer
|
||||||
# needs: make-installer
|
runs-on: windows-latest
|
||||||
# runs-on: windows-latest
|
defaults:
|
||||||
# defaults:
|
run:
|
||||||
# run:
|
shell: pwsh
|
||||||
# shell: pwsh
|
steps:
|
||||||
# steps:
|
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
|
||||||
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
|
with:
|
||||||
# with:
|
python-version: 3.9
|
||||||
# python-version: 3.9
|
- name: Install Python packages
|
||||||
# - name: Install Python packages
|
run: |
|
||||||
# run: |
|
python -m pip install --upgrade pip six pywin32 setuptools
|
||||||
# python -m pip install --upgrade pip six pywin32 setuptools
|
- name: Setup installer directory
|
||||||
# - name: Setup installer directory
|
run: |
|
||||||
# run: |
|
mkdir -p spack_installer
|
||||||
# mkdir -p spack_installer
|
echo "spack_installer=$((pwd).Path)\spack_installer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
# echo "spack_installer=$((pwd).Path)\spack_installer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
|
- uses: actions/download-artifact@v3
|
||||||
# - uses: actions/download-artifact@v3
|
with:
|
||||||
# with:
|
name: Windows Spack Installer Bundle
|
||||||
# name: Windows Spack Installer Bundle
|
path: ${{ env.spack_installer }}
|
||||||
# path: ${{ env.spack_installer }}
|
- name: Execute Bundled Installer
|
||||||
# - name: Execute Bundled Installer
|
run: |
|
||||||
# run: |
|
$proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru
|
||||||
# $proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru
|
$handle = $proc.Handle # cache proc.Handle
|
||||||
# $handle = $proc.Handle # cache proc.Handle
|
$proc.WaitForExit();
|
||||||
# $proc.WaitForExit();
|
$LASTEXITCODE
|
||||||
# $LASTEXITCODE
|
env:
|
||||||
# env:
|
ProgressPreference: SilentlyContinue
|
||||||
# ProgressPreference: SilentlyContinue
|
- uses: actions/download-artifact@v3
|
||||||
# - uses: actions/download-artifact@v3
|
with:
|
||||||
# with:
|
name: Windows Spack Installer
|
||||||
# name: Windows Spack Installer
|
path: ${{ env.spack_installer }}
|
||||||
# path: ${{ env.spack_installer }}
|
- name: Execute MSI
|
||||||
# - name: Execute MSI
|
run: |
|
||||||
# run: |
|
$proc = Start-Process ${{ env.spack_installer }}\spack.msi "/quiet" -Passthru
|
||||||
# $proc = Start-Process ${{ env.spack_installer }}\spack.msi "/quiet" -Passthru
|
$handle = $proc.Handle # cache proc.Handle
|
||||||
# $handle = $proc.Handle # cache proc.Handle
|
$proc.WaitForExit();
|
||||||
# $proc.WaitForExit();
|
$LASTEXITCODE
|
||||||
# $LASTEXITCODE
|
|
||||||
|
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,28 +1,3 @@
|
|||||||
# v0.19.1 (2023-02-07)
|
|
||||||
|
|
||||||
### Spack Bugfixes
|
|
||||||
|
|
||||||
* `buildcache create`: make "file exists" less verbose (#35019)
|
|
||||||
* `spack mirror create`: don't change paths to urls (#34992)
|
|
||||||
* Improve error message for requirements (#33988)
|
|
||||||
* uninstall: fix accidental cubic complexity (#34005)
|
|
||||||
* scons: fix signature for `install_args` (#34481)
|
|
||||||
* Fix `combine_phase_logs` text encoding issues (#34657)
|
|
||||||
* Use a module-like object to propagate changes in the MRO, when setting build env (#34059)
|
|
||||||
* PackageBase should not define builder legacy attributes (#33942)
|
|
||||||
* Forward lookup of the "run_tests" attribute (#34531)
|
|
||||||
* Bugfix for timers (#33917, #33900)
|
|
||||||
* Fix path handling in prefix inspections (#35318)
|
|
||||||
* Fix libtool filter for Fujitsu compilers (#34916)
|
|
||||||
* Bug fix for duplicate rpath errors on macOS when creating build caches (#34375)
|
|
||||||
* FileCache: delete the new cache file on exception (#34623)
|
|
||||||
* Propagate exceptions from Spack python console (#34547)
|
|
||||||
* Tests: Fix a bug/typo in a `config_values.py` fixture (#33886)
|
|
||||||
* Various CI fixes (#33953, #34560, #34560, #34828)
|
|
||||||
* Docs: remove monitors and analyzers, typos (#34358, #33926)
|
|
||||||
* bump release version for tutorial command (#33859)
|
|
||||||
|
|
||||||
|
|
||||||
# v0.19.0 (2022-11-11)
|
# v0.19.0 (2022-11-11)
|
||||||
|
|
||||||
`v0.19.0` is a major feature release.
|
`v0.19.0` is a major feature release.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2013-2023 LLNS, LLC and other Spack Project Developers.
|
Copyright (c) 2013-2022 LLNS, LLC and other Spack Project Developers.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -10,7 +10,6 @@ def getpywin():
|
|||||||
try:
|
try:
|
||||||
import win32con # noqa: F401
|
import win32con # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("pyWin32 not installed but is required...\nInstalling via pip:")
|
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "-q", "install", "--upgrade", "pip"])
|
subprocess.check_call([sys.executable, "-m", "pip", "-q", "install", "--upgrade", "pip"])
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "-q", "install", "pywin32"])
|
subprocess.check_call([sys.executable, "-m", "pip", "-q", "install", "pywin32"])
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
# sbang project developers. See the top-level COPYRIGHT file for details.
|
# sbang project developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
10
bin/spack
10
bin/spack
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
#
|
#
|
||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -31,11 +31,13 @@ import os
|
|||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
min_python3 = (3, 6)
|
min_python3 = (3, 5)
|
||||||
|
|
||||||
if sys.version_info[:2] < min_python3:
|
if sys.version_info[:2] < (2, 7) or (
|
||||||
|
sys.version_info[:2] >= (3, 0) and sys.version_info[:2] < min_python3
|
||||||
|
):
|
||||||
v_info = sys.version_info[:3]
|
v_info = sys.version_info[:3]
|
||||||
msg = "Spack requires Python %d.%d or higher " % min_python3
|
msg = "Spack requires Python 2.7 or %d.%d or higher " % min_python3
|
||||||
msg += "You are running spack with Python %d.%d.%d." % v_info
|
msg += "You are running spack with Python %d.%d.%d." % v_info
|
||||||
sys.exit(msg)
|
sys.exit(msg)
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -72,7 +72,6 @@ config:
|
|||||||
root: $TMP_DIR/install
|
root: $TMP_DIR/install
|
||||||
misc_cache: $$user_cache_path/cache
|
misc_cache: $$user_cache_path/cache
|
||||||
source_cache: $$user_cache_path/source
|
source_cache: $$user_cache_path/source
|
||||||
environments_root: $TMP_DIR/envs
|
|
||||||
EOF
|
EOF
|
||||||
cat >"$SPACK_USER_CONFIG_PATH/bootstrap.yaml" <<EOF
|
cat >"$SPACK_USER_CONFIG_PATH/bootstrap.yaml" <<EOF
|
||||||
bootstrap:
|
bootstrap:
|
||||||
|
109
bin/spack.bat
109
bin/spack.bat
@@ -1,4 +1,4 @@
|
|||||||
:: Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
:: Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
:: Spack Project Developers. See the top-level COPYRIGHT file for details.
|
:: Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
::
|
::
|
||||||
:: SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
:: SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -50,69 +50,24 @@ setlocal enabledelayedexpansion
|
|||||||
:: flags will always start with '-', e.g. --help or -V
|
:: flags will always start with '-', e.g. --help or -V
|
||||||
:: subcommands will never start with '-'
|
:: subcommands will never start with '-'
|
||||||
:: everything after the subcommand is an arg
|
:: everything after the subcommand is an arg
|
||||||
|
for %%x in (%*) do (
|
||||||
:: we cannot allow batch "for" loop to directly process CL args
|
set t="%%~x"
|
||||||
:: a number of batch reserved characters are commonly passed to
|
|
||||||
:: spack and allowing batch's "for" method to process the raw inputs
|
|
||||||
:: results in a large number of formatting issues
|
|
||||||
:: instead, treat the entire CLI as one string
|
|
||||||
:: and split by space manually
|
|
||||||
:: capture cl args in variable named cl_args
|
|
||||||
set cl_args=%*
|
|
||||||
:process_cl_args
|
|
||||||
rem tokens=1* returns the first processed token produced
|
|
||||||
rem by tokenizing the input string cl_args on spaces into
|
|
||||||
rem the named variable %%g
|
|
||||||
rem While this make look like a for loop, it only
|
|
||||||
rem executes a single time for each of the cl args
|
|
||||||
rem the actual iterative loop is performed by the
|
|
||||||
rem goto process_cl_args stanza
|
|
||||||
rem we are simply leveraging the "for" method's string
|
|
||||||
rem tokenization
|
|
||||||
for /f "tokens=1*" %%g in ("%cl_args%") do (
|
|
||||||
set t=%%~g
|
|
||||||
rem remainder of string is composed into %%h
|
|
||||||
rem these are the cl args yet to be processed
|
|
||||||
rem assign cl_args var to only the args to be processed
|
|
||||||
rem effectively discarding the current arg %%g
|
|
||||||
rem this will be nul when we have no further tokens to process
|
|
||||||
set cl_args=%%h
|
|
||||||
rem process the first space delineated cl arg
|
|
||||||
rem of this iteration
|
|
||||||
if "!t:~0,1!" == "-" (
|
if "!t:~0,1!" == "-" (
|
||||||
if defined _sp_subcommand (
|
if defined _sp_subcommand (
|
||||||
rem We already have a subcommand, processing args now
|
:: We already have a subcommand, processing args now
|
||||||
if not defined _sp_args (
|
set "_sp_args=!_sp_args! !t!"
|
||||||
set "_sp_args=!t!"
|
|
||||||
) else (
|
|
||||||
set "_sp_args=!_sp_args! !t!"
|
|
||||||
)
|
|
||||||
) else (
|
) else (
|
||||||
if not defined _sp_flags (
|
set "_sp_flags=!_sp_flags! !t!"
|
||||||
set "_sp_flags=!t!"
|
shift
|
||||||
shift
|
|
||||||
) else (
|
|
||||||
set "_sp_flags=!_sp_flags! !t!"
|
|
||||||
shift
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
) else if not defined _sp_subcommand (
|
) else if not defined _sp_subcommand (
|
||||||
set "_sp_subcommand=!t!"
|
set "_sp_subcommand=!t!"
|
||||||
shift
|
shift
|
||||||
) else (
|
) else (
|
||||||
if not defined _sp_args (
|
set "_sp_args=!_sp_args! !t!"
|
||||||
set "_sp_args=!t!"
|
shift
|
||||||
shift
|
|
||||||
) else (
|
|
||||||
set "_sp_args=!_sp_args! !t!"
|
|
||||||
shift
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
rem if this is not nil, we have more tokens to process
|
|
||||||
rem start above process again with remaining unprocessed cl args
|
|
||||||
if defined cl_args goto :process_cl_args
|
|
||||||
|
|
||||||
|
|
||||||
:: --help, -h and -V flags don't require further output parsing.
|
:: --help, -h and -V flags don't require further output parsing.
|
||||||
:: If we encounter, execute and exit
|
:: If we encounter, execute and exit
|
||||||
@@ -128,24 +83,24 @@ if defined _sp_flags (
|
|||||||
exit /B 0
|
exit /B 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if not defined _sp_subcommand (
|
|
||||||
if not defined _sp_args (
|
|
||||||
if not defined _sp_flags (
|
|
||||||
python "%spack%" --help
|
|
||||||
exit /B 0
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
:: pass parsed variables outside of local scope. Need to do
|
:: pass parsed variables outside of local scope. Need to do
|
||||||
:: this because delayedexpansion can only be set by setlocal
|
:: this because delayedexpansion can only be set by setlocal
|
||||||
endlocal & (
|
echo %_sp_flags%>flags
|
||||||
set "_sp_flags=%_sp_flags%"
|
echo %_sp_args%>args
|
||||||
set "_sp_args=%_sp_args%"
|
echo %_sp_subcommand%>subcmd
|
||||||
set "_sp_subcommand=%_sp_subcommand%"
|
endlocal
|
||||||
)
|
set /p _sp_subcommand=<subcmd
|
||||||
|
set /p _sp_flags=<flags
|
||||||
|
set /p _sp_args=<args
|
||||||
|
set str_subcommand=%_sp_subcommand:"='%
|
||||||
|
set str_flags=%_sp_flags:"='%
|
||||||
|
set str_args=%_sp_args:"='%
|
||||||
|
if "%str_subcommand%"=="ECHO is off." (set "_sp_subcommand=")
|
||||||
|
if "%str_flags%"=="ECHO is off." (set "_sp_flags=")
|
||||||
|
if "%str_args%"=="ECHO is off." (set "_sp_args=")
|
||||||
|
del subcmd
|
||||||
|
del flags
|
||||||
|
del args
|
||||||
|
|
||||||
:: Filter out some commands. For any others, just run the command.
|
:: Filter out some commands. For any others, just run the command.
|
||||||
if "%_sp_subcommand%" == "cd" (
|
if "%_sp_subcommand%" == "cd" (
|
||||||
@@ -188,9 +143,7 @@ goto :end_switch
|
|||||||
:: If no args or args contain --bat or -h/--help: just execute.
|
:: If no args or args contain --bat or -h/--help: just execute.
|
||||||
if NOT defined _sp_args (
|
if NOT defined _sp_args (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
)
|
)else if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
||||||
|
|
||||||
if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
|
||||||
goto :default_case
|
goto :default_case
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
) else if NOT "%_sp_args%"=="%_sp_args: -h=%" (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
@@ -198,11 +151,11 @@ if NOT "%_sp_args%"=="%_sp_args:--help=%" (
|
|||||||
goto :default_case
|
goto :default_case
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:deactivate=%" (
|
) else if NOT "%_sp_args%"=="%_sp_args:deactivate=%" (
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`call python %spack% %_sp_flags% env deactivate --bat %_sp_args:deactivate=%`
|
`call python "%spack%" %_sp_flags% env deactivate --bat %_sp_args:deactivate=%`
|
||||||
) do %%I
|
) do %%I
|
||||||
) else if NOT "%_sp_args%"=="%_sp_args:activate=%" (
|
) else if NOT "%_sp_args%"=="%_sp_args:activate=%" (
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`python %spack% %_sp_flags% env activate --bat %_sp_args:activate=%`
|
`call python "%spack%" %_sp_flags% env activate --bat %_sp_args:activate=%`
|
||||||
) do %%I
|
) do %%I
|
||||||
) else (
|
) else (
|
||||||
goto :default_case
|
goto :default_case
|
||||||
@@ -223,7 +176,7 @@ if defined _sp_args (
|
|||||||
|
|
||||||
for /f "tokens=* USEBACKQ" %%I in (
|
for /f "tokens=* USEBACKQ" %%I in (
|
||||||
`python "%spack%" %_sp_flags% %_sp_subcommand% --bat %_sp_args%`) do %%I
|
`python "%spack%" %_sp_flags% %_sp_subcommand% --bat %_sp_args%`) do %%I
|
||||||
|
)
|
||||||
goto :end_switch
|
goto :end_switch
|
||||||
|
|
||||||
:case_unload
|
:case_unload
|
||||||
@@ -261,10 +214,10 @@ for %%Z in ("%_pa_new_path%") do if EXIST %%~sZ\NUL (
|
|||||||
exit /b 0
|
exit /b 0
|
||||||
|
|
||||||
:: set module system roots
|
:: set module system roots
|
||||||
:_sp_multi_pathadd
|
:_sp_multi_pathadd
|
||||||
for %%I in (%~2) do (
|
for %%I in (%~2) do (
|
||||||
for %%Z in (%_sp_compatible_sys_types%) do (
|
for %%Z in (%_sp_compatible_sys_types%) do (
|
||||||
:pathadd "%~1" "%%I\%%Z"
|
:pathadd "%~1" "%%I\%%Z"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
exit /B %ERRORLEVEL%
|
exit /B %ERRORLEVEL%
|
@@ -52,6 +52,7 @@ if defined py_path (
|
|||||||
|
|
||||||
if defined py_exe (
|
if defined py_exe (
|
||||||
"%py_exe%" "%SPACK_ROOT%\bin\haspywin.py"
|
"%py_exe%" "%SPACK_ROOT%\bin\haspywin.py"
|
||||||
|
"%py_exe%" "%SPACK_ROOT%\bin\spack" external find python >NUL
|
||||||
)
|
)
|
||||||
|
|
||||||
set "EDITOR=notepad"
|
set "EDITOR=notepad"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -13,18 +13,16 @@ concretizer:
|
|||||||
# Whether to consider installed packages or packages from buildcaches when
|
# Whether to consider installed packages or packages from buildcaches when
|
||||||
# concretizing specs. If `true`, we'll try to use as many installs/binaries
|
# concretizing specs. If `true`, we'll try to use as many installs/binaries
|
||||||
# as possible, rather than building. If `false`, we'll always give you a fresh
|
# as possible, rather than building. If `false`, we'll always give you a fresh
|
||||||
# concretization. If `dependencies`, we'll only reuse dependencies but
|
# concretization.
|
||||||
# give you a fresh concretization for your root specs.
|
reuse: true
|
||||||
reuse: dependencies
|
|
||||||
# Options that tune which targets are considered for concretization. The
|
# Options that tune which targets are considered for concretization. The
|
||||||
# concretization process is very sensitive to the number targets, and the time
|
# concretization process is very sensitive to the number targets, and the time
|
||||||
# needed to reach a solution increases noticeably with the number of targets
|
# needed to reach a solution increases noticeably with the number of targets
|
||||||
# considered.
|
# considered.
|
||||||
targets:
|
targets:
|
||||||
# Determine whether we want to target specific or generic
|
# Determine whether we want to target specific or generic microarchitectures.
|
||||||
# microarchitectures. Valid values are: "microarchitectures" or "generic".
|
# An example of the first kind might be for instance "skylake" or "bulldozer",
|
||||||
# An example of "microarchitectures" would be "skylake" or "bulldozer",
|
# while generic microarchitectures are for instance "aarch64" or "x86_64_v4".
|
||||||
# while an example of "generic" would be "aarch64" or "x86_64_v4".
|
|
||||||
granularity: microarchitectures
|
granularity: microarchitectures
|
||||||
# If "false" allow targets that are incompatible with the current host (for
|
# If "false" allow targets that are incompatible with the current host (for
|
||||||
# instance concretize with target "icelake" while running on "haswell").
|
# instance concretize with target "icelake" while running on "haswell").
|
||||||
@@ -35,4 +33,4 @@ concretizer:
|
|||||||
# environments can always be activated. When "false" perform concretization separately
|
# environments can always be activated. When "false" perform concretization separately
|
||||||
# on each root spec, allowing different versions and variants of the same package in
|
# on each root spec, allowing different versions and variants of the same package in
|
||||||
# an environment.
|
# an environment.
|
||||||
unify: true
|
unify: true
|
@@ -19,7 +19,7 @@ config:
|
|||||||
install_tree:
|
install_tree:
|
||||||
root: $spack/opt/spack
|
root: $spack/opt/spack
|
||||||
projections:
|
projections:
|
||||||
all: "{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}"
|
all: "${ARCHITECTURE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}"
|
||||||
# install_tree can include an optional padded length (int or boolean)
|
# install_tree can include an optional padded length (int or boolean)
|
||||||
# default is False (do not pad)
|
# default is False (do not pad)
|
||||||
# if padded_length is True, Spack will pad as close to the system max path
|
# if padded_length is True, Spack will pad as close to the system max path
|
||||||
@@ -54,11 +54,6 @@ config:
|
|||||||
# are that it precludes its use as a system package and its ability to be
|
# are that it precludes its use as a system package and its ability to be
|
||||||
# pip installable.
|
# pip installable.
|
||||||
#
|
#
|
||||||
# In Spack environment files, chaining onto existing system Spack
|
|
||||||
# installations, the $env variable can be used to download, cache and build
|
|
||||||
# into user-writable paths that are relative to the currently active
|
|
||||||
# environment.
|
|
||||||
#
|
|
||||||
# In any case, if the username is not already in the path, Spack will append
|
# In any case, if the username is not already in the path, Spack will append
|
||||||
# the value of `$user` in an attempt to avoid potential conflicts between
|
# the value of `$user` in an attempt to avoid potential conflicts between
|
||||||
# users in shared temporary spaces.
|
# users in shared temporary spaces.
|
||||||
@@ -81,10 +76,6 @@ config:
|
|||||||
source_cache: $spack/var/spack/cache
|
source_cache: $spack/var/spack/cache
|
||||||
|
|
||||||
|
|
||||||
## Directory where spack managed environments are created and stored
|
|
||||||
# environments_root: $spack/var/spack/environments
|
|
||||||
|
|
||||||
|
|
||||||
# Cache directory for miscellaneous files, like the package index.
|
# Cache directory for miscellaneous files, like the package index.
|
||||||
# This can be purged with `spack clean --misc-cache`
|
# This can be purged with `spack clean --misc-cache`
|
||||||
misc_cache: $user_cache_path/cache
|
misc_cache: $user_cache_path/cache
|
||||||
@@ -185,7 +176,7 @@ config:
|
|||||||
# when Spack needs to manage its own package metadata and all operations are
|
# when Spack needs to manage its own package metadata and all operations are
|
||||||
# expected to complete within the default time limit. The timeout should
|
# expected to complete within the default time limit. The timeout should
|
||||||
# therefore generally be left untouched.
|
# therefore generally be left untouched.
|
||||||
db_lock_timeout: 60
|
db_lock_timeout: 3
|
||||||
|
|
||||||
|
|
||||||
# How long to wait when attempting to modify a package (e.g. to install it).
|
# How long to wait when attempting to modify a package (e.g. to install it).
|
||||||
@@ -223,8 +214,4 @@ config:
|
|||||||
|
|
||||||
# Number of seconds a buildcache's index.json is cached locally before probing
|
# Number of seconds a buildcache's index.json is cached locally before probing
|
||||||
# for updates, within a single Spack invocation. Defaults to 10 minutes.
|
# for updates, within a single Spack invocation. Defaults to 10 minutes.
|
||||||
binary_index_ttl: 600
|
binary_index_ttl: 600
|
||||||
|
|
||||||
flags:
|
|
||||||
# Whether to keep -Werror flags active in package builds.
|
|
||||||
keep_werror: 'none'
|
|
@@ -46,7 +46,7 @@ modules:
|
|||||||
|
|
||||||
tcl:
|
tcl:
|
||||||
all:
|
all:
|
||||||
autoload: direct
|
autoload: none
|
||||||
|
|
||||||
# Default configurations if lmod is enabled
|
# Default configurations if lmod is enabled
|
||||||
lmod:
|
lmod:
|
||||||
|
@@ -28,7 +28,7 @@ packages:
|
|||||||
gl: [glx, osmesa]
|
gl: [glx, osmesa]
|
||||||
glu: [mesa-glu, openglu]
|
glu: [mesa-glu, openglu]
|
||||||
golang: [go, gcc]
|
golang: [go, gcc]
|
||||||
go-or-gccgo-bootstrap: [go-bootstrap, gcc]
|
go-external-or-gccgo-bootstrap: [go-bootstrap, gcc]
|
||||||
iconv: [libiconv]
|
iconv: [libiconv]
|
||||||
ipp: [intel-ipp]
|
ipp: [intel-ipp]
|
||||||
java: [openjdk, jdk, ibm-java]
|
java: [openjdk, jdk, ibm-java]
|
||||||
|
@@ -3,4 +3,3 @@ config:
|
|||||||
concretizer: clingo
|
concretizer: clingo
|
||||||
build_stage::
|
build_stage::
|
||||||
- '$spack/.staging'
|
- '$spack/.staging'
|
||||||
stage_name: '{name}-{version}-{hash:7}'
|
|
||||||
|
@@ -1,22 +0,0 @@
|
|||||||
# -------------------------------------------------------------------------
|
|
||||||
# This file controls default concretization preferences for Spack.
|
|
||||||
#
|
|
||||||
# Settings here are versioned with Spack and are intended to provide
|
|
||||||
# sensible defaults out of the box. Spack maintainers should edit this
|
|
||||||
# file to keep it current.
|
|
||||||
#
|
|
||||||
# Users can override these settings by editing the following files.
|
|
||||||
#
|
|
||||||
# Per-spack-instance settings (overrides defaults):
|
|
||||||
# $SPACK_ROOT/etc/spack/packages.yaml
|
|
||||||
#
|
|
||||||
# Per-user settings (overrides default and site settings):
|
|
||||||
# ~/.spack/packages.yaml
|
|
||||||
# -------------------------------------------------------------------------
|
|
||||||
packages:
|
|
||||||
all:
|
|
||||||
compiler:
|
|
||||||
- msvc
|
|
||||||
providers:
|
|
||||||
mpi: [msmpi]
|
|
||||||
gl: [wgl]
|
|
1
lib/spack/docs/.gitignore
vendored
1
lib/spack/docs/.gitignore
vendored
@@ -5,4 +5,3 @@ llnl*.rst
|
|||||||
_build
|
_build
|
||||||
.spack-env
|
.spack-env
|
||||||
spack.lock
|
spack.lock
|
||||||
_spack_root
|
|
||||||
|
162
lib/spack/docs/analyze.rst
Normal file
162
lib/spack/docs/analyze.rst
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
.. _analyze:
|
||||||
|
|
||||||
|
=======
|
||||||
|
Analyze
|
||||||
|
=======
|
||||||
|
|
||||||
|
|
||||||
|
The analyze command is a front-end to various tools that let us analyze
|
||||||
|
package installations. Each analyzer is a module for a different kind
|
||||||
|
of analysis that can be done on a package installation, including (but not
|
||||||
|
limited to) binary, log, or text analysis. Thus, the analyze command group
|
||||||
|
allows you to take an existing package install, choose an analyzer,
|
||||||
|
and extract some output for the package using it.
|
||||||
|
|
||||||
|
|
||||||
|
-----------------
|
||||||
|
Analyzer Metadata
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
For all analyzers, we write to an ``analyzers`` folder in ``~/.spack``, or the
|
||||||
|
value that you specify in your spack config at ``config:analyzers_dir``.
|
||||||
|
For example, here we see the results of running an analysis on zlib:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ tree ~/.spack/analyzers/
|
||||||
|
└── linux-ubuntu20.04-skylake
|
||||||
|
└── gcc-9.3.0
|
||||||
|
└── zlib-1.2.11-sl7m27mzkbejtkrajigj3a3m37ygv4u2
|
||||||
|
├── environment_variables
|
||||||
|
│ └── spack-analyzer-environment-variables.json
|
||||||
|
├── install_files
|
||||||
|
│ └── spack-analyzer-install-files.json
|
||||||
|
└── libabigail
|
||||||
|
└── spack-analyzer-libabigail-libz.so.1.2.11.xml
|
||||||
|
|
||||||
|
|
||||||
|
This means that you can always find analyzer output in this folder, and it
|
||||||
|
is organized with the same logic as the package install it was run for.
|
||||||
|
If you want to customize this top level folder, simply provide the ``--path``
|
||||||
|
argument to ``spack analyze run``. The nested organization will be maintained
|
||||||
|
within your custom root.
|
||||||
|
|
||||||
|
-----------------
|
||||||
|
Listing Analyzers
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
If you aren't familiar with Spack's analyzers, you can quickly list those that
|
||||||
|
are available:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze list-analyzers
|
||||||
|
install_files : install file listing read from install_manifest.json
|
||||||
|
environment_variables : environment variables parsed from spack-build-env.txt
|
||||||
|
config_args : config args loaded from spack-configure-args.txt
|
||||||
|
libabigail : Application Binary Interface (ABI) features for objects
|
||||||
|
|
||||||
|
|
||||||
|
In the above, the first three are fairly simple - parsing metadata files from
|
||||||
|
a package install directory to save
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
Analyzing a Package
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
The analyze command, akin to install, will accept a package spec to perform
|
||||||
|
an analysis for. The package must be installed. Let's walk through an example
|
||||||
|
with zlib. We first ask to analyze it. However, since we have more than one
|
||||||
|
install, we are asked to disambiguate:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run zlib
|
||||||
|
==> Error: zlib matches multiple packages.
|
||||||
|
Matching packages:
|
||||||
|
fz2bs56 zlib@1.2.11%gcc@7.5.0 arch=linux-ubuntu18.04-skylake
|
||||||
|
sl7m27m zlib@1.2.11%gcc@9.3.0 arch=linux-ubuntu20.04-skylake
|
||||||
|
Use a more specific spec.
|
||||||
|
|
||||||
|
|
||||||
|
We can then specify the spec version that we want to analyze:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run zlib/fz2bs56
|
||||||
|
|
||||||
|
If you don't provide any specific analyzer names, by default all analyzers
|
||||||
|
(shown in the ``list-analyzers`` subcommand list) will be run. If an analyzer does not
|
||||||
|
have any result, it will be skipped. For example, here is a result running for
|
||||||
|
zlib:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ ls ~/.spack/analyzers/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.11-sl7m27mzkbejtkrajigj3a3m37ygv4u2/
|
||||||
|
spack-analyzer-environment-variables.json
|
||||||
|
spack-analyzer-install-files.json
|
||||||
|
spack-analyzer-libabigail-libz.so.1.2.11.xml
|
||||||
|
|
||||||
|
If you want to run a specific analyzer, ask for it with `--analyzer`. Here we run
|
||||||
|
spack analyze on libabigail (already installed) _using_ libabigail1
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run --analyzer abigail libabigail
|
||||||
|
|
||||||
|
|
||||||
|
.. _analyze_monitoring:
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
Monitoring An Analysis
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
For any kind of analysis, you can
|
||||||
|
use a `spack monitor <https://github.com/spack/spack-monitor>`_ "Spackmon"
|
||||||
|
as a server to upload the same run metadata to. You can
|
||||||
|
follow the instructions in the `spack monitor documentation <https://spack-monitor.readthedocs.org>`_
|
||||||
|
to first create a server along with a username and token for yourself.
|
||||||
|
You can then use this guide to interact with the server.
|
||||||
|
|
||||||
|
You should first export our spack monitor token and username to the environment:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ export SPACKMON_TOKEN=50445263afd8f67e59bd79bff597836ee6c05438
|
||||||
|
$ export SPACKMON_USER=spacky
|
||||||
|
|
||||||
|
|
||||||
|
By default, the host for your server is expected to be at ``http://127.0.0.1``
|
||||||
|
with a prefix of ``ms1``, and if this is the case, you can simply add the
|
||||||
|
``--monitor`` flag to the install command:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run --monitor wget
|
||||||
|
|
||||||
|
If you need to customize the host or the prefix, you can do that as well:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run --monitor --monitor-prefix monitor --monitor-host https://monitor-service.io wget
|
||||||
|
|
||||||
|
If your server doesn't have authentication, you can skip it:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze run --monitor --monitor-disable-auth wget
|
||||||
|
|
||||||
|
Regardless of your choice, when you run analyze on an installed package (whether
|
||||||
|
it was installed with ``--monitor`` or not, you'll see the results generating as they did
|
||||||
|
before, and a message that the monitor server was pinged:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack analyze --monitor wget
|
||||||
|
...
|
||||||
|
==> Sending result for wget bin/wget to monitor.
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -942,7 +942,7 @@ first ``libelf`` above, you would run:
|
|||||||
|
|
||||||
$ spack load /qmm4kso
|
$ spack load /qmm4kso
|
||||||
|
|
||||||
To see which packages that you have loaded to your environment you would
|
To see which packages that you have loaded to your enviornment you would
|
||||||
use ``spack find --loaded``.
|
use ``spack find --loaded``.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -1244,8 +1244,8 @@ For example, for the ``stackstart`` variant:
|
|||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
mpileaks stackstart==4 # variant will be propagated to dependencies
|
mpileaks stackstart=4 # variant will be propagated to dependencies
|
||||||
mpileaks stackstart=4 # only mpileaks will have this variant value
|
mpileaks stackstart==4 # only mpileaks will have this variant value
|
||||||
|
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
Compiler Flags
|
Compiler Flags
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -13,51 +13,49 @@ Some sites may encourage users to set up their own test environments
|
|||||||
before carrying out central installations, or some users may prefer to set
|
before carrying out central installations, or some users may prefer to set
|
||||||
up these environments on their own motivation. To reduce the load of
|
up these environments on their own motivation. To reduce the load of
|
||||||
recompiling otherwise identical package specs in different installations,
|
recompiling otherwise identical package specs in different installations,
|
||||||
installed packages can be put into build cache tarballs, pushed to
|
installed packages can be put into build cache tarballs, uploaded to
|
||||||
your Spack mirror and then downloaded and installed by others.
|
your Spack mirror and then downloaded and installed by others.
|
||||||
|
|
||||||
Whenever a mirror provides prebuilt packages, Spack will take these packages
|
|
||||||
into account during concretization and installation, making ``spack install``
|
|
||||||
significantly faster.
|
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
Creating build cache files
|
||||||
|
--------------------------
|
||||||
|
|
||||||
.. note::
|
A compressed tarball of an installed package is created. Tarballs are created
|
||||||
|
for all of its link and run dependency packages as well. Compressed tarballs are
|
||||||
We use the terms "build cache" and "mirror" often interchangeably. Mirrors
|
signed with gpg and signature and tarball and put in a ``.spack`` file. Optionally,
|
||||||
are used during installation both for sources and prebuilt packages. Build
|
the rpaths (and ids and deps on macOS) can be changed to paths relative to
|
||||||
caches refer to mirrors that provide prebuilt packages.
|
the Spack install tree before the tarball is created.
|
||||||
|
|
||||||
|
|
||||||
----------------------
|
|
||||||
Creating a build cache
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
Build caches are created via:
|
Build caches are created via:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack buildcache create <path/url/mirror name> <spec>
|
$ spack buildcache create <spec>
|
||||||
|
|
||||||
This command takes the locally installed spec and its dependencies, and
|
|
||||||
creates tarballs of their install prefixes. It also generates metadata files,
|
|
||||||
signed with GPG. These tarballs and metadata files are then pushed to the
|
|
||||||
provided binary cache, which can be a local directory or a remote URL.
|
|
||||||
|
|
||||||
Here is an example where a build cache is created in a local directory named
|
If you wanted to create a build cache in a local directory, you would provide
|
||||||
"spack-cache", to which we push the "ninja" spec:
|
the ``-d`` argument to target that directory, again also specifying the spec.
|
||||||
|
Here is an example creating a local directory, "spack-cache" and creating
|
||||||
|
build cache files for the "ninja" spec:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack buildcache create --allow-root ./spack-cache ninja
|
$ mkdir -p ./spack-cache
|
||||||
==> Pushing binary packages to file:///home/spackuser/spack/spack-cache/build_cache
|
$ spack buildcache create -d ./spack-cache ninja
|
||||||
|
==> Buildcache files will be output to file:///home/spackuser/spack/spack-cache/build_cache
|
||||||
|
gpgconf: socketdir is '/run/user/1000/gnupg'
|
||||||
|
gpg: using "E6DF6A8BD43208E4D6F392F23777740B7DBD643D" as default secret key for signing
|
||||||
|
|
||||||
Not that ``ninja`` must be installed locally for this to work.
|
Note that the targeted spec must already be installed. Once you have a build cache,
|
||||||
|
you can add it as a mirror, discussed next.
|
||||||
|
|
||||||
We're using the ``--allow-root`` flag to tell Spack that is OK when any of
|
.. warning::
|
||||||
the binaries we're pushing contain references to the local Spack install
|
|
||||||
directory.
|
|
||||||
|
|
||||||
Once you have a build cache, you can add it as a mirror, discussed next.
|
Spack improved the format used for binary caches in v0.18. The entire v0.18 series
|
||||||
|
will be able to verify and install binary caches both in the new and in the old format.
|
||||||
|
Support for using the old format is expected to end in v0.19, so we advise users to
|
||||||
|
recreate relevant buildcaches using Spack v0.18 or higher.
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
Finding or installing build cache files
|
Finding or installing build cache files
|
||||||
@@ -68,10 +66,10 @@ with:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack mirror add <name> <url or path>
|
$ spack mirror add <name> <url>
|
||||||
|
|
||||||
|
|
||||||
Both web URLs and local paths on the filesystem can be specified. In the previous
|
Note that the url can be a web url _or_ a local filesystem location. In the previous
|
||||||
example, you might add the directory "spack-cache" and call it ``mymirror``:
|
example, you might add the directory "spack-cache" and call it ``mymirror``:
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +94,7 @@ this new build cache as follows:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack buildcache update-index ./spack-cache
|
$ spack buildcache update-index -d spack-cache/
|
||||||
|
|
||||||
Now you can use list:
|
Now you can use list:
|
||||||
|
|
||||||
@@ -107,38 +105,46 @@ Now you can use list:
|
|||||||
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
|
-- linux-ubuntu20.04-skylake / gcc@9.3.0 ------------------------
|
||||||
ninja@1.10.2
|
ninja@1.10.2
|
||||||
|
|
||||||
With ``mymirror`` configured and an index available, Spack will automatically
|
|
||||||
use it during concretization and installation. That means that you can expect
|
Great! So now let's say you have a different spack installation, or perhaps just
|
||||||
``spack install ninja`` to fetch prebuilt packages from the mirror. Let's
|
a different environment for the same one, and you want to install a package from
|
||||||
verify by re-installing ninja:
|
that build cache. Let's first uninstall the actual library "ninja" to see if we can
|
||||||
|
re-install it from the cache.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack uninstall ninja
|
$ spack uninstall ninja
|
||||||
$ spack install ninja
|
|
||||||
==> Installing ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
|
|
||||||
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spec.json.sig
|
|
||||||
gpg: Signature made Do 12 Jan 2023 16:01:04 CET
|
|
||||||
gpg: using RSA key 61B82B2B2350E171BD17A1744E3A689061D57BF6
|
|
||||||
gpg: Good signature from "example (GPG created for Spack) <example@example.com>" [ultimate]
|
|
||||||
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.10.2/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz.spack
|
|
||||||
==> Extracting ninja-1.10.2-yxferyhmrjkosgta5ei6b4lqf6bxbscz from binary cache
|
|
||||||
==> ninja: Successfully installed ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
|
|
||||||
Search: 0.00s. Fetch: 0.17s. Install: 0.12s. Total: 0.29s
|
|
||||||
[+] /home/harmen/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.11.1-yxferyhmrjkosgta5ei6b4lqf6bxbscz
|
|
||||||
|
|
||||||
|
|
||||||
It worked! You've just completed a full example of creating a build cache with
|
And now reinstall from the buildcache
|
||||||
a spec of interest, adding it as a mirror, updating its index, listing the contents,
|
|
||||||
and finally, installing from it.
|
|
||||||
|
|
||||||
By default Spack falls back to building from sources when the mirror is not available
|
|
||||||
or when the package is simply not already available. To force Spack to only install
|
|
||||||
prebuilt packages, you can use
|
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack install --use-buildcache only <package>
|
$ spack buildcache install ninja
|
||||||
|
==> buildcache spec(s) matching ninja
|
||||||
|
==> Fetching file:///home/spackuser/spack/spack-cache/build_cache/linux-ubuntu20.04-skylake/gcc-9.3.0/ninja-1.10.2/linux-ubuntu20.04-skylake-gcc-9.3.0-ninja-1.10.2-i4e5luour7jxdpc3bkiykd4imke3mkym.spack
|
||||||
|
####################################################################################################################################### 100.0%
|
||||||
|
==> Installing buildcache for spec ninja@1.10.2%gcc@9.3.0 arch=linux-ubuntu20.04-skylake
|
||||||
|
gpgconf: socketdir is '/run/user/1000/gnupg'
|
||||||
|
gpg: Signature made Tue 23 Mar 2021 10:16:29 PM MDT
|
||||||
|
gpg: using RSA key E6DF6A8BD43208E4D6F392F23777740B7DBD643D
|
||||||
|
gpg: Good signature from "spackuser (GPG created for Spack) <spackuser@noreply.users.github.com>" [ultimate]
|
||||||
|
|
||||||
|
|
||||||
|
It worked! You've just completed a full example of creating a build cache with
|
||||||
|
a spec of interest, adding it as a mirror, updating it's index, listing the contents,
|
||||||
|
and finally, installing from it.
|
||||||
|
|
||||||
|
|
||||||
|
Note that the above command is intended to install a particular package to a
|
||||||
|
build cache you have created, and not to install a package from a build cache.
|
||||||
|
For the latter, once a mirror is added, by default when you do ``spack install`` the ``--use-cache``
|
||||||
|
flag is set, and you will install a package from a build cache if it is available.
|
||||||
|
If you want to always use the cache, you can do:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --cache-only <package>
|
||||||
|
|
||||||
For example, to combine all of the commands above to add the E4S build cache
|
For example, to combine all of the commands above to add the E4S build cache
|
||||||
and then install from it exclusively, you would do:
|
and then install from it exclusively, you would do:
|
||||||
@@ -147,7 +153,7 @@ and then install from it exclusively, you would do:
|
|||||||
|
|
||||||
$ spack mirror add E4S https://cache.e4s.io
|
$ spack mirror add E4S https://cache.e4s.io
|
||||||
$ spack buildcache keys --install --trust
|
$ spack buildcache keys --install --trust
|
||||||
$ spack install --use-buildache only <package>
|
$ spack install --cache-only <package>
|
||||||
|
|
||||||
We use ``--install`` and ``--trust`` to say that we are installing keys to our
|
We use ``--install`` and ``--trust`` to say that we are installing keys to our
|
||||||
keyring, and trusting all downloaded keys.
|
keyring, and trusting all downloaded keys.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -272,7 +272,7 @@ Selection of the target microarchitectures
|
|||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The options under the ``targets`` attribute control which targets are considered during a solve.
|
The options under the ``targets`` attribute control which targets are considered during a solve.
|
||||||
Currently the options in this section are only configurable from the ``concretizer.yaml`` file
|
Currently the options in this section are only configurable from the ``concretization.yaml`` file
|
||||||
and there are no corresponding command line arguments to enable them for a single solve.
|
and there are no corresponding command line arguments to enable them for a single solve.
|
||||||
|
|
||||||
The ``granularity`` option can take two possible values: ``microarchitectures`` and ``generic``.
|
The ``granularity`` option can take two possible values: ``microarchitectures`` and ``generic``.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _cachedcmakepackage:
|
.. _cachedcmakepackage:
|
||||||
|
|
||||||
-----------
|
------------------
|
||||||
CachedCMake
|
CachedCMakePackage
|
||||||
-----------
|
------------------
|
||||||
|
|
||||||
The CachedCMakePackage base class is used for CMake-based workflows
|
The CachedCMakePackage base class is used for CMake-based workflows
|
||||||
that create a CMake cache file prior to running ``cmake``. This is
|
that create a CMake cache file prior to running ``cmake``. This is
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _cudapackage:
|
.. _cudapackage:
|
||||||
|
|
||||||
----
|
-----------
|
||||||
Cuda
|
CudaPackage
|
||||||
----
|
-----------
|
||||||
|
|
||||||
Different from other packages, ``CudaPackage`` does not represent a build system.
|
Different from other packages, ``CudaPackage`` does not represent a build system.
|
||||||
Instead its goal is to simplify and unify usage of ``CUDA`` in other packages by providing a `mixin-class <https://en.wikipedia.org/wiki/Mixin>`_.
|
Instead its goal is to simplify and unify usage of ``CUDA`` in other packages by providing a `mixin-class <https://en.wikipedia.org/wiki/Mixin>`_.
|
||||||
@@ -28,14 +28,11 @@ This package provides the following variants:
|
|||||||
|
|
||||||
* **cuda_arch**
|
* **cuda_arch**
|
||||||
|
|
||||||
This variant supports the optional specification of one or multiple architectures.
|
This variant supports the optional specification of the architecture.
|
||||||
Valid values are maintained in the ``cuda_arch_values`` property and
|
Valid values are maintained in the ``cuda_arch_values`` property and
|
||||||
are the numeric character equivalent of the compute capability version
|
are the numeric character equivalent of the compute capability version
|
||||||
(e.g., '10' for version 1.0). Each provided value affects associated
|
(e.g., '10' for version 1.0). Each provided value affects associated
|
||||||
``CUDA`` dependencies and compiler conflicts.
|
``CUDA`` dependencies and compiler conflicts.
|
||||||
|
|
||||||
The variant builds both PTX code for the _virtual_ architecture
|
|
||||||
(e.g. ``compute_10``) and binary code for the _real_ architecture (e.g. ``sm_10``).
|
|
||||||
|
|
||||||
GPUs and their compute capability versions are listed at
|
GPUs and their compute capability versions are listed at
|
||||||
https://developer.nvidia.com/cuda-gpus .
|
https://developer.nvidia.com/cuda-gpus .
|
||||||
@@ -83,7 +80,7 @@ standard CUDA compiler flags.
|
|||||||
|
|
||||||
**cuda_flags**
|
**cuda_flags**
|
||||||
|
|
||||||
This built-in static method returns a list of command line flags
|
This built-in static method returns a list of command line flags
|
||||||
for the chosen ``cuda_arch`` value(s). The flags are intended to
|
for the chosen ``cuda_arch`` value(s). The flags are intended to
|
||||||
be passed to the CUDA compiler driver (i.e., ``nvcc``).
|
be passed to the CUDA compiler driver (i.e., ``nvcc``).
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -6,9 +6,9 @@
|
|||||||
.. _inteloneapipackage:
|
.. _inteloneapipackage:
|
||||||
|
|
||||||
|
|
||||||
===========
|
====================
|
||||||
IntelOneapi
|
IntelOneapiPackage
|
||||||
===========
|
====================
|
||||||
|
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
@@ -36,7 +36,7 @@ For more information on a specific package, do::
|
|||||||
|
|
||||||
Intel no longer releases new versions of Parallel Studio, which can be
|
Intel no longer releases new versions of Parallel Studio, which can be
|
||||||
used in Spack via the :ref:`intelpackage`. All of its components can
|
used in Spack via the :ref:`intelpackage`. All of its components can
|
||||||
now be found in oneAPI.
|
now be found in oneAPI.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
========
|
========
|
||||||
@@ -124,7 +124,7 @@ Using oneAPI Tools Installed by Spack
|
|||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
Spack can be a convenient way to install and configure compilers and
|
Spack can be a convenient way to install and configure compilers and
|
||||||
libraries, even if you do not intend to build a Spack package. If you
|
libaries, even if you do not intend to build a Spack package. If you
|
||||||
want to build a Makefile project using Spack-installed oneAPI compilers,
|
want to build a Makefile project using Spack-installed oneAPI compilers,
|
||||||
then use spack to configure your environment::
|
then use spack to configure your environment::
|
||||||
|
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _intelpackage:
|
.. _intelpackage:
|
||||||
|
|
||||||
-----
|
------------
|
||||||
Intel
|
IntelPackage
|
||||||
-----
|
------------
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ for specifics and examples for ``packages.yaml`` files.
|
|||||||
|
|
||||||
.. If your system administrator did not provide modules for pre-installed Intel
|
.. If your system administrator did not provide modules for pre-installed Intel
|
||||||
tools, you could do well to ask for them, because installing multiple copies
|
tools, you could do well to ask for them, because installing multiple copies
|
||||||
of the Intel tools, as is won't to happen once Spack is in the picture, is
|
of the Intel tools, as is wont to happen once Spack is in the picture, is
|
||||||
bound to stretch disk space and patience thin. If you *are* the system
|
bound to stretch disk space and patience thin. If you *are* the system
|
||||||
administrator and are still new to modules, then perhaps it's best to follow
|
administrator and are still new to modules, then perhaps it's best to follow
|
||||||
the `next section <Installing Intel tools within Spack_>`_ and install the tools
|
the `next section <Installing Intel tools within Spack_>`_ and install the tools
|
||||||
@@ -653,7 +653,7 @@ follow `the next section <intel-install-libs_>`_ instead.
|
|||||||
* If you specified a custom variant (for example ``+vtune``) you may want to add this as your
|
* If you specified a custom variant (for example ``+vtune``) you may want to add this as your
|
||||||
preferred variant in the packages configuration for the ``intel-parallel-studio`` package
|
preferred variant in the packages configuration for the ``intel-parallel-studio`` package
|
||||||
as described in :ref:`package-preferences`. Otherwise you will have to specify
|
as described in :ref:`package-preferences`. Otherwise you will have to specify
|
||||||
the variant every time ``intel-parallel-studio`` is being used as ``mkl``, ``fftw`` or ``mpi``
|
the variant everytime ``intel-parallel-studio`` is being used as ``mkl``, ``fftw`` or ``mpi``
|
||||||
implementation to avoid pulling in a different variant.
|
implementation to avoid pulling in a different variant.
|
||||||
|
|
||||||
* To set the Intel compilers for default use in Spack, instead of the usual ``%gcc``,
|
* To set the Intel compilers for default use in Spack, instead of the usual ``%gcc``,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _pythonpackage:
|
.. _pythonpackage:
|
||||||
|
|
||||||
------
|
-------------
|
||||||
Python
|
PythonPackage
|
||||||
------
|
-------------
|
||||||
|
|
||||||
Python packages and modules have their own special build system. This
|
Python packages and modules have their own special build system. This
|
||||||
documentation covers everything you'll need to know in order to write
|
documentation covers everything you'll need to know in order to write
|
||||||
@@ -366,7 +366,7 @@ If the ``pyproject.toml`` lists ``mesonpy`` as the ``build-backend``,
|
|||||||
it uses the meson build system. Meson uses the default
|
it uses the meson build system. Meson uses the default
|
||||||
``pyproject.toml`` keys to list dependencies.
|
``pyproject.toml`` keys to list dependencies.
|
||||||
|
|
||||||
See https://meson-python.readthedocs.io/en/latest/tutorials/introduction.html
|
See https://meson-python.readthedocs.io/en/latest/usage/start.html
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -582,7 +582,7 @@ libraries. Make sure not to add modules/packages containing the word
|
|||||||
"test", as these likely won't end up in the installation directory,
|
"test", as these likely won't end up in the installation directory,
|
||||||
or may require test dependencies like pytest to be installed.
|
or may require test dependencies like pytest to be installed.
|
||||||
|
|
||||||
Instead of defining the ``import_modules`` explicitly, only the subset
|
Instead of defining the ``import_modules`` explicity, only the subset
|
||||||
of module names to be skipped can be defined by using ``skip_modules``.
|
of module names to be skipped can be defined by using ``skip_modules``.
|
||||||
If a defined module has submodules, they are skipped as well, e.g.,
|
If a defined module has submodules, they are skipped as well, e.g.,
|
||||||
in case the ``plotting`` modules should be excluded from the
|
in case the ``plotting`` modules should be excluded from the
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _rocmpackage:
|
.. _rocmpackage:
|
||||||
|
|
||||||
----
|
-----------
|
||||||
ROCm
|
ROCmPackage
|
||||||
----
|
-----------
|
||||||
|
|
||||||
The ``ROCmPackage`` is not a build system but a helper package. Like ``CudaPackage``,
|
The ``ROCmPackage`` is not a build system but a helper package. Like ``CudaPackage``,
|
||||||
it provides standard variants, dependencies, and conflicts to facilitate building
|
it provides standard variants, dependencies, and conflicts to facilitate building
|
||||||
@@ -25,7 +25,7 @@ This package provides the following variants:
|
|||||||
|
|
||||||
* **rocm**
|
* **rocm**
|
||||||
|
|
||||||
This variant is used to enable/disable building with ``rocm``.
|
This variant is used to enable/disable building with ``rocm``.
|
||||||
The default is disabled (or ``False``).
|
The default is disabled (or ``False``).
|
||||||
|
|
||||||
* **amdgpu_target**
|
* **amdgpu_target**
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _rpackage:
|
.. _rpackage:
|
||||||
|
|
||||||
--
|
--------
|
||||||
R
|
RPackage
|
||||||
--
|
--------
|
||||||
|
|
||||||
Like Python, R has its own built-in build system.
|
Like Python, R has its own built-in build system.
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
.. _sourceforgepackage:
|
.. _sourceforgepackage:
|
||||||
|
|
||||||
-----------
|
------------------
|
||||||
Sourceforge
|
SourceforgePackage
|
||||||
-----------
|
------------------
|
||||||
|
|
||||||
``SourceforgePackage`` is a
|
``SourceforgePackage`` is a
|
||||||
`mixin-class <https://en.wikipedia.org/wiki/Mixin>`_. It automatically
|
`mixin-class <https://en.wikipedia.org/wiki/Mixin>`_. It automatically
|
||||||
sets the URL based on a list of Sourceforge mirrors listed in
|
sets the URL based on a list of Sourceforge mirrors listed in
|
||||||
`sourceforge_mirror_path`, which defaults to a half dozen known mirrors.
|
`sourceforge_mirror_path`, which defaults to a half dozen known mirrors.
|
||||||
Refer to the package source
|
Refer to the package source
|
||||||
(`<https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/sourceforge.py>`__) for the current list of mirrors used by Spack.
|
(`<https://github.com/spack/spack/blob/develop/lib/spack/spack/build_systems/sourceforge.py>`__) for the current list of mirrors used by Spack.
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ This package provides a method for populating mirror URLs.
|
|||||||
It is decorated with `property` so its results are treated as
|
It is decorated with `property` so its results are treated as
|
||||||
a package attribute.
|
a package attribute.
|
||||||
|
|
||||||
Refer to
|
Refer to
|
||||||
`<https://spack.readthedocs.io/en/latest/packaging_guide.html#mirrors-of-the-main-url>`__
|
`<https://spack.readthedocs.io/en/latest/packaging_guide.html#mirrors-of-the-main-url>`__
|
||||||
for information on how Spack uses the `urls` attribute during
|
for information on how Spack uses the `urls` attribute during
|
||||||
fetching.
|
fetching.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -58,7 +58,9 @@ Testing
|
|||||||
``WafPackage`` also provides ``test`` and ``installtest`` methods,
|
``WafPackage`` also provides ``test`` and ``installtest`` methods,
|
||||||
which are run after the ``build`` and ``install`` phases, respectively.
|
which are run after the ``build`` and ``install`` phases, respectively.
|
||||||
By default, these phases do nothing, but you can override them to
|
By default, these phases do nothing, but you can override them to
|
||||||
run package-specific unit tests.
|
run package-specific unit tests. For example, the
|
||||||
|
`py-py2cairo <https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/py-py2cairo/package.py>`_
|
||||||
|
package uses:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -36,7 +36,13 @@
|
|||||||
if not os.path.exists(link_name):
|
if not os.path.exists(link_name):
|
||||||
os.symlink(os.path.abspath("../../.."), link_name, target_is_directory=True)
|
os.symlink(os.path.abspath("../../.."), link_name, target_is_directory=True)
|
||||||
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external"))
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external"))
|
||||||
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/_vendoring"))
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/pytest-fallback"))
|
||||||
|
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/yaml/lib"))
|
||||||
|
else:
|
||||||
|
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/yaml/lib3"))
|
||||||
|
|
||||||
sys.path.append(os.path.abspath("_spack_root/lib/spack/"))
|
sys.path.append(os.path.abspath("_spack_root/lib/spack/"))
|
||||||
|
|
||||||
# Add the Spack bin directory to the path so that we can use its output in docs.
|
# Add the Spack bin directory to the path so that we can use its output in docs.
|
||||||
@@ -74,22 +80,13 @@
|
|||||||
"--force", # Overwrite existing files
|
"--force", # Overwrite existing files
|
||||||
"--no-toc", # Don't create a table of contents file
|
"--no-toc", # Don't create a table of contents file
|
||||||
"--output-dir=.", # Directory to place all output
|
"--output-dir=.", # Directory to place all output
|
||||||
"--module-first", # emit module docs before submodule docs
|
|
||||||
]
|
]
|
||||||
sphinx_apidoc(
|
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/spack"])
|
||||||
apidoc_args
|
|
||||||
+ [
|
|
||||||
"_spack_root/lib/spack/spack",
|
|
||||||
"_spack_root/lib/spack/spack/test/*.py",
|
|
||||||
"_spack_root/lib/spack/spack/test/cmd/*.py",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/llnl"])
|
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/llnl"])
|
||||||
|
|
||||||
# Enable todo items
|
# Enable todo items
|
||||||
todo_include_todos = True
|
todo_include_todos = True
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Disable duplicate cross-reference warnings.
|
# Disable duplicate cross-reference warnings.
|
||||||
#
|
#
|
||||||
@@ -163,8 +160,8 @@ def setup(sphinx):
|
|||||||
master_doc = "index"
|
master_doc = "index"
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = "Spack"
|
project = u"Spack"
|
||||||
copyright = "2013-2023, Lawrence Livermore National Laboratory."
|
copyright = u"2013-2021, Lawrence Livermore National Laboratory."
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
@@ -209,14 +206,12 @@ def setup(sphinx):
|
|||||||
("py:class", "_frozen_importlib_external.SourceFileLoader"),
|
("py:class", "_frozen_importlib_external.SourceFileLoader"),
|
||||||
("py:class", "clingo.Control"),
|
("py:class", "clingo.Control"),
|
||||||
("py:class", "six.moves.urllib.parse.ParseResult"),
|
("py:class", "six.moves.urllib.parse.ParseResult"),
|
||||||
("py:class", "TextIO"),
|
|
||||||
# Spack classes that are private and we don't want to expose
|
# Spack classes that are private and we don't want to expose
|
||||||
("py:class", "spack.provider_index._IndexBase"),
|
("py:class", "spack.provider_index._IndexBase"),
|
||||||
("py:class", "spack.repo._PrependFileLoader"),
|
("py:class", "spack.repo._PrependFileLoader"),
|
||||||
("py:class", "spack.build_systems._checks.BaseBuilder"),
|
("py:class", "spack.build_systems._checks.BaseBuilder"),
|
||||||
# Spack classes that intersphinx is unable to resolve
|
# Spack classes that intersphinx is unable to resolve
|
||||||
("py:class", "spack.version.VersionBase"),
|
("py:class", "spack.version.VersionBase"),
|
||||||
("py:class", "spack.spec.DependencySpec"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||||
@@ -354,7 +349,9 @@ class SpackStyle(DefaultStyle):
|
|||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||||
latex_documents = [("index", "Spack.tex", "Spack Documentation", "Todd Gamblin", "manual")]
|
latex_documents = [
|
||||||
|
("index", "Spack.tex", u"Spack Documentation", u"Todd Gamblin", "manual"),
|
||||||
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
# the title page.
|
# the title page.
|
||||||
@@ -381,7 +378,7 @@ class SpackStyle(DefaultStyle):
|
|||||||
|
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [("index", "spack", "Spack Documentation", ["Todd Gamblin"], 1)]
|
man_pages = [("index", "spack", u"Spack Documentation", [u"Todd Gamblin"], 1)]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
# man_show_urls = False
|
# man_show_urls = False
|
||||||
@@ -396,12 +393,12 @@ class SpackStyle(DefaultStyle):
|
|||||||
(
|
(
|
||||||
"index",
|
"index",
|
||||||
"Spack",
|
"Spack",
|
||||||
"Spack Documentation",
|
u"Spack Documentation",
|
||||||
"Todd Gamblin",
|
u"Todd Gamblin",
|
||||||
"Spack",
|
"Spack",
|
||||||
"One line description of project.",
|
"One line description of project.",
|
||||||
"Miscellaneous",
|
"Miscellaneous",
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
# Documents to append as an appendix to all manuals.
|
||||||
@@ -417,4 +414,6 @@ class SpackStyle(DefaultStyle):
|
|||||||
# -- Extension configuration -------------------------------------------------
|
# -- Extension configuration -------------------------------------------------
|
||||||
|
|
||||||
# sphinx.ext.intersphinx
|
# sphinx.ext.intersphinx
|
||||||
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
|
intersphinx_mapping = {
|
||||||
|
"python": ("https://docs.python.org/3", None),
|
||||||
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -222,7 +222,7 @@ and location. (See the *Configuration settings* section of ``man
|
|||||||
ccache`` to learn more about the default settings and how to change
|
ccache`` to learn more about the default settings and how to change
|
||||||
them). Please note that we currently disable ccache's ``hash_dir``
|
them). Please note that we currently disable ccache's ``hash_dir``
|
||||||
feature to avoid an issue with the stage directory (see
|
feature to avoid an issue with the stage directory (see
|
||||||
https://github.com/spack/spack/pull/3761#issuecomment-294352232).
|
https://github.com/LLNL/spack/pull/3761#issuecomment-294352232).
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
``shared_linking:type``
|
``shared_linking:type``
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -227,9 +227,6 @@ You can get the name to use for ``<platform>`` by running ``spack arch
|
|||||||
--platform``. The system config scope has a ``<platform>`` section for
|
--platform``. The system config scope has a ``<platform>`` section for
|
||||||
sites at which ``/etc`` is mounted on multiple heterogeneous machines.
|
sites at which ``/etc`` is mounted on multiple heterogeneous machines.
|
||||||
|
|
||||||
|
|
||||||
.. _config-scope-precedence:
|
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
Scope Precedence
|
Scope Precedence
|
||||||
----------------
|
----------------
|
||||||
@@ -242,11 +239,6 @@ lower-precedence settings. Completely ignoring higher-level configuration
|
|||||||
options is supported with the ``::`` notation for keys (see
|
options is supported with the ``::`` notation for keys (see
|
||||||
:ref:`config-overrides` below).
|
:ref:`config-overrides` below).
|
||||||
|
|
||||||
There are also special notations for string concatenation and precendense override.
|
|
||||||
Using the ``+:`` notation can be used to force *prepending* strings or lists. For lists, this is identical
|
|
||||||
to the default behavior. Using the ``-:`` works similarly, but for *appending* values.
|
|
||||||
:ref:`config-prepend-append`
|
|
||||||
|
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
Simple keys
|
Simple keys
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
@@ -287,47 +279,6 @@ command:
|
|||||||
- ~/.spack/stage
|
- ~/.spack/stage
|
||||||
|
|
||||||
|
|
||||||
.. _config-prepend-append:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
String Concatenation
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Above, the user ``config.yaml`` *completely* overrides specific settings in the
|
|
||||||
default ``config.yaml``. Sometimes, it is useful to add a suffix/prefix
|
|
||||||
to a path or name. To do this, you can use the ``-:`` notation for *append*
|
|
||||||
string concatenation at the end of a key in a configuration file. For example:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 1
|
|
||||||
:caption: ~/.spack/config.yaml
|
|
||||||
|
|
||||||
config:
|
|
||||||
install_tree-: /my/custom/suffix/
|
|
||||||
|
|
||||||
Spack will then append to the lower-precedence configuration under the
|
|
||||||
``install_tree-:`` section:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack config get config
|
|
||||||
config:
|
|
||||||
install_tree: /some/other/directory/my/custom/suffix
|
|
||||||
build_stage:
|
|
||||||
- $tempdir/$user/spack-stage
|
|
||||||
- ~/.spack/stage
|
|
||||||
|
|
||||||
|
|
||||||
Similarly, ``+:`` can be used to *prepend* to a path or name:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 1
|
|
||||||
:caption: ~/.spack/config.yaml
|
|
||||||
|
|
||||||
config:
|
|
||||||
install_tree+: /my/custom/suffix/
|
|
||||||
|
|
||||||
|
|
||||||
.. _config-overrides:
|
.. _config-overrides:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@@ -443,7 +394,7 @@ are indicated at the start of the path with ``~`` or ``~user``.
|
|||||||
Spack-specific variables
|
Spack-specific variables
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Spack understands over a dozen special variables. These are:
|
Spack understands several special variables. These are:
|
||||||
|
|
||||||
* ``$env``: name of the currently active :ref:`environment <environments>`
|
* ``$env``: name of the currently active :ref:`environment <environments>`
|
||||||
* ``$spack``: path to the prefix of this Spack installation
|
* ``$spack``: path to the prefix of this Spack installation
|
||||||
@@ -465,8 +416,6 @@ Spack understands over a dozen special variables. These are:
|
|||||||
ArchSpec. E.g. ``skylake`` or ``neoverse-n1``.
|
ArchSpec. E.g. ``skylake`` or ``neoverse-n1``.
|
||||||
* ``$target_family``. The target family for the current host, as
|
* ``$target_family``. The target family for the current host, as
|
||||||
detected by ArchSpec. E.g. ``x86_64`` or ``aarch64``.
|
detected by ArchSpec. E.g. ``x86_64`` or ``aarch64``.
|
||||||
* ``$date``: the current date in the format YYYY-MM-DD
|
|
||||||
|
|
||||||
|
|
||||||
Note that, as with shell variables, you can write these as ``$varname``
|
Note that, as with shell variables, you can write these as ``$varname``
|
||||||
or with braces to distinguish the variable from surrounding characters:
|
or with braces to distinguish the variable from surrounding characters:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -444,120 +444,6 @@ attribute:
|
|||||||
The minimum version of Singularity required to build a SIF (Singularity Image Format)
|
The minimum version of Singularity required to build a SIF (Singularity Image Format)
|
||||||
image from the recipes generated by Spack is ``3.5.3``.
|
image from the recipes generated by Spack is ``3.5.3``.
|
||||||
|
|
||||||
------------------------------
|
|
||||||
Extending the Jinja2 Templates
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
The Dockerfile and the Singularity definition file that Spack can generate are based on
|
|
||||||
a few Jinja2 templates that are rendered according to the environment being containerized.
|
|
||||||
Even though Spack allows a great deal of customization by just setting appropriate values for
|
|
||||||
the configuration options, sometimes that is not enough.
|
|
||||||
|
|
||||||
In those cases, a user can directly extend the template that Spack uses to render the image
|
|
||||||
to e.g. set additional environment variables or perform specific operations either before or
|
|
||||||
after a given stage of the build. Let's consider as an example the following structure:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ tree /opt/environment
|
|
||||||
/opt/environment
|
|
||||||
├── data
|
|
||||||
│ └── data.csv
|
|
||||||
├── spack.yaml
|
|
||||||
├── data
|
|
||||||
└── templates
|
|
||||||
└── container
|
|
||||||
└── CustomDockerfile
|
|
||||||
|
|
||||||
containing both the custom template extension and the environment manifest file. To use a custom
|
|
||||||
template, the environment must register the directory containing it, and declare its use under the
|
|
||||||
``container`` configuration:
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
|
||||||
:emphasize-lines: 7-8,12
|
|
||||||
|
|
||||||
spack:
|
|
||||||
specs:
|
|
||||||
- hdf5~mpi
|
|
||||||
concretizer:
|
|
||||||
unify: true
|
|
||||||
config:
|
|
||||||
template_dirs:
|
|
||||||
- /opt/environment/templates
|
|
||||||
container:
|
|
||||||
format: docker
|
|
||||||
depfile: true
|
|
||||||
template: container/CustomDockerfile
|
|
||||||
|
|
||||||
The template extension can override two blocks, named ``build_stage`` and ``final_stage``, similarly to
|
|
||||||
the example below:
|
|
||||||
|
|
||||||
.. code-block::
|
|
||||||
:emphasize-lines: 3,8
|
|
||||||
|
|
||||||
{% extends "container/Dockerfile" %}
|
|
||||||
{% block build_stage %}
|
|
||||||
RUN echo "Start building"
|
|
||||||
{{ super() }}
|
|
||||||
{% endblock %}
|
|
||||||
{% block final_stage %}
|
|
||||||
{{ super() }}
|
|
||||||
COPY data /share/myapp/data
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
The recipe that gets generated contains the two extra instruction that we added in our template extension:
|
|
||||||
|
|
||||||
.. code-block:: Dockerfile
|
|
||||||
:emphasize-lines: 4,43
|
|
||||||
|
|
||||||
# Build stage with Spack pre-installed and ready to be used
|
|
||||||
FROM spack/ubuntu-jammy:latest as builder
|
|
||||||
|
|
||||||
RUN echo "Start building"
|
|
||||||
|
|
||||||
# What we want to install and how we want to install it
|
|
||||||
# is specified in a manifest file (spack.yaml)
|
|
||||||
RUN mkdir /opt/spack-environment \
|
|
||||||
&& (echo "spack:" \
|
|
||||||
&& echo " specs:" \
|
|
||||||
&& echo " - hdf5~mpi" \
|
|
||||||
&& echo " concretizer:" \
|
|
||||||
&& echo " unify: true" \
|
|
||||||
&& echo " config:" \
|
|
||||||
&& echo " template_dirs:" \
|
|
||||||
&& echo " - /tmp/environment/templates" \
|
|
||||||
&& echo " install_tree: /opt/software" \
|
|
||||||
&& echo " view: /opt/view") > /opt/spack-environment/spack.yaml
|
|
||||||
|
|
||||||
# Install the software, remove unnecessary deps
|
|
||||||
RUN cd /opt/spack-environment && spack env activate . && spack concretize && spack env depfile -o Makefile && make -j $(nproc) && spack gc -y
|
|
||||||
|
|
||||||
# Strip all the binaries
|
|
||||||
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
|
|
||||||
xargs file -i | \
|
|
||||||
grep 'charset=binary' | \
|
|
||||||
grep 'x-executable\|x-archive\|x-sharedlib' | \
|
|
||||||
awk -F: '{print $1}' | xargs strip -s
|
|
||||||
|
|
||||||
# Modifications to the environment that are necessary to run
|
|
||||||
RUN cd /opt/spack-environment && \
|
|
||||||
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
|
|
||||||
|
|
||||||
# Bare OS image to run the installed executables
|
|
||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
COPY --from=builder /opt/spack-environment /opt/spack-environment
|
|
||||||
COPY --from=builder /opt/software /opt/software
|
|
||||||
COPY --from=builder /opt/._view /opt/._view
|
|
||||||
COPY --from=builder /opt/view /opt/view
|
|
||||||
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
|
|
||||||
|
|
||||||
COPY data /share/myapp/data
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c", "$*", "--" ]
|
|
||||||
CMD [ "/bin/bash" ]
|
|
||||||
|
|
||||||
|
|
||||||
.. _container_config_options:
|
.. _container_config_options:
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
@@ -578,10 +464,6 @@ to customize the generation of container recipes:
|
|||||||
- The format of the recipe
|
- The format of the recipe
|
||||||
- ``docker`` or ``singularity``
|
- ``docker`` or ``singularity``
|
||||||
- Yes
|
- Yes
|
||||||
* - ``depfile``
|
|
||||||
- Whether to use a depfile for installation, or not
|
|
||||||
- True or False (default)
|
|
||||||
- No
|
|
||||||
* - ``images:os``
|
* - ``images:os``
|
||||||
- Operating system used as a base for the image
|
- Operating system used as a base for the image
|
||||||
- See :ref:`containers-supported-os`
|
- See :ref:`containers-supported-os`
|
||||||
@@ -630,6 +512,14 @@ to customize the generation of container recipes:
|
|||||||
- System packages needed at run-time
|
- System packages needed at run-time
|
||||||
- Valid packages for the current OS
|
- Valid packages for the current OS
|
||||||
- No
|
- No
|
||||||
|
* - ``extra_instructions:build``
|
||||||
|
- Extra instructions (e.g. `RUN`, `COPY`, etc.) at the end of the ``build`` stage
|
||||||
|
- Anything understood by the current ``format``
|
||||||
|
- No
|
||||||
|
* - ``extra_instructions:final``
|
||||||
|
- Extra instructions (e.g. `RUN`, `COPY`, etc.) at the end of the ``final`` stage
|
||||||
|
- Anything understood by the current ``format``
|
||||||
|
- No
|
||||||
* - ``labels``
|
* - ``labels``
|
||||||
- Labels to tag the image
|
- Labels to tag the image
|
||||||
- Pairs of key-value strings
|
- Pairs of key-value strings
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -118,7 +118,7 @@ make another change, test that change, etc. We use `pytest
|
|||||||
<http://pytest.org/>`_ as our tests framework, and these types of
|
<http://pytest.org/>`_ as our tests framework, and these types of
|
||||||
arguments are just passed to the ``pytest`` command underneath. See `the
|
arguments are just passed to the ``pytest`` command underneath. See `the
|
||||||
pytest docs
|
pytest docs
|
||||||
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
|
<http://doc.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests>`_
|
||||||
for more details on test selection syntax.
|
for more details on test selection syntax.
|
||||||
|
|
||||||
``spack unit-test`` has a few special options that can help you
|
``spack unit-test`` has a few special options that can help you
|
||||||
@@ -147,7 +147,7 @@ you want to know about. For example, to see just the tests in
|
|||||||
|
|
||||||
You can also combine any of these options with a ``pytest`` keyword
|
You can also combine any of these options with a ``pytest`` keyword
|
||||||
search. See the `pytest usage docs
|
search. See the `pytest usage docs
|
||||||
<https://doc.pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run>`_
|
<https://docs.pytest.org/en/stable/usage.html#specifying-tests-selecting-tests>`_:
|
||||||
for more details on test selection syntax. For example, to see the names of all tests that have "spec"
|
for more details on test selection syntax. For example, to see the names of all tests that have "spec"
|
||||||
or "concretize" somewhere in their names:
|
or "concretize" somewhere in their names:
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -175,11 +175,14 @@ Spec-related modules
|
|||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
:mod:`spack.spec`
|
:mod:`spack.spec`
|
||||||
Contains :class:`~spack.spec.Spec`. Also implements most of the logic for concretization
|
Contains :class:`~spack.spec.Spec` and :class:`~spack.spec.SpecParser`.
|
||||||
|
Also implements most of the logic for normalization and concretization
|
||||||
of specs.
|
of specs.
|
||||||
|
|
||||||
:mod:`spack.parser`
|
:mod:`spack.parse`
|
||||||
Contains :class:`~spack.parser.SpecParser` and functions related to parsing specs.
|
Contains some base classes for implementing simple recursive descent
|
||||||
|
parsers: :class:`~spack.parse.Parser` and :class:`~spack.parse.Lexer`.
|
||||||
|
Used by :class:`~spack.spec.SpecParser`.
|
||||||
|
|
||||||
:mod:`spack.concretize`
|
:mod:`spack.concretize`
|
||||||
Contains :class:`~spack.concretize.Concretizer` implementation,
|
Contains :class:`~spack.concretize.Concretizer` implementation,
|
||||||
@@ -232,7 +235,7 @@ Spack Subcommands
|
|||||||
Unit tests
|
Unit tests
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
||||||
``spack.test``
|
:mod:`spack.test`
|
||||||
Implements Spack's test suite. Add a module and put its name in
|
Implements Spack's test suite. Add a module and put its name in
|
||||||
the test suite in ``__init__.py`` to add more unit tests.
|
the test suite in ``__init__.py`` to add more unit tests.
|
||||||
|
|
||||||
@@ -472,7 +475,7 @@ use my new hook as follows:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
def post_log_write(message, level):
|
def post_log_write(message, level):
|
||||||
"""Do something custom with the message and level every time we write
|
"""Do something custom with the messsage and level every time we write
|
||||||
to the log
|
to the log
|
||||||
"""
|
"""
|
||||||
print('running post_log_write!')
|
print('running post_log_write!')
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -58,9 +58,9 @@ Using Environments
|
|||||||
Here we follow a typical use case of creating, concretizing,
|
Here we follow a typical use case of creating, concretizing,
|
||||||
installing and loading an environment.
|
installing and loading an environment.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Creating a managed Environment
|
Creating a named Environment
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
An environment is created by:
|
An environment is created by:
|
||||||
|
|
||||||
@@ -72,8 +72,7 @@ Spack then creates the directory ``var/spack/environments/myenv``.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
All managed environments by default are stored in the ``var/spack/environments`` folder.
|
All named environments are stored in the ``var/spack/environments`` folder.
|
||||||
This location can be changed by setting the ``environments_root`` variable in ``config.yaml``.
|
|
||||||
|
|
||||||
In the ``var/spack/environments/myenv`` directory, Spack creates the
|
In the ``var/spack/environments/myenv`` directory, Spack creates the
|
||||||
file ``spack.yaml`` and the hidden directory ``.spack-env``.
|
file ``spack.yaml`` and the hidden directory ``.spack-env``.
|
||||||
@@ -1040,7 +1039,7 @@ gets installed and is available for use in the ``env`` target.
|
|||||||
$(SPACK) -e . concretize -f
|
$(SPACK) -e . concretize -f
|
||||||
|
|
||||||
env.mk: spack.lock
|
env.mk: spack.lock
|
||||||
$(SPACK) -e . env depfile -o $@ --make-prefix spack
|
$(SPACK) -e . env depfile -o $@ --make-target-prefix spack
|
||||||
|
|
||||||
env: spack/env
|
env: spack/env
|
||||||
$(info Environment installed!)
|
$(info Environment installed!)
|
||||||
@@ -1063,79 +1062,27 @@ the include is conditional.
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
When including generated ``Makefile``\s, it is important to use
|
When including generated ``Makefile``\s, it is important to use
|
||||||
the ``--make-prefix`` flag and use the non-phony target
|
the ``--make-target-prefix`` flag and use the non-phony target
|
||||||
``<prefix>/env`` as prerequisite, instead of the phony target
|
``<target-prefix>/env`` as prerequisite, instead of the phony target
|
||||||
``<prefix>/all``.
|
``<target-prefix>/all``.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Building a subset of the environment
|
Building a subset of the environment
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The generated ``Makefile``\s contain install targets for each spec, identified
|
The generated ``Makefile``\s contain install targets for each spec. Given the hash
|
||||||
by ``<name>-<version>-<hash>``. This allows you to install only a subset of the
|
of a particular spec, you can use the ``.install/<hash>`` target to install the
|
||||||
packages in the environment. When packages are unique in the environment, it's
|
spec with its dependencies. There is also ``.install-deps/<hash>`` to *only* install
|
||||||
enough to know the name and let tab-completion fill out the version and hash.
|
|
||||||
|
|
||||||
The following phony targets are available: ``install/<spec>`` to install the
|
|
||||||
spec with its dependencies, and ``install-deps/<spec>`` to *only* install
|
|
||||||
its dependencies. This can be useful when certain flags should only apply to
|
its dependencies. This can be useful when certain flags should only apply to
|
||||||
dependencies. Below we show a use case where a spec is installed with verbose
|
dependencies. Below we show a use case where a spec is installed with verbose
|
||||||
output (``spack install --verbose``) while its dependencies are installed silently:
|
output (``spack install --verbose``) while its dependencies are installed silently:
|
||||||
|
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
$ spack env depfile -o Makefile
|
$ spack env depfile -o Makefile --make-target-prefix my_env
|
||||||
|
|
||||||
# Install dependencies in parallel, only show a log on error.
|
# Install dependencies in parallel, only show a log on error.
|
||||||
$ make -j16 install-deps/python-3.11.0-<hash> SPACK_INSTALL_FLAGS=--show-log-on-error
|
$ make -j16 my_env/.install-deps/<hash> SPACK_INSTALL_FLAGS=--show-log-on-error
|
||||||
|
|
||||||
# Install the root spec with verbose output.
|
# Install the root spec with verbose output.
|
||||||
$ make -j16 install/python-3.11.0-<hash> SPACK_INSTALL_FLAGS=--verbose
|
$ make -j16 my_env/.install/<hash> SPACK_INSTALL_FLAGS=--verbose
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Adding post-install hooks
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Another advanced use-case of generated ``Makefile``\s is running a post-install
|
|
||||||
command for each package. These "hooks" could be anything from printing a
|
|
||||||
post-install message, running tests, or pushing just-built binaries to a buildcache.
|
|
||||||
|
|
||||||
This can be accomplished through the generated ``[<prefix>/]SPACK_PACKAGE_IDS``
|
|
||||||
variable. Assuming we have an active and concrete environment, we generate the
|
|
||||||
associated ``Makefile`` with a prefix ``example``:
|
|
||||||
|
|
||||||
.. code:: console
|
|
||||||
|
|
||||||
$ spack env depfile -o env.mk --make-prefix example
|
|
||||||
|
|
||||||
And we now include it in a different ``Makefile``, in which we create a target
|
|
||||||
``example/push/%`` with ``%`` referring to a package identifier. This target
|
|
||||||
depends on the particular package installation. In this target we automatically
|
|
||||||
have the target-specific ``HASH`` and ``SPEC`` variables at our disposal. They
|
|
||||||
are respectively the spec hash (excluding leading ``/``), and a human-readable spec.
|
|
||||||
Finally, we have an entrypoint target ``push`` that will update the buildcache
|
|
||||||
index once every package is pushed. Note how this target uses the generated
|
|
||||||
``example/SPACK_PACKAGE_IDS`` variable to define its prerequisites.
|
|
||||||
|
|
||||||
.. code:: Makefile
|
|
||||||
|
|
||||||
SPACK ?= spack
|
|
||||||
BUILDCACHE_DIR = $(CURDIR)/tarballs
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
|
|
||||||
all: push
|
|
||||||
|
|
||||||
include env.mk
|
|
||||||
|
|
||||||
example/push/%: example/install/%
|
|
||||||
@mkdir -p $(dir $@)
|
|
||||||
$(info About to push $(SPEC) to a buildcache)
|
|
||||||
$(SPACK) -e . buildcache create --allow-root --only=package --directory $(BUILDCACHE_DIR) /$(HASH)
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
push: $(addprefix example/push/,$(example/SPACK_PACKAGE_IDS))
|
|
||||||
$(info Updating the buildcache index)
|
|
||||||
$(SPACK) -e . buildcache update-index --directory $(BUILDCACHE_DIR)
|
|
||||||
$(info Done!)
|
|
||||||
@touch $@
|
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -116,7 +116,7 @@ creates a simple python file:
|
|||||||
|
|
||||||
# FIXME: Add a list of GitHub accounts to
|
# FIXME: Add a list of GitHub accounts to
|
||||||
# notify when the package is updated.
|
# notify when the package is updated.
|
||||||
# maintainers("github_user1", "github_user2")
|
# maintainers = ["github_user1", "github_user2"]
|
||||||
|
|
||||||
version("0.8.13", sha256="591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d")
|
version("0.8.13", sha256="591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d")
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -21,9 +21,8 @@ be present on the machine where Spack is run:
|
|||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|
||||||
These requirements can be easily installed on most modern Linux systems;
|
These requirements can be easily installed on most modern Linux systems;
|
||||||
on macOS, the Command Line Tools package is required, and a full XCode suite
|
on macOS, XCode is required. Spack is designed to run on HPC
|
||||||
may be necessary for some packages such as Qt and apple-gl. Spack is designed
|
platforms like Cray. Not all packages should be expected
|
||||||
to run on HPC platforms like Cray. Not all packages should be expected
|
|
||||||
to work on all platforms.
|
to work on all platforms.
|
||||||
|
|
||||||
A build matrix showing which packages are working on which systems is shown below.
|
A build matrix showing which packages are working on which systems is shown below.
|
||||||
@@ -1506,7 +1505,7 @@ Spack On Windows
|
|||||||
|
|
||||||
Windows support for Spack is currently under development. While this work is still in an early stage,
|
Windows support for Spack is currently under development. While this work is still in an early stage,
|
||||||
it is currently possible to set up Spack and perform a few operations on Windows. This section will guide
|
it is currently possible to set up Spack and perform a few operations on Windows. This section will guide
|
||||||
you through the steps needed to install Spack and start running it on a fresh Windows machine.
|
you through the steps needed to install Spack and start running it on a fresh Windows machine.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Step 1: Install prerequisites
|
Step 1: Install prerequisites
|
||||||
@@ -1516,7 +1515,7 @@ To use Spack on Windows, you will need the following packages:
|
|||||||
|
|
||||||
Required:
|
Required:
|
||||||
* Microsoft Visual Studio
|
* Microsoft Visual Studio
|
||||||
* Python
|
* Python
|
||||||
* Git
|
* Git
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
@@ -1547,8 +1546,8 @@ Intel Fortran
|
|||||||
"""""""""""""
|
"""""""""""""
|
||||||
|
|
||||||
For Fortran-based packages on Windows, we strongly recommend Intel's oneAPI Fortran compilers.
|
For Fortran-based packages on Windows, we strongly recommend Intel's oneAPI Fortran compilers.
|
||||||
The suite is free to download from Intel's website, located at
|
The suite is free to download from Intel's website, located at
|
||||||
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html.
|
https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fortran-compiler.html#gs.70t5tw.
|
||||||
The executable of choice for Spack will be Intel's Beta Compiler, ifx, which supports the classic
|
The executable of choice for Spack will be Intel's Beta Compiler, ifx, which supports the classic
|
||||||
compiler's (ifort's) frontend and runtime libraries by using LLVM.
|
compiler's (ifort's) frontend and runtime libraries by using LLVM.
|
||||||
|
|
||||||
@@ -1597,8 +1596,8 @@ in a Windows CMD prompt.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If you chose to install Spack into a directory on Windows that is set up to require Administrative
|
If you chose to install Spack into a directory on Windows that is set up to require Administrative
|
||||||
Privileges, Spack will require elevated privileges to run.
|
Privleges, Spack will require elevated privleges to run.
|
||||||
Administrative Privileges can be denoted either by default such as
|
Administrative Privleges can be denoted either by default such as
|
||||||
``C:\Program Files``, or aministrator applied administrative restrictions
|
``C:\Program Files``, or aministrator applied administrative restrictions
|
||||||
on a directory that spack installs files to such as ``C:\Users``
|
on a directory that spack installs files to such as ``C:\Users``
|
||||||
|
|
||||||
@@ -1694,21 +1693,33 @@ Spack console via:
|
|||||||
|
|
||||||
spack install cpuinfo
|
spack install cpuinfo
|
||||||
|
|
||||||
If in the previous step, you did not have CMake or Ninja installed, running the command above should bootstrap both packages
|
If in the previous step, you did not have CMake or Ninja installed, running the command above should boostrap both packages
|
||||||
|
|
||||||
"""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""
|
||||||
Windows Compatible Packages
|
Windows Compatible Packages
|
||||||
"""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""
|
||||||
|
|
||||||
Not all spack packages currently have Windows support. Some are inherently incompatible with the
|
Many Spack packages are not currently compatible with Windows, due to Unix
|
||||||
platform, and others simply have yet to be ported. To view the current set of packages with Windows
|
dependencies or incompatible build tools like autoconf. Here are several
|
||||||
support, the list command should be used via `spack list -t windows`. If there's a package you'd like
|
packages known to work on Windows:
|
||||||
to install on Windows but is not in that list, feel free to reach out to request the port or contribute
|
|
||||||
the port yourself.
|
* abseil-cpp
|
||||||
|
* clingo
|
||||||
|
* cpuinfo
|
||||||
|
* cmake
|
||||||
|
* glm
|
||||||
|
* nasm
|
||||||
|
* netlib-lapack (requires Intel Fortran)
|
||||||
|
* ninja
|
||||||
|
* openssl
|
||||||
|
* perl
|
||||||
|
* python
|
||||||
|
* ruby
|
||||||
|
* wrf
|
||||||
|
* zlib
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
This is by no means a comprehensive list, some packages may have ports that were not tagged
|
This is by no means a comprehensive list
|
||||||
while others may just work out of the box on Windows and have not been tagged as such.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
For developers
|
For developers
|
||||||
@@ -1720,4 +1731,3 @@ Instructions for creating the installer are at
|
|||||||
https://github.com/spack/spack/blob/develop/lib/spack/spack/cmd/installer/README.md
|
https://github.com/spack/spack/blob/develop/lib/spack/spack/cmd/installer/README.md
|
||||||
|
|
||||||
Alternatively a pre-built copy of the Windows installer is available as an artifact of Spack's Windows CI
|
Alternatively a pre-built copy of the Windows installer is available as an artifact of Spack's Windows CI
|
||||||
available at each run of the CI on develop or any PR.
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -67,6 +67,7 @@ or refer to the full manual below.
|
|||||||
build_settings
|
build_settings
|
||||||
environments
|
environments
|
||||||
containers
|
containers
|
||||||
|
monitoring
|
||||||
mirrors
|
mirrors
|
||||||
module_file_support
|
module_file_support
|
||||||
repositories
|
repositories
|
||||||
@@ -77,6 +78,12 @@ or refer to the full manual below.
|
|||||||
extensions
|
extensions
|
||||||
pipelines
|
pipelines
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
:caption: Research
|
||||||
|
|
||||||
|
analyze
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
:caption: Contributing
|
:caption: Contributing
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -13,7 +13,7 @@ The use of module systems to manage user environment in a controlled way
|
|||||||
is a common practice at HPC centers that is often embraced also by
|
is a common practice at HPC centers that is often embraced also by
|
||||||
individual programmers on their development machines. To support this
|
individual programmers on their development machines. To support this
|
||||||
common practice Spack integrates with `Environment Modules
|
common practice Spack integrates with `Environment Modules
|
||||||
<http://modules.sourceforge.net/>`_ and `Lmod
|
<http://modules.sourceforge.net/>`_ and `LMod
|
||||||
<http://lmod.readthedocs.io/en/latest/>`_ by providing post-install hooks
|
<http://lmod.readthedocs.io/en/latest/>`_ by providing post-install hooks
|
||||||
that generate module files and commands to manipulate them.
|
that generate module files and commands to manipulate them.
|
||||||
|
|
||||||
@@ -26,8 +26,8 @@ Using module files via Spack
|
|||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
If you have installed a supported module system you should be able to
|
If you have installed a supported module system you should be able to
|
||||||
run ``module avail`` to see what module
|
run either ``module avail`` or ``use -l spack`` to see what module
|
||||||
files have been installed. Here is sample output of those programs,
|
files have been installed. Here is sample output of those programs,
|
||||||
showing lots of installed packages:
|
showing lots of installed packages:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -51,7 +51,12 @@ showing lots of installed packages:
|
|||||||
help2man-1.47.4-gcc-4.8-kcnqmau lua-luaposix-33.4.0-gcc-4.8-mdod2ry netlib-scalapack-2.0.2-gcc-6.3.0-rgqfr6d py-scipy-0.19.0-gcc-6.3.0-kr7nat4 zlib-1.2.11-gcc-6.3.0-7cqp6cj
|
help2man-1.47.4-gcc-4.8-kcnqmau lua-luaposix-33.4.0-gcc-4.8-mdod2ry netlib-scalapack-2.0.2-gcc-6.3.0-rgqfr6d py-scipy-0.19.0-gcc-6.3.0-kr7nat4 zlib-1.2.11-gcc-6.3.0-7cqp6cj
|
||||||
|
|
||||||
The names should look familiar, as they resemble the output from ``spack find``.
|
The names should look familiar, as they resemble the output from ``spack find``.
|
||||||
For example, you could type the following command to load the ``cmake`` module:
|
You *can* use the modules here directly. For example, you could type either of these commands
|
||||||
|
to load the ``cmake`` module:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ use cmake-3.7.2-gcc-6.3.0-fowuuby
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@@ -88,9 +93,9 @@ the different file formats that can be generated by Spack:
|
|||||||
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
| | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** |
|
| | **Hook name** | **Default root directory** | **Default template file** | **Compatible tools** |
|
||||||
+=============================+====================+===============================+==============================================+======================+
|
+=============================+====================+===============================+==============================================+======================+
|
||||||
| **Tcl - Non-Hierarchical** | ``tcl`` | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/Lmod |
|
| **TCL - Non-Hierarchical** | ``tcl`` | share/spack/modules | share/spack/templates/modules/modulefile.tcl | Env. Modules/LMod |
|
||||||
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
| **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | share/spack/templates/modules/modulefile.lua | Lmod |
|
| **Lua - Hierarchical** | ``lmod`` | share/spack/lmod | share/spack/templates/modules/modulefile.lua | LMod |
|
||||||
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
+-----------------------------+--------------------+-------------------------------+----------------------------------------------+----------------------+
|
||||||
|
|
||||||
|
|
||||||
@@ -391,13 +396,13 @@ name and version for all packages that depend on mpi.
|
|||||||
|
|
||||||
When specifying module names by projection for Lmod modules, we
|
When specifying module names by projection for Lmod modules, we
|
||||||
recommend NOT including names of dependencies (e.g., MPI, compilers)
|
recommend NOT including names of dependencies (e.g., MPI, compilers)
|
||||||
that are already in the Lmod hierarchy.
|
that are already in the LMod hierarchy.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Tcl modules
|
TCL modules
|
||||||
Tcl modules also allow for explicit conflicts between modulefiles.
|
TCL modules also allow for explicit conflicts between modulefiles.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@@ -421,9 +426,9 @@ that are already in the Lmod hierarchy.
|
|||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Lmod hierarchical module files
|
LMod hierarchical module files
|
||||||
When ``lmod`` is activated Spack will generate a set of hierarchical lua module
|
When ``lmod`` is activated Spack will generate a set of hierarchical lua module
|
||||||
files that are understood by Lmod. The hierarchy will always contain the
|
files that are understood by LMod. The hierarchy will always contain the
|
||||||
two layers ``Core`` / ``Compiler`` but can be further extended to
|
two layers ``Core`` / ``Compiler`` but can be further extended to
|
||||||
any of the virtual dependencies present in Spack. A case that could be useful in
|
any of the virtual dependencies present in Spack. A case that could be useful in
|
||||||
practice is for instance:
|
practice is for instance:
|
||||||
@@ -445,7 +450,7 @@ that are already in the Lmod hierarchy.
|
|||||||
|
|
||||||
that will generate a hierarchy in which the ``lapack`` and ``mpi`` layer can be switched
|
that will generate a hierarchy in which the ``lapack`` and ``mpi`` layer can be switched
|
||||||
independently. This allows a site to build the same libraries or applications against different
|
independently. This allows a site to build the same libraries or applications against different
|
||||||
implementations of ``mpi`` and ``lapack``, and let Lmod switch safely from one to the
|
implementations of ``mpi`` and ``lapack``, and let LMod switch safely from one to the
|
||||||
other.
|
other.
|
||||||
|
|
||||||
All packages built with a compiler in ``core_compilers`` and all
|
All packages built with a compiler in ``core_compilers`` and all
|
||||||
@@ -455,12 +460,12 @@ that are already in the Lmod hierarchy.
|
|||||||
.. warning::
|
.. warning::
|
||||||
Consistency of Core packages
|
Consistency of Core packages
|
||||||
The user is responsible for maintining consistency among core packages, as ``core_specs``
|
The user is responsible for maintining consistency among core packages, as ``core_specs``
|
||||||
bypasses the hierarchy that allows Lmod to safely switch between coherent software stacks.
|
bypasses the hierarchy that allows LMod to safely switch between coherent software stacks.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
Deep hierarchies and ``lmod spider``
|
Deep hierarchies and ``lmod spider``
|
||||||
For hierarchies that are deeper than three layers ``lmod spider`` may have some issues.
|
For hierarchies that are deeper than three layers ``lmod spider`` may have some issues.
|
||||||
See `this discussion on the Lmod project <https://github.com/TACC/Lmod/issues/114>`_.
|
See `this discussion on the LMod project <https://github.com/TACC/Lmod/issues/114>`_.
|
||||||
|
|
||||||
""""""""""""""""""""""
|
""""""""""""""""""""""
|
||||||
Select default modules
|
Select default modules
|
||||||
@@ -529,7 +534,7 @@ installed to ``/spack/prefix/foo``, if ``foo`` installs executables to
|
|||||||
update ``MANPATH``.
|
update ``MANPATH``.
|
||||||
|
|
||||||
The default list of environment variables in this config section
|
The default list of environment variables in this config section
|
||||||
includes ``PATH``, ``MANPATH``, ``ACLOCAL_PATH``, ``PKG_CONFIG_PATH``
|
inludes ``PATH``, ``MANPATH``, ``ACLOCAL_PATH``, ``PKG_CONFIG_PATH``
|
||||||
and ``CMAKE_PREFIX_PATH``, as well as ``DYLD_FALLBACK_LIBRARY_PATH``
|
and ``CMAKE_PREFIX_PATH``, as well as ``DYLD_FALLBACK_LIBRARY_PATH``
|
||||||
on macOS. On Linux however, the corresponding ``LD_LIBRARY_PATH``
|
on macOS. On Linux however, the corresponding ``LD_LIBRARY_PATH``
|
||||||
variable is *not* set, because it affects the behavior of
|
variable is *not* set, because it affects the behavior of
|
||||||
@@ -629,9 +634,8 @@ by its dependency; when the dependency is autoloaded, the executable will be in
|
|||||||
PATH. Similarly for scripting languages such as Python, packages and their dependencies
|
PATH. Similarly for scripting languages such as Python, packages and their dependencies
|
||||||
have to be loaded together.
|
have to be loaded together.
|
||||||
|
|
||||||
Autoloading is enabled by default for Lmod and Environment Modules. The former
|
Autoloading is enabled by default for LMod, as it has great builtin support for through
|
||||||
has builtin support for through the ``depends_on`` function. The latter uses
|
the ``depends_on`` function. For Environment Modules it is disabled by default.
|
||||||
``module load`` statement to load and track dependencies.
|
|
||||||
|
|
||||||
Autoloading can also be enabled conditionally:
|
Autoloading can also be enabled conditionally:
|
||||||
|
|
||||||
@@ -651,14 +655,12 @@ The allowed values for the ``autoload`` statement are either ``none``,
|
|||||||
``direct`` or ``all``.
|
``direct`` or ``all``.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Tcl prerequisites
|
TCL prerequisites
|
||||||
In the ``tcl`` section of the configuration file it is possible to use
|
In the ``tcl`` section of the configuration file it is possible to use
|
||||||
the ``prerequisites`` directive that accepts the same values as
|
the ``prerequisites`` directive that accepts the same values as
|
||||||
``autoload``. It will produce module files that have a ``prereq``
|
``autoload``. It will produce module files that have a ``prereq``
|
||||||
statement, which autoloads dependencies on Environment Modules when its
|
statement, which can be used to autoload dependencies in some versions
|
||||||
``auto_handling`` configuration option is enabled. If Environment Modules
|
of Environment Modules.
|
||||||
is installed with Spack, ``auto_handling`` is enabled by default starting
|
|
||||||
version 4.2. Otherwise it is enabled by default since version 5.0.
|
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
Maintaining Module Files
|
Maintaining Module Files
|
||||||
|
265
lib/spack/docs/monitoring.rst
Normal file
265
lib/spack/docs/monitoring.rst
Normal file
@@ -0,0 +1,265 @@
|
|||||||
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
.. _monitoring:
|
||||||
|
|
||||||
|
==========
|
||||||
|
Monitoring
|
||||||
|
==========
|
||||||
|
|
||||||
|
You can use a `spack monitor <https://github.com/spack/spack-monitor>`_ "Spackmon"
|
||||||
|
server to store a database of your packages, builds, and associated metadata
|
||||||
|
for provenance, research, or some other kind of development. You should
|
||||||
|
follow the instructions in the `spack monitor documentation <https://spack-monitor.readthedocs.org>`_
|
||||||
|
to first create a server along with a username and token for yourself.
|
||||||
|
You can then use this guide to interact with the server.
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
Analysis Monitoring
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
To read about how to monitor an analysis (meaning you want to send analysis results
|
||||||
|
to a server) see :ref:`analyze_monitoring`.
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
Monitoring An Install
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Since an install is typically when you build packages, we logically want
|
||||||
|
to tell spack to monitor during this step. Let's start with an example
|
||||||
|
where we want to monitor the install of hdf5. Unless you have disabled authentication
|
||||||
|
for the server, we first want to export our spack monitor token and username to the environment:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ export SPACKMON_TOKEN=50445263afd8f67e59bd79bff597836ee6c05438
|
||||||
|
$ export SPACKMON_USER=spacky
|
||||||
|
|
||||||
|
|
||||||
|
By default, the host for your server is expected to be at ``http://127.0.0.1``
|
||||||
|
with a prefix of ``ms1``, and if this is the case, you can simply add the
|
||||||
|
``--monitor`` flag to the install command:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --monitor hdf5
|
||||||
|
|
||||||
|
|
||||||
|
If you need to customize the host or the prefix, you can do that as well:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --monitor --monitor-prefix monitor --monitor-host https://monitor-service.io hdf5
|
||||||
|
|
||||||
|
|
||||||
|
As a precaution, we cut out early in the spack client if you have not provided
|
||||||
|
authentication credentials. For example, if you run the command above without
|
||||||
|
exporting your username or token, you'll see:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
==> Error: You are required to export SPACKMON_TOKEN and SPACKMON_USER
|
||||||
|
|
||||||
|
This extra check is to ensure that we don't start any builds,
|
||||||
|
and then discover that you forgot to export your token. However, if
|
||||||
|
your monitoring server has authentication disabled, you can tell this to
|
||||||
|
the client to skip this step:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --monitor --monitor-disable-auth hdf5
|
||||||
|
|
||||||
|
If the service is not running, you'll cleanly exit early - the install will
|
||||||
|
not continue if you've asked it to monitor and there is no service.
|
||||||
|
For example, here is what you'll see if the monitoring service is not running:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
[Errno 111] Connection refused
|
||||||
|
|
||||||
|
|
||||||
|
If you want to continue builds (and stop monitoring) you can set the ``--monitor-keep-going``
|
||||||
|
flag.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --monitor --monitor-keep-going hdf5
|
||||||
|
|
||||||
|
This could mean that if a request fails, you only have partial or no data
|
||||||
|
added to your monitoring database. This setting will not be applied to the
|
||||||
|
first request to check if the server is running, but to subsequent requests.
|
||||||
|
If you don't have a monitor server running and you want to build, simply
|
||||||
|
don't provide the ``--monitor`` flag! Finally, if you want to provide one or
|
||||||
|
more tags to your build, you can do:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# Add one tag, "pizza"
|
||||||
|
$ spack install --monitor --monitor-tags pizza hdf5
|
||||||
|
|
||||||
|
# Add two tags, "pizza" and "pasta"
|
||||||
|
$ spack install --monitor --monitor-tags pizza,pasta hdf5
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------
|
||||||
|
Monitoring with Containerize
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
The same argument group is available to add to a containerize command.
|
||||||
|
|
||||||
|
^^^^^^
|
||||||
|
Docker
|
||||||
|
^^^^^^
|
||||||
|
|
||||||
|
To add monitoring to a Docker container recipe generation using the defaults,
|
||||||
|
and assuming a monitor server running on localhost, you would
|
||||||
|
start with a spack.yaml in your present working directory:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
specs:
|
||||||
|
- samtools
|
||||||
|
|
||||||
|
And then do:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# preview first
|
||||||
|
spack containerize --monitor
|
||||||
|
|
||||||
|
# and then write to a Dockerfile
|
||||||
|
spack containerize --monitor > Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
The install command will be edited to include commands for enabling monitoring.
|
||||||
|
However, getting secrets into the container for your monitor server is something
|
||||||
|
that should be done carefully. Specifically you should:
|
||||||
|
|
||||||
|
- Never try to define secrets as ENV, ARG, or using ``--build-arg``
|
||||||
|
- Do not try to get the secret into the container via a "temporary" file that you remove (it in fact will still exist in a layer)
|
||||||
|
|
||||||
|
Instead, it's recommended to use buildkit `as explained here <https://pythonspeed.com/articles/docker-build-secrets/>`_.
|
||||||
|
You'll need to again export environment variables for your spack monitor server:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ export SPACKMON_TOKEN=50445263afd8f67e59bd79bff597836ee6c05438
|
||||||
|
$ export SPACKMON_USER=spacky
|
||||||
|
|
||||||
|
And then use buildkit along with your build and identifying the name of the secret:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ DOCKER_BUILDKIT=1 docker build --secret id=st,env=SPACKMON_TOKEN --secret id=su,env=SPACKMON_USER -t spack/container .
|
||||||
|
|
||||||
|
The secrets are expected to come from your environment, and then will be temporarily mounted and available
|
||||||
|
at ``/run/secrets/<name>``. If you forget to supply them (and authentication is required) the build
|
||||||
|
will fail. If you need to build on your host (and interact with a spack monitor at localhost) you'll
|
||||||
|
need to tell Docker to use the host network:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ DOCKER_BUILDKIT=1 docker build --network="host" --secret id=st,env=SPACKMON_TOKEN --secret id=su,env=SPACKMON_USER -t spack/container .
|
||||||
|
|
||||||
|
|
||||||
|
^^^^^^^^^^^
|
||||||
|
Singularity
|
||||||
|
^^^^^^^^^^^
|
||||||
|
|
||||||
|
To add monitoring to a Singularity container build, the spack.yaml needs to
|
||||||
|
be modified slightly to specify wanting a different format:
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
spack:
|
||||||
|
specs:
|
||||||
|
- samtools
|
||||||
|
container:
|
||||||
|
format: singularity
|
||||||
|
|
||||||
|
|
||||||
|
Again, generate the recipe:
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# preview first
|
||||||
|
$ spack containerize --monitor
|
||||||
|
|
||||||
|
# then write to a Singularity recipe
|
||||||
|
$ spack containerize --monitor > Singularity
|
||||||
|
|
||||||
|
|
||||||
|
Singularity doesn't have a direct way to define secrets at build time, so we have
|
||||||
|
to do a bit of a manual command to add a file, source secrets in it, and remove it.
|
||||||
|
Since Singularity doesn't have layers like Docker, deleting a file will truly
|
||||||
|
remove it from the container and history. So let's say we have this file,
|
||||||
|
``secrets.sh``:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# secrets.sh
|
||||||
|
export SPACKMON_USER=spack
|
||||||
|
export SPACKMON_TOKEN=50445263afd8f67e59bd79bff597836ee6c05438
|
||||||
|
|
||||||
|
|
||||||
|
We would then generate the Singularity recipe, and add a files section,
|
||||||
|
a source of that file at the start of ``%post``, and **importantly**
|
||||||
|
a removal of the final at the end of that same section.
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
|
||||||
|
Bootstrap: docker
|
||||||
|
From: spack/ubuntu-bionic:latest
|
||||||
|
Stage: build
|
||||||
|
|
||||||
|
%files
|
||||||
|
secrets.sh /opt/secrets.sh
|
||||||
|
|
||||||
|
%post
|
||||||
|
. /opt/secrets.sh
|
||||||
|
|
||||||
|
# spack install commands are here
|
||||||
|
...
|
||||||
|
|
||||||
|
# Don't forget to remove here!
|
||||||
|
rm /opt/secrets.sh
|
||||||
|
|
||||||
|
|
||||||
|
You can then build the container as your normally would.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ sudo singularity build container.sif Singularity
|
||||||
|
|
||||||
|
|
||||||
|
------------------
|
||||||
|
Monitoring Offline
|
||||||
|
------------------
|
||||||
|
|
||||||
|
In the case that you want to save monitor results to your filesystem
|
||||||
|
and then upload them later (perhaps you are in an environment where you don't
|
||||||
|
have credentials or it isn't safe to use them) you can use the ``--monitor-save-local``
|
||||||
|
flag.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack install --monitor --monitor-save-local hdf5
|
||||||
|
|
||||||
|
This will save results in a subfolder, "monitor" in your designated spack
|
||||||
|
reports folder, which defaults to ``$HOME/.spack/reports/monitor``. When
|
||||||
|
you are ready to upload them to a spack monitor server:
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ spack monitor upload ~/.spack/reports/monitor
|
||||||
|
|
||||||
|
|
||||||
|
You can choose the root directory of results as shown above, or a specific
|
||||||
|
subdirectory. The command accepts other arguments to specify configuration
|
||||||
|
for the monitor.
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -9,32 +9,27 @@
|
|||||||
CI Pipelines
|
CI Pipelines
|
||||||
============
|
============
|
||||||
|
|
||||||
Spack provides commands that support generating and running automated build pipelines in CI instances. At the highest
|
Spack provides commands that support generating and running automated build
|
||||||
level it works like this: provide a spack environment describing the set of packages you care about, and include a
|
pipelines designed for Gitlab CI. At the highest level it works like this:
|
||||||
description of how those packages should be mapped to Gitlab runners. Spack can then generate a ``.gitlab-ci.yml``
|
provide a spack environment describing the set of packages you care about,
|
||||||
file containing job descriptions for all your packages that can be run by a properly configured CI instance. When
|
and include within that environment file a description of how those packages
|
||||||
run, the generated pipeline will build and deploy binaries, and it can optionally report to a CDash instance
|
should be mapped to Gitlab runners. Spack can then generate a ``.gitlab-ci.yml``
|
||||||
|
file containing job descriptions for all your packages that can be run by a
|
||||||
|
properly configured Gitlab CI instance. When run, the generated pipeline will
|
||||||
|
build and deploy binaries, and it can optionally report to a CDash instance
|
||||||
regarding the health of the builds as they evolve over time.
|
regarding the health of the builds as they evolve over time.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Getting started with pipelines
|
Getting started with pipelines
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
To get started with automated build pipelines a Gitlab instance with version ``>= 12.9``
|
It is fairly straightforward to get started with automated build pipelines. At
|
||||||
(more about Gitlab CI `here <https://about.gitlab.com/product/continuous-integration/>`_)
|
a minimum, you'll need to set up a Gitlab instance (more about Gitlab CI
|
||||||
with at least one `runner <https://docs.gitlab.com/runner/>`_ configured is required. This
|
`here <https://about.gitlab.com/product/continuous-integration/>`_) and configure
|
||||||
can be done quickly by setting up a local Gitlab instance.
|
at least one `runner <https://docs.gitlab.com/runner/>`_. Then the basic steps
|
||||||
|
for setting up a build pipeline are as follows:
|
||||||
|
|
||||||
It is possible to set up pipelines on gitlab.com, but the builds there are limited to
|
#. Create a repository on your gitlab instance
|
||||||
60 minutes and generic hardware. It is possible to
|
|
||||||
`hook up <https://about.gitlab.com/blog/2018/04/24/getting-started-gitlab-ci-gcp>`_
|
|
||||||
Gitlab to Google Kubernetes Engine (`GKE <https://cloud.google.com/kubernetes-engine/>`_)
|
|
||||||
or Amazon Elastic Kubernetes Service (`EKS <https://aws.amazon.com/eks>`_), though those
|
|
||||||
topics are outside the scope of this document.
|
|
||||||
|
|
||||||
After setting up a Gitlab instance for running CI, the basic steps for setting up a build pipeline are as follows:
|
|
||||||
|
|
||||||
#. Create a repository in the Gitlab instance with CI and a runner enabled.
|
|
||||||
#. Add a ``spack.yaml`` at the root containing your pipeline environment
|
#. Add a ``spack.yaml`` at the root containing your pipeline environment
|
||||||
#. Add a ``.gitlab-ci.yml`` at the root containing two jobs (one to generate
|
#. Add a ``.gitlab-ci.yml`` at the root containing two jobs (one to generate
|
||||||
the pipeline dynamically, and one to run the generated jobs).
|
the pipeline dynamically, and one to run the generated jobs).
|
||||||
@@ -45,6 +40,13 @@ See the :ref:`functional_example` section for a minimal working example. See al
|
|||||||
the :ref:`custom_Workflow` section for a link to an example of a custom workflow
|
the :ref:`custom_Workflow` section for a link to an example of a custom workflow
|
||||||
based on spack pipelines.
|
based on spack pipelines.
|
||||||
|
|
||||||
|
While it is possible to set up pipelines on gitlab.com, as illustrated above, the
|
||||||
|
builds there are limited to 60 minutes and generic hardware. It is also possible to
|
||||||
|
`hook up <https://about.gitlab.com/blog/2018/04/24/getting-started-gitlab-ci-gcp>`_
|
||||||
|
Gitlab to Google Kubernetes Engine (`GKE <https://cloud.google.com/kubernetes-engine/>`_)
|
||||||
|
or Amazon Elastic Kubernetes Service (`EKS <https://aws.amazon.com/eks>`_), though those
|
||||||
|
topics are outside the scope of this document.
|
||||||
|
|
||||||
Spack's pipelines are now making use of the
|
Spack's pipelines are now making use of the
|
||||||
`trigger <https://docs.gitlab.com/ee/ci/yaml/#trigger>`_ syntax to run
|
`trigger <https://docs.gitlab.com/ee/ci/yaml/#trigger>`_ syntax to run
|
||||||
dynamically generated
|
dynamically generated
|
||||||
@@ -130,35 +132,29 @@ And here's the spack environment built by the pipeline represented as a
|
|||||||
|
|
||||||
mirrors: { "mirror": "s3://spack-public/mirror" }
|
mirrors: { "mirror": "s3://spack-public/mirror" }
|
||||||
|
|
||||||
ci:
|
gitlab-ci:
|
||||||
|
before_script:
|
||||||
|
- git clone ${SPACK_REPO}
|
||||||
|
- pushd spack && git checkout ${SPACK_CHECKOUT_VERSION} && popd
|
||||||
|
- . "./spack/share/spack/setup-env.sh"
|
||||||
|
script:
|
||||||
|
- pushd ${SPACK_CONCRETE_ENV_DIR} && spack env activate --without-view . && popd
|
||||||
|
- spack -d ci rebuild
|
||||||
|
mappings:
|
||||||
|
- match: ["os=ubuntu18.04"]
|
||||||
|
runner-attributes:
|
||||||
|
image:
|
||||||
|
name: ghcr.io/scottwittenburg/ecpe4s-ubuntu18.04-runner-x86_64:2020-09-01
|
||||||
|
entrypoint: [""]
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
enable-artifacts-buildcache: True
|
enable-artifacts-buildcache: True
|
||||||
rebuild-index: False
|
rebuild-index: False
|
||||||
pipeline-gen:
|
|
||||||
- any-job:
|
|
||||||
before_script:
|
|
||||||
- git clone ${SPACK_REPO}
|
|
||||||
- pushd spack && git checkout ${SPACK_CHECKOUT_VERSION} && popd
|
|
||||||
- . "./spack/share/spack/setup-env.sh"
|
|
||||||
- build-job:
|
|
||||||
tags: [docker]
|
|
||||||
image:
|
|
||||||
name: ghcr.io/scottwittenburg/ecpe4s-ubuntu18.04-runner-x86_64:2020-09-01
|
|
||||||
entrypoint: [""]
|
|
||||||
|
|
||||||
|
|
||||||
The elements of this file important to spack ci pipelines are described in more
|
The elements of this file important to spack ci pipelines are described in more
|
||||||
detail below, but there are a couple of things to note about the above working
|
detail below, but there are a couple of things to note about the above working
|
||||||
example:
|
example:
|
||||||
|
|
||||||
.. note::
|
|
||||||
There is no ``script`` attribute specified for here. The reason for this is
|
|
||||||
Spack CI will automatically generate reasonable default scripts. More
|
|
||||||
detail on what is in these scripts can be found below.
|
|
||||||
|
|
||||||
Also notice the ``before_script`` section. It is required when using any of the
|
|
||||||
default scripts to source the ``setup-env.sh`` script in order to inform
|
|
||||||
the default scripts where to find the ``spack`` executable.
|
|
||||||
|
|
||||||
Normally ``enable-artifacts-buildcache`` is not recommended in production as it
|
Normally ``enable-artifacts-buildcache`` is not recommended in production as it
|
||||||
results in large binary artifacts getting transferred back and forth between
|
results in large binary artifacts getting transferred back and forth between
|
||||||
gitlab and the runners. But in this example on gitlab.com where there is no
|
gitlab and the runners. But in this example on gitlab.com where there is no
|
||||||
@@ -178,7 +174,7 @@ during subsequent pipeline runs.
|
|||||||
With the addition of reproducible builds (#22887) a previously working
|
With the addition of reproducible builds (#22887) a previously working
|
||||||
pipeline will require some changes:
|
pipeline will require some changes:
|
||||||
|
|
||||||
* In the build-jobs, the environment location changed.
|
* In the build jobs (``runner-attributes``), the environment location changed.
|
||||||
This will typically show as a ``KeyError`` in the failing job. Be sure to
|
This will typically show as a ``KeyError`` in the failing job. Be sure to
|
||||||
point to ``${SPACK_CONCRETE_ENV_DIR}``.
|
point to ``${SPACK_CONCRETE_ENV_DIR}``.
|
||||||
|
|
||||||
@@ -200,9 +196,9 @@ ci pipelines. These commands are covered in more detail in this section.
|
|||||||
|
|
||||||
.. _cmd-spack-ci:
|
.. _cmd-spack-ci:
|
||||||
|
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
``spack ci``
|
``spack ci``
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Super-command for functionality related to generating pipelines and executing
|
Super-command for functionality related to generating pipelines and executing
|
||||||
pipeline jobs.
|
pipeline jobs.
|
||||||
@@ -231,7 +227,7 @@ Using ``--prune-dag`` or ``--no-prune-dag`` configures whether or not jobs are
|
|||||||
generated for specs that are already up to date on the mirror. If enabling
|
generated for specs that are already up to date on the mirror. If enabling
|
||||||
DAG pruning using ``--prune-dag``, more information may be required in your
|
DAG pruning using ``--prune-dag``, more information may be required in your
|
||||||
``spack.yaml`` file, see the :ref:`noop_jobs` section below regarding
|
``spack.yaml`` file, see the :ref:`noop_jobs` section below regarding
|
||||||
``noop-job``.
|
``service-job-attributes``.
|
||||||
|
|
||||||
The optional ``--check-index-only`` argument can be used to speed up pipeline
|
The optional ``--check-index-only`` argument can be used to speed up pipeline
|
||||||
generation by telling spack to consider only remote buildcache indices when
|
generation by telling spack to consider only remote buildcache indices when
|
||||||
@@ -267,11 +263,11 @@ generated by jobs in the pipeline.
|
|||||||
|
|
||||||
.. _cmd-spack-ci-rebuild:
|
.. _cmd-spack-ci-rebuild:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
``spack ci rebuild``
|
``spack ci rebuild``
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The purpose of ``spack ci rebuild`` is to take an assigned
|
The purpose of ``spack ci rebuild`` is straightforward: take its assigned
|
||||||
spec and ensure a binary of a successful build exists on the target mirror.
|
spec and ensure a binary of a successful build exists on the target mirror.
|
||||||
If the binary does not already exist, it is built from source and pushed
|
If the binary does not already exist, it is built from source and pushed
|
||||||
to the mirror. The associated stand-alone tests are optionally run against
|
to the mirror. The associated stand-alone tests are optionally run against
|
||||||
@@ -284,7 +280,7 @@ directory. The script is run in a job to install the spec from source. The
|
|||||||
resulting binary package is pushed to the mirror. If ``cdash`` is configured
|
resulting binary package is pushed to the mirror. If ``cdash`` is configured
|
||||||
for the environment, then the build results will be uploaded to the site.
|
for the environment, then the build results will be uploaded to the site.
|
||||||
|
|
||||||
Environment variables and values in the ``ci::pipeline-gen`` section of the
|
Environment variables and values in the ``gitlab-ci`` section of the
|
||||||
``spack.yaml`` environment file provide inputs to this process. The
|
``spack.yaml`` environment file provide inputs to this process. The
|
||||||
two main sources of environment variables are variables written into
|
two main sources of environment variables are variables written into
|
||||||
``.gitlab-ci.yml`` by ``spack ci generate`` and the GitLab CI runtime.
|
``.gitlab-ci.yml`` by ``spack ci generate`` and the GitLab CI runtime.
|
||||||
@@ -302,23 +298,21 @@ A snippet from an example ``spack.yaml`` file illustrating use of this
|
|||||||
option *and* specification of a package with broken tests is given below.
|
option *and* specification of a package with broken tests is given below.
|
||||||
The inclusion of a spec for building ``gptune`` is not shown here. Note
|
The inclusion of a spec for building ``gptune`` is not shown here. Note
|
||||||
that ``--tests`` is passed to ``spack ci rebuild`` as part of the
|
that ``--tests`` is passed to ``spack ci rebuild`` as part of the
|
||||||
``build-job`` script.
|
``gitlab-ci`` script.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
ci:
|
gitlab-ci:
|
||||||
pipeline-gen:
|
script:
|
||||||
- build-job
|
- . "./share/spack/setup-env.sh"
|
||||||
script:
|
- spack --version
|
||||||
- . "./share/spack/setup-env.sh"
|
- cd ${SPACK_CONCRETE_ENV_DIR}
|
||||||
- spack --version
|
- spack env activate --without-view .
|
||||||
- cd ${SPACK_CONCRETE_ENV_DIR}
|
- spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}'"
|
||||||
- spack env activate --without-view .
|
- mkdir -p ${SPACK_ARTIFACTS_ROOT}/user_data
|
||||||
- spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}'"
|
- if [[ -r /mnt/key/intermediate_ci_signing_key.gpg ]]; then spack gpg trust /mnt/key/intermediate_ci_signing_key.gpg; fi
|
||||||
- mkdir -p ${SPACK_ARTIFACTS_ROOT}/user_data
|
- if [[ -r /mnt/key/spack_public_key.gpg ]]; then spack gpg trust /mnt/key/spack_public_key.gpg; fi
|
||||||
- if [[ -r /mnt/key/intermediate_ci_signing_key.gpg ]]; then spack gpg trust /mnt/key/intermediate_ci_signing_key.gpg; fi
|
- spack -d ci rebuild --tests > >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_out.txt) 2> >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_err.txt >&2)
|
||||||
- if [[ -r /mnt/key/spack_public_key.gpg ]]; then spack gpg trust /mnt/key/spack_public_key.gpg; fi
|
|
||||||
- spack -d ci rebuild --tests > >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_out.txt) 2> >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_err.txt >&2)
|
|
||||||
|
|
||||||
broken-tests-packages:
|
broken-tests-packages:
|
||||||
- gptune
|
- gptune
|
||||||
@@ -360,31 +354,113 @@ arguments you can pass to ``spack ci reproduce-build`` in order to reproduce
|
|||||||
a particular build locally.
|
a particular build locally.
|
||||||
|
|
||||||
------------------------------------
|
------------------------------------
|
||||||
Job Types
|
A pipeline-enabled spack environment
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^
|
Here's an example of a spack environment file that has been enhanced with
|
||||||
Rebuild (build)
|
sections describing a build pipeline:
|
||||||
^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Rebuild jobs, denoted as ``build-job``'s in the ``pipeline-gen`` list, are jobs
|
.. code-block:: yaml
|
||||||
associated with concrete specs that have been marked for rebuild. By default a simple
|
|
||||||
script for doing rebuild is generated, but may be modified as needed.
|
|
||||||
|
|
||||||
The default script does three main steps, change directories to the pipelines concrete
|
spack:
|
||||||
environment, activate the concrete environment, and run the ``spack ci rebuild`` command:
|
definitions:
|
||||||
|
- pkgs:
|
||||||
|
- readline@7.0
|
||||||
|
- compilers:
|
||||||
|
- '%gcc@5.5.0'
|
||||||
|
- oses:
|
||||||
|
- os=ubuntu18.04
|
||||||
|
- os=centos7
|
||||||
|
specs:
|
||||||
|
- matrix:
|
||||||
|
- [$pkgs]
|
||||||
|
- [$compilers]
|
||||||
|
- [$oses]
|
||||||
|
mirrors:
|
||||||
|
cloud_gitlab: https://mirror.spack.io
|
||||||
|
gitlab-ci:
|
||||||
|
mappings:
|
||||||
|
- match:
|
||||||
|
- os=ubuntu18.04
|
||||||
|
runner-attributes:
|
||||||
|
tags:
|
||||||
|
- spack-kube
|
||||||
|
image: spack/ubuntu-bionic
|
||||||
|
- match:
|
||||||
|
- os=centos7
|
||||||
|
runner-attributes:
|
||||||
|
tags:
|
||||||
|
- spack-kube
|
||||||
|
image: spack/centos7
|
||||||
|
cdash:
|
||||||
|
build-group: Release Testing
|
||||||
|
url: https://cdash.spack.io
|
||||||
|
project: Spack
|
||||||
|
site: Spack AWS Gitlab Instance
|
||||||
|
|
||||||
.. code-block:: bash
|
Hopefully, the ``definitions``, ``specs``, ``mirrors``, etc. sections are already
|
||||||
|
familiar, as they are part of spack :ref:`environments`. So let's take a more
|
||||||
|
in-depth look some of the pipeline-related sections in that environment file
|
||||||
|
that might not be as familiar.
|
||||||
|
|
||||||
cd ${concrete_environment_dir}
|
The ``gitlab-ci`` section is used to configure how the pipeline workload should be
|
||||||
spack env activate --without-view .
|
generated, mainly how the jobs for building specs should be assigned to the
|
||||||
spack ci rebuild
|
configured runners on your instance. Each entry within the list of ``mappings``
|
||||||
|
corresponds to a known gitlab runner, where the ``match`` section is used
|
||||||
|
in assigning a release spec to one of the runners, and the ``runner-attributes``
|
||||||
|
section is used to configure the spec/job for that particular runner.
|
||||||
|
|
||||||
|
Both the top-level ``gitlab-ci`` section as well as each ``runner-attributes``
|
||||||
|
section can also contain the following keys: ``image``, ``tags``, ``variables``,
|
||||||
|
``before_script``, ``script``, and ``after_script``. If any of these keys are
|
||||||
|
provided at the ``gitlab-ci`` level, they will be used as the defaults for any
|
||||||
|
``runner-attributes``, unless they are overridden in those sections. Specifying
|
||||||
|
any of these keys at the ``runner-attributes`` level generally overrides the
|
||||||
|
keys specified at the higher level, with a couple exceptions. Any ``variables``
|
||||||
|
specified at both levels result in those dictionaries getting merged in the
|
||||||
|
resulting generated job, and any duplicate variable names get assigned the value
|
||||||
|
provided in the specific ``runner-attributes``. If ``tags`` are specified both
|
||||||
|
at the ``gitlab-ci`` level as well as the ``runner-attributes`` level, then the
|
||||||
|
lists of tags are combined, and any duplicates are removed.
|
||||||
|
|
||||||
|
See the section below on using a custom spack for an example of how these keys
|
||||||
|
could be used.
|
||||||
|
|
||||||
|
There are other pipeline options you can configure within the ``gitlab-ci`` section
|
||||||
|
as well.
|
||||||
|
|
||||||
|
The ``bootstrap`` section allows you to specify lists of specs from
|
||||||
|
your ``definitions`` that should be staged ahead of the environment's ``specs`` (this
|
||||||
|
section is described in more detail below). The ``enable-artifacts-buildcache`` key
|
||||||
|
takes a boolean and determines whether the pipeline uses artifacts to store and
|
||||||
|
pass along the buildcaches from one stage to the next (the default if you don't
|
||||||
|
provide this option is ``False``).
|
||||||
|
|
||||||
|
The optional ``broken-specs-url`` key tells Spack to check against a list of
|
||||||
|
specs that are known to be currently broken in ``develop``. If any such specs
|
||||||
|
are found, the ``spack ci generate`` command will fail with an error message
|
||||||
|
informing the user what broken specs were encountered. This allows the pipeline
|
||||||
|
to fail early and avoid wasting compute resources attempting to build packages
|
||||||
|
that will not succeed.
|
||||||
|
|
||||||
|
The optional ``cdash`` section provides information that will be used by the
|
||||||
|
``spack ci generate`` command (invoked by ``spack ci start``) for reporting
|
||||||
|
to CDash. All the jobs generated from this environment will belong to a
|
||||||
|
"build group" within CDash that can be tracked over time. As the release
|
||||||
|
progresses, this build group may have jobs added or removed. The url, project,
|
||||||
|
and site are used to specify the CDash instance to which build results should
|
||||||
|
be reported.
|
||||||
|
|
||||||
|
Take a look at the
|
||||||
|
`schema <https://github.com/spack/spack/blob/develop/lib/spack/spack/schema/gitlab_ci.py>`_
|
||||||
|
for the gitlab-ci section of the spack environment file, to see precisely what
|
||||||
|
syntax is allowed there.
|
||||||
|
|
||||||
.. _rebuild_index:
|
.. _rebuild_index:
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Update Index (reindex)
|
Note about rebuilding buildcache index
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
By default, while a pipeline job may rebuild a package, create a buildcache
|
By default, while a pipeline job may rebuild a package, create a buildcache
|
||||||
entry, and push it to the mirror, it does not automatically re-generate the
|
entry, and push it to the mirror, it does not automatically re-generate the
|
||||||
@@ -399,44 +475,21 @@ not correctly reflect the mirror's contents at the end of a pipeline.
|
|||||||
To make sure the buildcache index is up to date at the end of your pipeline,
|
To make sure the buildcache index is up to date at the end of your pipeline,
|
||||||
spack generates a job to update the buildcache index of the target mirror
|
spack generates a job to update the buildcache index of the target mirror
|
||||||
at the end of each pipeline by default. You can disable this behavior by
|
at the end of each pipeline by default. You can disable this behavior by
|
||||||
adding ``rebuild-index: False`` inside the ``ci`` section of your
|
adding ``rebuild-index: False`` inside the ``gitlab-ci`` section of your
|
||||||
spack environment.
|
spack environment. Spack will assign the job any runner attributes found
|
||||||
|
on the ``service-job-attributes``, if you have provided that in your
|
||||||
Reindex jobs do not allow modifying the ``script`` attribute since it is automatically
|
``spack.yaml``.
|
||||||
generated using the target mirror listed in the ``mirrors::mirror`` configuration.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
|
||||||
Signing (signing)
|
|
||||||
^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
This job is run after all of the rebuild jobs are completed and is intended to be used
|
|
||||||
to sign the package binaries built by a protected CI run. Signing jobs are generated
|
|
||||||
only if a signing job ``script`` is specified and the spack CI job type is protected.
|
|
||||||
Note, if an ``any-job`` section contains a script, this will not implicitly create a
|
|
||||||
``signing`` job, a signing job may only exist if it is explicitly specified in the
|
|
||||||
configuration with a ``script`` attribute. Specifying a signing job without a script
|
|
||||||
does not create a signing job and the job configuration attributes will be ignored.
|
|
||||||
Signing jobs are always assigned the runner tags ``aws``, ``protected``, and ``notary``.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
|
||||||
Cleanup (cleanup)
|
|
||||||
^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
When using ``temporary-storage-url-prefix`` the cleanup job will destroy the mirror
|
|
||||||
created for the associated Gitlab pipeline. Cleanup jobs do not allow modifying the
|
|
||||||
script, but do expect that the spack command is in the path and require a
|
|
||||||
``before_script`` to be specified that sources the ``setup-env.sh`` script.
|
|
||||||
|
|
||||||
.. _noop_jobs:
|
.. _noop_jobs:
|
||||||
|
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
No Op (noop)
|
Note about "no-op" jobs
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
If no specs in an environment need to be rebuilt during a given pipeline run
|
If no specs in an environment need to be rebuilt during a given pipeline run
|
||||||
(meaning all are already up to date on the mirror), a single successful job
|
(meaning all are already up to date on the mirror), a single successful job
|
||||||
(a NO-OP) is still generated to avoid an empty pipeline (which GitLab
|
(a NO-OP) is still generated to avoid an empty pipeline (which GitLab
|
||||||
considers to be an error). The ``noop-job*`` sections
|
considers to be an error). An optional ``service-job-attributes`` section
|
||||||
can be added to your ``spack.yaml`` where you can provide ``tags`` and
|
can be added to your ``spack.yaml`` where you can provide ``tags`` and
|
||||||
``image`` or ``variables`` for the generated NO-OP job. This section also
|
``image`` or ``variables`` for the generated NO-OP job. This section also
|
||||||
supports providing ``before_script``, ``script``, and ``after_script``, in
|
supports providing ``before_script``, ``script``, and ``after_script``, in
|
||||||
@@ -446,100 +499,51 @@ Following is an example of this section added to a ``spack.yaml``:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
spack:
|
spack:
|
||||||
ci:
|
specs:
|
||||||
pipeline-gen:
|
- openmpi
|
||||||
- noop-job:
|
mirrors:
|
||||||
tags: ['custom', 'tag']
|
cloud_gitlab: https://mirror.spack.io
|
||||||
image:
|
gitlab-ci:
|
||||||
name: 'some.image.registry/custom-image:latest'
|
mappings:
|
||||||
entrypoint: ['/bin/bash']
|
- match:
|
||||||
script::
|
- os=centos8
|
||||||
- echo "Custom message in a custom script"
|
runner-attributes:
|
||||||
|
tags:
|
||||||
|
- custom
|
||||||
|
- tag
|
||||||
|
image: spack/centos7
|
||||||
|
service-job-attributes:
|
||||||
|
tags: ['custom', 'tag']
|
||||||
|
image:
|
||||||
|
name: 'some.image.registry/custom-image:latest'
|
||||||
|
entrypoint: ['/bin/bash']
|
||||||
|
script:
|
||||||
|
- echo "Custom message in a custom script"
|
||||||
|
|
||||||
The example above illustrates how you can provide the attributes used to run
|
The example above illustrates how you can provide the attributes used to run
|
||||||
the NO-OP job in the case of an empty pipeline. The only field for the NO-OP
|
the NO-OP job in the case of an empty pipeline. The only field for the NO-OP
|
||||||
job that might be generated for you is ``script``, but that will only happen
|
job that might be generated for you is ``script``, but that will only happen
|
||||||
if you do not provide one yourself. Notice in this example the ``script``
|
if you do not provide one yourself.
|
||||||
uses the ``::`` notation to prescribe override behavior. Without this, the
|
|
||||||
``echo`` command would have been prepended to the automatically generated script
|
|
||||||
rather than replacing it.
|
|
||||||
|
|
||||||
------------------------------------
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
ci.yaml
|
Assignment of specs to runners
|
||||||
------------------------------------
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Here's an example of a spack configuration file describing a build pipeline:
|
The ``mappings`` section corresponds to a list of runners, and during assignment
|
||||||
|
of specs to runners, the list is traversed in order looking for matches, the
|
||||||
|
first runner that matches a release spec is assigned to build that spec. The
|
||||||
|
``match`` section within each runner mapping section is a list of specs, and
|
||||||
|
if any of those specs match the release spec (the ``spec.satisfies()`` method
|
||||||
|
is used), then that runner is considered a match.
|
||||||
|
|
||||||
.. code-block:: yaml
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Configuration of specs/jobs for a runner
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
ci:
|
Once a runner has been chosen to build a release spec, the ``runner-attributes``
|
||||||
target: gitlab
|
section provides information determining details of the job in the context of
|
||||||
|
the runner. The ``runner-attributes`` section must have a ``tags`` key, which
|
||||||
rebuild_index: True
|
|
||||||
|
|
||||||
broken-specs-url: https://broken.specs.url
|
|
||||||
|
|
||||||
broken-tests-packages:
|
|
||||||
- gptune
|
|
||||||
|
|
||||||
pipeline-gen:
|
|
||||||
- submapping:
|
|
||||||
- match:
|
|
||||||
- os=ubuntu18.04
|
|
||||||
build-job:
|
|
||||||
tags:
|
|
||||||
- spack-kube
|
|
||||||
image: spack/ubuntu-bionic
|
|
||||||
- match:
|
|
||||||
- os=centos7
|
|
||||||
build-job:
|
|
||||||
tags:
|
|
||||||
- spack-kube
|
|
||||||
image: spack/centos7
|
|
||||||
|
|
||||||
cdash:
|
|
||||||
build-group: Release Testing
|
|
||||||
url: https://cdash.spack.io
|
|
||||||
project: Spack
|
|
||||||
site: Spack AWS Gitlab Instance
|
|
||||||
|
|
||||||
The ``ci`` config section is used to configure how the pipeline workload should be
|
|
||||||
generated, mainly how the jobs for building specs should be assigned to the
|
|
||||||
configured runners on your instance. The main section for configuring pipelines
|
|
||||||
is ``pipeline-gen``, which is a list of job attribute sections that are merged,
|
|
||||||
using the same rules as Spack configs (:ref:`config-scope-precedence`), from the bottom up.
|
|
||||||
The order sections are applied is to be consistent with how spack orders scope precedence when merging lists.
|
|
||||||
There are two main section types, ``<type>-job`` sections and ``submapping``
|
|
||||||
sections.
|
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Job Attribute Sections
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Each type of job may have attributes added or removed via sections in the ``pipeline-gen``
|
|
||||||
list. Job type specific attributes may be specified using the keys ``<type>-job`` to
|
|
||||||
add attributes to all jobs of type ``<type>`` or ``<type>-job-remove`` to remove attributes
|
|
||||||
of type ``<type>``. Each section may only contain one type of job attribute specification, ie. ,
|
|
||||||
``build-job`` and ``noop-job`` may not coexist but ``build-job`` and ``build-job-remove`` may.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
The ``*-remove`` specifications are applied before the additive attribute specification.
|
|
||||||
For example, in the case where both ``build-job`` and ``build-job-remove`` are listed in
|
|
||||||
the same ``pipeline-gen`` section, the value will still exist in the merged build-job after
|
|
||||||
applying the section.
|
|
||||||
|
|
||||||
All of the attributes specified are forwarded to the generated CI jobs, however special
|
|
||||||
treatment is applied to the attributes ``tags``, ``image``, ``variables``, ``script``,
|
|
||||||
``before_script``, and ``after_script`` as they are components recognized explicitly by the
|
|
||||||
Spack CI generator. For the ``tags`` attribute, Spack will remove reserved tags
|
|
||||||
(:ref:`reserved_tags`) from all jobs specified in the config. In some cases, such as for
|
|
||||||
``signing`` jobs, reserved tags will be added back based on the type of CI that is being run.
|
|
||||||
|
|
||||||
Once a runner has been chosen to build a release spec, the ``build-job*``
|
|
||||||
sections provide information determining details of the job in the context of
|
|
||||||
the runner. At lease one of the ``build-job*`` sections must contain a ``tags`` key, which
|
|
||||||
is a list containing at least one tag used to select the runner from among the
|
is a list containing at least one tag used to select the runner from among the
|
||||||
runners known to the gitlab instance. For Docker executor type runners, the
|
runners known to the gitlab instance. For Docker executor type runners, the
|
||||||
``image`` key is used to specify the Docker image used to build the release spec
|
``image`` key is used to specify the Docker image used to build the release spec
|
||||||
@@ -550,7 +554,7 @@ information on to the runner that it needs to do its work (e.g. scheduler
|
|||||||
parameters, etc.). Any ``variables`` provided here will be added, verbatim, to
|
parameters, etc.). Any ``variables`` provided here will be added, verbatim, to
|
||||||
each job.
|
each job.
|
||||||
|
|
||||||
The ``build-job`` section also allows users to supply custom ``script``,
|
The ``runner-attributes`` section also allows users to supply custom ``script``,
|
||||||
``before_script``, and ``after_script`` sections to be applied to every job
|
``before_script``, and ``after_script`` sections to be applied to every job
|
||||||
scheduled on that runner. This allows users to do any custom preparation or
|
scheduled on that runner. This allows users to do any custom preparation or
|
||||||
cleanup tasks that fit their particular workflow, as well as completely
|
cleanup tasks that fit their particular workflow, as well as completely
|
||||||
@@ -561,45 +565,46 @@ environment directory is located within your ``--artifacts_root`` (or if not
|
|||||||
provided, within your ``$CI_PROJECT_DIR``), activates that environment for
|
provided, within your ``$CI_PROJECT_DIR``), activates that environment for
|
||||||
you, and invokes ``spack ci rebuild``.
|
you, and invokes ``spack ci rebuild``.
|
||||||
|
|
||||||
Sections that specify scripts (``script``, ``before_script``, ``after_script``) are all
|
.. _staging_algorithm:
|
||||||
read as lists of commands or lists of lists of commands. It is recommended to write scripts
|
|
||||||
as lists of lists if scripts will be composed via merging. The default behavior of merging
|
|
||||||
lists will remove duplicate commands and potentially apply unwanted reordering, whereas
|
|
||||||
merging lists of lists will preserve the local ordering and never removes duplicate
|
|
||||||
commands. When writing commands to the CI target script, all lists are expanded and
|
|
||||||
flattened into a single list.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
Submapping Sections
|
Summary of ``.gitlab-ci.yml`` generation algorithm
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
A special case of attribute specification is the ``submapping`` section which may be used
|
All specs yielded by the matrix (or all the specs in the environment) have their
|
||||||
to apply job attributes to build jobs based on the package spec associated with the rebuild
|
dependencies computed, and the entire resulting set of specs are staged together
|
||||||
job. Submapping is specified as a list of spec ``match`` lists associated with
|
before being run through the ``gitlab-ci/mappings`` entries, where each staged
|
||||||
``build-job``/``build-job-remove`` sections. There are two options for ``match_behavior``,
|
spec is assigned a runner. "Staging" is the name given to the process of
|
||||||
either ``first`` or ``merge`` may be specified. In either case, the ``submapping`` list is
|
figuring out in what order the specs should be built, taking into consideration
|
||||||
processed from the bottom up, and then each ``match`` list is searched for a string that
|
Gitlab CI rules about jobs/stages. In the staging process the goal is to maximize
|
||||||
satisfies the check ``spec.satisfies({match_item})`` for each concrete spec.
|
the number of jobs in any stage of the pipeline, while ensuring that the jobs in
|
||||||
|
any stage only depend on jobs in previous stages (since those jobs are guaranteed
|
||||||
|
to have completed already). As a runner is determined for a job, the information
|
||||||
|
in the ``runner-attributes`` is used to populate various parts of the job
|
||||||
|
description that will be used by Gitlab CI. Once all the jobs have been assigned
|
||||||
|
a runner, the ``.gitlab-ci.yml`` is written to disk.
|
||||||
|
|
||||||
The the case of ``match_behavior: first``, the first ``match`` section in the list of
|
The short example provided above would result in the ``readline``, ``ncurses``,
|
||||||
``submappings`` that contains a string that satisfies the spec will apply it's
|
and ``pkgconf`` packages getting staged and built on the runner chosen by the
|
||||||
``build-job*`` attributes to the rebuild job associated with that spec. This is the
|
``spack-k8s`` tag. In this example, spack assumes the runner is a Docker executor
|
||||||
default behavior and will be the method if no ``match_behavior`` is specified.
|
type runner, and thus certain jobs will be run in the ``centos7`` container,
|
||||||
|
and others in the ``ubuntu-18.04`` container. The resulting ``.gitlab-ci.yml``
|
||||||
|
will contain 6 jobs in three stages. Once the jobs have been generated, the
|
||||||
|
presence of a ``SPACK_CDASH_AUTH_TOKEN`` environment variable during the
|
||||||
|
``spack ci generate`` command would result in all of the jobs being put in a
|
||||||
|
build group on CDash called "Release Testing" (that group will be created if
|
||||||
|
it didn't already exist).
|
||||||
|
|
||||||
The the case of ``merge`` match, all of the ``match`` sections in the list of
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
``submappings`` that contain a string that satisfies the spec will have the associated
|
Optional compiler bootstrapping
|
||||||
``build-job*`` attributes applied to the rebuild job associated with that spec. Again,
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
the attributes will be merged starting from the bottom match going up to the top match.
|
|
||||||
|
|
||||||
In the case that no match is found in a submapping section, no additional attributes will be applied.
|
Spack pipelines also have support for bootstrapping compilers on systems that
|
||||||
|
may not already have the desired compilers installed. The idea here is that
|
||||||
^^^^^^^^^^^^^
|
you can specify a list of things to bootstrap in your ``definitions``, and
|
||||||
Bootstrapping
|
spack will guarantee those will be installed in a phase of the pipeline before
|
||||||
^^^^^^^^^^^^^
|
your release specs, so that you can rely on those packages being available in
|
||||||
|
the binary mirror when you need them later on in the pipeline. At the moment
|
||||||
|
|
||||||
The ``bootstrap`` section allows you to specify lists of specs from
|
|
||||||
your ``definitions`` that should be staged ahead of the environment's ``specs``. At the moment
|
|
||||||
the only viable use-case for bootstrapping is to install compilers.
|
the only viable use-case for bootstrapping is to install compilers.
|
||||||
|
|
||||||
Here's an example of what bootstrapping some compilers might look like:
|
Here's an example of what bootstrapping some compilers might look like:
|
||||||
@@ -632,18 +637,18 @@ Here's an example of what bootstrapping some compilers might look like:
|
|||||||
exclude:
|
exclude:
|
||||||
- '%gcc@7.3.0 os=centos7'
|
- '%gcc@7.3.0 os=centos7'
|
||||||
- '%gcc@5.5.0 os=ubuntu18.04'
|
- '%gcc@5.5.0 os=ubuntu18.04'
|
||||||
ci:
|
gitlab-ci:
|
||||||
bootstrap:
|
bootstrap:
|
||||||
- name: compiler-pkgs
|
- name: compiler-pkgs
|
||||||
compiler-agnostic: true
|
compiler-agnostic: true
|
||||||
pipeline-gen:
|
mappings:
|
||||||
# similar to the example higher up in this description
|
# mappings similar to the example higher up in this description
|
||||||
...
|
...
|
||||||
|
|
||||||
The example above adds a list to the ``definitions`` called ``compiler-pkgs``
|
The example above adds a list to the ``definitions`` called ``compiler-pkgs``
|
||||||
(you can add any number of these), which lists compiler packages that should
|
(you can add any number of these), which lists compiler packages that should
|
||||||
be staged ahead of the full matrix of release specs (in this example, only
|
be staged ahead of the full matrix of release specs (in this example, only
|
||||||
readline). Then within the ``ci`` section, note the addition of a
|
readline). Then within the ``gitlab-ci`` section, note the addition of a
|
||||||
``bootstrap`` section, which can contain a list of items, each referring to
|
``bootstrap`` section, which can contain a list of items, each referring to
|
||||||
a list in the ``definitions`` section. These items can either
|
a list in the ``definitions`` section. These items can either
|
||||||
be a dictionary or a string. If you supply a dictionary, it must have a name
|
be a dictionary or a string. If you supply a dictionary, it must have a name
|
||||||
@@ -675,86 +680,6 @@ environment/stack file, and in that case no bootstrapping will be done (only the
|
|||||||
specs will be staged for building) and the runners will be expected to already
|
specs will be staged for building) and the runners will be expected to already
|
||||||
have all needed compilers installed and configured for spack to use.
|
have all needed compilers installed and configured for spack to use.
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
|
||||||
Pipeline Buildcache
|
|
||||||
^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The ``enable-artifacts-buildcache`` key
|
|
||||||
takes a boolean and determines whether the pipeline uses artifacts to store and
|
|
||||||
pass along the buildcaches from one stage to the next (the default if you don't
|
|
||||||
provide this option is ``False``).
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^
|
|
||||||
Broken Specs URL
|
|
||||||
^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The optional ``broken-specs-url`` key tells Spack to check against a list of
|
|
||||||
specs that are known to be currently broken in ``develop``. If any such specs
|
|
||||||
are found, the ``spack ci generate`` command will fail with an error message
|
|
||||||
informing the user what broken specs were encountered. This allows the pipeline
|
|
||||||
to fail early and avoid wasting compute resources attempting to build packages
|
|
||||||
that will not succeed.
|
|
||||||
|
|
||||||
^^^^^
|
|
||||||
CDash
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
The optional ``cdash`` section provides information that will be used by the
|
|
||||||
``spack ci generate`` command (invoked by ``spack ci start``) for reporting
|
|
||||||
to CDash. All the jobs generated from this environment will belong to a
|
|
||||||
"build group" within CDash that can be tracked over time. As the release
|
|
||||||
progresses, this build group may have jobs added or removed. The url, project,
|
|
||||||
and site are used to specify the CDash instance to which build results should
|
|
||||||
be reported.
|
|
||||||
|
|
||||||
Take a look at the
|
|
||||||
`schema <https://github.com/spack/spack/blob/develop/lib/spack/spack/schema/ci.py>`_
|
|
||||||
for the ci section of the spack environment file, to see precisely what
|
|
||||||
syntax is allowed there.
|
|
||||||
|
|
||||||
.. _reserved_tags:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^
|
|
||||||
Reserved Tags
|
|
||||||
^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Spack has a subset of tags (``public``, ``protected``, and ``notary``) that it reserves
|
|
||||||
for classifying runners that may require special permissions or access. The tags
|
|
||||||
``public`` and ``protected`` are used to distinguish between runners that use public
|
|
||||||
permissions and runners with protected permissions. The ``notary`` tag is a special tag
|
|
||||||
that is used to indicate runners that have access to the highly protected information
|
|
||||||
used for signing binaries using the ``signing`` job.
|
|
||||||
|
|
||||||
.. _staging_algorithm:
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
Summary of ``.gitlab-ci.yml`` generation algorithm
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
All specs yielded by the matrix (or all the specs in the environment) have their
|
|
||||||
dependencies computed, and the entire resulting set of specs are staged together
|
|
||||||
before being run through the ``ci/pipeline-gen`` entries, where each staged
|
|
||||||
spec is assigned a runner. "Staging" is the name given to the process of
|
|
||||||
figuring out in what order the specs should be built, taking into consideration
|
|
||||||
Gitlab CI rules about jobs/stages. In the staging process the goal is to maximize
|
|
||||||
the number of jobs in any stage of the pipeline, while ensuring that the jobs in
|
|
||||||
any stage only depend on jobs in previous stages (since those jobs are guaranteed
|
|
||||||
to have completed already). As a runner is determined for a job, the information
|
|
||||||
in the merged ``any-job*`` and ``build-job*`` sections is used to populate various parts of the job
|
|
||||||
description that will be used by the target CI pipelines. Once all the jobs have been assigned
|
|
||||||
a runner, the ``.gitlab-ci.yml`` is written to disk.
|
|
||||||
|
|
||||||
The short example provided above would result in the ``readline``, ``ncurses``,
|
|
||||||
and ``pkgconf`` packages getting staged and built on the runner chosen by the
|
|
||||||
``spack-k8s`` tag. In this example, spack assumes the runner is a Docker executor
|
|
||||||
type runner, and thus certain jobs will be run in the ``centos7`` container,
|
|
||||||
and others in the ``ubuntu-18.04`` container. The resulting ``.gitlab-ci.yml``
|
|
||||||
will contain 6 jobs in three stages. Once the jobs have been generated, the
|
|
||||||
presence of a ``SPACK_CDASH_AUTH_TOKEN`` environment variable during the
|
|
||||||
``spack ci generate`` command would result in all of the jobs being put in a
|
|
||||||
build group on CDash called "Release Testing" (that group will be created if
|
|
||||||
it didn't already exist).
|
|
||||||
|
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
Using a custom spack in your pipeline
|
Using a custom spack in your pipeline
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
@@ -801,21 +726,23 @@ generated by ``spack ci generate``. You also want your generated rebuild jobs
|
|||||||
|
|
||||||
spack:
|
spack:
|
||||||
...
|
...
|
||||||
ci:
|
gitlab-ci:
|
||||||
pipeline-gen:
|
mappings:
|
||||||
- build-job:
|
- match:
|
||||||
tags:
|
- os=ubuntu18.04
|
||||||
- spack-kube
|
runner-attributes:
|
||||||
image: spack/ubuntu-bionic
|
tags:
|
||||||
before_script:
|
- spack-kube
|
||||||
- git clone ${SPACK_REPO}
|
image: spack/ubuntu-bionic
|
||||||
- pushd spack && git checkout ${SPACK_REF} && popd
|
before_script:
|
||||||
- . "./spack/share/spack/setup-env.sh"
|
- git clone ${SPACK_REPO}
|
||||||
script:
|
- pushd spack && git checkout ${SPACK_REF} && popd
|
||||||
- spack env activate --without-view ${SPACK_CONCRETE_ENV_DIR}
|
- . "./spack/share/spack/setup-env.sh"
|
||||||
- spack -d ci rebuild
|
script:
|
||||||
after_script:
|
- spack env activate --without-view ${SPACK_CONCRETE_ENV_DIR}
|
||||||
- rm -rf ./spack
|
- spack -d ci rebuild
|
||||||
|
after_script:
|
||||||
|
- rm -rf ./spack
|
||||||
|
|
||||||
Now all of the generated rebuild jobs will use the same shell script to clone
|
Now all of the generated rebuild jobs will use the same shell script to clone
|
||||||
spack before running their actual workload.
|
spack before running their actual workload.
|
||||||
@@ -904,4 +831,3 @@ verify binary packages (when installing or creating buildcaches). You could
|
|||||||
also have already trusted a key spack know about, or if no key is present anywhere,
|
also have already trusted a key spack know about, or if no key is present anywhere,
|
||||||
spack will install specs using ``--no-check-signature`` and create buildcaches
|
spack will install specs using ``--no-check-signature`` and create buildcaches
|
||||||
using ``-u`` (for unsigned binaries).
|
using ``-u`` (for unsigned binaries).
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -184,48 +184,13 @@ simply run the following commands:
|
|||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ spack env activate myenv
|
$ spack env activate myenv
|
||||||
$ spack concretize --fresh --force
|
$ spack concretize --force
|
||||||
$ spack install
|
$ spack install
|
||||||
|
|
||||||
The ``--fresh`` flag tells Spack to use the latest version of every package
|
The ``--force`` flag tells Spack to overwrite its previous concretization
|
||||||
where possible instead of trying to optimize for reuse of existing installed
|
decisions, allowing you to choose a new version of Python. If any of the new
|
||||||
packages.
|
packages like Bash are already installed, ``spack install`` won't re-install
|
||||||
|
them, it will keep the symlinks in place.
|
||||||
The ``--force`` flag in addition tells Spack to overwrite its previous
|
|
||||||
concretization decisions, allowing you to choose a new version of Python.
|
|
||||||
If any of the new packages like Bash are already installed, ``spack install``
|
|
||||||
won't re-install them, it will keep the symlinks in place.
|
|
||||||
|
|
||||||
-----------------------------------
|
|
||||||
Updating & Cleaning Up Old Packages
|
|
||||||
-----------------------------------
|
|
||||||
|
|
||||||
If you're looking to mimic the behavior of Homebrew, you may also want to
|
|
||||||
clean up out-of-date packages from your environment after an upgrade. To
|
|
||||||
upgrade your entire software stack within an environment and clean up old
|
|
||||||
package versions, simply run the following commands:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack env activate myenv
|
|
||||||
$ spack mark -i --all
|
|
||||||
$ spack concretize --fresh --force
|
|
||||||
$ spack install
|
|
||||||
$ spack gc
|
|
||||||
|
|
||||||
Running ``spack mark -i --all`` tells Spack to mark all of the existing
|
|
||||||
packages within an environment as "implicitly" installed. This tells
|
|
||||||
spack's garbage collection system that these packages should be cleaned up.
|
|
||||||
|
|
||||||
Don't worry however, this will not remove your entire environment.
|
|
||||||
Running ``spack install`` will reexamine your spack environment after
|
|
||||||
a fresh concretization and will re-mark any packages that should remain
|
|
||||||
installed as "explicitly" installed.
|
|
||||||
|
|
||||||
**Note:** if you use multiple spack environments you should re-run ``spack install``
|
|
||||||
in each of your environments prior to running ``spack gc`` to prevent spack
|
|
||||||
from uninstalling any shared packages that are no longer required by the
|
|
||||||
environment you just upgraded.
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
Uninstallation
|
Uninstallation
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
.. Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
.. Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
|
||||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Name, Supported Versions, Notes, Requirement Reason
|
Name, Supported Versions, Notes, Requirement Reason
|
||||||
Python, 3.6--3.11, , Interpreter for Spack
|
Python, 2.7/3.6-3.11, , Interpreter for Spack
|
||||||
C/C++ Compilers, , , Building software
|
C/C++ Compilers, , , Building software
|
||||||
make, , , Build software
|
make, , , Build software
|
||||||
patch, , , Build software
|
patch, , , Build software
|
||||||
|
|
221
lib/spack/env/cc
vendored
221
lib/spack/env/cc
vendored
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh -f
|
#!/bin/sh -f
|
||||||
# shellcheck disable=SC2034 # evals in this script fool shellcheck
|
# shellcheck disable=SC2034 # evals in this script fool shellcheck
|
||||||
#
|
#
|
||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -427,55 +427,6 @@ isystem_include_dirs_list=""
|
|||||||
libs_list=""
|
libs_list=""
|
||||||
other_args_list=""
|
other_args_list=""
|
||||||
|
|
||||||
# Global state for keeping track of -Wl,-rpath -Wl,/path
|
|
||||||
wl_expect_rpath=no
|
|
||||||
|
|
||||||
# Same, but for -Xlinker -rpath -Xlinker /path
|
|
||||||
xlinker_expect_rpath=no
|
|
||||||
|
|
||||||
parse_Wl() {
|
|
||||||
# drop -Wl
|
|
||||||
shift
|
|
||||||
while [ $# -ne 0 ]; do
|
|
||||||
if [ "$wl_expect_rpath" = yes ]; then
|
|
||||||
if system_dir "$1"; then
|
|
||||||
append system_rpath_dirs_list "$1"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$1"
|
|
||||||
fi
|
|
||||||
wl_expect_rpath=no
|
|
||||||
else
|
|
||||||
case "$1" in
|
|
||||||
-rpath=*)
|
|
||||||
arg="${1#-rpath=}"
|
|
||||||
if system_dir "$arg"; then
|
|
||||||
append system_rpath_dirs_list "$arg"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$arg"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--rpath=*)
|
|
||||||
arg="${1#--rpath=}"
|
|
||||||
if system_dir "$arg"; then
|
|
||||||
append system_rpath_dirs_list "$arg"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$arg"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
-rpath|--rpath)
|
|
||||||
wl_expect_rpath=yes
|
|
||||||
;;
|
|
||||||
"$dtags_to_strip")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
append other_args_list "-Wl,$1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
|
|
||||||
@@ -489,47 +440,6 @@ while [ $# -ne 0 ]; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${SPACK_COMPILER_FLAGS_KEEP}" ] ; then
|
|
||||||
# NOTE: the eval is required to allow `|` alternatives inside the variable
|
|
||||||
eval "\
|
|
||||||
case \"\$1\" in
|
|
||||||
$SPACK_COMPILER_FLAGS_KEEP)
|
|
||||||
append other_args_list \"\$1\"
|
|
||||||
shift
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
# the replace list is a space-separated list of pipe-separated pairs,
|
|
||||||
# the first in each pair is the original prefix to be matched, the
|
|
||||||
# second is the replacement prefix
|
|
||||||
if [ -n "${SPACK_COMPILER_FLAGS_REPLACE}" ] ; then
|
|
||||||
for rep in ${SPACK_COMPILER_FLAGS_REPLACE} ; do
|
|
||||||
before=${rep%|*}
|
|
||||||
after=${rep#*|}
|
|
||||||
eval "\
|
|
||||||
stripped=\"\${1##$before}\"
|
|
||||||
"
|
|
||||||
if [ "$stripped" = "$1" ] ; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
replaced="$after$stripped"
|
|
||||||
|
|
||||||
# it matched, remove it
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ -z "$replaced" ] ; then
|
|
||||||
# completely removed, continue OUTER loop
|
|
||||||
continue 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# re-build argument list with replacement
|
|
||||||
set -- "$replaced" "$@"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-isystem*)
|
-isystem*)
|
||||||
arg="${1#-isystem}"
|
arg="${1#-isystem}"
|
||||||
@@ -575,77 +485,88 @@ while [ $# -ne 0 ]; do
|
|||||||
append other_args_list "-l$arg"
|
append other_args_list "-l$arg"
|
||||||
;;
|
;;
|
||||||
-Wl,*)
|
-Wl,*)
|
||||||
IFS=,
|
arg="${1#-Wl,}"
|
||||||
parse_Wl $1
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
unset IFS
|
case "$arg" in
|
||||||
|
-rpath=*) rp="${arg#-rpath=}" ;;
|
||||||
|
--rpath=*) rp="${arg#--rpath=}" ;;
|
||||||
|
-rpath,*) rp="${arg#-rpath,}" ;;
|
||||||
|
--rpath,*) rp="${arg#--rpath,}" ;;
|
||||||
|
-rpath|--rpath)
|
||||||
|
shift; arg="$1"
|
||||||
|
case "$arg" in
|
||||||
|
-Wl,*)
|
||||||
|
rp="${arg#-Wl,}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "-Wl,-rpath was not followed by -Wl,*"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"$dtags_to_strip")
|
||||||
|
: # We want to remove explicitly this flag
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
append other_args_list "-Wl,$arg"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
-Xlinker,*)
|
||||||
|
arg="${1#-Xlinker,}"
|
||||||
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
|
|
||||||
|
case "$arg" in
|
||||||
|
-rpath=*) rp="${arg#-rpath=}" ;;
|
||||||
|
--rpath=*) rp="${arg#--rpath=}" ;;
|
||||||
|
-rpath|--rpath)
|
||||||
|
shift; arg="$1"
|
||||||
|
case "$arg" in
|
||||||
|
-Xlinker,*)
|
||||||
|
rp="${arg#-Xlinker,}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "-Xlinker,-rpath was not followed by -Xlinker,*"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
append other_args_list "-Xlinker,$arg"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
-Xlinker)
|
-Xlinker)
|
||||||
shift
|
if [ "$2" = "-rpath" ]; then
|
||||||
if [ $# -eq 0 ]; then
|
if [ "$3" != "-Xlinker" ]; then
|
||||||
# -Xlinker without value: let the compiler error about it.
|
die "-Xlinker,-rpath was not followed by -Xlinker,*"
|
||||||
append other_args_list -Xlinker
|
|
||||||
xlinker_expect_rpath=no
|
|
||||||
break
|
|
||||||
elif [ "$xlinker_expect_rpath" = yes ]; then
|
|
||||||
# Register the path of -Xlinker -rpath <other args> -Xlinker <path>
|
|
||||||
if system_dir "$1"; then
|
|
||||||
append system_rpath_dirs_list "$1"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$1"
|
|
||||||
fi
|
fi
|
||||||
xlinker_expect_rpath=no
|
shift 3;
|
||||||
|
rp="$1"
|
||||||
|
elif [ "$2" = "$dtags_to_strip" ]; then
|
||||||
|
shift # We want to remove explicitly this flag
|
||||||
else
|
else
|
||||||
case "$1" in
|
append other_args_list "$1"
|
||||||
-rpath=*)
|
|
||||||
arg="${1#-rpath=}"
|
|
||||||
if system_dir "$arg"; then
|
|
||||||
append system_rpath_dirs_list "$arg"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$arg"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--rpath=*)
|
|
||||||
arg="${1#--rpath=}"
|
|
||||||
if system_dir "$arg"; then
|
|
||||||
append system_rpath_dirs_list "$arg"
|
|
||||||
else
|
|
||||||
append rpath_dirs_list "$arg"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
-rpath|--rpath)
|
|
||||||
xlinker_expect_rpath=yes
|
|
||||||
;;
|
|
||||||
"$dtags_to_strip")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
append other_args_list -Xlinker
|
|
||||||
append other_args_list "$1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"$dtags_to_strip")
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
append other_args_list "$1"
|
if [ "$1" = "$dtags_to_strip" ]; then
|
||||||
|
: # We want to remove explicitly this flag
|
||||||
|
else
|
||||||
|
append other_args_list "$1"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# test rpaths against system directories in one place.
|
||||||
|
if [ -n "$rp" ]; then
|
||||||
|
if system_dir "$rp"; then
|
||||||
|
append system_rpath_dirs_list "$rp"
|
||||||
|
else
|
||||||
|
append rpath_dirs_list "$rp"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# We found `-Xlinker -rpath` but no matching value `-Xlinker /path`. Just append
|
|
||||||
# `-Xlinker -rpath` again and let the compiler or linker handle the error during arg
|
|
||||||
# parsing.
|
|
||||||
if [ "$xlinker_expect_rpath" = yes ]; then
|
|
||||||
append other_args_list -Xlinker
|
|
||||||
append other_args_list -rpath
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Same, but for -Wl flags.
|
|
||||||
if [ "$wl_expect_rpath" = yes ]; then
|
|
||||||
append other_args_list -Wl,-rpath
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add flags from Spack's cppflags, cflags, cxxflags, fcflags, fflags, and
|
# Add flags from Spack's cppflags, cflags, cxxflags, fcflags, fflags, and
|
||||||
# ldflags. We stick to the order that gmake puts the flags in by default.
|
# ldflags. We stick to the order that gmake puts the flags in by default.
|
||||||
|
59
lib/spack/external/__init__.py
vendored
59
lib/spack/external/__init__.py
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
@@ -11,14 +11,25 @@
|
|||||||
|
|
||||||
* Homepage: https://altgraph.readthedocs.io/en/latest/index.html
|
* Homepage: https://altgraph.readthedocs.io/en/latest/index.html
|
||||||
* Usage: dependency of macholib
|
* Usage: dependency of macholib
|
||||||
* Version: 0.17.3
|
* Version: 0.17.2
|
||||||
|
|
||||||
archspec
|
archspec
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/archspec
|
* Homepage: https://pypi.python.org/pypi/archspec
|
||||||
* Usage: Labeling, comparison and detection of microarchitectures
|
* Usage: Labeling, comparison and detection of microarchitectures
|
||||||
* Version: 0.2.0-dev (commit f3667f95030c6573842fb5f6df0d647285597509)
|
* Version: 0.2.0 (commit 77640e572725ad97f18e63a04857155752ace045)
|
||||||
|
|
||||||
|
argparse
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Homepage: https://pypi.python.org/pypi/argparse
|
||||||
|
* Usage: We include our own version to be Python 3.X compatible.
|
||||||
|
* Version: 1.4.0
|
||||||
|
* Note: This package has been slightly modified to improve
|
||||||
|
error message formatting. See the following commit if the
|
||||||
|
vendored copy ever needs to be updated again:
|
||||||
|
https://github.com/spack/spack/pull/6786/commits/dfcef577b77249106ea4e4c69a6cd9e64fa6c418
|
||||||
|
|
||||||
astunparse
|
astunparse
|
||||||
----------------
|
----------------
|
||||||
@@ -41,7 +52,7 @@
|
|||||||
|
|
||||||
* Homepage: https://github.com/python-attrs/attrs
|
* Homepage: https://github.com/python-attrs/attrs
|
||||||
* Usage: Needed by jsonschema.
|
* Usage: Needed by jsonschema.
|
||||||
* Version: 22.1.0
|
* Version: 21.2.0 (83d3cd70f90a3f4d19ee8b508e58d1c58821c0ad)
|
||||||
|
|
||||||
ctest_log_parser
|
ctest_log_parser
|
||||||
----------------
|
----------------
|
||||||
@@ -56,14 +67,21 @@
|
|||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/distro
|
* Homepage: https://pypi.python.org/pypi/distro
|
||||||
* Usage: Provides a more stable linux distribution detection.
|
* Usage: Provides a more stable linux distribution detection.
|
||||||
* Version: 1.8.0
|
* Version: 1.6.0 (64946a1e2a9ff529047070657728600e006c99ff)
|
||||||
|
* Note: Last version supporting Python 2.7
|
||||||
|
|
||||||
|
functools32
|
||||||
|
-----------
|
||||||
|
* Homepage: https://github.com/MiCHiLU/python-functools32
|
||||||
|
* Usage: Needed by jsonschema when using Python 2.7.
|
||||||
|
* Version: 3.2.3-2
|
||||||
|
|
||||||
jinja2
|
jinja2
|
||||||
------
|
------
|
||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/Jinja2
|
* Homepage: https://pypi.python.org/pypi/Jinja2
|
||||||
* Usage: A modern and designer-friendly templating language for Python.
|
* Usage: A modern and designer-friendly templating language for Python.
|
||||||
* Version: 3.0.3 (last version supporting Python 3.6)
|
* Version: 2.11.3 (last version supporting Python 2.7)
|
||||||
|
|
||||||
jsonschema
|
jsonschema
|
||||||
----------
|
----------
|
||||||
@@ -78,21 +96,44 @@
|
|||||||
|
|
||||||
* Homepage: https://macholib.readthedocs.io/en/latest/index.html#
|
* Homepage: https://macholib.readthedocs.io/en/latest/index.html#
|
||||||
* Usage: Manipulation of Mach-o binaries for relocating macOS buildcaches on Linux
|
* Usage: Manipulation of Mach-o binaries for relocating macOS buildcaches on Linux
|
||||||
* Version: 1.16.2
|
* Version: 1.15.2
|
||||||
|
|
||||||
markupsafe
|
markupsafe
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* Homepage: https://pypi.python.org/pypi/MarkupSafe
|
* Homepage: https://pypi.python.org/pypi/MarkupSafe
|
||||||
* Usage: Implements a XML/HTML/XHTML Markup safe string for Python.
|
* Usage: Implements a XML/HTML/XHTML Markup safe string for Python.
|
||||||
* Version: 2.0.1 (last version supporting Python 3.6)
|
* Version: 1.1.1 (last version supporting Python 2.7)
|
||||||
|
|
||||||
|
py
|
||||||
|
--
|
||||||
|
|
||||||
|
* Homepage: https://pypi.python.org/pypi/py
|
||||||
|
* Usage: Needed by pytest. Library with cross-python path,
|
||||||
|
ini-parsing, io, code, and log facilities.
|
||||||
|
* Version: 1.4.34 (last version supporting Python 2.6)
|
||||||
|
* Note: This packages has been modified:
|
||||||
|
* https://github.com/pytest-dev/py/pull/186 was backported
|
||||||
|
|
||||||
pyrsistent
|
pyrsistent
|
||||||
----------
|
----------
|
||||||
|
|
||||||
* Homepage: http://github.com/tobgu/pyrsistent/
|
* Homepage: http://github.com/tobgu/pyrsistent/
|
||||||
* Usage: Needed by `jsonschema`
|
* Usage: Needed by `jsonschema`
|
||||||
* Version: 0.18.0
|
* Version: 0.16.1 (last version supporting Python 2.7)
|
||||||
|
* Note: We only include the parts needed for `jsonschema`.
|
||||||
|
|
||||||
|
pytest
|
||||||
|
------
|
||||||
|
|
||||||
|
* Homepage: https://pypi.python.org/pypi/pytest
|
||||||
|
* Usage: Testing framework used by Spack.
|
||||||
|
* Version: 3.2.5 (last version supporting Python 2.6)
|
||||||
|
* Note: This package has been slightly modified:
|
||||||
|
* We improve Python 2.6 compatibility. See:
|
||||||
|
https://github.com/spack/spack/pull/6801.
|
||||||
|
* We have patched pytest not to depend on setuptools. See:
|
||||||
|
https://github.com/spack/spack/pull/15612
|
||||||
|
|
||||||
ruamel.yaml
|
ruamel.yaml
|
||||||
------
|
------
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
__version__ = '0.18.0'
|
|
@@ -1 +0,0 @@
|
|||||||
from _pyrsistent_version import *
|
|
1
lib/spack/external/_vendoring/altgraph.pyi
vendored
1
lib/spack/external/_vendoring/altgraph.pyi
vendored
@@ -1 +0,0 @@
|
|||||||
from altgraph import *
|
|
18
lib/spack/external/_vendoring/altgraph/LICENSE
vendored
18
lib/spack/external/_vendoring/altgraph/LICENSE
vendored
@@ -1,18 +0,0 @@
|
|||||||
Copyright (c) 2004 Istvan Albert unless otherwise noted.
|
|
||||||
Copyright (c) 2006-2010 Bob Ippolito
|
|
||||||
Copyright (2) 2010-2020 Ronald Oussoren, et. al.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to
|
|
||||||
deal in the Software without restriction, including without limitation the
|
|
||||||
rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
IN THE SOFTWARE.
|
|
486
lib/spack/external/_vendoring/attr/__init__.pyi
vendored
486
lib/spack/external/_vendoring/attr/__init__.pyi
vendored
@@ -1,486 +0,0 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
from typing import (
|
|
||||||
Any,
|
|
||||||
Callable,
|
|
||||||
ClassVar,
|
|
||||||
Dict,
|
|
||||||
Generic,
|
|
||||||
List,
|
|
||||||
Mapping,
|
|
||||||
Optional,
|
|
||||||
Protocol,
|
|
||||||
Sequence,
|
|
||||||
Tuple,
|
|
||||||
Type,
|
|
||||||
TypeVar,
|
|
||||||
Union,
|
|
||||||
overload,
|
|
||||||
)
|
|
||||||
|
|
||||||
# `import X as X` is required to make these public
|
|
||||||
from . import converters as converters
|
|
||||||
from . import exceptions as exceptions
|
|
||||||
from . import filters as filters
|
|
||||||
from . import setters as setters
|
|
||||||
from . import validators as validators
|
|
||||||
from ._cmp import cmp_using as cmp_using
|
|
||||||
from ._version_info import VersionInfo
|
|
||||||
|
|
||||||
__version__: str
|
|
||||||
__version_info__: VersionInfo
|
|
||||||
__title__: str
|
|
||||||
__description__: str
|
|
||||||
__url__: str
|
|
||||||
__uri__: str
|
|
||||||
__author__: str
|
|
||||||
__email__: str
|
|
||||||
__license__: str
|
|
||||||
__copyright__: str
|
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
|
||||||
_C = TypeVar("_C", bound=type)
|
|
||||||
|
|
||||||
_EqOrderType = Union[bool, Callable[[Any], Any]]
|
|
||||||
_ValidatorType = Callable[[Any, Attribute[_T], _T], Any]
|
|
||||||
_ConverterType = Callable[[Any], Any]
|
|
||||||
_FilterType = Callable[[Attribute[_T], _T], bool]
|
|
||||||
_ReprType = Callable[[Any], str]
|
|
||||||
_ReprArgType = Union[bool, _ReprType]
|
|
||||||
_OnSetAttrType = Callable[[Any, Attribute[Any], Any], Any]
|
|
||||||
_OnSetAttrArgType = Union[
|
|
||||||
_OnSetAttrType, List[_OnSetAttrType], setters._NoOpType
|
|
||||||
]
|
|
||||||
_FieldTransformer = Callable[
|
|
||||||
[type, List[Attribute[Any]]], List[Attribute[Any]]
|
|
||||||
]
|
|
||||||
# FIXME: in reality, if multiple validators are passed they must be in a list
|
|
||||||
# or tuple, but those are invariant and so would prevent subtypes of
|
|
||||||
# _ValidatorType from working when passed in a list or tuple.
|
|
||||||
_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
|
|
||||||
|
|
||||||
# A protocol to be able to statically accept an attrs class.
|
|
||||||
class AttrsInstance(Protocol):
|
|
||||||
__attrs_attrs__: ClassVar[Any]
|
|
||||||
|
|
||||||
# _make --
|
|
||||||
|
|
||||||
NOTHING: object
|
|
||||||
|
|
||||||
# NOTE: Factory lies about its return type to make this possible:
|
|
||||||
# `x: List[int] # = Factory(list)`
|
|
||||||
# Work around mypy issue #4554 in the common case by using an overload.
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
from typing import Literal
|
|
||||||
@overload
|
|
||||||
def Factory(factory: Callable[[], _T]) -> _T: ...
|
|
||||||
@overload
|
|
||||||
def Factory(
|
|
||||||
factory: Callable[[Any], _T],
|
|
||||||
takes_self: Literal[True],
|
|
||||||
) -> _T: ...
|
|
||||||
@overload
|
|
||||||
def Factory(
|
|
||||||
factory: Callable[[], _T],
|
|
||||||
takes_self: Literal[False],
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
else:
|
|
||||||
@overload
|
|
||||||
def Factory(factory: Callable[[], _T]) -> _T: ...
|
|
||||||
@overload
|
|
||||||
def Factory(
|
|
||||||
factory: Union[Callable[[Any], _T], Callable[[], _T]],
|
|
||||||
takes_self: bool = ...,
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
# Static type inference support via __dataclass_transform__ implemented as per:
|
|
||||||
# https://github.com/microsoft/pyright/blob/1.1.135/specs/dataclass_transforms.md
|
|
||||||
# This annotation must be applied to all overloads of "define" and "attrs"
|
|
||||||
#
|
|
||||||
# NOTE: This is a typing construct and does not exist at runtime. Extensions
|
|
||||||
# wrapping attrs decorators should declare a separate __dataclass_transform__
|
|
||||||
# signature in the extension module using the specification linked above to
|
|
||||||
# provide pyright support.
|
|
||||||
def __dataclass_transform__(
|
|
||||||
*,
|
|
||||||
eq_default: bool = True,
|
|
||||||
order_default: bool = False,
|
|
||||||
kw_only_default: bool = False,
|
|
||||||
field_descriptors: Tuple[Union[type, Callable[..., Any]], ...] = (()),
|
|
||||||
) -> Callable[[_T], _T]: ...
|
|
||||||
|
|
||||||
class Attribute(Generic[_T]):
|
|
||||||
name: str
|
|
||||||
default: Optional[_T]
|
|
||||||
validator: Optional[_ValidatorType[_T]]
|
|
||||||
repr: _ReprArgType
|
|
||||||
cmp: _EqOrderType
|
|
||||||
eq: _EqOrderType
|
|
||||||
order: _EqOrderType
|
|
||||||
hash: Optional[bool]
|
|
||||||
init: bool
|
|
||||||
converter: Optional[_ConverterType]
|
|
||||||
metadata: Dict[Any, Any]
|
|
||||||
type: Optional[Type[_T]]
|
|
||||||
kw_only: bool
|
|
||||||
on_setattr: _OnSetAttrType
|
|
||||||
def evolve(self, **changes: Any) -> "Attribute[Any]": ...
|
|
||||||
|
|
||||||
# NOTE: We had several choices for the annotation to use for type arg:
|
|
||||||
# 1) Type[_T]
|
|
||||||
# - Pros: Handles simple cases correctly
|
|
||||||
# - Cons: Might produce less informative errors in the case of conflicting
|
|
||||||
# TypeVars e.g. `attr.ib(default='bad', type=int)`
|
|
||||||
# 2) Callable[..., _T]
|
|
||||||
# - Pros: Better error messages than #1 for conflicting TypeVars
|
|
||||||
# - Cons: Terrible error messages for validator checks.
|
|
||||||
# e.g. attr.ib(type=int, validator=validate_str)
|
|
||||||
# -> error: Cannot infer function type argument
|
|
||||||
# 3) type (and do all of the work in the mypy plugin)
|
|
||||||
# - Pros: Simple here, and we could customize the plugin with our own errors.
|
|
||||||
# - Cons: Would need to write mypy plugin code to handle all the cases.
|
|
||||||
# We chose option #1.
|
|
||||||
|
|
||||||
# `attr` lies about its return type to make the following possible:
|
|
||||||
# attr() -> Any
|
|
||||||
# attr(8) -> int
|
|
||||||
# attr(validator=<some callable>) -> Whatever the callable expects.
|
|
||||||
# This makes this type of assignments possible:
|
|
||||||
# x: int = attr(8)
|
|
||||||
#
|
|
||||||
# This form catches explicit None or no default but with no other arguments
|
|
||||||
# returns Any.
|
|
||||||
@overload
|
|
||||||
def attrib(
|
|
||||||
default: None = ...,
|
|
||||||
validator: None = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
type: None = ...,
|
|
||||||
converter: None = ...,
|
|
||||||
factory: None = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> Any: ...
|
|
||||||
|
|
||||||
# This form catches an explicit None or no default and infers the type from the
|
|
||||||
# other arguments.
|
|
||||||
@overload
|
|
||||||
def attrib(
|
|
||||||
default: None = ...,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
type: Optional[Type[_T]] = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
# This form catches an explicit default argument.
|
|
||||||
@overload
|
|
||||||
def attrib(
|
|
||||||
default: _T,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
type: Optional[Type[_T]] = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
# This form covers type=non-Type: e.g. forward references (str), Any
|
|
||||||
@overload
|
|
||||||
def attrib(
|
|
||||||
default: Optional[_T] = ...,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
type: object = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> Any: ...
|
|
||||||
@overload
|
|
||||||
def field(
|
|
||||||
*,
|
|
||||||
default: None = ...,
|
|
||||||
validator: None = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
converter: None = ...,
|
|
||||||
factory: None = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[bool] = ...,
|
|
||||||
order: Optional[bool] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> Any: ...
|
|
||||||
|
|
||||||
# This form catches an explicit None or no default and infers the type from the
|
|
||||||
# other arguments.
|
|
||||||
@overload
|
|
||||||
def field(
|
|
||||||
*,
|
|
||||||
default: None = ...,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
# This form catches an explicit default argument.
|
|
||||||
@overload
|
|
||||||
def field(
|
|
||||||
*,
|
|
||||||
default: _T,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> _T: ...
|
|
||||||
|
|
||||||
# This form covers type=non-Type: e.g. forward references (str), Any
|
|
||||||
@overload
|
|
||||||
def field(
|
|
||||||
*,
|
|
||||||
default: Optional[_T] = ...,
|
|
||||||
validator: Optional[_ValidatorArgType[_T]] = ...,
|
|
||||||
repr: _ReprArgType = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
metadata: Optional[Mapping[Any, Any]] = ...,
|
|
||||||
converter: Optional[_ConverterType] = ...,
|
|
||||||
factory: Optional[Callable[[], _T]] = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
) -> Any: ...
|
|
||||||
@overload
|
|
||||||
@__dataclass_transform__(order_default=True, field_descriptors=(attrib, field))
|
|
||||||
def attrs(
|
|
||||||
maybe_cls: _C,
|
|
||||||
these: Optional[Dict[str, Any]] = ...,
|
|
||||||
repr_ns: Optional[str] = ...,
|
|
||||||
repr: bool = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
slots: bool = ...,
|
|
||||||
frozen: bool = ...,
|
|
||||||
weakref_slot: bool = ...,
|
|
||||||
str: bool = ...,
|
|
||||||
auto_attribs: bool = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
cache_hash: bool = ...,
|
|
||||||
auto_exc: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
auto_detect: bool = ...,
|
|
||||||
collect_by_mro: bool = ...,
|
|
||||||
getstate_setstate: Optional[bool] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
field_transformer: Optional[_FieldTransformer] = ...,
|
|
||||||
match_args: bool = ...,
|
|
||||||
) -> _C: ...
|
|
||||||
@overload
|
|
||||||
@__dataclass_transform__(order_default=True, field_descriptors=(attrib, field))
|
|
||||||
def attrs(
|
|
||||||
maybe_cls: None = ...,
|
|
||||||
these: Optional[Dict[str, Any]] = ...,
|
|
||||||
repr_ns: Optional[str] = ...,
|
|
||||||
repr: bool = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
slots: bool = ...,
|
|
||||||
frozen: bool = ...,
|
|
||||||
weakref_slot: bool = ...,
|
|
||||||
str: bool = ...,
|
|
||||||
auto_attribs: bool = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
cache_hash: bool = ...,
|
|
||||||
auto_exc: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
auto_detect: bool = ...,
|
|
||||||
collect_by_mro: bool = ...,
|
|
||||||
getstate_setstate: Optional[bool] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
field_transformer: Optional[_FieldTransformer] = ...,
|
|
||||||
match_args: bool = ...,
|
|
||||||
) -> Callable[[_C], _C]: ...
|
|
||||||
@overload
|
|
||||||
@__dataclass_transform__(field_descriptors=(attrib, field))
|
|
||||||
def define(
|
|
||||||
maybe_cls: _C,
|
|
||||||
*,
|
|
||||||
these: Optional[Dict[str, Any]] = ...,
|
|
||||||
repr: bool = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
slots: bool = ...,
|
|
||||||
frozen: bool = ...,
|
|
||||||
weakref_slot: bool = ...,
|
|
||||||
str: bool = ...,
|
|
||||||
auto_attribs: bool = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
cache_hash: bool = ...,
|
|
||||||
auto_exc: bool = ...,
|
|
||||||
eq: Optional[bool] = ...,
|
|
||||||
order: Optional[bool] = ...,
|
|
||||||
auto_detect: bool = ...,
|
|
||||||
getstate_setstate: Optional[bool] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
field_transformer: Optional[_FieldTransformer] = ...,
|
|
||||||
match_args: bool = ...,
|
|
||||||
) -> _C: ...
|
|
||||||
@overload
|
|
||||||
@__dataclass_transform__(field_descriptors=(attrib, field))
|
|
||||||
def define(
|
|
||||||
maybe_cls: None = ...,
|
|
||||||
*,
|
|
||||||
these: Optional[Dict[str, Any]] = ...,
|
|
||||||
repr: bool = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
slots: bool = ...,
|
|
||||||
frozen: bool = ...,
|
|
||||||
weakref_slot: bool = ...,
|
|
||||||
str: bool = ...,
|
|
||||||
auto_attribs: bool = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
cache_hash: bool = ...,
|
|
||||||
auto_exc: bool = ...,
|
|
||||||
eq: Optional[bool] = ...,
|
|
||||||
order: Optional[bool] = ...,
|
|
||||||
auto_detect: bool = ...,
|
|
||||||
getstate_setstate: Optional[bool] = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
field_transformer: Optional[_FieldTransformer] = ...,
|
|
||||||
match_args: bool = ...,
|
|
||||||
) -> Callable[[_C], _C]: ...
|
|
||||||
|
|
||||||
mutable = define
|
|
||||||
frozen = define # they differ only in their defaults
|
|
||||||
|
|
||||||
def fields(cls: Type[AttrsInstance]) -> Any: ...
|
|
||||||
def fields_dict(cls: Type[AttrsInstance]) -> Dict[str, Attribute[Any]]: ...
|
|
||||||
def validate(inst: AttrsInstance) -> None: ...
|
|
||||||
def resolve_types(
|
|
||||||
cls: _C,
|
|
||||||
globalns: Optional[Dict[str, Any]] = ...,
|
|
||||||
localns: Optional[Dict[str, Any]] = ...,
|
|
||||||
attribs: Optional[List[Attribute[Any]]] = ...,
|
|
||||||
) -> _C: ...
|
|
||||||
|
|
||||||
# TODO: add support for returning a proper attrs class from the mypy plugin
|
|
||||||
# we use Any instead of _CountingAttr so that e.g. `make_class('Foo',
|
|
||||||
# [attr.ib()])` is valid
|
|
||||||
def make_class(
|
|
||||||
name: str,
|
|
||||||
attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]],
|
|
||||||
bases: Tuple[type, ...] = ...,
|
|
||||||
repr_ns: Optional[str] = ...,
|
|
||||||
repr: bool = ...,
|
|
||||||
cmp: Optional[_EqOrderType] = ...,
|
|
||||||
hash: Optional[bool] = ...,
|
|
||||||
init: bool = ...,
|
|
||||||
slots: bool = ...,
|
|
||||||
frozen: bool = ...,
|
|
||||||
weakref_slot: bool = ...,
|
|
||||||
str: bool = ...,
|
|
||||||
auto_attribs: bool = ...,
|
|
||||||
kw_only: bool = ...,
|
|
||||||
cache_hash: bool = ...,
|
|
||||||
auto_exc: bool = ...,
|
|
||||||
eq: Optional[_EqOrderType] = ...,
|
|
||||||
order: Optional[_EqOrderType] = ...,
|
|
||||||
collect_by_mro: bool = ...,
|
|
||||||
on_setattr: Optional[_OnSetAttrArgType] = ...,
|
|
||||||
field_transformer: Optional[_FieldTransformer] = ...,
|
|
||||||
) -> type: ...
|
|
||||||
|
|
||||||
# _funcs --
|
|
||||||
|
|
||||||
# TODO: add support for returning TypedDict from the mypy plugin
|
|
||||||
# FIXME: asdict/astuple do not honor their factory args. Waiting on one of
|
|
||||||
# these:
|
|
||||||
# https://github.com/python/mypy/issues/4236
|
|
||||||
# https://github.com/python/typing/issues/253
|
|
||||||
# XXX: remember to fix attrs.asdict/astuple too!
|
|
||||||
def asdict(
|
|
||||||
inst: AttrsInstance,
|
|
||||||
recurse: bool = ...,
|
|
||||||
filter: Optional[_FilterType[Any]] = ...,
|
|
||||||
dict_factory: Type[Mapping[Any, Any]] = ...,
|
|
||||||
retain_collection_types: bool = ...,
|
|
||||||
value_serializer: Optional[
|
|
||||||
Callable[[type, Attribute[Any], Any], Any]
|
|
||||||
] = ...,
|
|
||||||
tuple_keys: Optional[bool] = ...,
|
|
||||||
) -> Dict[str, Any]: ...
|
|
||||||
|
|
||||||
# TODO: add support for returning NamedTuple from the mypy plugin
|
|
||||||
def astuple(
|
|
||||||
inst: AttrsInstance,
|
|
||||||
recurse: bool = ...,
|
|
||||||
filter: Optional[_FilterType[Any]] = ...,
|
|
||||||
tuple_factory: Type[Sequence[Any]] = ...,
|
|
||||||
retain_collection_types: bool = ...,
|
|
||||||
) -> Tuple[Any, ...]: ...
|
|
||||||
def has(cls: type) -> bool: ...
|
|
||||||
def assoc(inst: _T, **changes: Any) -> _T: ...
|
|
||||||
def evolve(inst: _T, **changes: Any) -> _T: ...
|
|
||||||
|
|
||||||
# _config --
|
|
||||||
|
|
||||||
def set_run_validators(run: bool) -> None: ...
|
|
||||||
def get_run_validators() -> bool: ...
|
|
||||||
|
|
||||||
# aliases --
|
|
||||||
|
|
||||||
s = attributes = attrs
|
|
||||||
ib = attr = attrib
|
|
||||||
dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;)
|
|
13
lib/spack/external/_vendoring/attr/_cmp.pyi
vendored
13
lib/spack/external/_vendoring/attr/_cmp.pyi
vendored
@@ -1,13 +0,0 @@
|
|||||||
from typing import Any, Callable, Optional, Type
|
|
||||||
|
|
||||||
_CompareWithType = Callable[[Any, Any], bool]
|
|
||||||
|
|
||||||
def cmp_using(
|
|
||||||
eq: Optional[_CompareWithType],
|
|
||||||
lt: Optional[_CompareWithType],
|
|
||||||
le: Optional[_CompareWithType],
|
|
||||||
gt: Optional[_CompareWithType],
|
|
||||||
ge: Optional[_CompareWithType],
|
|
||||||
require_same_type: bool,
|
|
||||||
class_name: str,
|
|
||||||
) -> Type: ...
|
|
185
lib/spack/external/_vendoring/attr/_compat.py
vendored
185
lib/spack/external/_vendoring/attr/_compat.py
vendored
@@ -1,185 +0,0 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
|
|
||||||
import inspect
|
|
||||||
import platform
|
|
||||||
import sys
|
|
||||||
import threading
|
|
||||||
import types
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
from collections.abc import Mapping, Sequence # noqa
|
|
||||||
|
|
||||||
|
|
||||||
PYPY = platform.python_implementation() == "PyPy"
|
|
||||||
PY36 = sys.version_info[:2] >= (3, 6)
|
|
||||||
HAS_F_STRINGS = PY36
|
|
||||||
PY310 = sys.version_info[:2] >= (3, 10)
|
|
||||||
|
|
||||||
|
|
||||||
if PYPY or PY36:
|
|
||||||
ordered_dict = dict
|
|
||||||
else:
|
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
ordered_dict = OrderedDict
|
|
||||||
|
|
||||||
|
|
||||||
def just_warn(*args, **kw):
|
|
||||||
warnings.warn(
|
|
||||||
"Running interpreter doesn't sufficiently support code object "
|
|
||||||
"introspection. Some features like bare super() or accessing "
|
|
||||||
"__class__ will not work with slotted classes.",
|
|
||||||
RuntimeWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class _AnnotationExtractor:
|
|
||||||
"""
|
|
||||||
Extract type annotations from a callable, returning None whenever there
|
|
||||||
is none.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__slots__ = ["sig"]
|
|
||||||
|
|
||||||
def __init__(self, callable):
|
|
||||||
try:
|
|
||||||
self.sig = inspect.signature(callable)
|
|
||||||
except (ValueError, TypeError): # inspect failed
|
|
||||||
self.sig = None
|
|
||||||
|
|
||||||
def get_first_param_type(self):
|
|
||||||
"""
|
|
||||||
Return the type annotation of the first argument if it's not empty.
|
|
||||||
"""
|
|
||||||
if not self.sig:
|
|
||||||
return None
|
|
||||||
|
|
||||||
params = list(self.sig.parameters.values())
|
|
||||||
if params and params[0].annotation is not inspect.Parameter.empty:
|
|
||||||
return params[0].annotation
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
def get_return_type(self):
|
|
||||||
"""
|
|
||||||
Return the return type if it's not empty.
|
|
||||||
"""
|
|
||||||
if (
|
|
||||||
self.sig
|
|
||||||
and self.sig.return_annotation is not inspect.Signature.empty
|
|
||||||
):
|
|
||||||
return self.sig.return_annotation
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def make_set_closure_cell():
|
|
||||||
"""Return a function of two arguments (cell, value) which sets
|
|
||||||
the value stored in the closure cell `cell` to `value`.
|
|
||||||
"""
|
|
||||||
# pypy makes this easy. (It also supports the logic below, but
|
|
||||||
# why not do the easy/fast thing?)
|
|
||||||
if PYPY:
|
|
||||||
|
|
||||||
def set_closure_cell(cell, value):
|
|
||||||
cell.__setstate__((value,))
|
|
||||||
|
|
||||||
return set_closure_cell
|
|
||||||
|
|
||||||
# Otherwise gotta do it the hard way.
|
|
||||||
|
|
||||||
# Create a function that will set its first cellvar to `value`.
|
|
||||||
def set_first_cellvar_to(value):
|
|
||||||
x = value
|
|
||||||
return
|
|
||||||
|
|
||||||
# This function will be eliminated as dead code, but
|
|
||||||
# not before its reference to `x` forces `x` to be
|
|
||||||
# represented as a closure cell rather than a local.
|
|
||||||
def force_x_to_be_a_cell(): # pragma: no cover
|
|
||||||
return x
|
|
||||||
|
|
||||||
try:
|
|
||||||
# Extract the code object and make sure our assumptions about
|
|
||||||
# the closure behavior are correct.
|
|
||||||
co = set_first_cellvar_to.__code__
|
|
||||||
if co.co_cellvars != ("x",) or co.co_freevars != ():
|
|
||||||
raise AssertionError # pragma: no cover
|
|
||||||
|
|
||||||
# Convert this code object to a code object that sets the
|
|
||||||
# function's first _freevar_ (not cellvar) to the argument.
|
|
||||||
if sys.version_info >= (3, 8):
|
|
||||||
|
|
||||||
def set_closure_cell(cell, value):
|
|
||||||
cell.cell_contents = value
|
|
||||||
|
|
||||||
else:
|
|
||||||
args = [co.co_argcount]
|
|
||||||
args.append(co.co_kwonlyargcount)
|
|
||||||
args.extend(
|
|
||||||
[
|
|
||||||
co.co_nlocals,
|
|
||||||
co.co_stacksize,
|
|
||||||
co.co_flags,
|
|
||||||
co.co_code,
|
|
||||||
co.co_consts,
|
|
||||||
co.co_names,
|
|
||||||
co.co_varnames,
|
|
||||||
co.co_filename,
|
|
||||||
co.co_name,
|
|
||||||
co.co_firstlineno,
|
|
||||||
co.co_lnotab,
|
|
||||||
# These two arguments are reversed:
|
|
||||||
co.co_cellvars,
|
|
||||||
co.co_freevars,
|
|
||||||
]
|
|
||||||
)
|
|
||||||
set_first_freevar_code = types.CodeType(*args)
|
|
||||||
|
|
||||||
def set_closure_cell(cell, value):
|
|
||||||
# Create a function using the set_first_freevar_code,
|
|
||||||
# whose first closure cell is `cell`. Calling it will
|
|
||||||
# change the value of that cell.
|
|
||||||
setter = types.FunctionType(
|
|
||||||
set_first_freevar_code, {}, "setter", (), (cell,)
|
|
||||||
)
|
|
||||||
# And call it to set the cell.
|
|
||||||
setter(value)
|
|
||||||
|
|
||||||
# Make sure it works on this interpreter:
|
|
||||||
def make_func_with_cell():
|
|
||||||
x = None
|
|
||||||
|
|
||||||
def func():
|
|
||||||
return x # pragma: no cover
|
|
||||||
|
|
||||||
return func
|
|
||||||
|
|
||||||
cell = make_func_with_cell().__closure__[0]
|
|
||||||
set_closure_cell(cell, 100)
|
|
||||||
if cell.cell_contents != 100:
|
|
||||||
raise AssertionError # pragma: no cover
|
|
||||||
|
|
||||||
except Exception:
|
|
||||||
return just_warn
|
|
||||||
else:
|
|
||||||
return set_closure_cell
|
|
||||||
|
|
||||||
|
|
||||||
set_closure_cell = make_set_closure_cell()
|
|
||||||
|
|
||||||
# Thread-local global to track attrs instances which are already being repr'd.
|
|
||||||
# This is needed because there is no other (thread-safe) way to pass info
|
|
||||||
# about the instances that are already being repr'd through the call stack
|
|
||||||
# in order to ensure we don't perform infinite recursion.
|
|
||||||
#
|
|
||||||
# For instance, if an instance contains a dict which contains that instance,
|
|
||||||
# we need to know that we're already repr'ing the outside instance from within
|
|
||||||
# the dict's repr() call.
|
|
||||||
#
|
|
||||||
# This lives here rather than in _make.py so that the functions in _make.py
|
|
||||||
# don't have a direct reference to the thread-local in their globals dict.
|
|
||||||
# If they have such a reference, it breaks cloudpickle.
|
|
||||||
repr_context = threading.local()
|
|
@@ -1,9 +0,0 @@
|
|||||||
class VersionInfo:
|
|
||||||
@property
|
|
||||||
def year(self) -> int: ...
|
|
||||||
@property
|
|
||||||
def minor(self) -> int: ...
|
|
||||||
@property
|
|
||||||
def micro(self) -> int: ...
|
|
||||||
@property
|
|
||||||
def releaselevel(self) -> str: ...
|
|
@@ -1,13 +0,0 @@
|
|||||||
from typing import Callable, Optional, TypeVar, overload
|
|
||||||
|
|
||||||
from . import _ConverterType
|
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
|
||||||
|
|
||||||
def pipe(*validators: _ConverterType) -> _ConverterType: ...
|
|
||||||
def optional(converter: _ConverterType) -> _ConverterType: ...
|
|
||||||
@overload
|
|
||||||
def default_if_none(default: _T) -> _ConverterType: ...
|
|
||||||
@overload
|
|
||||||
def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType: ...
|
|
||||||
def to_bool(val: str) -> bool: ...
|
|
@@ -1,17 +0,0 @@
|
|||||||
from typing import Any
|
|
||||||
|
|
||||||
class FrozenError(AttributeError):
|
|
||||||
msg: str = ...
|
|
||||||
|
|
||||||
class FrozenInstanceError(FrozenError): ...
|
|
||||||
class FrozenAttributeError(FrozenError): ...
|
|
||||||
class AttrsAttributeNotFoundError(ValueError): ...
|
|
||||||
class NotAnAttrsClassError(ValueError): ...
|
|
||||||
class DefaultAlreadySetError(RuntimeError): ...
|
|
||||||
class UnannotatedAttributeError(RuntimeError): ...
|
|
||||||
class PythonTooOldError(RuntimeError): ...
|
|
||||||
|
|
||||||
class NotCallableError(TypeError):
|
|
||||||
msg: str = ...
|
|
||||||
value: Any = ...
|
|
||||||
def __init__(self, msg: str, value: Any) -> None: ...
|
|
@@ -1,6 +0,0 @@
|
|||||||
from typing import Any, Union
|
|
||||||
|
|
||||||
from . import Attribute, _FilterType
|
|
||||||
|
|
||||||
def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ...
|
|
||||||
def exclude(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ...
|
|
19
lib/spack/external/_vendoring/attr/setters.pyi
vendored
19
lib/spack/external/_vendoring/attr/setters.pyi
vendored
@@ -1,19 +0,0 @@
|
|||||||
from typing import Any, NewType, NoReturn, TypeVar, cast
|
|
||||||
|
|
||||||
from . import Attribute, _OnSetAttrType
|
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
|
||||||
|
|
||||||
def frozen(
|
|
||||||
instance: Any, attribute: Attribute[Any], new_value: Any
|
|
||||||
) -> NoReturn: ...
|
|
||||||
def pipe(*setters: _OnSetAttrType) -> _OnSetAttrType: ...
|
|
||||||
def validate(instance: Any, attribute: Attribute[_T], new_value: _T) -> _T: ...
|
|
||||||
|
|
||||||
# convert is allowed to return Any, because they can be chained using pipe.
|
|
||||||
def convert(
|
|
||||||
instance: Any, attribute: Attribute[Any], new_value: Any
|
|
||||||
) -> Any: ...
|
|
||||||
|
|
||||||
_NoOpType = NewType("_NoOpType", object)
|
|
||||||
NO_OP: _NoOpType
|
|
@@ -1,80 +0,0 @@
|
|||||||
from typing import (
|
|
||||||
Any,
|
|
||||||
AnyStr,
|
|
||||||
Callable,
|
|
||||||
Container,
|
|
||||||
ContextManager,
|
|
||||||
Iterable,
|
|
||||||
List,
|
|
||||||
Mapping,
|
|
||||||
Match,
|
|
||||||
Optional,
|
|
||||||
Pattern,
|
|
||||||
Tuple,
|
|
||||||
Type,
|
|
||||||
TypeVar,
|
|
||||||
Union,
|
|
||||||
overload,
|
|
||||||
)
|
|
||||||
|
|
||||||
from . import _ValidatorType
|
|
||||||
from . import _ValidatorArgType
|
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
|
||||||
_T1 = TypeVar("_T1")
|
|
||||||
_T2 = TypeVar("_T2")
|
|
||||||
_T3 = TypeVar("_T3")
|
|
||||||
_I = TypeVar("_I", bound=Iterable)
|
|
||||||
_K = TypeVar("_K")
|
|
||||||
_V = TypeVar("_V")
|
|
||||||
_M = TypeVar("_M", bound=Mapping)
|
|
||||||
|
|
||||||
def set_disabled(run: bool) -> None: ...
|
|
||||||
def get_disabled() -> bool: ...
|
|
||||||
def disabled() -> ContextManager[None]: ...
|
|
||||||
|
|
||||||
# To be more precise on instance_of use some overloads.
|
|
||||||
# If there are more than 3 items in the tuple then we fall back to Any
|
|
||||||
@overload
|
|
||||||
def instance_of(type: Type[_T]) -> _ValidatorType[_T]: ...
|
|
||||||
@overload
|
|
||||||
def instance_of(type: Tuple[Type[_T]]) -> _ValidatorType[_T]: ...
|
|
||||||
@overload
|
|
||||||
def instance_of(
|
|
||||||
type: Tuple[Type[_T1], Type[_T2]]
|
|
||||||
) -> _ValidatorType[Union[_T1, _T2]]: ...
|
|
||||||
@overload
|
|
||||||
def instance_of(
|
|
||||||
type: Tuple[Type[_T1], Type[_T2], Type[_T3]]
|
|
||||||
) -> _ValidatorType[Union[_T1, _T2, _T3]]: ...
|
|
||||||
@overload
|
|
||||||
def instance_of(type: Tuple[type, ...]) -> _ValidatorType[Any]: ...
|
|
||||||
def provides(interface: Any) -> _ValidatorType[Any]: ...
|
|
||||||
def optional(
|
|
||||||
validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]]
|
|
||||||
) -> _ValidatorType[Optional[_T]]: ...
|
|
||||||
def in_(options: Container[_T]) -> _ValidatorType[_T]: ...
|
|
||||||
def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ...
|
|
||||||
def matches_re(
|
|
||||||
regex: Union[Pattern[AnyStr], AnyStr],
|
|
||||||
flags: int = ...,
|
|
||||||
func: Optional[
|
|
||||||
Callable[[AnyStr, AnyStr, int], Optional[Match[AnyStr]]]
|
|
||||||
] = ...,
|
|
||||||
) -> _ValidatorType[AnyStr]: ...
|
|
||||||
def deep_iterable(
|
|
||||||
member_validator: _ValidatorArgType[_T],
|
|
||||||
iterable_validator: Optional[_ValidatorType[_I]] = ...,
|
|
||||||
) -> _ValidatorType[_I]: ...
|
|
||||||
def deep_mapping(
|
|
||||||
key_validator: _ValidatorType[_K],
|
|
||||||
value_validator: _ValidatorType[_V],
|
|
||||||
mapping_validator: Optional[_ValidatorType[_M]] = ...,
|
|
||||||
) -> _ValidatorType[_M]: ...
|
|
||||||
def is_callable() -> _ValidatorType[_T]: ...
|
|
||||||
def lt(val: _T) -> _ValidatorType[_T]: ...
|
|
||||||
def le(val: _T) -> _ValidatorType[_T]: ...
|
|
||||||
def ge(val: _T) -> _ValidatorType[_T]: ...
|
|
||||||
def gt(val: _T) -> _ValidatorType[_T]: ...
|
|
||||||
def max_len(length: int) -> _ValidatorType[_T]: ...
|
|
||||||
def min_len(length: int) -> _ValidatorType[_T]: ...
|
|
70
lib/spack/external/_vendoring/attrs/__init__.py
vendored
70
lib/spack/external/_vendoring/attrs/__init__.py
vendored
@@ -1,70 +0,0 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
from attr import (
|
|
||||||
NOTHING,
|
|
||||||
Attribute,
|
|
||||||
Factory,
|
|
||||||
__author__,
|
|
||||||
__copyright__,
|
|
||||||
__description__,
|
|
||||||
__doc__,
|
|
||||||
__email__,
|
|
||||||
__license__,
|
|
||||||
__title__,
|
|
||||||
__url__,
|
|
||||||
__version__,
|
|
||||||
__version_info__,
|
|
||||||
assoc,
|
|
||||||
cmp_using,
|
|
||||||
define,
|
|
||||||
evolve,
|
|
||||||
field,
|
|
||||||
fields,
|
|
||||||
fields_dict,
|
|
||||||
frozen,
|
|
||||||
has,
|
|
||||||
make_class,
|
|
||||||
mutable,
|
|
||||||
resolve_types,
|
|
||||||
validate,
|
|
||||||
)
|
|
||||||
from attr._next_gen import asdict, astuple
|
|
||||||
|
|
||||||
from . import converters, exceptions, filters, setters, validators
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
|
||||||
"__author__",
|
|
||||||
"__copyright__",
|
|
||||||
"__description__",
|
|
||||||
"__doc__",
|
|
||||||
"__email__",
|
|
||||||
"__license__",
|
|
||||||
"__title__",
|
|
||||||
"__url__",
|
|
||||||
"__version__",
|
|
||||||
"__version_info__",
|
|
||||||
"asdict",
|
|
||||||
"assoc",
|
|
||||||
"astuple",
|
|
||||||
"Attribute",
|
|
||||||
"cmp_using",
|
|
||||||
"converters",
|
|
||||||
"define",
|
|
||||||
"evolve",
|
|
||||||
"exceptions",
|
|
||||||
"Factory",
|
|
||||||
"field",
|
|
||||||
"fields_dict",
|
|
||||||
"fields",
|
|
||||||
"filters",
|
|
||||||
"frozen",
|
|
||||||
"has",
|
|
||||||
"make_class",
|
|
||||||
"mutable",
|
|
||||||
"NOTHING",
|
|
||||||
"resolve_types",
|
|
||||||
"setters",
|
|
||||||
"validate",
|
|
||||||
"validators",
|
|
||||||
]
|
|
66
lib/spack/external/_vendoring/attrs/__init__.pyi
vendored
66
lib/spack/external/_vendoring/attrs/__init__.pyi
vendored
@@ -1,66 +0,0 @@
|
|||||||
from typing import (
|
|
||||||
Any,
|
|
||||||
Callable,
|
|
||||||
Dict,
|
|
||||||
Mapping,
|
|
||||||
Optional,
|
|
||||||
Sequence,
|
|
||||||
Tuple,
|
|
||||||
Type,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Because we need to type our own stuff, we have to make everything from
|
|
||||||
# attr explicitly public too.
|
|
||||||
from attr import __author__ as __author__
|
|
||||||
from attr import __copyright__ as __copyright__
|
|
||||||
from attr import __description__ as __description__
|
|
||||||
from attr import __email__ as __email__
|
|
||||||
from attr import __license__ as __license__
|
|
||||||
from attr import __title__ as __title__
|
|
||||||
from attr import __url__ as __url__
|
|
||||||
from attr import __version__ as __version__
|
|
||||||
from attr import __version_info__ as __version_info__
|
|
||||||
from attr import _FilterType
|
|
||||||
from attr import assoc as assoc
|
|
||||||
from attr import Attribute as Attribute
|
|
||||||
from attr import cmp_using as cmp_using
|
|
||||||
from attr import converters as converters
|
|
||||||
from attr import define as define
|
|
||||||
from attr import evolve as evolve
|
|
||||||
from attr import exceptions as exceptions
|
|
||||||
from attr import Factory as Factory
|
|
||||||
from attr import field as field
|
|
||||||
from attr import fields as fields
|
|
||||||
from attr import fields_dict as fields_dict
|
|
||||||
from attr import filters as filters
|
|
||||||
from attr import frozen as frozen
|
|
||||||
from attr import has as has
|
|
||||||
from attr import make_class as make_class
|
|
||||||
from attr import mutable as mutable
|
|
||||||
from attr import NOTHING as NOTHING
|
|
||||||
from attr import resolve_types as resolve_types
|
|
||||||
from attr import setters as setters
|
|
||||||
from attr import validate as validate
|
|
||||||
from attr import validators as validators
|
|
||||||
|
|
||||||
# TODO: see definition of attr.asdict/astuple
|
|
||||||
def asdict(
|
|
||||||
inst: Any,
|
|
||||||
recurse: bool = ...,
|
|
||||||
filter: Optional[_FilterType[Any]] = ...,
|
|
||||||
dict_factory: Type[Mapping[Any, Any]] = ...,
|
|
||||||
retain_collection_types: bool = ...,
|
|
||||||
value_serializer: Optional[
|
|
||||||
Callable[[type, Attribute[Any], Any], Any]
|
|
||||||
] = ...,
|
|
||||||
tuple_keys: bool = ...,
|
|
||||||
) -> Dict[str, Any]: ...
|
|
||||||
|
|
||||||
# TODO: add support for returning NamedTuple from the mypy plugin
|
|
||||||
def astuple(
|
|
||||||
inst: Any,
|
|
||||||
recurse: bool = ...,
|
|
||||||
filter: Optional[_FilterType[Any]] = ...,
|
|
||||||
tuple_factory: Type[Sequence[Any]] = ...,
|
|
||||||
retain_collection_types: bool = ...,
|
|
||||||
) -> Tuple[Any, ...]: ...
|
|
@@ -1,3 +0,0 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
from attr.converters import * # noqa
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user