Run audits on windows

Add debug log for external detection tests. The debug log
is used to print which test is being executed.

Skip version audit on Windows where appropriate
This commit is contained in:
Gregory Becker 2024-04-26 10:38:09 -07:00 committed by Massimiliano Culpo
parent ddabb8b12c
commit 859745f1a9
23 changed files with 66 additions and 20 deletions

View file

@ -17,10 +17,16 @@ concurrency:
jobs: jobs:
# Run audits on all the packages in the built-in repository # Run audits on all the packages in the built-in repository
package-audits: package-audits:
runs-on: ${{ matrix.operating_system }} runs-on: ${{ matrix.system.os }}
strategy: strategy:
matrix: matrix:
operating_system: ["ubuntu-latest", "macos-latest"] system:
- { os: windows-latest, shell: 'powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0}' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
defaults:
run:
shell: ${{ matrix.system.shell }}
steps: steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
@ -29,8 +35,12 @@ jobs:
- name: Install Python packages - name: Install Python packages
run: | run: |
pip install --upgrade pip setuptools pytest coverage[toml] pip install --upgrade pip setuptools pytest coverage[toml]
- name: Setup for Windows run
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pywin32
- name: Package audits (with coverage) - name: Package audits (with coverage)
if: ${{ inputs.with_coverage == 'true' }} if: ${{ inputs.with_coverage == 'true' && runner.os != 'Windows' }}
run: | run: |
. share/spack/setup-env.sh . share/spack/setup-env.sh
coverage run $(which spack) audit packages coverage run $(which spack) audit packages
@ -38,11 +48,19 @@ jobs:
coverage combine coverage combine
coverage xml coverage xml
- name: Package audits (without coverage) - name: Package audits (without coverage)
if: ${{ inputs.with_coverage == 'false' }} if: ${{ inputs.with_coverage == 'false' && runner.os != 'Windows' }}
run: | run: |
. share/spack/setup-env.sh . share/spack/setup-env.sh
$(which spack) audit packages spack -d audit packages
$(which spack) audit externals spack -d audit externals
- name: Package audits (without coverage)
if: ${{ runner.os == 'Windows' }}
run: |
. share/spack/setup-env.sh
spack -d audit packages
./share/spack/qa/validate_last_exit.ps1
spack -d audit externals
./share/spack/qa/validate_last_exit.ps1
- uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed - uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed
if: ${{ inputs.with_coverage == 'true' }} if: ${{ inputs.with_coverage == 'true' }}
with: with:

View file

@ -1046,7 +1046,7 @@ def _extracts_errors(triggers, summary):
group="externals", group="externals",
tag="PKG-EXTERNALS", tag="PKG-EXTERNALS",
description="Sanity checks for external software detection", description="Sanity checks for external software detection",
kwargs=("pkgs",), kwargs=("pkgs", "debug_log"),
) )
@ -1069,7 +1069,7 @@ def packages_with_detection_tests():
@external_detection @external_detection
def _test_detection_by_executable(pkgs, error_cls): def _test_detection_by_executable(pkgs, debug_log, error_cls):
"""Test drive external detection for packages""" """Test drive external detection for packages"""
import spack.detection import spack.detection
@ -1095,6 +1095,7 @@ def _test_detection_by_executable(pkgs, error_cls):
for idx, test_runner in enumerate( for idx, test_runner in enumerate(
spack.detection.detection_tests(pkg_name, spack.repo.PATH) spack.detection.detection_tests(pkg_name, spack.repo.PATH)
): ):
debug_log(f"[{__file__}]: running test {idx} for package {pkg_name}")
specs = test_runner.execute() specs = test_runner.execute()
expected_specs = test_runner.expected_specs expected_specs = test_runner.expected_specs
@ -1115,11 +1116,10 @@ def _test_detection_by_executable(pkgs, error_cls):
for candidate in expected_specs: for candidate in expected_specs:
try: try:
idx = specs.index(candidate) idx = specs.index(candidate)
matched_detection.append((candidate, specs[idx]))
except (AttributeError, ValueError): except (AttributeError, ValueError):
pass pass
matched_detection.append((candidate, specs[idx]))
def _compare_extra_attribute(_expected, _detected, *, _spec): def _compare_extra_attribute(_expected, _detected, *, _spec):
result = [] result = []
# Check items are of the same type # Check items are of the same type

View file

@ -84,7 +84,7 @@ def externals(parser, args):
return return
pkgs = args.name or spack.repo.PATH.all_package_names() pkgs = args.name or spack.repo.PATH.all_package_names()
reports = spack.audit.run_group(args.subcommand, pkgs=pkgs) reports = spack.audit.run_group(args.subcommand, pkgs=pkgs, debug_log=tty.debug)
_process_reports(reports) _process_reports(reports)

View file

