Install without root, and keep the commit in the container #96
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-agent-ac43519e3623ff416"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes
4876fba0and7156e09a— two packaging defects that both make thedocumented path the wrong one.
4876fba0—make installneeded rootPREFIXnow defaults to$HOME/.local.sudo make install PREFIX=/usr/localis still the system-wide install, and the README documents the command that
works with the system one as a named variant rather than the default.
uninstallnow removes the man pages as well as the binaries:git-collab.1and
git-collab-*.1under the same prefix, which is the whole setinstallwrites, plus pages an older version installed for subcommands that no longer
exist — precisely the litter worth clearing.
Verified against a throwaway prefix:
Only empty directories are left behind; nothing removes
$PREFIX/binitself,which would be an unfriendly thing to do to a directory that was there first.
Man pages no longer gate the install. They were a prerequisite of the
installtarget, so a prefix with an unwritableshare/manaborted before asingle binary was written — the convenience blocking the thing being installed.
The binaries go in first now and the man pages are attempted after, warning and
exiting 0 if they cannot be written:
make install-manon its own stays strict. The asymmetry is deliberate: askingfor man pages explicitly and silently not getting them is the worse failure,
while asking for an install and not getting the binaries over a man directory is
the one that leaves you with nothing.
7156e09a— container lost--versionprovenanceThe commit is passed in rather than the repository shipped:
--build-arg GIT_COMMIT, whichmake dockerfills fromgit rev-parse HEAD, plus aGIT_DIRTYargument so an image built from a work-in-progress tree says soinstead of claiming to be the commit.
TAGnow defaults to the short commitfrom the same
git rev-parse, so the tag and the stamp cannot disagree..dockerignorestill excludes.git/, and I confirmed by listing/buildinthe builder stage that nothing git-related reaches the image.
and the degraded path, built with no arguments at all:
A passed commit overrides a discovered one and bypasses the same-checkout guard
from
5519937drather than being filtered by it. The guard exists becausediscovery can pick up a stranger's repository when this crate is vendored into
another tree, and nobody chose that; passing a value is a choice made by whoever
is in a position to know. The price of that trust is validation: an unexpanded
GIT_COMMIT=HEADfails the build loudly rather than quietly producing theuntraceable binary the mechanism exists to prevent. A discovered value that
looks wrong still degrades to silence, so the tarball case is unaffected.
The bug the container found
The first image I built reported the commit it was given, and
-dirty, from aspotlessly clean tree.
ENV FOO=$BARwith an unsetARG BARdoes not leaveFOOunset — it sets it to the empty string — andoption_env!reads thecompiler's whole environment, not only what the build script emitted. So both
variables arrived as
Some("")however little the build had been told, whichwould also have rendered an argument-free container as
0.1.0 ().src/cli.rsnow asks what a variable says rather than whether it exists.
Every unit test passed while that was broken. Worth recording, because the fix
for a provenance bug that only appears in a container is not provable from
outside one.
Tests
tests/version_test.rscovers the resolution rules directly — passed beatsdiscovered, empty is not a decision, malformed-passed errors, malformed-
discovered degrades — and builds a throwaway crate whose build script is
src/build_provenance.rsto check what a realcargo buildemits with a commitpassed, with neither a commit nor a repository, and with the variables set but
empty. Those are the paths a binary built from this checkout can never exercise
itself. The decision logic moved into
src/build_provenance.rs, included bybuild.rsthe waysrc/cli.rsalready is, so it could be tested at all.Full suite green (53 suites, 0 failures);
cargo clippy --all-targetssilent.tests/tui_review_test.rsrun 11 times across the change with no failures andno meaningful variance (2.84–2.94s).
Migrated from git-collab patche
b7480bbbd59fa81b7cb3d4d5d37dc0971cda95b2.Original author: a73x dev@a73x.sh.
Fixes #91
Revision 1:
a1ed85e91cf36657bd2ab8595fef1f3b8529365e; base9a13fc36a85adc6fc8bf9fcd05de2f842ca6e0cfRevision 2:
969a798355aeb5b0569464ab0659cfbabeb924ba; base690c31f46ee29825da4f366bb0f707038b00c944Rebased onto main@690c31f (governance bootstrap). No content change; full suite green on the new base.
Note on the transcript in the body: the image was rebuilt at r2's commit after the rebase, so the tag in the body (236a3a8) has been superseded. Current evidence, at HEAD
969a798355:Exactly
git rev-parse HEAD. The superseded images have been removed so no tag names a commit that no longer exists.