Repository navigation
build(fish): vendor cargo dependencies and drop system-crate model - #79
mrbobbytables wants to merge 2 commits into
Conversation
Fedora's fish spec used %cargo_generate_buildrequires, requiring every Rust crate as a system RPM. Fedora 44 does not ship Rust crate binary packages, causing buildroot failures. Rewrite fish.spec to vendor crates with cargo vendor and %cargo_prep -v vendor, drop %cargo_generate_buildrequires, declare bundled(crate(...)) provides, generate cargo-vendor.txt manifest, and remove fish from the unavailable list in config/runtime-contract.toml. Closes projectbluefin#19 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
hanthor
left a comment
There was a problem hiding this comment.
The stated premise is contradicted by the actual fish build log on main. I do not think this PR fixes the failure it claims to fix, and the [unavailable] removal makes that worse rather than better.
fish does not fail in the buildroot. It fails in %check.
The PR body says this resolves "buildroot failures on F44 + Hummingbird where crate RPMs do not exist". From the fish job on the latest scheduled run of unmodified main (run 34571911239 @ 54cc8d1, job 103175696704), here is where it actually dies:
tests/pexpects/bind_mode_events.py PASSED 60233 ms
193 / 196 passed (44 skipped)
Failed tests:
tests/checks/cd.fish
tests/checks/fish_config.fish
tests/checks/path.fish
FAILED: [code=1] CMakeFiles/fish_run_tests .../redhat-linux-build/CMakeFiles/fish_run_tests
ninja: build stopped: subcommand failed.
error: Bad exit status from /var/tmp/rpm-tmp.56yZAa (%check)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.56yZAa (%check)
The build got through %generate_buildrequires, resolved every crate, compiled the entire Rust tree, and ran 196 integration tests of which 193 passed. The system-crate model on main works. There is no missing-crate buildroot failure to fix here.
And this PR does not touch %check. Stripping the ~120 Provides: bundled(crate(...)) lines, the whole functional diff is:
-%cargo_prep
+cargo vendor
+%cargo_prep -v vendor
-%generate_buildrequires
-%cargo_generate_buildrequires -t
+%cargo_vendor_manifest
+%license cargo-vendor.txt
Nothing there changes cd.fish, path.fish or fish_config.fish. Those three are the classic run-as-root / no-$HOME / no-passwd-entry failures — fish_config wants a writable config dir, cd/path assert on ~ resolution and on permission denials that do not happen to uid 0.
Someone has already written the actual fix, in a PR that does not mention it. PR #57 ("exclude anaconda-live from runtime transaction") carries an undeclared hunk in packages/fish/fish.spec:
%check
export CI=1
-%cmake_build --target fish_run_tests
+if [ "$(id -u)" -eq 0 ]; then
+ useradd --system --create-home fish-tests
+ chown -R fish-tests:fish-tests %{_vpath_builddir}
+ runuser -u fish-tests -- env USER=fish-tests LOGNAME=fish-tests HOME=/home/fish-tests \
+ cmake --build %{_vpath_builddir} --target fish_run_tests
+else
+ %cmake_build --target fish_run_tests
+fi
That addresses the observed failure directly. PR #58 takes the same approach more generally, creating a mockbuild user and running rpmbuild unprivileged for every package. Either would fix fish; this PR would not.
Removing fish from [unavailable] is therefore premature. I confirmed the effect locally — merged into main, the runtime contract goes from 72 to 73 packages:
PR#79 quoting=0 runtime_contract=0 unittest=0 | validated runtime contract: 73 packages against quay.io/hummingbird-community/bootc-os:latest@sha256:c5539f9e...
That asserts fish is required and will be present, while the recipe still fails %check and produces no RPM. That is the wrong-list bug this repo's [unavailable] mechanism exists to prevent. The list change should follow a green fish build, not lead it.
Separately, cargo vendor in %prep is a problem for this repo specifically.
+cargo vendor
+%cargo_prep -v vendor
This repo's whole contract is sha512-pinned upstream sources — config/upstream-sources.json, tools/validate.py ("validated 193 source RPMs"), source_pipeline.py --verify-staged. A bare cargo vendor reaches out to crates.io at build time and pulls whatever the resolver picks that day. That is unpinned, unverified, network-dependent input landing inside a build whose entire point is that every byte is locked. It also makes the build non-reproducible: the ~120 bundled(crate(...)) versions you hand-enumerated are a snapshot that will silently drift from what cargo vendor actually fetches on the next run, and nothing checks the two agree. If vendoring really is wanted later, the vendor tarball needs to be a locked Source with a sha512 like every other input, not a %prep network call.
What I would suggest:
- Drop the
config/runtime-contract.tomlhunk from this PR entirely.fishstays in[unavailable]until it builds. - Coordinate with #57/#58 on the
%checkprivilege fix, which is the change that actually turns thefishjob green. - If the vendoring is wanted on its own merits (dropping the system-crate dependency), re-propose it separately with the vendor archive source-locked, and say so in the body rather than framing it as a buildroot fix.
For completeness, the branch is not broken — merged into main every gate passes unchanged from baseline (fc=0 val=0 pytest=0, 193 SRPMs, 72 tests). The objection is to the claim and the contract change, not to the mechanics.
Generated by Claude Code
…ge entry Keep fish in config/runtime-contract.toml's unavailable list until %check is fixed and an RPM is successfully built. Revert incorrect skill guide entry attributing fish failure to missing crate RPMs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
|
Thanks @hanthor! Addressed the feedback:
🐝 Hive Agent:
|
|
Closing as no longer needed: Generated by Claude Code |
Rewrite the fish spec to vendor Rust crate dependencies rather than using the system-crate model (%cargo_generate_buildrequires), resolving buildroot failures on F44 + Hummingbird where crate RPMs do not exist:
cargo vendorand%cargo_prep -v vendorduring%prep%generate_buildrequiresand%cargo_generate_buildrequires -tbundled(crate(...))provides for all vendored dependenciescargo-vendor.txtvia%cargo_vendor_manifestin%buildand include as%licensefishfrom[unavailable]inconfig/runtime-contract.tomlCloses #19
— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:8b5978c