diff --git a/.github/workflows/arm-mask.yml b/.github/workflows/arm-mask.yml new file mode 100644 index 00000000..5f412d50 --- /dev/null +++ b/.github/workflows/arm-mask.yml @@ -0,0 +1,89 @@ +name: arm-mask +# The cpuid route's aarch64 mask on real Arm silicon. ubuntu-24.04-arm runs on +# Neoverse cores, so getauxval, /proc/cpuinfo and gcc -mcpu=native here are the +# real readings the mask rewrites. +on: [push, pull_request] +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + arm-mask: + name: arm-mask + runs-on: ubuntu-24.04-arm + timeout-minutes: 20 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.17.1 + - name: Allow the user and mount namespaces the mask runs in + run: | + set -euo pipefail + if [ "$(sysctl -n kernel.apparmor_restrict_unprivileged_userns 2>/dev/null || echo 0)" != "0" ]; then + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + fi + - name: Which Arm core this runner is + run: | + set -euo pipefail + uname -m + grep -m1 'CPU implementer' /proc/cpuinfo + grep -m1 'CPU part' /proc/cpuinfo + grep -m1 '^Features' /proc/cpuinfo + lscpu | sed -n 's/^Model name: */model name: /p' + - name: release build + run: zig build --release=safe --prefix "$RUNNER_TEMP/eb-local" + - name: doctor reports the cpuid route for aarch64 + run: | + set -euo pipefail + "$RUNNER_TEMP/eb-local/bin/eb-local" doctor --cpu-target aarch64/neoverse_n1 || true + - name: getauxval, /proc/cpuinfo and gcc -mcpu=native name the target under the mask + run: tools/mask/check_arm_mask.sh "$RUNNER_TEMP/eb-local/bin/eb-local" aarch64/neoverse_n1 aarch64/generic + # The whole path with EESSI mounted: preflight against EESSI archdetect, + # archspec and gcc, a build of a recipe, the ISA audit and the provenance record. + arm-mask-build: + name: arm-mask-build + runs-on: ubuntu-24.04-arm + timeout-minutes: 45 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.17.1 + - name: Allow the user and mount namespaces the mask runs in + run: | + set -euo pipefail + if [ "$(sysctl -n kernel.apparmor_restrict_unprivileged_userns 2>/dev/null || echo 0)" != "0" ]; then + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + fi + - name: release build + run: zig build --release=safe --prefix "$RUNNER_TEMP/eb-local" + - name: EESSI mount, without initialising EESSI + uses: EESSI/github-action-eessi@834df09f7d60de47f10a7cbf59b470d69b9e2852 # v3.4.0 + with: + eessi_stack_version: "2026.06" + mount_cvmfs_only: "true" + - name: build pigz as a Neoverse N1 on a Neoverse N2 + run: | + set -euo pipefail + export PATH="$RUNNER_TEMP/eb-local/bin:$PATH" + eb-local --workstation --cpu-target aarch64/neoverse_n1 pigz-2.8-GCCcore-15.2.0.eb --robot 2>&1 | tee build.log + grep -F 'eb-local: --cpu-target aarch64/neoverse_n1, cpuid route' build.log + grep -F 'preflight ok: EESSI archdetect names aarch64/neoverse_n1' build.log + grep -F 'preflight ok: archspec names neoverse_n1' build.log + grep -F 'preflight ok: gcc -mcpu=native is neoverse-n1' build.log + ! grep -F 'preflight FAILED' build.log + - name: the install is labelled for the target and the audit passed + run: | + set -euo pipefail + record=$(find "$HOME/eessi/versions" -path '*/aarch64/neoverse_n1/software/pigz/*/easybuild/eb-local-build-mode.json' | head -n 1) + test -n "$record" + cat "$record" + grep -F '"cpu_target": "aarch64/neoverse_n1"' "$record" + grep -F '"route": "cpuid"' "$record" + grep -F '"isa_audit": "pass"' "$record" diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a3ead4..60ae0678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,64 @@ +## 3.6.0 (2026-11-27) + +### Features + +- The internal helper `eb-local __vm-run --mode kvm|tcg --cpu-target TARGET -- COMMAND` runs COMMAND inside a QEMU virtual CPU that presents an EESSI target, as the caller, in the caller's working directory, and refuses, before COMMAND starts, when EESSI archdetect, archspec, `gcc -march=native`, the CPU vendor or `/dev/fd` do not name the target. +- `--cpu-target TARGET` builds an easyconfig for another CPU target than the build host's, with `--mask auto|cpuid|kvm|tcg` choosing the route. The `cpuid` route runs the build with CPUID faulting and a target `/proc/cpuinfo` in an unprivileged namespace, refuses to build unless EESSI archdetect, archspec, gcc and the CPUID vendor name the target, pins the GROMACS SIMD level to the target, audits the installed tree and records the route in `easybuild/eb-local-build-mode.json`; `doctor --cpu-target` reports what the host can present. +- `--mask kvm` and `--mask tcg` run the build through `eb-local __vm-run`, and report its statuses 2, 125 and 126 as a refused request, a virtual machine that did not run and a guest CPU that did not read as the target. `--mask-allow-archspec-mismatch` passes `--allow-archspec-mismatch` to the helper and lets the build's preflight accept an archspec name other than the target's, which an aarch64 `--mask tcg` build needs because archspec reads `aarch64` under qemu-user. +- `--variant perf` and `--variant debug` build the named easyconfig with debug symbols and frame pointers, or unoptimised with debug symbols, as a module whose version ends in `-perf` or `-debug`; `doctor --profiling` reports whether perf may sample and debuggers attach, and finds perf, valgrind and gdb. +- `eb-local audit-isa PATH --target TARGET` runs `objdump` on the ELF files under PATH. It reports each instruction that needs a CPU feature the EESSI target lacks, per file with counts. It covers x86-64 (AVX-512, AMX) and aarch64 (SVE, SVE2, BF16, I8MM). Packages that choose their instruction set at run time print as dispatch and do not fail the audit; `--allow FILE` replaces that list. Exit 0 means clean, 1 means an instruction exceeds the target, and 2 means a usage or tool error. +- `eb-local dev` prints the Cargo linker lines that `eb-local eb` already runs. They live in `src/cargo-linker.sh`: a host `CARGO_TARGET_*_LINKER`, `RUSTFLAGS` and the rustc wrappers are dropped, and when `rustc -vV` prints a host, `CARGO_TARGET__LINKER` is `${CC:-gcc}`. The Zig program embeds that file. + +### Fixes + +- A `--cpu-target aarch64/neoverse_v1` or `aarch64/a64fx` build under `--mask tcg` stopped before `eb` started with `no mask profile`. The preflight in the virtual machine now takes the vendor and compiler names of a target that has no `cpuid` profile from the `__vm-run` target table. +- A failed sync or close while writing `eb-local.lock` leaves the previous lock in place. A new lock is published only after its bytes are durable, and a failed write removes its temporary file. +- A failed sync or close while writing a submit script is an error, and that script is not handed to sbatch. +- A signalled build keeps killing and reaping descendants until none remain or ten seconds pass, and if one remains it reports that, exits 1, and does not clean the logs. +- Avoid reloading the EESSI stack and extension modules when applying a development lock while preserving extension loading for locks written before the install prefix exists. +- Emit `drop_rpath_wrappers` and `rpath-wrappers` after loading locked modules in `eb-local dev --locked`, covering compiler families without a `buildenv` module such as `llvm-compilers` on EESSI 2026.06. Each `rpath-wrappers` command is checked, and `EB_LOCAL_DEV_PREFIX` is exported only after those commands succeed. +- The scheduler read an apostrophe in a `#SBATCH` `--output` or + `--chdir` path as an opening quote, stopped on the unmatched quote + and never submitted the job. `eb-local submit` now double-quotes + such a path. +- `--profile` now selects the profile for `eb-local profiles`. It wins + over `EB_LOCAL_PROFILE` and `default_profile`, and an unknown name is + refused. +- `--variant` now works only with a recipe build or `submit`. Other commands refuse it instead of running as if it were absent. +- `audit-isa` stops with `cannot resolve PATH` when the working directory is gone and PATH is relative, and `__vm-run` reports `cannot resolve the read-only share PATH` and exits 125 in that case, where each reported out of memory or gave no reason. +- `doctor.approved_prefixes` refuses a path with a parent component or a spelling of the root directory, so `eb-local doctor` and a build with `build.clear_foreign_prefixes` do not treat that spelling as an approved prefix. +- `eb-local __vm-run --mode kvm --cpu-target x86_64/amd/zen3` refused with status 126 because the guest read as `x86_64/amd/zen2`: QEMU's EPYC-Milan model has no `vaes`, which EESSI archdetect requires. The zen3 guest now adds `vaes` and `vpclmulqdq`. +- `eb-local submit` keeps every job script, prints the path it submits, and writes the new script beside one whose path is already taken. + +### Documentation + +- Document in `docs/howto/compile.md` that the European Environment for Scientific Software Installations (EESSI) 2026.06 includes `buildenv/default-foss-2026.1` and has no `default-lfoss` or `default-intel` build environment. +- Document in the command reference that `--variant` is accepted before an easyconfig and before `submit`. `submit` keeps the option and puts it on the batch command. Another command refuses it. +- The README lists the check, rpath-wrappers, lmod-cache, modulerc, overlay and site commands and doctor --cvmfs and --mpi, says clean refuses without rtrash unless --delete is given, and says eb-local builds on a workstation as well as in a Slurm job. + +### Miscellaneous + +- CI builds a recipe on a GitHub-hosted runner with the EESSI mount and no Slurm, the path a user without a cluster takes. +- Discover `eb-stack` 0.8.0 or newer from `PATH` when `EB_STACK_BIN` is + unset, isolate host `/etc/profile.d/lmod.sh` and `/etc/eb-local` site + files in a mount namespace with a user-namespace probe and bounded + timeouts, and run the full Python suite with zero skips in the `zig` CI + job. +- Extract the compiler family detection snippet used by `buildenvLines` into a shared helper with no behavior change. +- Guard the remaining doctor tests that require no site file from host + configuration, and cover them in the zero-skip isolation check. +- Require `zsh`, `eb-stack`, and `unshare` in `ZeroPythonSkips` when `EB_LOCAL_REQUIRE_TOOLS` is set, and skip with a reason otherwise. +- Run the live EESSI 2026.06 checks in `tests/site/test_dev_locked_eessi.py` + outside `python3 -m unittest discover -s tests`. `tests/site` is not a + package, so the zero-skip `zig` job does not collect them. Running the + file fails when the Zig build or the EESSI init file is absent. +- The `arm-mask` workflow runs the aarch64 mask on a real Neoverse core (`ubuntu-24.04-arm`): `getauxval`, `/proc/cpuinfo` and `gcc -mcpu=native` name the target under `__mask-run`, and a recipe builds for `aarch64/neoverse_n1` with EESSI mounted, the preflight and the ISA audit on. +- The `live-eessi` job in the `zig` workflow runs `tests/site/test_dev_locked_eessi.py` on an EESSI 2026.06 mount. + + ## 3.5.0 (2026-11-26) ### Features diff --git a/build.zig.zon b/build.zig.zon index aa8548b6..b30e6cca 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,12 +1,12 @@ .{ .name = .eb_local, - .version = "3.5.0", + .version = "3.6.0", .fingerprint = 0x512ce9ad65023f55, .minimum_zig_version = "0.17.1", .dependencies = .{ .zig_common = .{ - .url = "git+https://github.com/stackhands/zig-common#a45142ad410c099d901241ab7aeba5aa2fd17321", - .hash = "zig_common-0.13.0-kBaPeac6CQA9othDLZWEw-nshWseJI2Q74IcjWL4ek7d", + .url = "git+https://github.com/stackhands/zig-common?ref=v0.14.0#831c49ec6662e1f6b146e2aad2aab05d7e89b17c", + .hash = "zig_common-0.14.0-kBaPeU0jCgAcDv5ha1TEwkzIXsM_17chRRIlZ7zbLWle", }, }, .paths = .{ diff --git a/changelog.d/+approved-prefix-parent.bugfix.md b/changelog.d/+approved-prefix-parent.bugfix.md deleted file mode 100644 index faeeee43..00000000 --- a/changelog.d/+approved-prefix-parent.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -`doctor.approved_prefixes` refuses a path with a parent component or a spelling of the root directory, so `eb-local doctor` and a build with `build.clear_foreign_prefixes` do not treat that spelling as an approved prefix. diff --git a/changelog.d/+audit-isa.feature.md b/changelog.d/+audit-isa.feature.md deleted file mode 100644 index ffcce54a..00000000 --- a/changelog.d/+audit-isa.feature.md +++ /dev/null @@ -1 +0,0 @@ -`eb-local audit-isa PATH --target TARGET` runs `objdump` on the ELF files under PATH. It reports each instruction that needs a CPU feature the EESSI target lacks, per file with counts. It covers x86-64 (AVX-512, AMX) and aarch64 (SVE, SVE2, BF16, I8MM). Packages that choose their instruction set at run time print as dispatch and do not fail the audit; `--allow FILE` replaces that list. Exit 0 means clean, 1 means an instruction exceeds the target, and 2 means a usage or tool error. diff --git a/changelog.d/+build-variants.feature.md b/changelog.d/+build-variants.feature.md deleted file mode 100644 index 8b05b2f1..00000000 --- a/changelog.d/+build-variants.feature.md +++ /dev/null @@ -1 +0,0 @@ -`--variant perf` and `--variant debug` build the named easyconfig with debug symbols and frame pointers, or unoptimised with debug symbols, as a module whose version ends in `-perf` or `-debug`; `doctor --profiling` reports whether perf may sample and debuggers attach, and finds perf, valgrind and gdb. diff --git a/changelog.d/+ci-workstation-build.misc.md b/changelog.d/+ci-workstation-build.misc.md deleted file mode 100644 index 08dbdee1..00000000 --- a/changelog.d/+ci-workstation-build.misc.md +++ /dev/null @@ -1 +0,0 @@ -CI builds a recipe on a GitHub-hosted runner with the EESSI mount and no Slurm, the path a user without a cluster takes. diff --git a/changelog.d/+compile-llvm-fallback-note.doc.md b/changelog.d/+compile-llvm-fallback-note.doc.md deleted file mode 100644 index 72ff06b9..00000000 --- a/changelog.d/+compile-llvm-fallback-note.doc.md +++ /dev/null @@ -1 +0,0 @@ -Document in `docs/howto/compile.md` that the European Environment for Scientific Software Installations (EESSI) 2026.06 includes `buildenv/default-foss-2026.1` and has no `default-lfoss` or `default-intel` build environment. diff --git a/changelog.d/+cpu-target-vm.feature.md b/changelog.d/+cpu-target-vm.feature.md deleted file mode 100644 index 6efd019c..00000000 --- a/changelog.d/+cpu-target-vm.feature.md +++ /dev/null @@ -1 +0,0 @@ -The internal helper `eb-local __vm-run --mode kvm|tcg --cpu-target TARGET -- COMMAND` runs COMMAND inside a QEMU virtual CPU that presents an EESSI target, as the caller, in the caller's working directory, and refuses, before COMMAND starts, when EESSI archdetect, archspec, `gcc -march=native`, the CPU vendor or `/dev/fd` do not name the target. diff --git a/changelog.d/+cpu-target.feature.md b/changelog.d/+cpu-target.feature.md deleted file mode 100644 index b46f77da..00000000 --- a/changelog.d/+cpu-target.feature.md +++ /dev/null @@ -1 +0,0 @@ -`--cpu-target TARGET` builds an easyconfig for another CPU target than the build host's, with `--mask auto|cpuid|kvm|tcg` choosing the route. The `cpuid` route runs the build with CPUID faulting and a target `/proc/cpuinfo` in an unprivileged namespace, refuses to build unless EESSI archdetect, archspec, gcc and the CPUID vendor name the target, pins the GROMACS SIMD level to the target, audits the installed tree and records the route in `easybuild/eb-local-build-mode.json`; `doctor --cpu-target` reports what the host can present. diff --git a/changelog.d/+dev-cargo-linker.feature.md b/changelog.d/+dev-cargo-linker.feature.md deleted file mode 100644 index 10f23c8e..00000000 --- a/changelog.d/+dev-cargo-linker.feature.md +++ /dev/null @@ -1 +0,0 @@ -`eb-local dev` prints the Cargo linker lines that `eb-local eb` already runs. They live in `src/cargo-linker.sh`: a host `CARGO_TARGET_*_LINKER`, `RUSTFLAGS` and the rustc wrappers are dropped, and when `rustc -vV` prints a host, `CARGO_TARGET__LINKER` is `${CC:-gcc}`. The Zig program embeds that file. diff --git a/changelog.d/+dev-family-detect-helper.misc.md b/changelog.d/+dev-family-detect-helper.misc.md deleted file mode 100644 index e4800497..00000000 --- a/changelog.d/+dev-family-detect-helper.misc.md +++ /dev/null @@ -1 +0,0 @@ -Extract the compiler family detection snippet used by `buildenvLines` into a shared helper with no behavior change. diff --git a/changelog.d/+dev-lock-durable-publish.bugfix.md b/changelog.d/+dev-lock-durable-publish.bugfix.md deleted file mode 100644 index a0a9f5ff..00000000 --- a/changelog.d/+dev-lock-durable-publish.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -A failed sync or close while writing `eb-local.lock` leaves the previous lock in place. A new lock is published only after its bytes are durable, and a failed write removes its temporary file. diff --git a/changelog.d/+dev-locked-no-duplicate-reloads.bugfix.md b/changelog.d/+dev-locked-no-duplicate-reloads.bugfix.md deleted file mode 100644 index e60cb9f6..00000000 --- a/changelog.d/+dev-locked-no-duplicate-reloads.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Avoid reloading the EESSI stack and extension modules when applying a development lock while preserving extension loading for locks written before the install prefix exists. diff --git a/changelog.d/+dev-locked-rpath-wrappers.bugfix.md b/changelog.d/+dev-locked-rpath-wrappers.bugfix.md deleted file mode 100644 index 3842187f..00000000 --- a/changelog.d/+dev-locked-rpath-wrappers.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Emit `drop_rpath_wrappers` and `rpath-wrappers` after loading locked modules in `eb-local dev --locked`, covering compiler families without a `buildenv` module such as `llvm-compilers` on EESSI 2026.06. Each `rpath-wrappers` command is checked, and `EB_LOCAL_DEV_PREFIX` is exported only after those commands succeed. diff --git a/changelog.d/+live-eessi-ci.misc.md b/changelog.d/+live-eessi-ci.misc.md deleted file mode 100644 index d3f08ae3..00000000 --- a/changelog.d/+live-eessi-ci.misc.md +++ /dev/null @@ -1 +0,0 @@ -The `live-eessi` job in the `zig` workflow runs `tests/site/test_dev_locked_eessi.py` on an EESSI 2026.06 mount. diff --git a/changelog.d/+live-eessi-zero-skips.misc.md b/changelog.d/+live-eessi-zero-skips.misc.md deleted file mode 100644 index 50870f4f..00000000 --- a/changelog.d/+live-eessi-zero-skips.misc.md +++ /dev/null @@ -1,4 +0,0 @@ -Run the live EESSI 2026.06 checks in `tests/site/test_dev_locked_eessi.py` -outside `python3 -m unittest discover -s tests`. `tests/site` is not a -package, so the zero-skip `zig` job does not collect them. Running the -file fails when the Zig build or the EESSI init file is absent. diff --git a/changelog.d/+mask-vm-routes.feature.md b/changelog.d/+mask-vm-routes.feature.md deleted file mode 100644 index fd9a399f..00000000 --- a/changelog.d/+mask-vm-routes.feature.md +++ /dev/null @@ -1 +0,0 @@ -`--mask kvm` and `--mask tcg` run the build through `eb-local __vm-run`, and report its statuses 2, 125 and 126 as a refused request, a virtual machine that did not run and a guest CPU that did not read as the target. `--mask-allow-archspec-mismatch` passes `--allow-archspec-mismatch` to the helper and lets the build's preflight accept an archspec name other than the target's, which an aarch64 `--mask tcg` build needs because archspec reads `aarch64` under qemu-user. diff --git a/changelog.d/+profiles-option.bugfix.md b/changelog.d/+profiles-option.bugfix.md deleted file mode 100644 index 47b4c621..00000000 --- a/changelog.d/+profiles-option.bugfix.md +++ /dev/null @@ -1,3 +0,0 @@ -`--profile` now selects the profile for `eb-local profiles`. It wins -over `EB_LOCAL_PROFILE` and `default_profile`, and an unknown name is -refused. diff --git a/changelog.d/+readme-matches-code.doc.md b/changelog.d/+readme-matches-code.doc.md deleted file mode 100644 index 5b7c3773..00000000 --- a/changelog.d/+readme-matches-code.doc.md +++ /dev/null @@ -1 +0,0 @@ -The README lists the check, rpath-wrappers, lmod-cache, modulerc, overlay and site commands and doctor --cvmfs and --mpi, says clean refuses without rtrash unless --delete is given, and says eb-local builds on a workstation as well as in a Slurm job. diff --git a/changelog.d/+reap-group-after-kill.bugfix.md b/changelog.d/+reap-group-after-kill.bugfix.md deleted file mode 100644 index c1569128..00000000 --- a/changelog.d/+reap-group-after-kill.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -A signalled build keeps killing and reaping descendants until none remain or ten seconds pass, and if one remains it reports that, exits 1, and does not clean the logs. diff --git a/changelog.d/+remaining-doctor-no-site-file.misc.md b/changelog.d/+remaining-doctor-no-site-file.misc.md deleted file mode 100644 index e7d924eb..00000000 --- a/changelog.d/+remaining-doctor-no-site-file.misc.md +++ /dev/null @@ -1,2 +0,0 @@ -Guard the remaining doctor tests that require no site file from host -configuration, and cover them in the zero-skip isolation check. diff --git a/changelog.d/+submit-sbatch-apostrophe.bugfix.md b/changelog.d/+submit-sbatch-apostrophe.bugfix.md deleted file mode 100644 index fd7b90cc..00000000 --- a/changelog.d/+submit-sbatch-apostrophe.bugfix.md +++ /dev/null @@ -1,4 +0,0 @@ -The scheduler read an apostrophe in a `#SBATCH` `--output` or -`--chdir` path as an opening quote, stopped on the unmatched quote -and never submitted the job. `eb-local submit` now double-quotes -such a path. diff --git a/changelog.d/+submit-script-collision.bugfix.md b/changelog.d/+submit-script-collision.bugfix.md deleted file mode 100644 index 1fd2fb0d..00000000 --- a/changelog.d/+submit-script-collision.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -`eb-local submit` keeps every job script, prints the path it submits, and writes the new script beside one whose path is already taken. diff --git a/changelog.d/+submit-script-sync-close.bugfix.md b/changelog.d/+submit-script-sync-close.bugfix.md deleted file mode 100644 index 94040f0c..00000000 --- a/changelog.d/+submit-script-sync-close.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -A failed sync or close while writing a submit script is an error, and that script is not handed to sbatch. diff --git a/changelog.d/+variant-other-command.bugfix.md b/changelog.d/+variant-other-command.bugfix.md deleted file mode 100644 index df80d553..00000000 --- a/changelog.d/+variant-other-command.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -`--variant` now works only with a recipe build or `submit`. Other commands refuse it instead of running as if it were absent. diff --git a/changelog.d/+variant-submit-carveout.doc.md b/changelog.d/+variant-submit-carveout.doc.md deleted file mode 100644 index 2eb462d6..00000000 --- a/changelog.d/+variant-submit-carveout.doc.md +++ /dev/null @@ -1 +0,0 @@ -Document in the command reference that `--variant` is accepted before an easyconfig and before `submit`. `submit` keeps the option and puts it on the batch command. Another command refuses it. diff --git a/changelog.d/+zero-python-skips.misc.md b/changelog.d/+zero-python-skips.misc.md deleted file mode 100644 index 4bc2bd6e..00000000 --- a/changelog.d/+zero-python-skips.misc.md +++ /dev/null @@ -1,5 +0,0 @@ -Discover `eb-stack` 0.8.0 or newer from `PATH` when `EB_STACK_BIN` is -unset, isolate host `/etc/profile.d/lmod.sh` and `/etc/eb-local` site -files in a mount namespace with a user-namespace probe and bounded -timeouts, and run the full Python suite with zero skips in the `zig` CI -job. diff --git a/changelog.d/+zero-skips-strict-env.misc.md b/changelog.d/+zero-skips-strict-env.misc.md deleted file mode 100644 index f613f13b..00000000 --- a/changelog.d/+zero-skips-strict-env.misc.md +++ /dev/null @@ -1 +0,0 @@ -Require `zsh`, `eb-stack`, and `unshare` in `ZeroPythonSkips` when `EB_LOCAL_REQUIRE_TOOLS` is set, and skip with a reason otherwise. diff --git a/docs/howto/build-for-another-cpu.md b/docs/howto/build-for-another-cpu.md index 0bfebfad..f9344122 100644 --- a/docs/howto/build-for-another-cpu.md +++ b/docs/howto/build-for-another-cpu.md @@ -55,7 +55,7 @@ Each directory the build installed has `easybuild/eb-local-build-mode.json`: "profile": "x86_64/amd/zen4", "host_cpu": "AMD Ryzen 9 9950X 16-Core Processor", "kernel": "7.0.13-arch1-1-rg", - "eb_local_version": "3.5.0", + "eb_local_version": "3.6.0", "isa_audit": "pass" } ``` diff --git a/docs/howto/build-under-qemu.md b/docs/howto/build-under-qemu.md index 9fdf8abc..5c91c432 100644 --- a/docs/howto/build-under-qemu.md +++ b/docs/howto/build-under-qemu.md @@ -99,7 +99,24 @@ Wall times on a Ryzen 9 9950X (Zen 5) host under load, from the helper's start t |---|---|---|---| | `x86_64/amd/zen4` | kvm | 9 to 15 s | boot, the five checks, `gcc -march=native` | | `x86_64/intel/icelake` | kvm | 10 to 13 s | the same | -| `aarch64/neoverse_n1` | tcg | 16 to 21 s | the checks, `uname -m`, a one-line C compile and run under emulation | +| `x86_64/amd/zen2` | kvm | 11 to 17 s | the same | +| `x86_64/amd/zen3` | kvm | 12 to 13 s | the same | +| `aarch64/neoverse_n1` | tcg | 15 to 21 s | the checks, `uname -m`, a one-line C compile and run under emulation | +| `aarch64/neoverse_v1` | tcg | 18 to 25 s | the same, and the SVE vector length | +| `aarch64/a64fx` | tcg | 19 s | the same | + +A guest of an SVE core reports the vector length the core has: 32 bytes (256 bits) for `aarch64/neoverse_v1`, 64 bytes (512 bits) for `aarch64/a64fx`, and none for `aarch64/neoverse_n1`. Most of the time goes to the checks, which load EESSI, GCC and EasyBuild modules. A build is another matter: a guest on 4 KiB host pages and a virtiofs root costs a compile about 1.45 to 2.3 times its native time, and emulation costs 16 to 28 times. + +A whole build, `bzip2-1.0.8-GCCcore-15.2.0` with the audit on, through `eb-local --cpu-target TARGET --mask ROUTE`, on the same host while other jobs loaded it to 35 to 55 on 32 threads: + +| Target | Mode | Wall time | Audit | +|---|---|---|---| +| `x86_64/amd/zen2` | kvm | 71 s | no instruction beyond `x86_64/amd/zen2` | +| `x86_64/amd/zen3` | kvm | 66 s | no instruction beyond `x86_64/amd/zen3` | +| `aarch64/neoverse_v1` | tcg | 191 s | no instruction beyond `aarch64/neoverse_v1` | +| `aarch64/a64fx` | tcg | 283 s | no instruction beyond `aarch64/a64fx` | + +The two Arm targets have no `cpuid` profile, so the build runs only under `--mask tcg --mask-allow-archspec-mismatch`. diff --git a/docs/howto/eb-without-a-site-file.md b/docs/howto/eb-without-a-site-file.md index 85b50375..0e8afcd2 100644 --- a/docs/howto/eb-without-a-site-file.md +++ b/docs/howto/eb-without-a-site-file.md @@ -21,7 +21,7 @@ EESSI-extend keeps EESSI's hooks, RPATH and compatibility layer, and installs wh ``` ```text - ok eb-local 3.5.0 + ok eb-local 3.6.0 info no site file sets storage.node_local_root: `eb-local RECIPE` needs a site file; `eb-local eb` does not. `eb-local site install` writes one beside the program ok installs go to /home/alice/eessi: a user install, prefix from default ok no other EESSI or EasyBuild install variable is set in this shell diff --git a/docs/howto/find-what-is-wrong.md b/docs/howto/find-what-is-wrong.md index 7af7fb15..17968799 100644 --- a/docs/howto/find-what-is-wrong.md +++ b/docs/howto/find-what-is-wrong.md @@ -20,7 +20,7 @@ These steps run them and read what they say. ``` ```text - ok eb-local 3.5.0 + ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/eessi: a user install, prefix from default diff --git a/docs/howto/install.md b/docs/howto/install.md index 2b6491b4..2f462368 100644 --- a/docs/howto/install.md +++ b/docs/howto/install.md @@ -5,8 +5,8 @@ Install the `eb-local` program for your account, from a release or from source. On a cluster whose site installs eb-local, load the site's module, or use the `eb-local` already on `PATH`, and skip this page. -These pages describe release 3.5.0. -Release 3.4.0 is older: it builds only inside a Slurm job, with no `--workstation` and no local build on a host without Slurm; its `dev` sets no `PYTHONUSERBASE`, `JULIA_DEPOT_PATH`, `R_LIBS_USER` or Go paths under `EB_LOCAL_DEV_PREFIX`; and its recipe overlays take no top-level easyconfig assignments. The [changelog](https://github.com/stackhands/eb-local/blob/main/CHANGELOG.md) lists what each earlier release lacks. +These pages describe release 3.6.0. +Release 3.5.0 is older: it has no `--variant`, so it builds no `-perf` or `-debug` module; no `--cpu-target` and `--mask`, so it builds only for the CPU of the build host; no `audit-isa` command; and no `doctor --profiling`. The [changelog](https://github.com/stackhands/eb-local/blob/main/CHANGELOG.md) lists what each earlier release lacks. A build from the main branch prints the version of the last release, with its own commit. [Find what is wrong before a build](find-what-is-wrong.md) copies `eb-local-readiness` from a pinned `main` commit when you use the release binary. @@ -22,14 +22,14 @@ A build from the main branch prints the version of the last release, with its ow 1. Download the binary for this host's architecture and the release's checksums, and check the binary: ```bash - v=3.5.0; f=eb-local-$v-$(uname -m)-linux-musl + v=3.6.0; f=eb-local-$v-$(uname -m)-linux-musl mkdir -p ~/.local/bin && cd ~/.local/bin curl -fLO "https://github.com/stackhands/eb-local/releases/download/v$v/$f" curl -fL "https://github.com/stackhands/eb-local/releases/download/v$v/SHA256SUMS" | sha256sum -c --ignore-missing ``` ```text - eb-local-3.5.0-x86_64-linux-musl: OK + eb-local-3.6.0-x86_64-linux-musl: OK ``` 2. With the GitHub CLI, you can also check the build provenance attestation of the binary, and that of its CycloneDX software bill of materials (SBOM), `$f.cdx.json` in the release: @@ -69,7 +69,7 @@ eb-local --version ```text /home/alice/.local/bin/eb-local -eb-local 3.5.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) +eb-local 3.6.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) ``` The last part of the version line is the commit the binary was built from: the release commit for a release binary, and your checkout's for a build from source. @@ -83,7 +83,7 @@ A build with EasyBuild also needs a site file, which [Write the site file for a | Message | Cause | What to do | |---|---|---| -| `eb-local-3.5.0-x86_64-linux-musl: FAILED` and `sha256sum: WARNING: 1 computed checksum did NOT match` | The file is not the one the checksums name, as after a broken download. | Download it again, and check it again. | +| `eb-local-3.6.0-x86_64-linux-musl: FAILED` and `sha256sum: WARNING: 1 computed checksum did NOT match` | The file is not the one the checksums name, as after a broken download. | Download it again, and check it again. | | `curl: (22) The requested URL returned error: 404` | The release has no binary of that name: the architecture is neither x86\_64 nor aarch64, or `v` names no release. | Install from source, or set `v` to a release. | | `eb-local: FILE:1: unknown key build.node_types` | Release 3.1.0 reads a site file written for 3.2.0. | Install release 3.2.0, or name the table `[build.targets]` for 3.1.0. | | The shell does not find `eb-local` | `~/.local/bin` is not on `PATH`. | Add it to `PATH` in your shell's startup file. | diff --git a/docs/howto/set-site-defaults.md b/docs/howto/set-site-defaults.md index cd666e0c..b62af612 100644 --- a/docs/howto/set-site-defaults.md +++ b/docs/howto/set-site-defaults.md @@ -110,7 +110,7 @@ eb-local doctor ``` ```text -ok eb-local 3.5.0 +ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/.local/eessi: a user install, prefix from site /usr/local/bin/config.toml:9 diff --git a/docs/howto/write-a-site-file.md b/docs/howto/write-a-site-file.md index 68e13696..dfb19fbd 100644 --- a/docs/howto/write-a-site-file.md +++ b/docs/howto/write-a-site-file.md @@ -119,7 +119,7 @@ salloc -p cpu -n 1 -t 00:05:00 srun eb-local doctor ``` ```text -ok eb-local 3.5.0 +ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/eessi: a user install, prefix from default diff --git a/docs/orgmode/howto/build-for-another-cpu.org b/docs/orgmode/howto/build-for-another-cpu.org index 53fc5810..99820e8f 100644 --- a/docs/orgmode/howto/build-for-another-cpu.org +++ b/docs/orgmode/howto/build-for-another-cpu.org @@ -53,7 +53,7 @@ Each directory the build installed has =easybuild/eb-local-build-mode.json=: "profile": "x86_64/amd/zen4", "host_cpu": "AMD Ryzen 9 9950X 16-Core Processor", "kernel": "7.0.13-arch1-1-rg", - "eb_local_version": "3.5.0", + "eb_local_version": "3.6.0", "isa_audit": "pass" } #+end_src diff --git a/docs/orgmode/howto/build-under-qemu.org b/docs/orgmode/howto/build-under-qemu.org index cce3ad86..a7248578 100644 --- a/docs/orgmode/howto/build-under-qemu.org +++ b/docs/orgmode/howto/build-under-qemu.org @@ -97,7 +97,24 @@ Wall times on a Ryzen 9 9950X (Zen 5) host under load, from the helper's start t |--------------------------------------+------+--------------+-----------------------------------------------------------------------| | =x86_64/amd/zen4= | kvm | 9 to 15 s | boot, the five checks, =gcc -march=native= | | =x86_64/intel/icelake= | kvm | 10 to 13 s | the same | -| =aarch64/neoverse_n1= | tcg | 16 to 21 s | the checks, =uname -m=, a one-line C compile and run under emulation | +| =x86_64/amd/zen2= | kvm | 11 to 17 s | the same | +| =x86_64/amd/zen3= | kvm | 12 to 13 s | the same | +| =aarch64/neoverse_n1= | tcg | 15 to 21 s | the checks, =uname -m=, a one-line C compile and run under emulation | +| =aarch64/neoverse_v1= | tcg | 18 to 25 s | the same, and the SVE vector length | +| =aarch64/a64fx= | tcg | 19 s | the same | + +A guest of an SVE core reports the vector length the core has: 32 bytes (256 bits) for =aarch64/neoverse_v1=, 64 bytes (512 bits) for =aarch64/a64fx=, and none for =aarch64/neoverse_n1=. Most of the time goes to the checks, which load EESSI, GCC and EasyBuild modules. A build is another matter: a guest on 4 KiB host pages and a virtiofs root costs a compile about 1.45 to 2.3 times its native time, and emulation costs 16 to 28 times. + +A whole build, =bzip2-1.0.8-GCCcore-15.2.0= with the audit on, through =eb-local --cpu-target TARGET --mask ROUTE=, on the same host while other jobs loaded it to 35 to 55 on 32 threads: + +| Target | Mode | Wall time | Audit | +|--------------------------------------+------+--------------+-----------------------------------------------| +| =x86_64/amd/zen2= | kvm | 71 s | no instruction beyond =x86_64/amd/zen2= | +| =x86_64/amd/zen3= | kvm | 66 s | no instruction beyond =x86_64/amd/zen3= | +| =aarch64/neoverse_v1= | tcg | 191 s | no instruction beyond =aarch64/neoverse_v1= | +| =aarch64/a64fx= | tcg | 283 s | no instruction beyond =aarch64/a64fx= | + +The two Arm targets have no =cpuid= profile, so the build runs only under =--mask tcg --mask-allow-archspec-mismatch=. diff --git a/docs/orgmode/howto/eb-without-a-site-file.org b/docs/orgmode/howto/eb-without-a-site-file.org index f27ea4e5..99155a06 100644 --- a/docs/orgmode/howto/eb-without-a-site-file.org +++ b/docs/orgmode/howto/eb-without-a-site-file.org @@ -19,7 +19,7 @@ EESSI-extend keeps EESSI's hooks, RPATH and compatibility layer, and installs wh #+end_src #+begin_example - ok eb-local 3.5.0 + ok eb-local 3.6.0 info no site file sets storage.node_local_root: `eb-local RECIPE` needs a site file; `eb-local eb` does not. `eb-local site install` writes one beside the program ok installs go to /home/alice/eessi: a user install, prefix from default ok no other EESSI or EasyBuild install variable is set in this shell diff --git a/docs/orgmode/howto/find-what-is-wrong.org b/docs/orgmode/howto/find-what-is-wrong.org index f8954cf3..6dc13902 100644 --- a/docs/orgmode/howto/find-what-is-wrong.org +++ b/docs/orgmode/howto/find-what-is-wrong.org @@ -18,7 +18,7 @@ These steps run them and read what they say. #+end_src #+begin_example - ok eb-local 3.5.0 + ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/eessi: a user install, prefix from default diff --git a/docs/orgmode/howto/install.org b/docs/orgmode/howto/install.org index de95e53c..c43e2b81 100644 --- a/docs/orgmode/howto/install.org +++ b/docs/orgmode/howto/install.org @@ -3,8 +3,8 @@ Install the =eb-local= program for your account, from a release or from source. On a cluster whose site installs eb-local, load the site's module, or use the =eb-local= already on =PATH=, and skip this page. -These pages describe release 3.5.0. -Release 3.4.0 is older: it builds only inside a Slurm job, with no =--workstation= and no local build on a host without Slurm; its =dev= sets no =PYTHONUSERBASE=, =JULIA_DEPOT_PATH=, =R_LIBS_USER= or Go paths under =EB_LOCAL_DEV_PREFIX=; and its recipe overlays take no top-level easyconfig assignments. The [[https://github.com/stackhands/eb-local/blob/main/CHANGELOG.md][changelog]] lists what each earlier release lacks. +These pages describe release 3.6.0. +Release 3.5.0 is older: it has no =--variant=, so it builds no =-perf= or =-debug= module; no =--cpu-target= and =--mask=, so it builds only for the CPU of the build host; no =audit-isa= command; and no =doctor --profiling=. The [[https://github.com/stackhands/eb-local/blob/main/CHANGELOG.md][changelog]] lists what each earlier release lacks. A build from the main branch prints the version of the last release, with its own commit. [[file:find-what-is-wrong.org][Find what is wrong before a build]] copies =eb-local-readiness= from a pinned =main= commit when you use the release binary. @@ -20,14 +20,14 @@ A build from the main branch prints the version of the last release, with its ow 1. Download the binary for this host's architecture and the release's checksums, and check the binary: #+begin_src bash - v=3.5.0; f=eb-local-$v-$(uname -m)-linux-musl + v=3.6.0; f=eb-local-$v-$(uname -m)-linux-musl mkdir -p ~/.local/bin && cd ~/.local/bin curl -fLO "https://github.com/stackhands/eb-local/releases/download/v$v/$f" curl -fL "https://github.com/stackhands/eb-local/releases/download/v$v/SHA256SUMS" | sha256sum -c --ignore-missing #+end_src #+begin_example - eb-local-3.5.0-x86_64-linux-musl: OK + eb-local-3.6.0-x86_64-linux-musl: OK #+end_example 2. With the GitHub CLI, you can also check the build provenance attestation of the binary, and that of its CycloneDX software bill of materials (SBOM), =$f.cdx.json= in the release: @@ -67,7 +67,7 @@ eb-local --version #+begin_example /home/alice/.local/bin/eb-local -eb-local 3.5.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) +eb-local 3.6.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) #+end_example The last part of the version line is the commit the binary was built from: the release commit for a release binary, and your checkout's for a build from source. @@ -81,7 +81,7 @@ A build with EasyBuild also needs a site file, which [[file:write-a-site-file.or | Message | Cause | What to do | |------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------------------------------------------------------------| -| =eb-local-3.5.0-x86_64-linux-musl: FAILED= and =sha256sum: WARNING: 1 computed checksum did NOT match= | The file is not the one the checksums name, as after a broken download. | Download it again, and check it again. | +| =eb-local-3.6.0-x86_64-linux-musl: FAILED= and =sha256sum: WARNING: 1 computed checksum did NOT match= | The file is not the one the checksums name, as after a broken download. | Download it again, and check it again. | | =curl: (22) The requested URL returned error: 404= | The release has no binary of that name: the architecture is neither x86_64 nor aarch64, or =v= names no release. | Install from source, or set =v= to a release. | | =eb-local: FILE:1: unknown key build.node_types= | Release 3.1.0 reads a site file written for 3.2.0. | Install release 3.2.0, or name the table =[build.targets]= for 3.1.0. | | The shell does not find =eb-local= | =~/.local/bin= is not on =PATH=. | Add it to =PATH= in your shell's startup file. | diff --git a/docs/orgmode/howto/set-site-defaults.org b/docs/orgmode/howto/set-site-defaults.org index 20926c17..af601cb5 100644 --- a/docs/orgmode/howto/set-site-defaults.org +++ b/docs/orgmode/howto/set-site-defaults.org @@ -108,7 +108,7 @@ eb-local doctor #+end_src #+begin_example -ok eb-local 3.5.0 +ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/.local/eessi: a user install, prefix from site /usr/local/bin/config.toml:9 diff --git a/docs/orgmode/howto/write-a-site-file.org b/docs/orgmode/howto/write-a-site-file.org index cfaa179b..32eb3c32 100644 --- a/docs/orgmode/howto/write-a-site-file.org +++ b/docs/orgmode/howto/write-a-site-file.org @@ -117,7 +117,7 @@ salloc -p cpu -n 1 -t 00:05:00 srun eb-local doctor #+end_src #+begin_example -ok eb-local 3.5.0 +ok eb-local 3.6.0 ok site file /usr/local/bin/config.toml ok builds use the allocation's own xfs mount /local/%u.%j ok installs go to /home/alice/eessi: a user install, prefix from default diff --git a/docs/orgmode/reference/cli.org b/docs/orgmode/reference/cli.org index 06d5db86..0c9b6d72 100644 --- a/docs/orgmode/reference/cli.org +++ b/docs/orgmode/reference/cli.org @@ -264,10 +264,10 @@ The version line names the program, its version, the target and optimize mode of Built with =zig build --release=safe -Dcommit=0123abc=, it prints: #+begin_example -eb-local 3.5.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) +eb-local 3.6.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) #+end_example -Between =v3.4.0= and =v3.5.0= the command line adds =--workstation=; no flag was removed or renamed. +Between =v3.5.0= and =v3.6.0= the command line adds =--variant=, =--cpu-target=, =--mask=, =--mask-allow-archspec-mismatch=, =--no-audit=, =doctor --profiling= and the =audit-isa= command; no flag was removed or renamed. * Commands diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 11e51b5b..bb49ab62 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -266,10 +266,10 @@ The version line names the program, its version, the target and optimize mode of Built with `zig build --release=safe -Dcommit=0123abc`, it prints: ```text -eb-local 3.5.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) +eb-local 3.6.0 (x86_64-linux-musl, safe, zig 0.17.1, 0123abc) ``` -Between `v3.4.0` and `v3.5.0` the command line adds `--workstation`; no flag was removed or renamed. +Between `v3.5.0` and `v3.6.0` the command line adds `--variant`, `--cpu-target`, `--mask`, `--mask-allow-archspec-mismatch`, `--no-audit`, `doctor --profiling` and the `audit-isa` command; no flag was removed or renamed. ## Commands diff --git a/src/isa/dispatch-allow.txt b/src/isa/dispatch-allow.txt index f21e4179..bcac391a 100644 --- a/src/isa/dispatch-allow.txt +++ b/src/isa/dispatch-allow.txt @@ -24,5 +24,6 @@ RStudio-Server cldemote,rtm,xop # bundled node, pandoc, typst Pandoc rtm,xop # statically linked runtime with dispatch zlib avx512bw,avx512dq,avx512f,avx512vl,avx512vnni # zlib-ng (zlib 2.3 compat build): functable.c and arch/x86/x86_features.c pick AVX-512 adler32, crc32, chunkset, compare256 and slide_hash kernels from a CPUID check at first use; observed in libz.so.1.3.1.zlib-ng of a zen3-masked build GCCcore fma4,rtm # libgfortran matmul variants chosen at run time (fma4); libitm hardware transactions behind cpuid (rtm) +GROMACS avx512f # GROMACS 2025.4 src/gromacs/hardware/identifyavx512fmaunits.cpp: timeFmaOnlyLoop and timeFmaAndShuffleLoop are zmm inline assembly in every x86 build; identifyAvx512FmaUnits() (called from simd_support.cpp and printhardware.cpp) runs them only after CpuInfo::detect() reports avx512f. Observed as 75 instructions in each of the four libgromacs variants of a zen3 build (GMX_SIMD=AVX2_256) # Not confirmed as dispatch; may be linear-sweep decoding of data in .text: Rust fma4 # bin/rust-analyzer, 2 sites (vfmaddsd) diff --git a/src/isa_audit.zig b/src/isa_audit.zig index 0c3cb447..c9187478 100644 --- a/src/isa_audit.zig +++ b/src/isa_audit.zig @@ -753,7 +753,10 @@ pub fn run(a: Allocator, o: Options, path_env: []const u8, tmpdir: []const u8, e default_allow; const allow = parseAllow(a, db, allow_text) catch oom(); - const root = fsx.absPath(a, o.path) catch oom(); + const root = fsx.absPath(a, o.path) catch |e| switch (e) { + error.OutOfMemory => oom(), + else => |se| cli.die("eb-local", "cannot resolve {s} ({s})", .{ o.path, sys.describe(se) }), + }; const st = fsx.statAt(fsx.cwd, root, true) catch |e| cli.die("eb-local", "cannot read {s} ({s})", .{ root, sys.describe(e) }); var files: std.ArrayList([]const u8) = .empty; var errors: std.ArrayList(Problem) = .empty; @@ -1092,6 +1095,11 @@ test "the allow list names packages and features" { try std.testing.expect(allowed(entries, "/p/software/zlib/2.3.2/lib/libz.so.1.3.1.zlib-ng", avx512bw)); try std.testing.expect(allowed(entries, "/p/software/zlib/2.3.2/lib/libz.so.1.3.1.zlib-ng", db.idOf("avx512vnni").?)); try std.testing.expect(!allowed(entries, "/p/software/zlib/2.3.2/lib/libz.so.1.3.1.zlib-ng", db.idOf("avx512fp16").?)); + // GROMACS: the AVX-512 FMA unit timing loops of an AVX2_256 build. + try std.testing.expect(allowed(entries, "/p/software/GROMACS/2025.4-foss-2026.1/lib/libgromacs.so.10.0.0", db.idOf("avx512f").?)); + try std.testing.expect(allowed(entries, "/p/software/GROMACS/2025.4-foss-2026.1/lib/libgromacs_mpi_d.so.10.0.0", db.idOf("avx512f").?)); + try std.testing.expect(!allowed(entries, "/p/software/GROMACS/2025.4-foss-2026.1/lib/libgromacs.so.10.0.0", db.idOf("avx512bw").?)); + try std.testing.expect(!allowed(entries, "/p/software/GROMACS/2025.4-foss-2026.1/lib/libgromacs.so.10.0.0", db.idOf("avx512vl").?)); const custom = try parseAllow(a, db, "Foo avx512f,nosuchfeature # reason\n# comment\n\n"); try std.testing.expectEqual(@as(usize, 1), custom.len); try std.testing.expect(allowed(custom, "/a/software/Foo/1/lib/x.so", db.idOf("avx512f").?)); diff --git a/src/main.zig b/src/main.zig index fc27686a..a284f3d9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -49,7 +49,7 @@ const Allocator = std.mem.Allocator; const tool = "eb-local"; /// The version `eb-local --version` prints, and the release it is. -pub const version = "3.5.0"; +pub const version = "3.6.0"; const usage_text = \\eb-local: install and build software on top of EESSI 2026.06, into a @@ -4982,6 +4982,44 @@ fn maskMaterialize(c: Ctx, plan: MaskPlan, dir: []const u8) union(enum) { ok: Ma return .{ .ok = .{ .vars = vars, .prefix = prefix } }; } +/// The profile a preflight in a virtual machine uses for a target that has no +/// cpuid profile (neoverse_v1, a64fx): the names the guest checks come from the +/// `__vm-run` target table. `gcc_seen` is what `gcc -mcpu=native` printed; the +/// table lists alternatives for a CPU GCC names more than one way, and the one +/// seen is the one compared. +fn vmOnlyProfile(subdir: []const u8, route: cpumask.Route, gcc_seen: []const u8) ?cpumask.Profile { + if (route != .kvm and route != .tcg) return null; + const t = vm.find(subdir) orelse return null; + const seen = std.mem.trim(u8, gcc_seen, " \t\r\n"); + const seen_cpu = seen[0 .. std.mem.indexOfScalar(u8, seen, '+') orelse seen.len]; + var pick: []const u8 = t.gcc[0 .. std.mem.indexOfScalar(u8, t.gcc, ' ') orelse t.gcc.len]; + var alts = std.mem.tokenizeScalar(u8, t.gcc, ' '); + while (alts.next()) |alt| if (std.mem.eql(u8, alt, seen_cpu) or std.mem.eql(u8, alt, seen)) { + pick = alt; + }; + return .{ + .subdir = t.name, + .arch = switch (t.arch) { + .x86_64 => .x86_64, + .aarch64 => .aarch64, + }, + .vendor = t.vendor, + .gcc_march = pick, + .gcc_cpu = pick, + }; +} + +test "a virtual machine preflight has a profile for a target that has no cpuid profile" { + const v1 = vmOnlyProfile("aarch64/neoverse_v1", .tcg, "neoverse-v1+sm4+crc") orelse return error.TestUnexpectedResult; + try std.testing.expectEqualStrings("neoverse-v1", v1.gcc_cpu); + try std.testing.expect(v1.arch == .aarch64); + const fx = vmOnlyProfile("aarch64/a64fx", .tcg, "a64fx+crc+crypto") orelse return error.TestUnexpectedResult; + try std.testing.expectEqualStrings("a64fx", fx.gcc_cpu); + try std.testing.expectEqualStrings("0x46", fx.vendor); + try std.testing.expect(vmOnlyProfile("aarch64/a64fx", .cpuid, "a64fx") == null); + try std.testing.expect(vmOnlyProfile("x86_64/amd/zen9", .kvm, "") == null); +} + /// `__mask-preflight TARGET ROUTE DEVFD ARCHDETECT ARCHSPEC GCC PROBE`: what the /// build script saw inside the mask, checked against the target. Prints one /// line per check and exits 1 when any fails. @@ -4990,7 +5028,8 @@ fn cmdMaskPreflight(c: Ctx, args: []const []const u8) u8 { const a = c.a; const target = args[0]; const route = std.meta.stringToEnum(cpumask.Route, args[1]) orelse die("__mask-preflight: unknown route {s}", .{args[1]}); - const profile = cpumask.findProfile(cpumask.builtinProfiles(a), target) orelse die("no mask profile for {s}", .{target}); + const profile = cpumask.findProfile(cpumask.builtinProfiles(a), target) orelse + vmOnlyProfile(target, route, args[5]) orelse die("no mask profile for {s}", .{target}); var obs: cpumask.Observed = .{ .devfd = std.mem.eql(u8, args[2], "yes"), .archspec_allowed = args.len == 8 and std.mem.eql(u8, args[7], "allow-archspec") }; if (args[3].len > 0) obs.archdetect = args[3]; if (args[4].len > 0) obs.archspec = std.mem.trim(u8, args[4], " \t\r\n"); diff --git a/src/vm.zig b/src/vm.zig index 8a12b521..e6c2c30a 100644 --- a/src/vm.zig +++ b/src/vm.zig @@ -74,10 +74,12 @@ const no_avx512 = "TCG has no AVX-512, so the guest would be a zen3 or a haswell const no_arm_kvm = "KVM on Arm offers the host CPU only; use --mode tcg from an x86_64 host"; const no_x86_kvm = "an x86_64 target needs an x86_64 host under KVM, or --mode tcg from an aarch64 host"; -/// Every target `__vm-run` knows. +/// Every target `__vm-run` knows. QEMU's EPYC-Milan lacks vaes and vpclmulqdq, +/// which a real Milan has and EESSI archdetect requires for amd/zen3 (its +/// spec line is "avx2 fma vaes"), so the zen3 line adds both. pub const targets = [_]Target{ .{ .name = "x86_64/amd/zen2", .arch = .x86_64, .vendor = "AuthenticAMD", .archspec = "zen2", .gcc = "znver2", .kvm = "EPYC-Rome," ++ amd_bits, .tcg = "EPYC-Rome" }, - .{ .name = "x86_64/amd/zen3", .arch = .x86_64, .vendor = "AuthenticAMD", .archspec = "zen3", .gcc = "znver3", .kvm = "EPYC-Milan,pcid=off," ++ amd_bits, .tcg = "EPYC-Milan" }, + .{ .name = "x86_64/amd/zen3", .arch = .x86_64, .vendor = "AuthenticAMD", .archspec = "zen3", .gcc = "znver3", .kvm = "EPYC-Milan,pcid=off,vaes=on,vpclmulqdq=on," ++ amd_bits, .tcg = "EPYC-Milan" }, .{ .name = "x86_64/amd/zen4", .arch = .x86_64, .vendor = "AuthenticAMD", .archspec = "zen4", .gcc = "znver4", .kvm = "EPYC-Genoa,flush-l1d=on,la57=off,pcid=off," ++ amd_bits, .tcg_refusal = no_avx512 }, .{ .name = "x86_64/amd/zen5", .arch = .x86_64, .vendor = "AuthenticAMD", .archspec = "zen5", .gcc = "znver5", .kvm_refusal = no_zen5, .tcg_refusal = no_avx512 }, .{ .name = "x86_64/intel/haswell", .arch = .x86_64, .vendor = "GenuineIntel", .archspec = "haswell", .gcc = "haswell", .kvm = "Haswell-noTSX-IBRS,vendor=GenuineIntel,pcid=off", .tcg = "Haswell-noTSX-IBRS,vendor=GenuineIntel" }, @@ -686,11 +688,20 @@ fn runKvm(a: Allocator, env: *const std.process.Environ.Map, cwd: []const u8, re .readonly = false, .cache = "auto", }) catch break :fail false; - for (req.share_ro, 0..) |p, i| shares.append(a, .{ - .tag = std.fmt.allocPrint(a, "ro{d}", .{i}) catch break :fail false, - .host = fsx.absPath(a, p) catch break :fail false, - .guest = fsx.absPath(a, p) catch break :fail false, - }) catch break :fail false; + for (req.share_ro, 0..) |p, i| { + const abs = fsx.absPath(a, p) catch |e| switch (e) { + error.OutOfMemory => break :fail false, + else => |se| { + err("cannot resolve the read-only share {s} ({s})", .{ p, sys.describe(se) }); + break :fail false; + }, + }; + shares.append(a, .{ + .tag = std.fmt.allocPrint(a, "ro{d}", .{i}) catch break :fail false, + .host = abs, + .guest = abs, + }) catch break :fail false; + } break :fail true; }; if (!build) return status_failed; @@ -908,7 +919,8 @@ test "an AMD target keeps its model, the corrections and enforce" { const zen4 = try plan(a, testTarget("x86_64/amd/zen4"), .kvm, .x86_64); try testing.expectEqualStrings("EPYC-Genoa,flush-l1d=on,la57=off,pcid=off,srso-user-kernel-no=on,sbpb=on,ibpb-brtype=on,tsa-sq-no=on,tsa-l1-no=on,tsc-deadline=on,enforce", zen4.kvm); const zen3 = try plan(a, testTarget("x86_64/amd/zen3"), .kvm, .x86_64); - try testing.expectEqualStrings("EPYC-Milan,pcid=off,srso-user-kernel-no=on,sbpb=on,ibpb-brtype=on,tsa-sq-no=on,tsa-l1-no=on,tsc-deadline=on,enforce", zen3.kvm); + try testing.expectEqualStrings("EPYC-Milan,pcid=off,vaes=on,vpclmulqdq=on,srso-user-kernel-no=on,sbpb=on,ibpb-brtype=on,tsa-sq-no=on,tsa-l1-no=on,tsc-deadline=on,enforce", zen3.kvm); + try testing.expect(std.mem.indexOf(u8, zen3.kvm, "vaes=on") != null); const zen2 = try plan(a, testTarget("x86_64/amd/zen2"), .kvm, .x86_64); try testing.expect(std.mem.startsWith(u8, zen2.kvm, "EPYC-Rome,srso-user-kernel-no=on")); try testing.expect(std.mem.endsWith(u8, zen2.kvm, ",enforce")); diff --git a/tests/fixtures/doctor-without-workspace.txt b/tests/fixtures/doctor-without-workspace.txt index 0458e987..61e18f1a 100644 --- a/tests/fixtures/doctor-without-workspace.txt +++ b/tests/fixtures/doctor-without-workspace.txt @@ -1,4 +1,4 @@ -ok eb-local 3.5.0 +ok eb-local 3.6.0 ok site file {root}/site.conf ok builds use the allocation's own xfs mount {root}/node-mounts/%u.%j ok installs go to {root}/durable/owned prefix: a user install, prefix from environment EB_LOCAL_PREFIX diff --git a/tests/test_cpu_target_cli.py b/tests/test_cpu_target_cli.py index 8fdf97de..24d69526 100644 --- a/tests/test_cpu_target_cli.py +++ b/tests/test_cpu_target_cli.py @@ -72,6 +72,24 @@ def test_preflight_refuses_missing_answers(self): self.assertIn("archdetect gave no answer", r.stdout) self.assertIn("gcc gave no -march=native value", r.stdout) + def test_preflight_names_a_target_only_the_virtual_machine_routes_present(self): + for target, cpu, part in [("aarch64/neoverse_v1", "neoverse-v1", "0x41"), ("aarch64/a64fx", "a64fx", "0x46")]: + with self.subTest(target=target): + words = [target, "tcg", "yes", target, "aarch64", f"{cpu}+crc+crypto", f"vendor={part}", "allow-archspec"] + r = self.run_cli("__mask-preflight", *words) + self.assertEqual(r.returncode, 0, r.stdout + r.stderr) + self.assertIn(f"preflight ok: gcc -mcpu=native is {cpu}", r.stdout) + self.assertIn(f"preflight ok: EESSI archdetect names {target}", r.stdout) + words[5] = "neoverse-n1+crc" + r = self.run_cli("__mask-preflight", *words) + self.assertEqual(r.returncode, 1) + self.assertIn("gcc -mcpu=native is 'neoverse-n1'", r.stdout) + + def test_a_cpuid_route_preflight_still_needs_a_profile(self): + r = self.run_cli("__mask-preflight", "aarch64/a64fx", "cpuid", "yes", "aarch64/a64fx", "a64fx", "a64fx", "vendor=0x46") + self.assertNotEqual(r.returncode, 0) + self.assertIn("no mask profile for aarch64/a64fx", r.stderr) + def test_preflight_notes_an_archspec_that_cannot_be_imported(self): r = self.preflight(spec="") self.assertEqual(r.returncode, 0, r.stdout) diff --git a/tests/test_overlay_cli.py b/tests/test_overlay_cli.py index 7ad0b74e..5bbcac6f 100644 --- a/tests/test_overlay_cli.py +++ b/tests/test_overlay_cli.py @@ -843,7 +843,7 @@ def test_version_line_is_unchanged(self): self.assertEqual(run.returncode, 0, run.stderr) self.assertRegex( run.stdout, - rf"^eb-local 3\.5\.0 \({self.host_musl_target_triple()}", + rf"^eb-local 3\.6\.0 \({self.host_musl_target_triple()}", ) diff --git a/tests/test_vm_run.py b/tests/test_vm_run.py index 8a973e97..b953d88b 100644 --- a/tests/test_vm_run.py +++ b/tests/test_vm_run.py @@ -93,6 +93,31 @@ def test_kvm_icelake_reports_an_intel_part(self): self.assertIn("GenuineIntel", run.stdout) self.assertIn("archspec=icelake", run.stderr) + @unittest.skipUnless(HOST == "x86_64", "KVM targets are of the host architecture") + def test_kvm_zen2_and_zen3_report_their_compiler_names(self): + for target, gcc, archspec in [("x86_64/amd/zen2", "znver2", "zen2"), ("x86_64/amd/zen3", "znver3", "zen3")]: + run = self.timed("--mode", "kvm", "--cpu-target", target, "--", + "bash", "-c", "gcc -march=native -Q --help=target | grep -- '-march='; grep -m1 vendor_id /proc/cpuinfo") + self.assertEqual(run.returncode, 0, (target, run.stderr)) + self.assertIn(gcc, run.stdout) + self.assertIn("AuthenticAMD", run.stdout) + self.assertIn(f"archdetect={target}", run.stderr) + self.assertIn(f"archspec={archspec}", run.stderr) + + @unittest.skipUnless(HOST == "x86_64", "the aarch64 emulation runs on an x86_64 host here") + def test_tcg_sve_vector_length_follows_the_core(self): + probe = ("printf '%s\\n' '#include ' '#include ' " + "'int main(void){printf(\"vl_bytes=%d\\n\", prctl(51) & 0xffff);return 0;}' > /tmp/vl.c; " + "gcc -mcpu=native -### -c /tmp/vl.c 2>&1 | grep -o -- '-mcpu=[^ ]*' | head -n 1; " + "gcc -o /tmp/vl /tmp/vl.c && /tmp/vl") + for target, cpu, vl in [("aarch64/neoverse_v1", "neoverse-v1", 32), ("aarch64/a64fx", "a64fx", 64)]: + run = self.timed("--mode", "tcg", "--cpu-target", target, "--allow-archspec-mismatch", "--", + "bash", "-c", probe) + self.assertEqual(run.returncode, 0, (target, run.stderr)) + self.assertIn(cpu, run.stdout) + self.assertIn(f"vl_bytes={vl}", run.stdout) + self.assertIn(f"archdetect={target}", run.stderr) + @unittest.skipUnless(HOST == "x86_64", "KVM targets are of the host architecture") def test_a_cpu_view_that_does_not_name_the_target_is_refused_before_the_command(self): marker = f"/tmp/eb-local-vm-test-{os.getpid()}" diff --git a/tools/mask/check_arm_mask.sh b/tools/mask/check_arm_mask.sh new file mode 100755 index 00000000..0714b59f --- /dev/null +++ b/tools/mask/check_arm_mask.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# Checks the cpuid route's aarch64 mask on real Arm silicon, without EESSI: +# under __mask-run, getauxval, /proc/cpuinfo and gcc -mcpu=native must name +# the target profile. Usage: check_arm_mask.sh EB_LOCAL_BINARY [TARGET...] +set -euo pipefail + +eb=${1:?usage: check_arm_mask.sh EB_LOCAL_BINARY [TARGET...]} +shift +[ "$(uname -m)" = aarch64 ] || { echo "check_arm_mask: this host is $(uname -m), not aarch64" >&2; exit 2; } +here=$(cd "$(dirname "$0")" && pwd) +profiles=$here/../../share/eb-local/mask/profiles.conf +targets=("$@") +[ ${#targets[@]} -gt 0 ] || targets=(aarch64/neoverse_n1 aarch64/generic) + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +cat > "$work/hwcap.c" <<'C' +#include +#include +int main(void) +{ + printf("hwcap=0x%lx hwcap2=0x%lx\n", getauxval(AT_HWCAP), getauxval(AT_HWCAP2)); + return 0; +} +C +cat > "$work/x.c" <<'C' +int add(int a, int b) { return a + b; } +C +cat > "$work/inner.sh" <<'SH' +#!/usr/bin/env bash +# runs inside the mask: $1 is the work directory +grep -m1 'CPU part' /proc/cpuinfo +grep -m1 '^Features' /proc/cpuinfo +"$1/hwcap" +gcc -mcpu=native -Q --help=target -x c /dev/null -c -o /dev/null | + awk '$1 == "-mcpu=" { print "gcc_q " $2 }' +gcc -mcpu=native -### -c "$1/x.c" -o /dev/null 2>&1 | + grep -o -- "-mcpu=[^ \"']*" | head -n 1 | sed 's/^/gcc_cc1 /' +SH +cc -O1 -o "$work/hwcap" "$work/hwcap.c" + +echo "host: $(grep -m1 'CPU part' /proc/cpuinfo), $(grep -m1 '^Features' /proc/cpuinfo)" +echo "host: $("$work/hwcap")" +echo "host: gcc $(gcc -dumpfullversion), -mcpu=$(gcc -mcpu=native -Q --help=target | awk '$1 == "-mcpu=" { print $2 }')" +host_hwcap=$("$work/hwcap" | sed -n 's/^hwcap=\(0x[0-9a-f]*\) .*/\1/p') + +# profile TARGET KEY: the value of KEY in the [TARGET] section of profiles.conf +profile() { + awk -v sec="[$1]" -v key="$2" ' + $0 == sec { in_sec = 1; next } + /^\[/ { in_sec = 0 } + in_sec && $1 == key { sub(/^[^=]*= */, ""); print; exit }' "$profiles" +} + +fail=0 +for t in "${targets[@]}"; do + part=$(profile "$t" cpu_part) + gcc_cpu=$(profile "$t" gcc_cpu) + keep=$(profile "$t" hwcap) + [ -n "$part" ] && [ -n "$gcc_cpu" ] && [ -n "$keep" ] || { echo "FAIL $t: no profile in $profiles" >&2; fail=1; continue; } + echo "=== $t: CPU part $part, -mcpu=$gcc_cpu, AT_HWCAP kept $keep" + + out=$("$eb" __mask-run --cpu-target "$t" --mask cpuid -- bash "$work/inner.sh" "$work") + printf '%s\n' "$out" | sed 's/^/ /' + + got_part=$(printf '%s\n' "$out" | sed -n 's/^CPU part[[:space:]]*:[[:space:]]*//p') + got_hwcap=$(printf '%s\n' "$out" | sed -n 's/^hwcap=\(0x[0-9a-f]*\) .*/\1/p') + got_q=$(printf '%s\n' "$out" | sed -n 's/^gcc_q //p') + got_cc1=$(printf '%s\n' "$out" | sed -n 's/^gcc_cc1 -mcpu=//p') + + [ "$got_part" = "$part" ] || { echo "FAIL $t: /proc/cpuinfo CPU part is '$got_part', want $part" >&2; fail=1; } + # the mask keeps the real word AND the profile's: nothing outside the profile survives + want_hwcap=$(printf '0x%x' $((host_hwcap & keep))) + [ "$got_hwcap" = "$want_hwcap" ] || { echo "FAIL $t: masked AT_HWCAP is '$got_hwcap', want $want_hwcap (host $host_hwcap & $keep)" >&2; fail=1; } + [ $(( got_hwcap & ~keep )) -eq 0 ] || { echo "FAIL $t: masked AT_HWCAP $got_hwcap carries bits outside $keep" >&2; fail=1; } + # GCC appends +extension names to the CPU; the CPU is the part before the first + + [ "${got_q%%+*}" = "$gcc_cpu" ] || { echo "FAIL $t: gcc -mcpu=native -Q reports '$got_q', want $gcc_cpu" >&2; fail=1; } + [ "${got_cc1%%+*}" = "$gcc_cpu" ] || { echo "FAIL $t: compiling with gcc -mcpu=native passes -mcpu=$got_cc1, want $gcc_cpu" >&2; fail=1; } + [ "$fail" -eq 0 ] && echo "ok $t" +done +exit "$fail" diff --git a/tools/sbom.py b/tools/sbom.py index b1dd234c..e8faed62 100644 --- a/tools/sbom.py +++ b/tools/sbom.py @@ -18,7 +18,7 @@ import uuid REPO = "stackhands/eb-local" -GITHUB = re.compile(r'^git\+https://github\.com/([\w.-]+/[\w.-]+?)(?:\.git)?#(.+)$') +GITHUB = re.compile(r'^git\+https://github\.com/([\w.-]+/[\w.-]+?)(?:\.git)?(?:\?ref=([^#]+))?#(.+)$') DEP_HEAD = re.compile(r'\.(\w+)\s*=\s*\.\{') URL_RE = re.compile(r'\.url\s*=\s*"([^"]+)"') HASH_RE = re.compile(r'\.hash\s*=\s*"([^"]+)"') @@ -115,7 +115,8 @@ def dependencies(text): gm = GITHUB.match(url) if not gm: raise SystemExit(f"dependency {name}: cannot name {url} as a package URL") - repo, ref = gm.groups() + repo, tag, commit = gm.groups() + ref = tag or commit version = ref[1:] if re.fullmatch(r'v\d.*', ref) else ref deps.append({ "type": "library",