@ -22,6 +22,8 @@ class ArmForge(Package):
# TODO: this mess should be fixed as soon as a way to parametrize/constrain # TODO: this mess should be fixed as soon as a way to parametrize/constrain
# versions (and checksums) based on the target platform shows up # versions (and checksums) based on the target platform shows up
skip_version_audit = ["platform=windows"]
if platform.machine() in ["aarch64", "arm64"]: if platform.machine() in ["aarch64", "arm64"]:
version( version(
"22.1.3", sha256="131884f998b82673e885a7b42cc883210e3a0229b50af374092140cdfd42a408" "22.1.3", sha256="131884f998b82673e885a7b42cc883210e3a0229b50af374092140cdfd42a408"

View file

@ -592,7 +592,7 @@ class Cuda(Package):
maintainers("ax3l", "Rombur") maintainers("ax3l", "Rombur")
executables = ["^nvcc$"] executables = ["^nvcc$"]
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
for ver, packages in _versions.items(): for ver, packages in _versions.items():
key = "{0}-{1}".format(platform.system(), platform.machine()) key = "{0}-{1}".format(platform.system(), platform.machine())

View file

@ -298,7 +298,7 @@ class Cudnn(Package):
# need to use modified URLs like in url_for_version. # need to use modified URLs like in url_for_version.
maintainers("adamjstewart", "bvanessen") maintainers("adamjstewart", "bvanessen")
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
license("MIT") license("MIT")

View file

@ -27,7 +27,7 @@ class Cutensor(Package):
maintainers("bvanessen") maintainers("bvanessen")
url = "cutensor" url = "cutensor"
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
for ver, packages in _versions.items(): for ver, packages in _versions.items():
key = "{0}-{1}".format(platform.system(), platform.machine()) key = "{0}-{1}".format(platform.system(), platform.machine())

View file

@ -23,7 +23,7 @@ class GccRuntime(Package):
tags = ["runtime"] tags = ["runtime"]
# gcc-runtime versions are declared dynamically # gcc-runtime versions are declared dynamically
skip_version_audit = ["platform=linux", "platform=darwin"] skip_version_audit = ["platform=linux", "platform=darwin", "platform=windows"]
maintainers("haampie") maintainers("haampie")

View file

@ -59,6 +59,7 @@ paths:
- "bin/x86_64-linux-gnu-gcc-10" - "bin/x86_64-linux-gnu-gcc-10"
- "bin/x86_64-linux-gnu-g++-10" - "bin/x86_64-linux-gnu-g++-10"
script: "echo 10.1.0" script: "echo 10.1.0"
platforms: [darwin, linux]
results: results:
- spec: "gcc@6.5.0 languages=c" - spec: "gcc@6.5.0 languages=c"
extra_attributes: extra_attributes:

View file

@ -47,7 +47,7 @@ class GitAnnex(Package):
# - $ git annex whereis git-annex/linux/current/git-annex-standalone-arm64.tar.gz # - $ git annex whereis git-annex/linux/current/git-annex-standalone-arm64.tar.gz
# -> gives web url # -> gives web url
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
license("AGPL-3.0-or-later") license("AGPL-3.0-or-later")

View file

@ -46,6 +46,8 @@ class Hpcviewer(Package):
homepage = "http://hpctoolkit.org" homepage = "http://hpctoolkit.org"
maintainers("mwkrentel") maintainers("mwkrentel")
skip_version_audit = ["platform=windows"]
darwin_sha = { darwin_sha = {
("2024.02", "aarch64"): "0f2bf2f89b7b9656b1b249efc8b24763f7865e8ddae5b22a3c21cc79fda49ce9", ("2024.02", "aarch64"): "0f2bf2f89b7b9656b1b249efc8b24763f7865e8ddae5b22a3c21cc79fda49ce9",
("2024.02", "x86_64"): "7f61166155f326179e309aa18568b44d98a2219973a323cd4713123b5bf6fd54", ("2024.02", "x86_64"): "7f61166155f326179e309aa18568b44d98a2219973a323cd4713123b5bf6fd54",

View file

@ -47,6 +47,8 @@ class Javafx(Package):
except KeyError: except KeyError:
continue continue
skip_version_audit = ["platform=windows"]
maintainers("snehring") maintainers("snehring")
extends("openjdk") extends("openjdk")

View file

@ -17,6 +17,8 @@ class NfTowerCli(Package):
homepage = "https://github.com/seqeralabs/tower-cli" homepage = "https://github.com/seqeralabs/tower-cli"
maintainers("marcodelapierre") maintainers("marcodelapierre")
skip_version_audit = ["platform=windows"]
if platform.machine() == "x86_64": if platform.machine() == "x86_64":
if platform.system() == "Darwin": if platform.system() == "Darwin":
version( version(

View file

@ -388,7 +388,7 @@ class Nvhpc(Package):
maintainers("samcmill") maintainers("samcmill")
tags = ["e4s"] tags = ["e4s"]
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
redistribute(source=False, binary=False) redistribute(source=False, binary=False)

View file

@ -367,6 +367,8 @@ class Openjdk(Package):
executables = ["^java$"] executables = ["^java$"]
skip_version_audit = ["platform=windows"]
@classmethod @classmethod
def determine_version(cls, exe): def determine_version(cls, exe):
output = Executable(exe)("-version", output=str, error=str) output = Executable(exe)("-version", output=str, error=str)

View file

@ -20,6 +20,8 @@ class Pandoc(Package):
# the challenges with Haskell. Until the Haskell framework is in Spack this # the challenges with Haskell. Until the Haskell framework is in Spack this
# package will meet the needs of packages that have a dependency on pandoc. # package will meet the needs of packages that have a dependency on pandoc.
skip_version_audit = ["platform=windows"]
if platform.system() == "Linux" and platform.machine() == "aarch64": if platform.system() == "Linux" and platform.machine() == "aarch64":
url = "https://github.com/jgm/pandoc/releases/download/2.14.0.3/pandoc-2.14.0.3-linux-arm64.tar.gz" url = "https://github.com/jgm/pandoc/releases/download/2.14.0.3/pandoc-2.14.0.3-linux-arm64.tar.gz"
version( version(

View file

@ -13,6 +13,8 @@ class PyAzuremlDataprepNative(PythonPackage):
homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py" homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py"
skip_version_audit = ["platform=windows"]
if sys.platform == "darwin": if sys.platform == "darwin":
version( version(
"30.0.0-py3.9", "30.0.0-py3.9",

View file

@ -16,6 +16,8 @@ class PyAzuremlDataprepRslex(PythonPackage):
homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py" homepage = "https://docs.microsoft.com/en-us/python/api/overview/azure/ml/?view=azure-ml-py"
skip_version_audit = ["platform=windows"]
if sys.platform == "darwin": if sys.platform == "darwin":
version( version(
"1.9.0-py3.9", "1.9.0-py3.9",

View file

@ -13,6 +13,8 @@ class PyDotnetcore2(PythonPackage):
homepage = "https://github.com/dotnet/core" homepage = "https://github.com/dotnet/core"
skip_version_audit = ["platform=windows"]
if sys.platform == "darwin": if sys.platform == "darwin":
version( version(
"2.1.14", "2.1.14",

View file

@ -15,6 +15,8 @@ class PyItk(PythonPackage):
homepage = "https://itk.org/" homepage = "https://itk.org/"
skip_version_audit = ["platform=windows"]
if sys.platform == "darwin": if sys.platform == "darwin":
# version 5.1.1 # version 5.1.1
version( version(

View file

@ -16,7 +16,7 @@ class PyNvidiaDali(PythonPackage):
homepage = "https://developer.nvidia.com/dali" homepage = "https://developer.nvidia.com/dali"
url = "https://developer.download.nvidia.com/compute/redist/" url = "https://developer.download.nvidia.com/compute/redist/"
skip_version_audit = ["platform=darwin"] skip_version_audit = ["platform=darwin", "platform=windows"]
maintainers("thomas-bouvier") maintainers("thomas-bouvier")

View file

@ -13,6 +13,8 @@ class PyShiboken2(PythonPackage):
homepage = "https://www.pyside.org/" homepage = "https://www.pyside.org/"
skip_version_audit = ["platform=windows"]
if sys.platform.startswith("linux"): if sys.platform.startswith("linux"):
version( version(
"5.15.2", "5.15.2",

View file

@ -16,6 +16,8 @@ class RustBootstrap(Package):
maintainers("alecbcs") maintainers("alecbcs")
skip_version_audit = ["platform=windows"]
# List binary rust releases for multiple operating systems and architectures. # List binary rust releases for multiple operating systems and architectures.
# These binary versions are not intended to stay up-to-date. Instead we # These binary versions are not intended to stay up-to-date. Instead we
# should update these binary releases as bootstrapping requirements are # should update these binary releases as bootstrapping requirements are
@ -110,6 +112,9 @@ class RustBootstrap(Package):
version(release, sha256=rust_releases[release][os][target]) version(release, sha256=rust_releases[release][os][target])
def url_for_version(self, version): def url_for_version(self, version):
if self.os not in ("linux", "darwin"):
return None
# Allow maintainers to checksum multiple architectures via # Allow maintainers to checksum multiple architectures via
# `spack checksum rust-bootstrap@1.70.0-darwin-aarch64`. # `spack checksum rust-bootstrap@1.70.0-darwin-aarch64`.
match = re.search(r"(\S+)-(\S+)-(\S+)", str(version)) match = re.search(r"(\S+)-(\S+)-(\S+)", str(version))