Skip to content

fix(choco): export the MSI install directory to the job PATH - #30

Open
ronaldtse wants to merge 6 commits into
mainfrom
fix/choco-msi-path
Open

ronaldtse wants to merge 6 commits into
mainfrom
fix/choco-msi-path

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Fixes the fleet-wide red Windows legs: Unable to locate executable file: metanorma.exe (metanorma/packed-metanorma#274).

Since the 1.17.0 Chocolatey package switched Windows installs to the packed-metanorma MSI (packed-metanorma#259), the generate workflows of every mn-samples repository fail on windows-latest:

  • the MSI adds its install directory to the machine PATH,
  • each Actions step is a fresh process that inherits the environment captured at job start, so that PATH change is invisible to every later step,
  • ChocoInstaller exported nothing, so the setup step reported success while the binary stayed unreachable.

The fix: after a successful choco install metanorma, query the Windows uninstall registry for the Metanorma entry's InstallLocation and export it via core.addPath, covering both flat and bin-subdirectory MSI layouts (with a warning fallback if no entry is found).

Validated: npm run build (tsc + esbuild) and the full vitest suite (12 files, 138 tests) pass. The repo's integration-test / idempotency-test Windows workflows exercise the choco path end-to-end on real runners.

Cut as 3.1.1 (patch); v3 needs re-pointing after release so the fleet picks it up.

The 1.17.0 Chocolatey package switched Windows installs to the packed-metanorma MSI (metanorma/packed-metanorma#259). The MSI adds its install directory to the MACHINE PATH, which later workflow steps never see - each Actions step is a fresh process inheriting the environment captured at job start - so every mn-samples generate workflow fails on Windows with 'Unable to locate executable file: metanorma.exe' (packed-metanorma#274).

Query the Windows uninstall registry for the Metanorma entry's InstallLocation after a successful choco install and export it via core.addPath, covering both flat and bin-subdirectory MSI layouts.
…Location

The tebako MSI's uninstall entry carries no InstallLocation, so the registry lookup found nothing on real runners. Fall back to a bounded metanorma.exe search over the per-machine Program Files roots, which is where the packaging installs.
…trap seed

The MSI appends <install>\\bin and <install>\\home\\shims to the machine PATH and creates the metanorma shim through bootstrap-seed.cmd, a quiet custom action whose failure is swallowed. Read the InstallDir value the MSI itself records under SOFTWARE\\Metanorma\\metanorma, re-run the idempotent seed, and export both directories to the job PATH.
The seed script's tebako steps have no error handling and it always exits 0, so a failed 'tebako install metanorma' left an empty shims directory that looked healthy. Log the seed's captured output and warn when the metanorma shim is missing after the run.
@ronaldtse

Copy link
Copy Markdown
Contributor Author

Attribution of the remaining red legs (none are caused by this change — the choco path this PR touches is verified working in the CI logs):

  • Test Idempotency Windows / Native Package Windows: the bootstrap-seed.cmd shipped in the packed-metanorma v1.17.0-1 MSI fails on every machine — tebako install metanorma dies with runtime "java@21.0.12;tebako=2.8.50-temurin;image" is pre-era — no readable release index for it (tebako-runtime-openjdk v2.8.50 was built by the pre-contract factory). The shims directory is created empty, so metanorma cannot resolve anywhere. Full evidence and fix options in Chocolatey package 1.17.0 (MSI): metanorma.exe not on PATH for later GHA steps — Windows generate legs red fleet-wide metanorma/packed-metanorma#274. This PR makes that failure loud (logs the seed output, warns when the shim is missing) instead of silent.
  • Compile/Site windows-latest gem: metanorma-ogc 2.10.0 (released stable) ships a lib/relaton/render shadow that breaks under relaton-render 3.x (uninitialized constant Relaton::Render::Parse). The stable wave cutting 2.10.1 (shadow-free) clears these; they pass with the candidate line.
  • Compile/Site macos/ubuntu and Docker Gem legs: these integration workflows have not run on a PR since February 2026 (no main-branch runs either); the same legs fail on a Windows-only-no-op diff, indicating long-standing environmental rot in those workflows.

What this PR delivers today: correct PATH export of the MSI's bin and home/shims directories, re-running of the idempotent seed, registry-based install-dir discovery, and loud diagnostics for the shim failure — so the Windows legs go green the moment packed-metanorma republishes a fixed MSI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant