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:
parent
ddabb8b12c
commit
859745f1a9
23 changed files with 66 additions and 20 deletions
34
.github/workflows/audit.yaml
vendored
34
.github/workflows/audit.yaml
vendored
|
@ -17,10 +17,16 @@ concurrency:
|
|||
jobs:
|
||||
# Run audits on all the packages in the built-in repository
|
||||
package-audits:
|
||||
runs-on: ${{ matrix.operating_system }}
|
||||
runs-on: ${{ matrix.system.os }}
|
||||
strategy:
|
||||
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:
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
|
||||
|
@ -29,20 +35,32 @@ jobs:
|
|||
- name: Install Python packages
|
||||
run: |
|
||||
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)
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
if: ${{ inputs.with_coverage == 'true' && runner.os != 'Windows' }}
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
coverage run $(which spack) audit packages
|
||||
coverage run $(which spack) -d audit externals
|
||||
coverage run $(which spack) -d audit externals
|
||||
coverage combine
|
||||
coverage xml
|
||||
- name: Package audits (without coverage)
|
||||
if: ${{ inputs.with_coverage == 'false' }}
|
||||
if: ${{ inputs.with_coverage == 'false' && runner.os != 'Windows' }}
|
||||
run: |
|
||||
. share/spack/setup-env.sh
|
||||
$(which spack) audit packages
|
||||
$(which spack) audit externals
|
||||
. share/spack/setup-env.sh
|
||||
spack -d audit packages
|
||||
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
|
||||
if: ${{ inputs.with_coverage == 'true' }}
|
||||
with:
|
||||
|
|
|
@ -1046,7 +1046,7 @@ def _extracts_errors(triggers, summary):
|
|||
group="externals",
|
||||
tag="PKG-EXTERNALS",
|
||||
description="Sanity checks for external software detection",
|
||||
kwargs=("pkgs",),
|
||||
kwargs=("pkgs", "debug_log"),
|
||||
)
|
||||
|
||||
|
||||
|
@ -1069,7 +1069,7 @@ def packages_with_detection_tests():
|
|||
|
||||
|
||||
@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"""
|
||||
import spack.detection
|
||||
|
||||
|
@ -1095,6 +1095,7 @@ def _test_detection_by_executable(pkgs, error_cls):
|
|||
for idx, test_runner in enumerate(
|
||||
spack.detection.detection_tests(pkg_name, spack.repo.PATH)
|
||||
):
|
||||
debug_log(f"[{__file__}]: running test {idx} for package {pkg_name}")
|
||||
specs = test_runner.execute()
|
||||
expected_specs = test_runner.expected_specs
|
||||
|
||||
|
@ -1115,11 +1116,10 @@ def _test_detection_by_executable(pkgs, error_cls):
|
|||
for candidate in expected_specs:
|
||||
try:
|
||||
idx = specs.index(candidate)
|
||||
matched_detection.append((candidate, specs[idx]))
|
||||
except (AttributeError, ValueError):
|
||||
pass
|
||||
|
||||
matched_detection.append((candidate, specs[idx]))
|
||||
|
||||
def _compare_extra_attribute(_expected, _detected, *, _spec):
|
||||
result = []
|
||||
# Check items are of the same type
|
||||
|
|
|
@ -84,7 +84,7 @@ def externals(parser, args):
|
|||
return
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@ class ArmForge(Package):
|
|||
# TODO: this mess should be fixed as soon as a way to parametrize/constrain
|
||||
# versions (and checksums) based on the target platform shows up
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
if platform.machine() in ["aarch64", "arm64"]:
|
||||
version(
|
||||
"22.1.3", sha256="131884f998b82673e885a7b42cc883210e3a0229b50af374092140cdfd42a408"
|
||||
|
|
|
@ -592,7 +592,7 @@ class Cuda(Package):
|
|||
maintainers("ax3l", "Rombur")
|
||||
executables = ["^nvcc$"]
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
for ver, packages in _versions.items():
|
||||
key = "{0}-{1}".format(platform.system(), platform.machine())
|
||||
|
|
|
@ -298,7 +298,7 @@ class Cudnn(Package):
|
|||
# need to use modified URLs like in url_for_version.
|
||||
maintainers("adamjstewart", "bvanessen")
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
license("MIT")
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class Cutensor(Package):
|
|||
maintainers("bvanessen")
|
||||
url = "cutensor"
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
for ver, packages in _versions.items():
|
||||
key = "{0}-{1}".format(platform.system(), platform.machine())
|
||||
|
|
|
@ -23,7 +23,7 @@ class GccRuntime(Package):
|
|||
tags = ["runtime"]
|
||||
|
||||
# gcc-runtime versions are declared dynamically
|
||||
skip_version_audit = ["platform=linux", "platform=darwin"]
|
||||
skip_version_audit = ["platform=linux", "platform=darwin", "platform=windows"]
|
||||
|
||||
maintainers("haampie")
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ paths:
|
|||
- "bin/x86_64-linux-gnu-gcc-10"
|
||||
- "bin/x86_64-linux-gnu-g++-10"
|
||||
script: "echo 10.1.0"
|
||||
platforms: [darwin, linux]
|
||||
results:
|
||||
- spec: "gcc@6.5.0 languages=c"
|
||||
extra_attributes:
|
||||
|
|
|
@ -47,7 +47,7 @@ class GitAnnex(Package):
|
|||
# - $ git annex whereis git-annex/linux/current/git-annex-standalone-arm64.tar.gz
|
||||
# -> gives web url
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
license("AGPL-3.0-or-later")
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ class Hpcviewer(Package):
|
|||
homepage = "http://hpctoolkit.org"
|
||||
maintainers("mwkrentel")
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
darwin_sha = {
|
||||
("2024.02", "aarch64"): "0f2bf2f89b7b9656b1b249efc8b24763f7865e8ddae5b22a3c21cc79fda49ce9",
|
||||
("2024.02", "x86_64"): "7f61166155f326179e309aa18568b44d98a2219973a323cd4713123b5bf6fd54",
|
||||
|
|
|
@ -47,6 +47,8 @@ class Javafx(Package):
|
|||
except KeyError:
|
||||
continue
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
maintainers("snehring")
|
||||
|
||||
extends("openjdk")
|
||||
|
|
|
@ -17,6 +17,8 @@ class NfTowerCli(Package):
|
|||
homepage = "https://github.com/seqeralabs/tower-cli"
|
||||
maintainers("marcodelapierre")
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
if platform.machine() == "x86_64":
|
||||
if platform.system() == "Darwin":
|
||||
version(
|
||||
|
|
|
@ -388,7 +388,7 @@ class Nvhpc(Package):
|
|||
maintainers("samcmill")
|
||||
tags = ["e4s"]
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
redistribute(source=False, binary=False)
|
||||
|
||||
|
|
|
@ -367,6 +367,8 @@ class Openjdk(Package):
|
|||
|
||||
executables = ["^java$"]
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
@classmethod
|
||||
def determine_version(cls, exe):
|
||||
output = Executable(exe)("-version", output=str, error=str)
|
||||
|
|
|
@ -20,6 +20,8 @@ class Pandoc(Package):
|
|||
# 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.
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
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"
|
||||
version(
|
||||
|
|
|
@ -13,6 +13,8 @@ class PyAzuremlDataprepNative(PythonPackage):
|
|||
|
||||
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":
|
||||
version(
|
||||
"30.0.0-py3.9",
|
||||
|
|
|
@ -16,6 +16,8 @@ class PyAzuremlDataprepRslex(PythonPackage):
|
|||
|
||||
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":
|
||||
version(
|
||||
"1.9.0-py3.9",
|
||||
|
|
|
@ -13,6 +13,8 @@ class PyDotnetcore2(PythonPackage):
|
|||
|
||||
homepage = "https://github.com/dotnet/core"
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
if sys.platform == "darwin":
|
||||
version(
|
||||
"2.1.14",
|
||||
|
|
|
@ -15,6 +15,8 @@ class PyItk(PythonPackage):
|
|||
|
||||
homepage = "https://itk.org/"
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
if sys.platform == "darwin":
|
||||
# version 5.1.1
|
||||
version(
|
||||
|
|
|
@ -16,7 +16,7 @@ class PyNvidiaDali(PythonPackage):
|
|||
homepage = "https://developer.nvidia.com/dali"
|
||||
url = "https://developer.download.nvidia.com/compute/redist/"
|
||||
|
||||
skip_version_audit = ["platform=darwin"]
|
||||
skip_version_audit = ["platform=darwin", "platform=windows"]
|
||||
|
||||
maintainers("thomas-bouvier")
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ class PyShiboken2(PythonPackage):
|
|||
|
||||
homepage = "https://www.pyside.org/"
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
version(
|
||||
"5.15.2",
|
||||
|
|
|
@ -16,6 +16,8 @@ class RustBootstrap(Package):
|
|||
|
||||
maintainers("alecbcs")
|
||||
|
||||
skip_version_audit = ["platform=windows"]
|
||||
|
||||
# List binary rust releases for multiple operating systems and architectures.
|
||||
# These binary versions are not intended to stay up-to-date. Instead we
|
||||
# should update these binary releases as bootstrapping requirements are
|
||||
|
@ -110,6 +112,9 @@ class RustBootstrap(Package):
|
|||
version(release, sha256=rust_releases[release][os][target])
|
||||
|
||||
def url_for_version(self, version):
|
||||
if self.os not in ("linux", "darwin"):
|
||||
return None
|
||||
|
||||
# Allow maintainers to checksum multiple architectures via
|
||||
# `spack checksum rust-bootstrap@1.70.0-darwin-aarch64`.
|
||||
match = re.search(r"(\S+)-(\S+)-(\S+)", str(version))
|
||||
|
|
Loading…
Reference in a new issue