Repository navigation
fix(minimal): remove the range aliases and resolver dir on macOS undo - #2246
Merged
norrietaylor merged 5 commits intoOct 18, 2026
Merged
Conversation
The macOS undo script left two of the step's artefacts behind: the /etc/resolver directory its mkdir -p created and the /32 lo0 aliases the range unit adds, which stayed until the next boot. Boot the unit out, then take each alias off with a tolerant ifconfig -alias, and rmdir /etc/resolver after removing the resolver file — an empty-only rmdir, so another resolver's file keeps the directory. Both undo tests cover the new lines, and the clean-host run stubs ifconfig too. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
Contributor
…o-leftovers-df5d703da1f0aaaa
…range aliases The running-VM check matches every minvmd process, so the note now asks to stop every VM and end any minvmd left running. Document that the undo removes every alias in the reserved range, and assert that the range unit is booted out before the aliases come off.
Member
|
/review |
1 similar comment
Member
|
/review |
Contributor
|
Approved: no findings at Nothing to do. Clobber: none. Not checked: actual runtime behaviour under a real macOS host, which needs a build. |
Member
|
/review |
norrietaylor
approved these changes
Oct 18, 2026
Member
There was a problem hiding this comment.
Approved on ARCH PASS at fee958c.
norrietaylor
deleted the
inbox-patch/macos-undo-leftovers-df5d703da1f0aaaa
branch
October 18, 2026 07:37
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vRaA
The macOS
min finalize-install --undoscript left two of the step'sartefacts behind: the
/etc/resolverdirectory itsmkdir -pcreated(it removed only the file inside), and the reserved-range
/32aliases the range unit adds to
lo0, which stayed until the nextboot. The script now boots the unit out and takes each range address
off
lo0with a tolerant/sbin/ifconfig lo0 -alias, then removesthe resolver file followed by
rmdir /etc/resolver— an empty-onlyrmdir, so a directory holding another resolver's file stays. Both
steps tolerate what is already gone, keeping the undo idempotent and
clean-host-safe.
The aliases are not pulled from under a running VM: when a VM host
daemon runs (
pgrep -x minvmd), the script leaves them onlo0andprints
note: the loopback IPs boxes use stay on lo0 while a VM is running; stop every VM (run min stop, and end any minvmd process still running), then run min finalize-install --undo again. The checkmatches any
minvmdprocess on the host (another user's VM, a leftover__krun-vmm), whichmin stopalone may not end, so the note says so.The rest of the undo still runs and the script exits 0.
The removal takes off every alias in the reserved range, including one
the range program found already present and skipped; the range is
reserved, so this is documented rather than tracked.
docs/reference/cli-min.mdsays so, and the rationale HTML commentunder spec 18's
--undorequirement is brought in line with therequirement: it now lists the aliases in the reserved range (kept while
any VM runs) and the resolver directory among what the undo removes.
Verification
finalize_install_undo_succeeds_on_a_clean_hoststubspgrep: withit exiting 1 every range alias comes off
lo0(theifconfigstand-in logs each call); with it exiting 0 the note is printed, no
ifconfigcall is made, the resolver file is still removed, and thescript exits 0
finalize_install_undo_removes_what_the_step_installsasserts therange unit is booted out before the running-VM check and alias removal
cargo fmt --all --check --manifest-path target/Cargo.toml— cleancargo clippy --workspace --all-targets --locked --manifest-path target/Cargo.toml -- -D warnings— cleancargo test --locked --manifest-path target/Cargo.toml -p minimal— 523 passed, 1 failed:legacy_network_spellings_parse_with_hint, a pre-existing failure reproduced identically on pristinemain(verified by stashing the change and recompiling); every resolver test passesfinalize_install_undo_removes_what_the_step_installsnow asserts the alias for-loop, the-aliasline and thermdir /etc/resolverline verbatim;finalize_install_undo_succeeds_on_a_clean_hostruns the macOS script end-to-end with anifconfigstand-in and still exits 0cargo run --bin min -- finalize-install --undo --show --scriptrenders a well-formed removal script (the sandbox is Linux, so the rendered arm is the Linux one; the macOS arm is exercised by the tests above)live-session: macos e2e (.github/workflows/ci-macos.yml)
Summary by CodeRabbit
min finalize-install --undonow removes the reserved-range addresses it added to the loopback interface. It also removes the resolver directory when empty.