← Back to issue list

Changing from basefull to baseless silently produces an incomplete rock

View original Github issue

Metadata

Project
rockcraft
Number
#1351
Type
issue
State
open
Author
lczyk
Labels
Type: Bug
Created
Updated
Closed
—

Current evaluation

Rebuilding a project after switching `base: ubuntu@26.04` to `base: bare` reuses stale state, silently producing a rock missing ~520 base-provided files; pack exits 0 with no warning. Labeled as a bug, awaiting triage/fix.

Suggested action: keep open

Reason: Valid, well-scoped bug with a turnkey reproducer (two YAML variants, explicit step-by-step build, and a `comm -13` diff proving 2-bare-no-clean.rock is a strict subset of the clean build); independently reproduced by lczyk and alesancor1 per the body. Silently emitting an incomplete rock from a successful exit-0 pack is a correctness/output-trust problem, so it should stay open. Impact is bounded by requiring a base change plus a non-clean rebuild, and complexity is mid-range because the likely fix is cache/overlay-part invalidation on base change (possibly touching craft-parts/craft-application) plus a new spread test. Confidence is capped because repository inspection tools returned 'No pinned SHA available for rockcraft', so I could not confirm the root cause or rule out an existing fix commit; the 0-comment state also means there is no maintainer triage confirmation yet.

Evaluated by: mr-cal-bot

Impact: 72 Quick Win: 25 Complexity: 58 Confidence: 76 Actionability: 83

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description Found together with @alesancor1 Rebuilding the same project after switching `base: ubuntu@26.04` to `base: bare` reuses stale state and packs a rock **silently** missing every file the previous base had provided. ### Steps to reproduce ```bash mkdir my-test-rock && cd my-test-rock # Two projects differing only in the base. cat > ubuntu-base.yaml <<'EOF' name: python base: ubuntu@26.04 version: "3.14" summary: Python3.14 rock description: Example of a Python rock license: Python-2.0 platforms: amd64: run-user: _daemon_ parts: install-python: plugin: nil stage-packages: - base-files - python3.14 EOF sed -e 's/^base: ubuntu@26.04$/base: bare\nbuild-base: ubuntu@26.04/' \ ubuntu-base.yaml > bare-base.yaml # 1. Build with the Ubuntu base. cp ubuntu-base.yaml rockcraft.yaml rockcraft pack mv python_3.14_amd64.rock 1-ubuntu.rock # 2. Swap to the bare base and rebuild WITHOUT cleaning. This succeeds. cp bare-base.yaml rockcraft.yaml rockcraft pack mv python_3.14_amd64.rock 2-bare-no-clean.rock # 3. Reference: the same bare project, built clean. rockcraft clean rockcraft pack mv python_3.14_amd64.rock 3-bare-clean.rock # 4. Compare the two bare rocks. They should be identical; they are not. list_rootfs() { d=$(mktemp -d) mkdir -p "$d/oci" "$d/fs" tar -xf "$1" -C "$d/oci" for l in $(find "$d/oci/blobs" -type f -size +100k); do tar -xzf "$l" -C "$d/fs" 2>/dev/null || tar -xf "$l" -C "$d/fs" 2>/dev/null || true done (cd "$d/fs" && find . | LC_ALL=C sort) rm -rf "$d" } list_rootfs 2-bare-no-clean.rock > no-clean.txt list_rootfs 3-bare-clean.rock > clean.txt wc -l no-clean.txt clean.txt comm -13 no-clean.txt clean.txt # files the no-clean build is missing ``` Step 2 exits 0 with no warning, but `2-bare-no-clean.rock` is a strict subset of `3-bare-clean.rock`, missing 520 files -- all of `base-files` and friends. ### Environment - Rockcraft 1.20.0 (snap, `latest/stable`, classic) - LXD provider, **not** destructive mode - Host: Ubuntu 24.04.4 LTS, amd64 (itself running as an LXD VM, but that does not matter. @alesancor1 reproduced this on metal host) - Build base: `ubuntu@26.04`, amd64 ### rockcraft.yaml ```yaml name: python base: ubuntu@26.04 version: "3.14" summary: Python3.14 rock description: Example of a Python rock license: Python-2.0 platforms: amd64: run-user: _daemon_ parts: install-python: plugin: nil stage-packages: - base-files - python3.14 ``` ### Log output ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 72
Quick Win: 25
Complexity: 58
Confidence: 76
Actionability: 83
keep open Rebuilding a project after switching `base: ubuntu@26.04` to `base: bare` reuses stale state, silently producing a rock missing ~520 base-provided files; pack exits 0 with no warning. Labeled as a bug, awaiting triage/fix.
stealth/space-bunny-alpha
Impact: 75
Quick Win: 30
Complexity: 55
Confidence: 92
Actionability: 88
keep open Switching an existing project from base: ubuntu@26.04 to base: bare can reuse stale state and silently omit 520 base-provided files, producing an incomplete rock.
qwen3.6-35b-a3b-mtp-q6
Impact: 75
Quick Win: 34
Staleness: 15
Complexity: 55
Confidence: 75
Support Request: 10
needs triage Switching from basefull to baseless without cleaning silently produces incomplete rocks missing 520 files from the previous base
qwen/qwen3.8-27b
Impact: 80
Quick Win: 28
Staleness: 5
Complexity: 65
Confidence: 70
Support Request: 5
needs triage Rockcraft 1.20.0 silently packs an incomplete rock when switching base from ubuntu@26.04 to bare without cleaning, reusing stale state and dropping 520 files (all of base-files). Freshly filed, no maintainer activity yet.

Update history

Date Change
updated
created

Related work

  • Related To: canonical/rockcraft#13 (confidence 30%)

    Merged PR making `build-base` optional and defaulting to `base` (CRAFT-590); establishes the build-base/base semantics exercised by the repro's `build-base: ubuntu@26.04`, but is not a fix for the stale-state problem.

Related issues

No related issues found above the similarity threshold.