Repository navigation
Conversation
…paths On Windows the update notice said "run 'proofline update'", but that command could never work there. It looked for the Unix installer folder ($HOME/.local/bin or PROOFLINE_INSTALL_DIR) and a binary called "proofline" without ".exe". So it failed with "set HOME or PROOFLINE_INSTALL_DIR", or with "this binary is outside the installer directory", even when PROOFLINE_INSTALL_DIR was the folder holding proofline.exe. It never showed the manual steps from the README. On Windows, install() now stops before any path check or download. It returns an error that lists the README's steps: close Proofline, download proofline-x86_64-pc-windows-msvc.tar.gz and SHA256SUMS from the latest GitHub release, check the hash with Get-FileHash, extract the archive and replace this binary (its path is printed). The exit status stays non-zero because nothing was updated. The Windows notice now says "'proofline update' shows how to install it". Linux and macOS behave exactly as before. Tests: windows_update_explains_the_manual_steps (tests/update.rs, Windows only, runs the real binary from a README-style folder with and without HOME) fails on main and passes now. windows_notices_point_to_the_manual_steps (src/update/tests.rs, runs on every OS) checks both notice texts and the steps.
…fely Proofline review, round 1: - Extracting with 'tar -xzf' in the current folder could overwrite the installed proofline.exe (and leave it broken if interrupted). The steps now extract into a new 'proofline-new' folder and replace the binary only after that succeeded. - The notice's version comes from https://proofline.sh/cli/latest, which the release workflow publishes before GitHub marks the release as latest, so 'releases/latest' could still be the old version. When the local cache holds the newer version the notice showed, the steps now link to that version's pinned downloads on proofline.sh (the same files the Unix updater verifies). Still no network call. - When the binary's own path can't be read, the steps say how to find it: '(Get-Command proofline).Source'. - Tests: the cached-discovery test now accepts the Windows wording; a new assertion checks that suggestion() picks the platform's wording; the Windows integration test also covers the pinned links and checks for the exact old error instead of any "HOME".
Proofline review, round 2: - Without a cached newer version, the steps point to GitHub's latest release, which may not be newer than the running binary. They now print this binary's version and say to stop if the release isn't newer. - In PowerShell, 'mkdir proofline-new; tar ...' runs tar even when mkdir failed because the folder exists, so an older staged copy could be reused. Creating the empty folder is now its own step (pick another name if it exists), before extracting. - The cached-discovery test now rejects any "is available;" notice before the refresh, not only one for 9.0.0.
This branch has not been deployed
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.
Fixes #83
The problem in one sentence
On Windows the CLI tells you to run
proofline update, but that command always fails there, with errors that send you the wrong way, and it never shows the manual update steps the README describes.Why it happens, step by step
suggestion()(src/update.rs) printsproofline X is available; run 'proofline update'on every OS.proofline updatecallsinstall(). Its first step,destination(), looks for the Unix installer folder:PROOFLINE_INSTALL_DIR, or else$HOME/.local/bin. A normal Windows PowerShell has noHOMEvariable, so the command stops withset HOME or PROOFLINE_INSTALL_DIR.HOMEorPROOFLINE_INSTALL_DIRset,install_path()expects<folder>/proofline, with no.exe. The Windows binary isproofline.exe, so this check can never pass, and the error says the binary is "outside the installer directory", even when that folder is the one holding it.target()would say "no official Proofline release is built for windows", which is false: every release shipsproofline-x86_64-pc-windows-msvc.tar.gz.Who is affected
Everyone who installed the official Windows release. They see the notice on every interactive command until they update, and the command it names can't help them.
What this PR changes (
src/update.rs, ~50 lines)install(): on Windows it now stops first, before any path check or download. It returns an error that lists the README's steps:SHA256SUMS.Get-FileHash -Algorithm SHA256.mkdir proofline-new, another name if it already exists).tar -xzf … -C proofline-new), so an interrupted extract can't damage the installed copy.current_exe(). If the path can't be read, the step says to find it with(Get-Command proofline).Source.The exit status stays non-zero because nothing was updated, so a script doesn't think the update worked.
Which download links: the notice's version comes from
https://proofline.sh/cli/latest, andrelease.ymlpublishes that file before GitHub marks the release as latest. If the local update cache holds a newer version (the one the notice showed), the steps link to that version's pinned files,https://proofline.sh/cli/download/<version>/…, the same files the Unix updater verifies. Otherwise they point to the GitHubreleases/latestpage and print this binary's version, with "stop if that release is not newer", so nobody downgrades by accident. The cached value has already passedversion()(only digits and dots) before it goes into a URL.notice(): the notice text moved into a small function. On Windows it readsproofline X is available; 'proofline update' shows how to install it. On Linux and macOS it is the same text as before.windows_steps(): builds the steps text. It is a plain function, so its test runs on Linux CI too.Linux and macOS behave exactly as before.
destination(),install_path()andtarget()are unchanged.Why not the obvious alternatives
.exe, so this needs a rename-aside step, cleanup on the next start, and zip/tar handling. That's a feature with its own risks, and the README says self-update doesn't install Windows binaries, so it should be the maintainer's call (offered in the issue).proofline updatewould still get the misleading errors.How I tested it (Windows 11, Rust 1.100.0)
Reproduced first on
main(105f387), withproofline.execopied into a folder as the README says:mainHOME)set HOME or PROOFLINE_INSTALL_DIRhttps://proofline.sh/cli/download/9.0.0/…, exit 1HOME=%USERPROFILE%…outside the installer directory C:\Users\…\.local/bin…PROOFLINE_INSTALL_DIR=<the folder holding proofline.exe>…outside the installer directory <that same folder>…proofline 9.0.0 is available; run 'proofline update'proofline 9.0.0 is available; 'proofline update' shows how to install itThe notice only appears when both output streams are a console, so I ran the binary in a new PowerShell window and read its screen buffer (
$host.UI.RawUI.GetBufferContents).The printed steps work: I followed them for v0.5.2 from both sources, GitHub
releases/latestand the pinnedhttps://proofline.sh/cli/download/0.5.2/….Get-FileHashgavee5631d11…500a, which matches its line inSHA256SUMS.mkdir proofline-newthentar -xzf … -C proofline-newexited 0, andproofline-new\proofline.exe --versionprintsproofline 0.5.2.New tests, written before the fix:
tests/update.rs::windows_update_explains_the_manual_steps(Windows only): runs the real binary from a README-style folder, with and withoutHOME, and with a cached newer version. It checks that the update fails, prints nothing on stdout, names the right download links,SHA256SUMS,Get-FileHash, the new-folder extract and the binary's own path, never shows the oldset HOME or PROOFLINE_INSTALL_DIR/ "outside the installer directory" errors, and leaves the binary untouched. Fails onmain(…missing from proofline: set HOME or PROOFLINE_INSTALL_DIR), passes now.src/update/tests.rs::windows_notices_point_to_the_manual_steps(every OS): checks both notice texts (the Unix one is unchanged), thatsuggestion()picks the wording of the platform it runs on, and the steps with and without a known path and version. Mutation check: hard-coding the Unix wording insuggestion()makes it fail.detached_discovery…now expects the platform's notice text after the refresh, and no notice of any version before it. It times out on Windows because of the pipe issue that Windows: don't make scripts wait for the background update check #79 fixes. With Windows: don't make scripts wait for the background update check #79 merged into a throwaway branch, all ofupdate::tests(9/9) passes on Windows.cached_update_preserves_schema_help_and_source_installationstill passes. On Windows the update still fails, prints nothing on stdout and leaves the files untouched.Whole suite:
cargo fmt --checkclean.cargo test --locked --no-fail-fastgives the same 8 failures onmainand on this branch, none of them about the update command's output:tests/mcp.rs(5),tests/agent_install.rs,tests/local_patch.rsandupdate::tests::detached_discovery…(the Windows pipe issue fixed in #79).cargo clippy --all-targetsreports the same 3 errors as onmain, all insrc/agent/tests.rs, which this PR doesn't touch.Proofline review log
Fork review PR: Ahmar004#3 (2 rounds, the cap for this contribution). 12 findings: 9 fixed, 3 accepted risk (all "CI doesn't run the Windows tests", which needs a workflow change and so an issue, per the README).
tar -xzfin the current folder can overwrite the installedproofline.exe92a28dd: extract intoproofline-new, replace only after successdetached_discoverytest still wants the Unix wording92a28dd; 9/9 with #79 mergedcurrent_exe()fails92a28dd:(Get-Command proofline).Sourcereleases/latestcan be older than the version in the noticerelease.ymlpublishescli/latestbeforegh release edit --latest.92a28dd: pinned proofline.sh links from the cached versionmain, GREEN here.suggestionalways used the Unix wording92a28dd, mutation-checked!stderr.contains("HOME")fails if the temp path containsHOME92a28dd: checks the exact old errormkdir proofline-new; tar …still extracts when the folder already existsaf2f6b2: separate "create an empty folder" stepaf2f6b2: prints this version, "stop if not newer"9.0.0noticeaf2f6b2: rejects anyis available;