Repository navigation
gawk, gawk-bootstrap: stop installing the same paths (#973) - #1560
Draft
bryan-minimal wants to merge 1 commit into
Draft
bryan-minimal wants to merge 1 commit into
bryan-minimal wants to merge 1 commit into
Conversation
gawk-bootstrap now ships only usr/bin/awk (a real binary, not upstream's awk -> gawk symlink). gawk ships every other gawk path, drops its own awk symlink, and takes awk from gawk-bootstrap through runtime_deps. The two packages no longer share any path, so a box holding both (any test or build sandbox with base-bootstrap plus gawk) gets one deterministic copy of each file instead of ~800 "Not linking ... already exists" warnings. base-bootstrap keeps an `awk` on PATH for every build; gawk's consumers (base, xdg-utils, check, tests) keep both `gawk` and `awk`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
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 #973.
What changes
gawk-bootstrap/usr(82 files)usr/bin/awk, a real binary (install -D gawk usr/bin/awk, not upstream'sawk -> gawksymlink)gawkusr/bin/awk -> gawksymlinkusr/bin/awk. It gainsgawk-bootstrapinruntime_deps, which suppliesawkThe two packages now share no path. A box that holds both, such as any build or test sandbox with
base-bootstrapplusgawk, gets one copy of each file, so the result no longer depends on which store entry was linked first. Under registry-model.md §12 (gominimal/arch#183) the pair no longer conflicts.A new standalone test,
gawk.awk_smoketest(/bin/awk --version), checks thatgawkstill providesawkthrough its runtime dep.What the two packages actually ship (cached amd64 artifacts)
I compared the cached artifacts from
gs://minimal-staging-cache: gawk-bootstrap with spec6802ed7b…, artifactacbd19be…, and gawk with spec8f286b40…, artifact2d059102….usr/bin/gawkandusr/bin/gawk-5.4.1differ in content. The readline build is 1,384,408 bytes and the bootstrap build is 1,374,320 bytes. The extension.sos,libexec/awk/{grcat,pwcat}, headers, man pages and locales are byte-identical.usr/bin/awkis a symlink togawkin both packages. So in a mixed box, whichevergawkis linked first decides whatawkruns.Who consumes gawk-bootstrap, and how they run awk
grep -l gawk-bootstrap/build.ncl packages/*/build.ncllists 19 packages:base-bootstrap(runtime_deps). This is the edge that matters: it puts gawk-bootstrap into every build sandbox in the repo.build_depsof 18 early-graph packages: acl, attr, bash-bootstrap, binutils, coreutils, diffutils, file, findutils, gcc, gmp, grep, libarchive, make, mpc, mpfr, pcre2, perl, sed. All except libarchive and perl have areplace_on_cyclegen-13 prebuilt breaker.test_deps:coreutils.wc, which runs bareawk '{print $1}'.How they use it: none of these recipes'
build.shnamesawkorgawk. They reach awk only through upstream autotools and Makefiles, which take$AWKfromAC_PROG_AWK. That macro probesgawk mawk nawk awkonPATH, so after this change it findsawk, which is the same gawk 5.4.1 binary. Across all ofpackages/*/build.shthere is one explicitgawkcall, in wget's CVE test, and wget depends onbase, which brings in the realgawk. Nothing uses/usr/bin/awkas an absolute path.gawkconsumers (8): base, check, xdg-utils (runtime); bash, glibc, redis (build); chromedriver-bin and ngspice (test_deps, both run bareawk). All of them still get bothgawkandawk.Why this layout and not the others
awkmust stay onPATHin every build sandbox, and the only package that can provide it there is gawk-bootstrap:base-bootstrapcannot depend on the realgawk, becausegawkbuilds withbase-bootstrap(a cycle). The sandbox has no per-packagePATHor env hook, so the awk has to sit at/usr/bin/awk. Exactly one package can own that path, so it goes to gawk-bootstrap, and gawk-bootstrap ships nothing else./usr/bin/awk) would takeawkaway from every build sandbox. This would break most autotools builds at configure time or, worse, whenconfig.statusruns.runtime_deps(option 2) doesn't apply: the main edge isbase-bootstrap's whole-package runtime dep. Session boxes also link the whole package regardless ofsubsetOf(min 0.8).base-bootstrapand for the 16 consumers that carry breakers. libarchive and perl could switch, but nothing would change, becausebase-bootstrapstill puts gawk-bootstrap into their sandboxes. So switching consumers can't remove the overlap. Only changing what the two packages ship can.The new
gawk -> gawk-bootstrapruntime edge adds no new cycle. gawk-bootstrap's closure already reaches gawk through glibc (glibc builds with gawk), and that cycle is already broken by glibc's bedrock breaker.Trade-offs and risks
base-bootstrap's, so every package's build hash changes. This is unavoidable for any fix that touches gawk-bootstrap. Expect a full world rebuild in build-bot and one merge-queue window.gawkis no longer a name in bootstrap-only build sandboxes. An upstream build that callsgawkby name (rather than$AWKorawk) and doesn't importgawkwill now fail withgawk: command not found. No recipe here does that, but upstream Makefiles can't all be audited from this repo, so the world rebuild is the real test. The fix for any hit is to addgawkto that package'sbuild_deps, as redis did in redis: declare gawk build dep (fixes 'awk: command not found') #542..sos,usr/share/awklibrary scripts and locales. That matters only for builds that use@load/-l, or@include/-i, with a bundled library. None was found.awk(notgawk) is now the non-readline build wherever the real gawk is installed. The only difference is line editing in the interactive debugger (awk -D).gawkitself is still the readline build.gawk-bootstrap (prebuilt)breaker is unchanged. It still ships the old fullusr/**layout. It only stands in for gawk-bootstrap inside gawk-bootstrap's own cycle, where the realgawkis not present, so it doesn't reintroduce the overlap. Re-cutting it in gominimal/bootstrap is a separate, optional step.🤖 Generated with Claude Code