From 15b315e503e56aa9643b70c929d1305ae2c68161 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Tue, 6 Oct 2026 17:03:32 +0000 Subject: [PATCH] Counter ASIC 3.0: the identities job's ${appDir}: fix and the class guard tools/ci/ps-drive-ref-check.sh in CI (a $name: inside a double-quoted string is a PowerShell 5.1 parse error; backtick-escaped dollars ignored) --- .github/workflows/ci.yml | 2 ++ tools/ca3-pc1-amd/pc1-amd-identities.ps1 | 2 +- tools/ci/ps-drive-ref-check.sh | 26 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 tools/ci/ps-drive-ref-check.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e00181eab..cc4b45fc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,8 @@ jobs: run: bash tools/ci/identity-check.sh - name: no conflict markers in tracked files run: bash tools/ci/no-conflict-markers.sh + - name: PowerShell drive-reference check (a `$name:` inside a double-quoted string is a 5.1 parse error) + run: bash tools/ci/ps-drive-ref-check.sh - name: copied sources are re-stamped before a build run: bash tools/ci/copied-sources-check.sh - name: override params files parse with no duplicate key (the duplicate-field class, 6 October 2026) diff --git a/tools/ca3-pc1-amd/pc1-amd-identities.ps1 b/tools/ca3-pc1-amd/pc1-amd-identities.ps1 index 514a64691..5420e5dd4 100644 --- a/tools/ca3-pc1-amd/pc1-amd-identities.ps1 +++ b/tools/ca3-pc1-amd/pc1-amd-identities.ps1 @@ -21,7 +21,7 @@ $appDir = if ($env:IGNEUM_APP_DIR) { $env:IGNEUM_APP_DIR } else { Join-Path $env $urlFile = Join-Path $appDir 'app.url' $base = $null if (Test-Path $urlFile) { $base = (Get-Content -LiteralPath $urlFile -Raw).Trim().TrimEnd('/') } -if (-not $base) { "RESULT identities error=no app.url under $appDir: nothing posted"; Summary 'failed' @{ reason = 'no app.url' }; exit 1 } +if (-not $base) { "RESULT identities error=no app.url under ${appDir}: nothing posted"; Summary 'failed' @{ reason = 'no app.url' }; exit 1 } $wantKey = 'amd:gfx1201' $wantIdent = 8 diff --git a/tools/ci/ps-drive-ref-check.sh b/tools/ci/ps-drive-ref-check.sh new file mode 100755 index 000000000..0c11a1ed6 --- /dev/null +++ b/tools/ci/ps-drive-ref-check.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# The drive-reference class (6 October 2026): in Windows PowerShell 5.1 a double-quoted string holding `$name:` followed +# by a character that is not a path separator is parsed as a drive-qualified variable (`$name:rest`), which is a parse +# error at script start ("Variable reference is not valid"): the identities job run-ca3-pc1-amd-identities-20261006 +# failed in 0 s on `"... under $appDir: nothing posted"`. Rule: write `${name}:` or `$($name):`. This check fails CI on +# any .ps1 whose double-quoted strings hold `$name:` where name is not a PowerShell scope or drive (env, script, +# global, local, private, using, function, variable, alias, Env). +set -euo pipefail +cd "$(dirname "$0")/../.." +python3 - <<'PY' +import re, subprocess, sys +files = subprocess.check_output(['git', 'ls-files', '*.ps1', '**/*.ps1'], text=True).split() +ok_names = {'env', 'Env', 'ENV', 'script', 'global', 'local', 'private', 'using', 'function', 'variable', 'alias'} +pat = re.compile(r'(?