Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
20b53b8
updating changes before troubleshooting style
nhanford Jan 17, 2023
9d02385
debugged tests
nhanford Jan 18, 2023
ab39de3
style
nhanford Jan 19, 2023
4dd74b4
added doc for BinaryCacheQuery
nhanford Jan 19, 2023
84004d6
forgot one mutable_empty_config
nhanford Jan 19, 2023
b604666
folding in changes to satisfies
nhanford Feb 21, 2023
fe451ea
checkpointing before cleanup and updating lookup
nhanford Jan 17, 2023
b50f3a5
debugged tests
nhanford Jan 18, 2023
95e4125
style
nhanford Jan 19, 2023
e94b975
forgot one mutable_empty_config
nhanford Jan 19, 2023
7ec00f4
checkpoint for debugging deps
nhanford Feb 24, 2023
8782935
allow parsing for multiple anonymous deps
becker33 Feb 24, 2023
5c5a981
fixed lookup_hash for dependencies with abstract hashes
becker33 Feb 24, 2023
1d58bf1
updated more test cases
nhanford Feb 24, 2023
920fdb0
updated logic
nhanford Feb 28, 2023
5ca2640
remaining print statement
nhanford Feb 28, 2023
ddafa0b
style
nhanford Feb 28, 2023
c14fc75
bugfix for cmp_iter
becker33 Mar 2, 2023
ccd7aaf
cleanup merge
nhanford Mar 2, 2023
6b91e54
handle more repl hash cases
nhanford Mar 7, 2023
e08b005
updated file error handling windows
nhanford Mar 14, 2023
655667e
style on mac
nhanford Mar 14, 2023
68956f5
cleanup after rebase
nhanford Mar 15, 2023
ac859ed
typos and split intersect
nhanford Mar 15, 2023
b467e6e
restore parsing logic and errors
nhanford Mar 15, 2023
15f304b
style
nhanford Mar 15, 2023
1378f77
style
nhanford Mar 15, 2023
7fdde64
updated windows specfile test realism
nhanford Mar 16, 2023
b7374f8
coverage, pruning
nhanford Mar 29, 2023
6cc9652
finishing tests, removing unnecessary checks
nhanford Mar 29, 2023
da00f41
windows didn't like a
nhanford Apr 1, 2023
b488c7f
Single CI job run
johnwparent Apr 18, 2023
facf80f
Run CI for me
johnwparent Apr 18, 2023
263b101
only run windows
johnwparent Apr 18, 2023
77cf971
attempt to get teh CI to run
johnwparent Apr 18, 2023
8428953
gha is frustrating
johnwparent Apr 18, 2023
c9b0e04
Print all compilers
johnwparent Apr 18, 2023
a9692b0
compiler_to_str
johnwparent Apr 18, 2023
ef78a7b
archspec_host_is_spack_test_host
johnwparent Apr 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 54 additions & 56 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,69 @@ concurrency:
cancel-in-progress: true

