Stop reporting an unknown Windows architecture as unsupported - #99
Merged
Merged
Conversation
install.ps1 compared the .NET architecture probe straight to 'X64', so a session where the probe returned nothing and a real Arm64 machine both threw `Only Windows x64 has a prebuilt Wayfinder bundle.` The reporter in #98 was on Windows x64: an interactive Windows PowerShell 5.1 session returned nothing from [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture, and the installer answered by naming the one thing that was not wrong with their machine. The same install worked under -NoProfile. Detection now follows what the installers people copy already do. The probe is wrapped in try/catch, as cargo-dist's generated installer.ps1 does, because the API is absent before .NET 4.7.1; an empty result means unknown, not unsupported. It then falls back to the environment the way dotnet-install.ps1 does, preferring the machine scope, which reports the hardware even inside an emulated process where the process variable claims AMD64 on an Arm64 box. Nothing assumes an architecture, so the two cases now read differently: an indeterminate probe says so and prints the clean-session command, and a detected machine is named. Three consistency fixes come with it. The architecture and tar checks run before any network call, as install.sh, rustup and cargo-dist all check the platform first. Windows PowerShell 5 hosts get the TLS 1.2 idiom Deno, Scoop and Chocolatey use, gated on PS 5 because it outlives the script; without it an older host fails the download with a transport error that says nothing. install.sh names the machine it detected, for the same reason the Windows message does, and its two leftover single-item `for name in wayfinder` loops are flattened. Testing follows the same split the reference installers use: run the real script on a real runner. The new Installer scripts workflow parses install.ps1 under both pwsh and Windows PowerShell 5.1 and runs tool/test_install_arch.ps1, and shellcheck-lints install.sh and runs tool/test_install_platform.sh. Both tests substitute the detection call in a copy of the installer, assert every substitution matched so they cannot pass vacuously, and stop at a check that precedes the first download, so they need no release archive and no network. The cases that must clear the gate set an unusable WAYFINDER_VERSION and expect its rejection as proof. tool/verify_installer.ps1 adds the #98 session end to end: an emptied probe installs the archive CI just built and indexes with it. A .NET static property cannot be shadowed the way that harness shadows Invoke-WebRequest, which is why the substitution approach exists. tool/ci/verify-installer.sh is deleted. Nothing referenced it, and it asserted OKF_VERSION pins and okf/okfp binaries that install.sh stopped having at the rename, so it would fail on its first line if anything ran it.
WAYFINDER_SKILLS and WAYFINDER_INSTALL_ROOT were still checked after the latest-release lookup, so a typo in either cost a round trip before the installer said so, while install.sh rejects both before it touches the network. The architecture and tar checks moved above that lookup in the previous commit; these two finish the job, and the installers now agree: machine, tools and caller input first, network second. tool/test_install_arch.ps1 sets WAYFINDER_INSTALL_ROOT for the same reason it sets WAYFINDER_VERSION. Its cases prove they cleared the architecture gate by the version rejection that follows, and that rejection now sits behind an installation-root check that would otherwise read the host's LOCALAPPDATA.
4 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
tool/install.ps1compared the .NET architecture probe straight to'X64', so a session where the probe returned nothing and a real Arm64 machine produced the identical throw:Only Windows x64 has a prebuilt Wayfinder bundle.The reporter was on Windows x64 — an interactive Windows PowerShell 5.1 session returned nothing from[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture, and the installer answered by naming the one thing that was not wrong with their machine. The same command worked under-NoProfile.Architecture detection follows the established convention. The probe is wrapped in
try/catch, as cargo-dist's generatedinstaller.ps1does (the API is absent before .NET 4.7.1); an empty result now means unknown, not unsupported. It falls back to the environment the waydotnet-install.ps1does, preferring the machine scope, which reports the hardware even inside an emulated process where the process variable claimsAMD64on an Arm64 box. Nothing assumes an architecture, so the two failures read differently:-NoProfilecommand;Windows Arm64 has no prebuilt Wayfinder bundle; only Windows x64 has one.Both installers now share one shape. The architecture and
tarchecks moved before any network call, and so did theWAYFINDER_SKILLSandWAYFINDER_INSTALL_ROOTchecks, which sat after the latest-release lookup — so a typo in either cost a round trip before the installer said so. Machine, tools and caller input first, network second, matchinginstall.sh, rustup and cargo-dist. Windows PowerShell 5 hosts get the TLS 1.2 idiom Deno, Scoop and Chocolatey use, gated on PS 5 because it outlives the caller's session — without it an older host fails the download with a transport error that says nothing.install.shnow names the machine it detected (Darwin-x86_64 has no prebuilt Wayfinder bundle; ...), for the same reason the Windows message does, and its two leftover single-itemfor name in wayfinderloops are flattened.Tests follow the same split the reference installers use — run the real script on a real runner:
Installer scriptsworkflow, on every PR touching the installers. It parsesinstall.ps1under bothpwshand Windows PowerShell 5.1 and runstool/test_install_arch.ps1; on Ubuntu it shellcheck-lintsinstall.shand runstool/test_install_platform.sh. No release archive, no network, about a minute.tool/test_install_arch.ps1— empty probe falls through to the environment (the Windows install script throws "Only Windows x64 has a prebuilt Wayfinder bundle" on genuine x64 machines when run in an interactive session #98 regression),AMD64normalizes to x64, anArm64probe and anARM64machine environment are both refused by name, and nothing-to-go-on reports indeterminate.tool/test_install_platform.sh— unsupported machines are named, and both published platforms clear the gate.tool/verify_installer.ps1— the Windows install script throws "Only Windows x64 has a prebuilt Wayfinder bundle" on genuine x64 machines when run in an interactive session #98 session end to end: an emptied probe installs the archive CI just built and indexes with it.Both new test scripts substitute the detection call in a copy of the installer and assert every substitution matched, so they fail loudly instead of passing vacuously if the installer is rewritten. Each case stops at a check that precedes the first download; cases that must clear the gate set an unusable
WAYFINDER_VERSIONand expect its rejection as proof. A .NET static property cannot be shadowed the wayverify_installer.ps1shadowsInvoke-WebRequest, which is why the substitution approach exists at all.Also removed:
tool/ci/verify-installer.sh— unreferenced, and it assertedOKF_VERSIONpins andokf/okfpbinaries thatinstall.shstopped having at the rename, so it would fail on its first line if anything ran it. Say the word if you would rather keep it.Linked issue
Closes #98
If this changes the profile
Not applicable — no profile change.
If this changes a rule the skills restate
Not applicable — no rule change. The installer URLs and messages the docs quote were updated in
docs/install.md.Checks
wayfinder validateexample gate pass — not run: no Dart, pubspec or example changed. CI runs them here regardless.Verification
Locally:
sh tool/test_install_platform.shpasses,shellcheck --shell=shandsh -nare clean on both POSIX scripts,actionlintis clean on all workflows, andtool/ci/verify-installer-pins.shpasses. There is no PowerShell on this machine, so the Windows jobs in this PR are the first execution — and first syntax check — of the PowerShell changes. That gap is exactly what the new workflow closes going forward; I am watching the run and will push fixes if it trips.An open question for the reporter, which the fix does not depend on: running the diagnostic snippet from the issue thread would confirm why their session's probe came back empty.