lxd: use a unique temporary folder
Metadata
Current evaluation
Merged #1519 in commit fcda45133, giving each LXD build a unique temporary directory so parallel cleanbuilds no longer share one folder.
Resolution: closed resolved
Reason: PR #1519 was merged as commit fcda45133, moving temporary-directory creation into the LXD constructor and preventing parallel cleanbuilds from colliding over a shared folder.
Evaluated by: mr-cal-bot
No scores available.
Issue body
See the [problem report in the forum](https://forum.snapcraft.io/t/cant-do-two-cleanbuilds-at-once/1883). `snapcraft cleanbuild` or `SNAPCRAFT_CONTAINER_BUILDS=1 snapcraft` can currently fails when used multiple times in parallel and the snapcraft snap is used.
I'm moving the temporary folder to the constructor so that it becomes accessible to tests. It's also a prerequisite to #1302 using folder in the non-snap case so I dropped the `is_snap` condition. Also, I moved the tests from commands.test_snap because they're testing behavior, not command usage.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #1519 in commit fcda45133, giving each LXD build a unique temporary directory so parallel cleanbuilds no longer share one folder. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1519 (commit fcda45133): LXD builds now allocate a unique temp folder in the constructor, fixing concurrent `cleanbuild`/SNAPCRAFT_CONTAINER_BUILDS failures with the snapcraft snap; prerequisite for #1302. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1519 in commit fcda45133, initializing each LXD build's temporary folder in the constructor so parallel cleanbuilds use unique directories. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged to resolve parallel snapcraft cleanbuild failures by moving the temporary folder initialization to the constructor. Removed the is_snap condition, relocated tests, and passed CI review. Modified 5 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix for parallel snapcraft cleanbuild failures by moving the temporary folder to the constructor. This improves test accessibility, removes an unnecessary snap condition, and enables related functionality. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#1302
(confidence 99%)
Unique temporary-folder handling in #1519 was identified as a prerequisite for remote project-folder mounting in #1302.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1742 lxd: always remove tmp_dir after execution | snapcraft | merged | Merged in PR #1742 as commit cd8013851, ensuring LXD container builds always delete their temporary build directory, including after errors, to prevent disk-space waste. | |
| #1488 lxd: always remove existing device for project folder | snapcraft | merged | Merged PR #1488 in commit 11450b469, ensuring an existing LXD device for the project folder is always removed; it followed up the path fix in #1483. | |
| #328 New command cleanbuild (using lxd) | snapcraft | merged | Merged via2f6116267 (branch feature/1480144/cleanbuild-lxd): adds the cleanbuild command building in LXD containers, dropping pylxd due to API/Python 3 breakage. Later fixes followed in #1610, #1807 and #2404. |