jobs:
prechecks:
needs: [ changes ]
uses: ./.github/workflows/valid-style.yml
with:
with_coverage: ${{ needs.changes.outputs.core }}
all-prechecks:
needs: [ prechecks ]
runs-on: ubuntu-latest
steps:
- name: Success
run: "true"
# Check which files have been updated by the PR
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
bootstrap: ${{ steps.filter.outputs.bootstrap }}
core: ${{ steps.filter.outputs.core }}
packages: ${{ steps.filter.outputs.packages }}
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
if: ${{ github.event_name == 'push' }}
with:
fetch-depth: 0
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
id: filter
with:
# See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
# Don't run if we only modified packages in the
# built-in repository or documentation
filters: |
bootstrap:
- 'var/spack/repos/builtin/packages/clingo-bootstrap/**'
- 'var/spack/repos/builtin/packages/clingo/**'
- 'var/spack/repos/builtin/packages/python/**'
- 'var/spack/repos/builtin/packages/re2c/**'
- 'lib/spack/**'
- 'share/spack/**'
- '.github/workflows/bootstrap.yml'
- '.github/workflows/ci.yaml'
core:
- './!(var/**)/**'
packages:
- 'var/**'
# prechecks:
# needs: [ changes ]
# uses: ./.github/workflows/valid-style.yml
# with:
# with_coverage: ${{ needs.changes.outputs.core }}
# all-prechecks:
# needs: [ prechecks ]
# runs-on: ubuntu-latest
# steps:
# - name: Success
# run: "true"
# # Check which files have been updated by the PR
# changes:
# runs-on: ubuntu-latest
# # Set job outputs to values from filter step
# outputs:
# bootstrap: ${{ steps.filter.outputs.bootstrap }}
# core: ${{ steps.filter.outputs.core }}
# packages: ${{ steps.filter.outputs.packages }}
# steps:
# - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # @v2
# if: ${{ github.event_name == 'push' }}
# with:
# fetch-depth: 0
# # For pull requests it's not necessary to checkout the code
# - uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
# id: filter
# with:
# # See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
# # Don't run if we only modified packages in the
# # built-in repository or documentation
# filters: |
# bootstrap:
# - 'var/spack/repos/builtin/packages/clingo-bootstrap/**'
# - 'var/spack/repos/builtin/packages/clingo/**'
# - 'var/spack/repos/builtin/packages/python/**'
# - 'var/spack/repos/builtin/packages/re2c/**'
# - 'lib/spack/**'
# - 'share/spack/**'
# - '.github/workflows/bootstrap.yml'
# - '.github/workflows/ci.yaml'
# core:
# - './!(var/**)/**'
# packages:
# - 'var/**'
# Some links for easier reference:
#
# "github" context: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
# job outputs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
# setting environment variables from earlier steps: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
#
bootstrap:
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.bootstrap == 'true' }}
needs: [ prechecks, changes ]
uses: ./.github/workflows/bootstrap.yml
unit-tests:
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
needs: [ prechecks, changes ]
uses: ./.github/workflows/unit_tests.yaml
# bootstrap:
# if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.bootstrap == 'true' }}
# needs: [ prechecks, changes ]
# uses: ./.github/workflows/bootstrap.yml
# unit-tests:
# if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
# needs: [ prechecks, changes ]
# uses: ./.github/workflows/unit_tests.yaml
windows:
if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }}
needs: [ prechecks ]
uses: ./.github/workflows/windows_python.yml
all:
needs: [ windows, unit-tests, bootstrap ]
needs: [ windows]
runs-on: ubuntu-latest
steps:
- name: Success
Expand Down
97 changes: 47 additions & 50 deletions .github/workflows/windows_python.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: windows

on:
workflow_call:
on: push

concurrency:
group: windows-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
Expand Down Expand Up @@ -29,55 +28,53 @@ jobs:
./.github/workflows/setup_git.ps1
- name: Unit Test
run: |
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 lib/spack/spack/test/spec_syntax.py::test_spec_by_hash
./share/spack/qa/validate_last_exit.ps1
coverage combine -a
coverage xml
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
flags: unittests,windows
unit-tests-cmd:
runs-on: windows-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
with:
fetch-depth: 0
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
with:
python-version: 3.9
- name: Install Python packages
run: |
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage pytest-cov clingo
- name: Create local develop
run: |
./.github/workflows/setup_git.ps1
- name: Command Unit Test
run: |
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 xml
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
flags: unittests,windows
build-abseil:
runs-on: windows-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
with:
fetch-depth: 0
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
with:
python-version: 3.9
- name: Install Python packages
run: |
python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
- name: Build Test
run: |
spack compiler find
spack external find cmake
spack external find ninja
spack -d install abseil-cpp
# - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
# with:
# flags: unittests,windows
# unit-tests-cmd:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
# with:
# fetch-depth: 0
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
# with:
# python-version: 3.9
# - name: Install Python packages
# run: |
# python -m pip install --upgrade pip six pywin32 setuptools codecov coverage pytest-cov clingo
# - name: Create local develop
# run: |
# ./.github/workflows/setup_git.ps1
# - name: Command Unit Test
# run: |
# 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 xml
# - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
# with:
# flags: unittests,windows
# build-abseil:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
# with:
# fetch-depth: 0
# - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435
# with:
# python-version: 3.9
# - name: Install Python packages
# run: |
# python -m pip install --upgrade pip six pywin32 setuptools codecov coverage
# - name: Build Test
# run: |
# spack compiler find
# spack external find cmake
# spack external find ninja
# spack -d install abseil-cpp
# TODO: johnwparent - reduce the size of the installer operations
# make-installer:
# runs-on: windows-latest
Expand Down
6 changes: 5 additions & 1 deletion lib/spack/spack/binary_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def update(self, with_cooldown=False):

