Repository navigation
Make the bootstrap and the deploy say why they stopped - #416
Merged
Merged
Conversation
Swordlash
pushed a commit
that referenced
this pull request
Dec 2, 2026
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
npm run deploy-local can stop right after "installing or checking GHC and cabal" with nothing more on the screen. One way, reproduced behind a proxy that refuses GitHub: the bootstrap asked cabal path for the index's directory from inside the toolchain's directory. Below a cabal.project (a --prefix inside the checkout), cabal path first clones the project's git packages from GitHub, fails, and wrote its message to the log alone; under set -e the assignment ended the run without a word. cabal path and cabal update now run with -z, so no project is read there, and a failure of cabal path goes through fail. Every step that downloads names the addresses it reaches when it fails, and which proxy variables curl, ghcup, cabal and git read (measured, not assumed). An EXIT trap in the bootstrap, set again inside the subshell that holds the lock, and one in the deploy, catch any other failure nothing explained and name the step, the status and the log. The deploy also says, last, which bootstrap command failed, its status and its log. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
…ssword A probe of --hackage-mirror that reached no server (a proxy refusing the tunnel, which curl reports with the same exit status as a 404) was reported as a mirror without root.json. The probe now reads curl's HTTP status: 404 or 410 is a mirror without the file, 000 is a download that failed, with curl's line and the proxy advice as for any other, and another status is named. Nothing is written in any of these cases. A mirror's URL may carry a user and a password. Every message that names it (the probe, the "written into" line, the advice's addresses, the deploy's last line) prints it through redact_url as https://***@host/; cabal's configuration keeps the URL as given. The advice names the repository cabal really uses: the url its configuration gives hackage.haskell.org (the toolchain's own, or the user's, which cabal path -z --config-file finds), Hackage when there is no configuration yet, and no repository by name when the configuration names no url for it. The maker's downloads after the hand-over (Node in the other modes, the wasm sysroot, Chromium, fourmolu, libsodium) go through several paths, not one function, so they keep showing the step and the log's end; the README and the changelog entry now say which stage gives the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
The advice for cabal's downloads read the url of cabal's configuration and printed it. A quoted url escaped the mask, and CABAL_CONFIG can name another file. The advice now says in words that the step downloads from the repository cabal's configuration names, hackage.haskell.org unless it says otherwise, and leaves the failing address to cabal's and curl's own lines. A --hackage-mirror given on the command line is named by its scheme and host alone (url_host); the deploy's last line shows the option as --hackage-mirror=<the mirror>. A log written by an older bootstrap holds mirror URLs with passwords. Every excerpt of the log the bootstrap shows, and every line it writes to the log, now goes through mask_userinfo, which replaces the userinfo of any scheme://userinfo@ with ***. The log itself is not rewritten. A probe of the mirror answered 407 is a proxy that wants a user and a password: the advice says so instead of blaming the mirror. The lock's descriptor is opened inside the subshell, after its net, so a lock file that cannot be opened is a named step like any other. The test of the user's own cabal configuration failed on CI: its fake cabal answered --config-file from CABAL_DIR, which the workflow exports as the runner's real ~/.cabal. The script no longer asks, and the fake no longer answers it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
Three rounds of review each found the mask of URLs' passwords incomplete (the live output of a long step, the maker's own log excerpt, an apostrophe). This pull request is about saying why a run stopped, so it now prints nothing from the log, a configuration file or the command line's values that main does not already print, and promises nothing about passwords. fail shows the log's end and run and run_long write and tee exactly as on main. The net prints one line, with the step, the status and the log's path, and no excerpt of the log: on main such a stop printed nothing at all. The mirror probe leaves curl's message in the log, where fail's excerpt or the log itself shows it. stop now writes only to stderr: it ends the read-only modes too, and system-tools with a failing ghcup whereis bindir wrote to an existing toolchain directory's log. A test checks that directory is left as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
Four review rounds found faults, nearly all in what this pull request added beyond its purpose: naming the hosts each download reaches, a Hackage mirror's probe told apart by its HTTP status, and the log's end printed on paths where nothing of the log was printed before, where an old run's line can hold a mirror's password. Those are gone. The probe of a mirror is as it was, but for setting spoke so that the net does not speak after its message. A failing cabal path stops with the log's path instead of the log's end. fail is as it was, and a step that downloads adds one fixed sentence about proxy variables. The deploy's last line names the command and the log, and no option's value. What stays: cabal path and cabal update with -z, the EXIT trap that names the step, the status and the log once when nothing else spoke, and stop for the exits that were bare. A test seeds a line in the log and checks that the probe's failure, cabal path's failure and the net print none of it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
The four exits that said why on main (missing commands twice, missing Debian packages, and the check for x86_64 Linux) printed on stdout and wrote to the log. They stay as they were, with spoke set so that the net does not speak after them. stop is left for the exits that were bare on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
Swordlash
force-pushed
the
bootstrap-says-why
branch
from
December 2, 2026 19:30
f389037 to
5a30715
Compare
A deploy whose prefix could not be made said it stopped while loading the toolchain's environment, and the bootstrap stopped before its log existed with no step named and a log it never wrote. The deploy now sets its step before each stage-one operation: the name and the prefix, the state, the toolchain's directory, the status report, claiming the prefix, the bootstrap, loading the environment and the maker. The bootstrap names its steps from the start, and its net names the log only after this run has written its first line there. The deploy cannot see whether the bootstrap got that far, so its last line says where the log is if one was written. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM
Swordlash
enabled auto-merge
December 3, 2026 08:48
Swordlash
disabled auto-merge
December 3, 2026 08:48
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.
The local deploy and the toolchain's bootstrap never stop without saying why. The owner ran
npm run deploy-localat work; it printed "installing or checking GHC and cabal, which build the deploy's maker (toolchain/bootstrap.sh maker)" and ended with nothing more. The cause was his network (a proxy, GitHub not reached). His words: "powinniśmy coś wypisywać".What was silent
update_cabal_indexassigned fromcabal path --remote-repo-cachewith its errors sent to the log. When the toolchain's directory lies below acabal.project(a deploy's--prefixinside the checkout),cabal pathfirst clones the project's git packages; behind a proxy that refuses GitHub the clone fails, andset -eended the run after the deploy's one line (status 128).GHCUP_BIN=$(ghcup whereis bindir)for a ghcup on the PATH;awk … >tmp && mvinhackage_config, which went on and said the mirror was written when awk had failed.cabal update, the maker's build, a proxy that refuses everything, an address where nothing listens.Whether the reproduced path is the owner's is not confirmed: it needs GHC and cabal present and a
". Whatever his was, a stop now names its step and shows the log's end.cabal.projectabove the toolchain's directory, and the line he quoted has no ", underWhat is built (as cut down after round 4; the rounds below tell how it got here)
cabal path -z -v0andcabal update -zread no project (cabal 3.12, the floor, has-z); a failingcabal pathstops with a message and the log's path.trap net EXITinbootstrap.sh, set again inside the subshell that holds the lock, which opens the lock's file after the trap. A non-zero exit that nothing explained prints one line with the step (current_step, set byrun,run_longand the main phases), the status and the log's path, and no excerpt of the log. It is silent on a zero exit, forready,checkandsystem-tools, after an exit that already spoke, and on usage errors.stop(a message on stderr, nothing written to the log) only for the two exits that were silent onmain:ghcup whereis bindirandcabal path. The exits that already spoke onmainkeepmain's lines and only mark that they spoke.failas onmain, and for a step that downloads (the ghcup download, ghcup's installs,cabal update, the maker's build, the Node download) one fixed sentence after it: that a proxy or a firewall may be in the way if the lines above show a refused or failed connection, and that curl, with which ghcup and cabal download here, and git readhttps_proxyorHTTPS_PROXY,http_proxyin small letters only, andALL_PROXY. No address, no mirror, no status in it.deploy-local.shhas the same net (diemarks that it spoke,deploy_stepnames the phase), and when the bootstrap fails its own last line says so with the script and mode, the status and the log's path, and no option's value.mainprints it (run,run_long, the two checksum checks, finding the maker's binary) and nowhere else; the mirror's probe ismain's code with one mark added.Known and left
maker/src/Maker/Store.hsrunscabal updatein the state directory without-z: it prints its failure, but the same project is read there.failshows and in a long step's live output, as onmain; the maker's own failure shows the log's end too; the deploy's--statusprints the stored mirror and npm registry in full; the usage error for a malformed--hackage-mirrorechoes the value. This pull request changes none of that and promises nothing about passwords: masking them everywhere is a package of its own.Tests
toolchain/test-bootstrap.sh: each kind of failing step gives a non-zero status and a message naming the step and the log; a download's failure adds the one sentence; a failingcabal pathspeaks once and shows no log; a silently failingmvmakes the net print exactly its one line; the net is silent on success, onreadynot ready, a blockedcheck, too-old system tools and usage errors; a directory at the lock's path gives one line;system-toolswith a failingghcup whereis bindirwrites nothing; the fake cabal refusespathwithout-z. A line seeded into the log beforehand appears in the output of none of the probe's failure,cabal path's failure and the net (shown failing with each made to print the log).toolchain/test-deploy-local.sh: a fake bootstrap failing with status 3 gives status 3 and the deploy's line last, with a mirror's password given on the command line appearing nowhere; a silently failing env mode gives one net line; a refused move adds none.Verification
Run locally:
test-bootstrap.sh(47 cases),test-deploy-local.sh(144 deploy, 11 deploy-server, 12 static), the wizard's part oftest-configure.sh(26),format,lint, shellcheck (no new finding againstmain). No Haskell is touched. The reproduction before and after, through a small CONNECT proxy and a toolchain home under a scratch directory, never the real one.Codex
root.json, without curl's error or the proxy advice. (2) A mirror's URL with credentials was printed whole in the new messages. (3) The downloads the maker makes after the hand-over (Node inbuildandstatic, and the rest) do not get the advice the README's paragraph promises. (4) The advice named public Hackage also when cabal's configuration names another repository.Round 1's fixes (38bbcc1). (1) The mirror's probe reads curl's HTTP status: a 404 or 410 says the mirror has no
root.json, with the sentence about Hackage's signed metadata; no answer at all (a proxy's refusal gives curl the same exit status as a 404, and the status 000) goes throughfailas any download does, with curl's own line and the proxy advice; nothing is written to cabal's configuration either way. (2)redact_url(scheme://***@host…) wherever a mirror's URL is printed or logged by these scripts; cabal's configuration keeps the real one; curl itself prints no userinfo on a refused connection, a 403 or a 404 (checked). The usage error for a malformed--hackage-mirrorand the deploy's--statusline, which this pull request does not touch, still print the value as given. (3) The README's paragraph and the changelog entry are narrowed instead of the maker being changed: the shell's stage gives the advice (ghcup, GHC and cabal through ghcup, cabal's index, the mirror's probe, the maker's build, Node in thenodemode); the maker's later downloads have no one function to carry it (some go through its fetch, others through its run helpers or git) and name the step and show the log's end. (4)hackage_reachnames the url cabal's configuration gives Hackage's repository, redacted: the toolchain's own under a named base, otherwise the user's (cabal path -z --config-file); public Hackage only when that is the url or no configuration exists yet. Run locally:test-bootstrap.sh(47),test-deploy-local.sh(144, 11, 12), the wizard's part (26), shellcheck againstmain,format,lint. One case oftest-deploy-local.sh(97,--refresh-page, the maker's page download from the cache, code this pull request does not change) failed once in a run with the wizard and passed in the rerun; the test prints no output for it, so the reason is not known.Round 2's fixes (87f2153), by narrowing. The advice no longer reads cabal's configuration and prints no URL from a file: for cabal's steps it says the step downloads from the repository cabal's configuration names, hackage.haskell.org unless that says otherwise, and that the lines above name the address that failed; a mirror given on the command line is named by scheme and host alone (
url_host, tested with userinfo, a port, quotes, an IPv6 literal, and values it must refuse), or not at all; the deploy's last line shows--hackage-mirror=<the mirror>.mask_userinfomasks userinfo in every excerpt of the log shown and in every line these scripts write to the log from now on; the log already written is not rewritten. Its test seeds a log with lines an older bootstrap wrote, makes two unrelated steps fail and finds the password on neither stream; with the filter made a no-op the test fails. A probe answered 407, by the proxy for anhttp://mirror or in the tunnel to anhttps://one, gets the proxy advice and a sentence that the proxy wants a user and a password. The lock's file is opened inside the subshell after its trap is set; a directory at its path gives one line naming the step. CI's failure on 38bbcc1 was the removed case: the fake cabal answered withCABAL_DIR's configuration, which the workflow sets to the runner's real home. Left unchanged, outside this diff: the usage error for a malformed--hackage-mirrorechoes the value, the deploy's--statusprints the stored mirror in full, and the maker's own failure shows its log's end unmasked. Run locally:test-bootstrap.sh(48, also withCABAL_DIRexported as on the runner),test-deploy-local.shwith the wizard (26, 144, 11, 12), shellcheck againstmain,format,lint.maindoes not already print.failshows the log's end as onmain; the net's line gives the step, the status and the log's path with no excerpt;stopwrites nothing to the log.Round 3's fixes (f389037).
mask_userinfoand its tests are gone, with the sentences about masking in the README and the changelog;fail,say,runandrun_longprint, write and tee as onmain; the probe no longer prints curl's line itself (it goes to the log, andfailshows the log's end as for any step). The net prints one line and no excerpt, for examplebootstrap: stopped while writing the environment file /home/me/.wiki-toolchain/env (status 1) without saying why; the end of its log, /home/me/.wiki-toolchain/bootstrap.log, may say more.stopwrites to stderr only:system-toolswith a failingghcup whereis bindirand an existing toolchain directory leaves everything byte for byte as it was (tested). Read againstmain: beside fixed words, steps' names, statuses and paths, the added lines print the pinned ghcup and Node addresses, a command line's mirror by scheme and host wheremainprinted the whole URL, and whatmainalready printed. Run locally:test-bootstrap.sh(48, also withCABAL_DIRexported),test-deploy-local.shwith the wizard (26, 144, 11, 12), shellcheck againstmain,format,lint.fail, which shows the log's end on a path wheremainshowed none; the hint about--hackage-mirroris given in modes that do not take the option; a 403 for anhttp://mirror gets no proxy advice. Four rounds have each found faults in the advice and the probe's special cases, so they are being cut: the probe goes back tomain's code, the advice becomes one fixed sentence with no address, mirror or status in it, and nothing prints the log's end wheremaindoes not. What stays is the purpose: cabal reading no project above the toolchain's directory, the net,stop, and the deploy's last line.Round 4's cut (5a30715, rebased onto
main). The diff againstmainwent from 637 added lines to 407. Removed: the lists of addresses, the naming of a mirror's host, the hint about--hackage-mirror, the probe's cases by status (404, 407, no answer), their tests;hackage_configismain's again with one mark. "What is built" and "Tests" above describe the pull request as it is now. Run locally:test-bootstrap.sh(47, also withCABAL_DIRexported),test-deploy-local.shwith the wizard (26, 144, 11, 12), shellcheck (the same findings asmain),format,lint.Round 5's fixes (9a6c6fe). The deploy sets its step before every operation from the end of option parsing to the maker's start (claiming the prefix among them); the bootstrap names a step from the moment its net is set; the bootstrap's net names the log only once this run has appended its header to it, and the deploy's last line says "its log, if it got as far as writing one, is …". Tests: a directory at the log's path (the net names the step and no log); a prefix whose parent is not writable (the deploy's net names claiming the prefix); the deploy's last line for a bootstrap that failed before logging. Run locally:
test-bootstrap.sh(47, also withCABAL_DIRexported),test-deploy-local.shwith the wizard (26, 144, 11, 12), shellcheck (the same findings asmain),format,lint.check,ready) mark that they spoke before they run, so an unexpected failure inside one (a helper'snode -eexiting with a status of its own) still ends without a line. (2) When writing the environment file fails in thenodemode, the net names installing Node. (3) Whenbootstrap.sh envhas explained its own failure, the deploy's net adds a line saying the deploy stopped without saying why.(rounds are added here)
🤖 Generated with Claude Code
https://claude.ai/code/session_01HnFn8HVAncUyJ6jU4yhnRM