Extra part triggering stage step before overlay step
Metadata
Current evaluation
⚠️ This summary may be outdated — the issue content or evaluation prompts have changed since this evaluation was made.
Closed after triage and logging as internal ticket CRAFT-5215. No fix was merged. The staging-before-overlay build order bug remains unresolved.
Suggested action: —
No scores available.
Issue body
### Bug Description
While using imagecraft with the following imagecraft.yaml:
```
name: minimal
version: "0.1"
summary: A test image
description: A test image
base: bare
build-base: ubuntu@24.04
platforms:
amd64:
filesystems:
default:
- mount: /
device: (volume/pc/rootfs)
- mount: /boot/efi/
device: (volume/pc/efi)
parts:
# build a simple rootfs
rootfs:
plugin: mmdebstrap
mmdebstrap-variant: "minbase"
mmdebstrap-packages:
- ubuntu-server-minimal
- grub2-common
- grub-efi-amd64
- shim-signed
- linux-image-generic
override-build: |
craftctl default
mkdir -p $CRAFT_PART_INSTALL/boot/efi
organize:
"*": (overlay)/
apt-config:
plugin: dump
source: apt-config/
after: [rootfs]
organize:
ubuntu.sources: (overlay)/etc/apt/sources.list.d/ubuntu.sources
fish-ppa.sources: (overlay)/etc/apt/sources.list.d/fish-ppa.sources
keyrings/fish-ppa.gpg: (overlay)/etc/apt/keyrings/fish-ppa.gpg
# Define a fstab
fstab:
plugin: nil
after: [rootfs]
overlay-script: |
cat << EOF > $CRAFT_OVERLAY/etc/fstab
LABEL=writable / ext4 discard,errors=remount-ro 0 1
LABEL=UEFI /boot/efi vfat umask=0077 0 1
EOF
volumes:
pc:
schema: gpt
structure:
- name: efi
type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
filesystem: vfat
role: system-boot
filesystem-label: UEFI
size: 256M
- name: rootfs
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
filesystem: ext4
filesystem-label: writable
role: system-data
size: 5G
```
I expected the overlay step in `fstab` to complete before `rootfs` staging. But:
- the staging step of `rootfs` happens first (when fstab's layer is empty) since its needed to build the `apt-config` part
- the content from `fstab` is in `parts/fstab/layer/etc/fstab` after packing but never makes it into the final image
```
2026-06-05 13:35:50.323 Staging rootfs (required to build 'apt-config')
...
2026-06-05 13:36:24.832 Overlaying fstab
```
Without the `apt-config` part, the `fstab` overlay step happens before `rootfs` staging:
```
2026-06-05 14:59:47.772 Overlaying fstab
...
2026-06-05 14:59:47.826 Staging rootfs (required to build 'fstab')
```
### To Reproduce
Run `imagecraft pack` with the example imagecraft.yaml with and without the apt-config part
### part yaml
```shell
parts:
# build a simple rootfs
rootfs:
plugin: mmdebstrap
mmdebstrap-variant: "minbase"
mmdebstrap-packages:
- ubuntu-server-minimal
- grub2-common
- grub-efi-amd64
- shim-signed
- linux-image-generic
override-build: |
craftctl default
mkdir -p $CRAFT_PART_INSTALL/boot/efi
organize:
"*": (overlay)/
apt-config:
plugin: dump
source: apt-config/
after: [rootfs]
organize:
ubuntu.sources: (overlay)/etc/apt/sources.list.d/ubuntu.sources
fish-ppa.sources: (overlay)/etc/apt/sources.list.d/fish-ppa.sources
keyrings/fish-ppa.gpg: (overlay)/etc/apt/keyrings/fish-ppa.gpg
# Define a fstab
fstab:
plugin: nil
after: [rootfs]
overlay-script: |
cat << EOF > $CRAFT_OVERLAY/etc/fstab
LABEL=writable / ext4 discard,errors=remount-ro 0 1
LABEL=UEFI /boot/efi vfat umask=0077 0 1
EOF
```
### Relevant log output
```shell
2026-06-05 13:35:50.323 Staging rootfs (required to build 'apt-config')
...
2026-06-05 13:36:24.832 Overlaying fstab
Without the `apt-config` part, the `fstab` overlay step happens before `rootfs` staging:
2026-06-05 14:59:47.772 Overlaying fstab
...
2026-06-05 14:59:47.826 Staging rootfs (required to build 'fstab')
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed after triage and logging as internal ticket CRAFT-5215. No fix was merged. The staging-before-overlay build order bug remains unresolved. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed and deferred to internal tracking as CRAFT-5215. No public fix or resolution was provided. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1127 Failing to prime content with overlay and partitions | craft-parts | closed | Closed and deferred to internal tracking ticket CRAFT-4600. No public fix or merge was provided. The bug involves incorrect overlay file visibility checks during partition priming causing stage migration failures. | |
| #1291 BUILD step of a part organizing to the overlay should invalidate overlay contents of following parts | craft-parts | open | craft-parts bug: when a part organizing to the overlay re-runs its BUILD step, dependent parts' OVERLAY steps should be invalidated and re-executed, but they are skipped. Filed by a maintainer from PR #1261 discussion; unlabelled, 0 comments, inactive ~1 year. |