self._write_local_index_cache()

if all_methods_failed:
if configured_mirror_urls and all_methods_failed:
raise FetchCacheError(fetch_errors)
if fetch_errors:
tty.warn(
Expand Down Expand Up @@ -2426,6 +2426,10 @@ def __init__(self, all_architectures):
self.possible_specs = specs

def __call__(self, spec, **kwargs):
"""
Args:
spec (str): The spec being searched for in its string representation or hash.
"""
matches = []
if spec.startswith("/"):
# Matching a DAG hash
Expand Down
43 changes: 21 additions & 22 deletions lib/spack/spack/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,11 @@ def next_spec(self, initial_spec: Optional[spack.spec.Spec] = None) -> spack.spe
root_spec = SpecNodeParser(self.ctx).parse(initial_spec)
while True:
if self.ctx.accept(TokenType.DEPENDENCY):
if root_spec.abstract_hash:
raise spack.spec.RedundantSpecError(root_spec, self.ctx.current_token)
dependency = SpecNodeParser(self.ctx).parse(spack.spec.Spec())

if dependency == spack.spec.Spec():
if not dependency.abstract_hash and dependency == spack.spec.Spec():
msg = (
"this dependency sigil needs to be followed by a package name "
"or a node attribute (version, variant, etc.)"
Expand Down Expand Up @@ -315,7 +317,6 @@ def parse(self, initial_spec: spack.spec.Spec) -> spack.spec.Spec:
Return
The object passed as argument
"""
import spack.environment # Needed to retrieve by hash

# If we start with a package name we have a named spec, we cannot
# accept another package name afterwards in a node
Expand Down Expand Up @@ -399,26 +400,24 @@ def parse(self, initial_spec: spack.spec.Spec) -> spack.spec.Spec:
name = name.strip("'\" ")
value = value.strip("'\" ")
initial_spec._add_flag(name, value, propagate=True)
elif not self.has_hash and self.ctx.accept(TokenType.DAG_HASH):
dag_hash = self.ctx.current_token.value[1:]
matches = []
if spack.environment.active_environment():
matches = spack.environment.active_environment().get_by_hash(dag_hash)
if not matches:
matches = spack.store.db.get_by_hash(dag_hash)
if not matches:
raise spack.spec.NoSuchHashError(dag_hash)

if len(matches) != 1:
raise spack.spec.AmbiguousHashError(
f"Multiple packages specify hash beginning '{dag_hash}'.", *matches
)
spec_by_hash = matches[0]
if not spec_by_hash.satisfies(initial_spec):
raise spack.spec.InvalidHashError(initial_spec, spec_by_hash.dag_hash())
initial_spec._dup(spec_by_hash)

self.has_hash = True
elif self.ctx.accept(TokenType.DAG_HASH):
# if initial_spec.abstract_hash:
# msg = (
# f"Parsed multiple hashes /{initial_spec.abstract_hash} and "
# "/{self.current_token}. If you were attempting to specify a file path,"
# " check that it was formatted properly"
# )
# raise spack.spec.RedundantSpecError(msg, self.ctx.current_token.value)
initial_spec.abstract_hash = self.ctx.current_token.value[1:]
if self.ctx.next_token and self.ctx.next_token.kind not in [
TokenType.UNQUALIFIED_PACKAGE_NAME,
TokenType.FULLY_QUALIFIED_PACKAGE_NAME,
TokenType.DAG_HASH,
TokenType.FILENAME,
TokenType.DEPENDENCY,
]:
raise spack.spec.RedundantSpecError(initial_spec, self.ctx.next_token)
break
else:
break

Expand Down
Loading