← Back to issue list

Overlay contents don't conflict with regular stage files

View original Github issue

Metadata

Project
craft-parts
Number
#1140
Type
issue
State
closed
Author
tigarmo
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Overlay/install collisions are now detected. PR #1190 was merged as commit b7455277, adding overlay contents to stage conflict checks and integration tests.

Resolution: closed resolved

Reason: Resolved by merged PR canonical/craft-parts#1190 in commit b7455277, which added overlay layer contents to staged-part collision detection and integration coverage.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description Files coming from a part's `OVERLAY` step and another part's `STAGE` step don't seem to be checked for conflict. The result seems undefined; in some cases I get the overlay file, in other cases the stage one. ### To Reproduce Have a part that places a file in `CRAFT_OVERLAY`, and another that places the same file, with different contents, in `CRAFT_PART_INSTALL`. Here's some output with the example parts.yaml: ``` ../project# cat ../parts/part1/install/should-conflict.txt This comes from part1's BUILD ../project# cat ../parts/part2/layer/should-conflict.txt This comes from part2's OVERLAY ../project# ls ../stage/ should-conflict.txt usr ../project# cat ../stage/should-conflict.txt This comes from part1's BUILD ``` ### part yaml ```shell name: overlay-conflict base: ubuntu@24.04 # the base environment for this rock version: '0.1' # just for humans. Semantic versioning is recommended summary: Single-line elevator pitch for your amazing rock # 79 char long summary description: | This is overlay-conflict's description. You have a paragraph or two to tell the most important story about it. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the container registries out there. platforms: # the platforms this rock should be built on and run on amd64: parts: part1: plugin: nil override-build: | echo "This comes from part1's BUILD" >> $CRAFT_PART_INSTALL/should-conflict.txt part2: plugin: nil overlay-script: | echo "This comes from part2's OVERLAY" >> $CRAFT_OVERLAY/should-conflict.txt ``` ### Relevant log output ```shell 2025-06-24 12:40:05.836 Staging part1 2025-06-24 12:40:05.836 execute action part1:Action(part_name='part1', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None)) 2025-06-24 12:40:05.855 Staging part2 2025-06-24 12:40:05.856 execute action part2:Action(part_name='part2', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None)) 2025-06-24 12:40:05.857 staging overlay files 2025-06-24 12:40:05.857 migrate None partition part 'part2' layer to stage 2025-06-24 12:40:05.857 check layer visibility in /root/parts/part2/layer 2025-06-24 12:40:05.857 check if path is visible: root=/root/stage, relpath=should-conflict.txt 2025-06-24 12:40:05.857 layer visibility files=set(), dirs=set() ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Overlay/install collisions are now detected. PR #1190 was merged as commit b7455277, adding overlay contents to stage conflict checks and integration tests.
stealth/space-bunny-alpha — closed resolved Overlay-vs-stage file collision detection added: commit b7455277 via merged PR #1190 makes stage conflict checks include overlay layer contents, plus integration tests for colliding/non-colliding cases. Tracked internally as CRAFT-4620.
stealth/space-bunny-alpha — closed resolved Overlay/install collisions were undetected. PR canonical/craft-parts#1190 merged as b7455277, adding conflict detection between overlay contents and staged part files, with integration tests.
qwen/qwen3.6-35b-a3b — — Conflicts between overlay and stage files across different parts were not detected, causing undefined behavior. Fixed and merged in pull request #1190 to the canonical/craft-parts repository.
qwen/qwen3.6-35b-a3b — — Fixed undefined behavior when overlay and stage files from different parts lacked conflict checks. Resolved by merging pull request #1190 in canonical/craft-parts.
qwen/qwen3.6-35b-a3b — — Fixed undefined behavior when overlay and stage steps from different parts placed identical files without conflict detection. Resolved and merged in pull request #1190.
qwen3.6-35b-a3b-mtp-q6 — — Overlay and stage file conflicts across parts were not properly detected, causing undefined behavior. The bug was fixed and merged in pull request #1190 for the canonical/craft-parts repository.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-parts#1190 (confidence 100%)

    Merged fix for overlay-versus-install file collisions, explicitly cited in the issue's closing comment.

Related issues

Issue Project State Summary Similarity
#1190 fix(overlay): detect conflicts between overlay and install craft-parts merged Merged PR #1190 fixed Stage collision detection by including overlay layer contents and added integration tests for colliding and non-colliding scenarios in commit b7455277.
85%
#1617 fix: migrate overlay files before running stage or prime craft-parts merged Merged #1617 as 2d81a4bd, moving overlay migration before stage/prime so build-created directories cannot shadow overlay state and break priming; regression coverage was added.
71%
#121 overlay: migrate overlay data to stage and prime (CRAFT-468, CRAFT-82) craft-parts merged Merged PR #121 as d45d7079, moving overlay data into stage/prime, translating whiteouts and opaque directories to OCI, and cleaning shared overlay data.
70%