Repository navigation
Conversation
…ng (ENG-2757) A project with runtime rt-a installed adds rt-b. `avocado build -r rt-b` before `avocado install -r rt-b` creates the empty rt-b sysroots with `mkdir -p`; `install -r rt-b` then reads them as installed (directory exists, pins from rt-a, the per-extension stamp from rt-a matches) and skips; the next build ships empty extension images with exit 0. - ext install: the fast path and the seed decision test <sysroot>/var/lib/rpm, which only the seed step writes. A failed first dnf transaction removes the seeded database so the retry installs. - ext build: refuse a package extension whose sysroot has no rpm database, naming `avocado install -r <rt>`. - scheduler: register every graph task on the renderer it was given. The fallback passthrough renderer used without a TTY had no entries, so set_error kept nothing and a failed task printed only "<id> failed". - renderer: passthrough prints a failed task's error message before its captured output, as the TTY summary does. Plain multi-runtime install and build without -r still go through the legacy extensions link; that is ENG-2691.
There was a problem hiding this comment.
🟡 Changes recommended
Override-only packages and interrupted installs bypass safeguards, and the recovery command can target the wrong runtime.
3 open issues
What changed in this PR
This PR hardens extension installation and builds against empty runtime sysroots, and improves failure reporting in non-interactive output.
Changes:
- Probe the RPM database before skipping installation or building package extensions.
- Remove newly seeded databases after failed package transactions.
- Register scheduler tasks and display their errors, with regression tests.
| File | Description |
|---|---|
src/utils/tui/renderer.rs |
Prints task errors in passthrough mode. |
src/utils/scheduler/executor.rs |
Registers tasks before execution. |
src/commands/ext/install.rs |
Adds database probes and failed-install cleanup. |
src/commands/ext/build.rs |
Rejects package builds without a database. |
Review effort: Balanced
…ope the clean hint Review follow-ups on #302. declares_packages now sees packages declared only inside target-* / kernel-* override blocks. The seeded rpm database is removed when the dnf transaction returns Err (Ctrl-C), not only on a failed exit. The recovery hint passes -r <runtime> when one is set.
Lockfile only. Clears the nine cargo audit findings that fail the Security Audit job on every PR: RUSTSEC-2026-0338 to 0342 (quinn-proto, fixed in 0.11.18) and RUSTSEC-2026-0346 to 0349 (rustls, fixed in 0.23.46). Both crates are transitive, pulled in through reqwest. (cherry picked from commit 0cd54a7)
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.

Summary
ENG-2757. In a project with runtime
rt-ainstalled, add runtimert-band runavocado build -r rt-bbeforeavocado install -r rt-b(or any plainavocado buildout of habit). The build creates the emptyrt-bextension sysroots withmkdir -p, thenavocado install -r rt-bsays every extension "is up to date" and leaves them empty, and the nextavocado build -r rt-bships empty extension images with exit 0. On the QEMU fixture,avocado-ext-dev-0.1.0.rawwent from 4,026,368 bytes to 8,192 andavocado-ext-tunnels-0.1.0.rawfrom 4,370,432 to 1,605,632. Nothing in the log said so.Three things line up to cause it. The install stamp is per extension, not per runtime, so
rt-a's stamp satisfiesrt-b. The fast path's sysroot probe tests only that the directory exists. Andext buildonly needs the stamp, so it builds an empty tree and creates the directory the probe then accepts.A second path reaches the same state: the first
install -r rt-bseeds the rpm database and then dnf fails (feed down, package missing). The seeded database stays, the retry passes the probe, and the sysroot never gets its packages.Plain
avocado installandavocado buildon a multi-runtime project with no-rrun the extension steps through the legacy$AVOCADO_PREFIX/extensionslink. That is a known limitation tracked in ENG-2691 and is not changed here. Multi-runtime projects pass-rto install and build.Changes
ext install: the fast path and the seed decision probe<sysroot>/var/lib/rpm, not the directory (ext_sysroot_seeded_test,sysroot_probe_line). The rpm database is written by the seed step and by nothing else, so its presence means an install reached dnf. Same rule as the runtime install'srpmdb_seeded_check. A directory with no database is also seeded now instead of handed to dnf as is, which would have resolved the whole dependency closure into the extension.ext install: a failed dnf transaction on a sysroot this call seeded removes the seededvar/lib/rpm(drop_seeded_rpmdb_command), so the retry seeds and installs again. A sysroot that existed before the call keeps what it had.ext build: a package extension whose sysroot has no rpm database is refused before anything is written:Extension '<ext>' declares packages, but its sysroot for runtime '<rt>' has no package database. Run 'avocado install -r <rt>' first.The probe rides in the existing stamp batch read, so there is no extra container round trip. Skipped under--no-stamps, like the rest of that block. Overlay-only extensions are not affected.installandbuildhand the scheduler a fresh passthrough renderer with no task entries, andset_errorkeeps nothing for a task it has never seen, so a failed task printed only<id> failed.register_taskis idempotent, so the TTY renderer keeps its entries and order. Passthrough success lines now show elapsed time, as TTY mode already did.Testing
Unit tests, all new:
sysroot_probe_reports_yes_only_for_a_seeded_sysrootanda_failed_first_install_drops_only_the_seeded_rpmdbrun the generated shell undershagainst a tempdir.declares_packages_needs_a_non_empty_packages_map,packages_not_installed_message_names_the_install_command.a_failing_task_keeps_its_error_on_an_unregistered_renderer(scheduler),passthrough_failed_task_prints_its_error_message(renderer).cargo test --no-fail-fast: 1986 passed, 5 failed. The same 5 fail onmainatb796364on macOS (BSDsed -i, nosha256sum): 4 sysroot digest tests instamps.rsandext::build::tests::install_section_from_a_dropin_enables_the_unit. All 136 integration tests pass. Clippy reports nothing in the touched files.End to end, on macOS with the avocado-vm, a
qemu-quickstartcopy with two runtimes that share every extension, 2024/edge, qemux86-64. Same script and fixture againstmainand this branch.mainbuild -r dev-bbefore installsshd.socket, creates empty sysrootsinstall -r dev-bafter thatdevbuild -r dev-b, image sizes vs. thedevbuildext-dev4,026,368 to 8,192install -r dev-bwith dnf forced to failinstall -r dev-binstalltwice on a one-runtime projectFinal run on this branch:
rpmdb-probe13 of 13 checks pass,smoke3 of 3,fast-path1 of 1 (the second install still says "is up to date"). Onmainthe samerpmdb-proberun fails 8 of 13. Fixture and script:wip/cli-rc6-fixtures/rpmdb-probe/andlocal-scripts/cli-rc6-validate.shin the workspace, not in this repo.Follow-up (not in this PR)
installandbuildstill go through.avocado build -r <rt> -e <ext>does not pass the runtime to the single-extension build, so the refusal there saysRun 'avocado install' firstwithout-r. Pre-existing.-rto install and build.