← Back to issue list

Snapcraft is testing file collisions on unbuilt parts

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1660696
Type
issue
State
closed
Author
~stevedelahunty
Labels
—
Created
Updated
Closed

Current evaluation

Collision detection ran on not-yet-built parts, causing file-not-found failures (dump plugin with custom build). Fixed by PR #1405 (commit dbdc4b5a6), merged into snapcraft; bug was acknowledged by maintainers.

Resolution: closed resolved

Reason: Reported against Launchpad, the bug was fixed on GitHub in snapcore/snapcraft PR #1405 "pluginhandler: check for collisions only in existing files", merged as commit dbdc4b5a6. A maintainer credited the report ("Great catch, thank you") and the closing comment links that PR, which changed collision checking to only consider already-existing files.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When using snapcraft, it appears to be calling "check_for_collisions" on parts that have not been built yet (or more accurately, not installed) so this call is failing with a "file not found" error. I've modified my version of snapcraft to remove this code (internal/lifecycle.py): for step in common.COMMAND_ORDER[0:step_index]: #if step == 'stage': # pluginhandler.check_for_collisions(self.config.all_parts) for part in parts: if step not in self._steps_run[part.name]: self._run_step(step, part, part_names) self._steps_run[part.name].add(step) self._create_meta(step, part_names) I did this to verify this is the cause of the failure and my yaml successfully ran. I've included a copy of my yaml file. It might be important to note that the failing parts all seem to be related to the dump plugin and with custom "build" instructions.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Collision detection ran on not-yet-built parts, causing file-not-found failures (dump plugin with custom build). Fixed by PR #1405 (commit dbdc4b5a6), merged into snapcraft; bug was acknowledged by maintainers.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/snapcraft#1405, merged as dbdc4b5a6: collision checks now consider only existing files, avoiding file-not-found errors for unbuilt parts.
stealth/space-bunny-alpha — closed resolved Collision checks were fixed by merged PR #1405 (dbdc4b5a6), which now checks only existing files and avoids errors from unbuilt parts.
qwen/qwen3.6-35b-a3b — — Closed without a merged fix. Snapcraft incorrectly checked file collisions on unbuilt parts, causing file not found errors. The author verified a local workaround, but the report was closed without upstream resolution or discussion.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Premature collision checks on unbuilt dump plugin parts caused file-not-found errors. No fix was implemented or documented.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1405 (confidence 96%)

    Merged PR titled 'pluginhandler: check for collisions only in existing files', commit dbdc4b5a6; referenced in the final issue comment.

Related issues

Issue Project State Summary Similarity
#1752766 Snapcraft fails to prime part containg device files snapcraft (launchpad) closed Merged PR #1976 (commit ef3309f3c) fixed device-node priming by limiting ELF inspection to regular files and symlinks.
73%
#1778081 Snapcraft saves the fact that parts need to be rebuilt rather than discovering them snapcraft (launchpad) closed Fixed by snapcore/snapcraft PR #2165, replacing persisted dependency-dirty state with dependency rebuild discovery.
72%
#52 executor: add part file collision verification craft-parts merged Merged PR #52 via commit a287b91e (implementation commit 77630113), adding craft_parts/executor/collisions.py to verify parts don't stage identically-named files with differing contents; logic ported from snapcraft.
71%
#2309 snap: improve early base detection logic snapcraft merged Merged PR #2309 (commit 3565ed2e7), fixing early base detection when Snapcraft runs in a build provider outside the project directory (LP #1795501).
70%
#1989149 File conflicts between parts should include files with identical contents snapcraft (launchpad) open Snapcraft still allows identical same-path files from different parts without warning; changing this collision behavior remains unresolved in craft-parts.
70%