Module error for snapcraft raised in override-build
Metadata
Current evaluation
The snapcraft_legacy import failure was resolved in Snapcraft 8.3.2; maintainers could no longer reproduce it with lifecycle commands in core22 override scripts.
Resolution: closed resolved
Reason: Maintainer testing found the failure in versions through 8.3.1 but not in 8.3.2 or edge. A later core22 test also confirmed it was no longer reproducible.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Calling `craftctl default` raises a `ModuleNotFoundError` for `snapcraft_legacy`
### To Reproduce
Run Snapcraft 8.3.1 with ansel from https://github.com/sergiusens/ansel/tree/core24
### Environment
Ubuntu 22.04, Snapcraft 8.3.1 using the LXD provider
### snapcraft.yaml
```shell
.
```
### Relevant log output
```shell
2024-07-11 22:05:54.669 :: + snapcraftctl build
2024-07-11 22:05:54.686 :: Traceback (most recent call last):
2024-07-11 22:05:54.686 :: File "<string>", line 2, in <module>
2024-07-11 22:05:54.686 :: ModuleNotFoundError: No module named 'snapcraft_legacy'
2024-07-11 22:05:54.861 'override-build' in part 'ansel' failed with code 1.
2024-07-11 22:05:54.864 Traceback (most recent call last):
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_application/services/lifecycle.py", line 261, in run
2024-07-11 22:05:54.864 aex.execute(action, stdout=stream, stderr=stream)
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 327, in execute
2024-07-11 22:05:54.864 self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 137, in execute
2024-07-11 22:05:54.864 self._run_action(act, stdout=stdout, stderr=stderr)
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 214, in _run_action
2024-07-11 22:05:54.864 handler.run_action(action, stdout=stdout, stderr=stderr)
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 170, in run_action
2024-07-11 22:05:54.864 state = handler(step_info, stdout=stdout, stderr=stderr)
2024-07-11 22:05:54.864 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 309, in _run_build
2024-07-11 22:05:54.865 self._run_step(
2024-07-11 22:05:54.865 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/part_handler.py", line 483, in _run_step
2024-07-11 22:05:54.865 step_handler.run_scriptlet(
2024-07-11 22:05:54.865 File "/snap/snapcraft/12136/lib/python3.10/site-packages/craft_parts/executor/step_handler.py", line 330, in run_scriptlet
2024-07-11 22:05:54.865 raise errors.ScriptletRunError(
2024-07-11 22:05:54.865 craft_parts.errors.ScriptletRunError: 'override-build' in part 'ansel' failed with code 1.
2024-07-11 22:05:54.865 Review the scriptlet and make sure it's correct.
2024-07-11 22:05:54.865 Recommended resolution: Review the scriptlet and make sure it's correct.
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | The snapcraft_legacy import failure was resolved in Snapcraft 8.3.2; maintainers could no longer reproduce it with lifecycle commands in core22 override scripts. | |
| stealth/space-bunny-alpha | — | closed resolved | Resolved in Snapcraft 8.3.2: snapcraftctl no longer raised ModuleNotFoundError for snapcraft_legacy; the 8.3.2 release was merged in #4953. | |
| stealth/space-bunny-alpha | — | closed resolved | The snapcraft_legacy import failure in snapcraftctl override steps was resolved in Snapcraft 8.3.2; testing and the reporter's confirmation found it no longer reproducible. | |
| stealth/space-bunny-alpha | — | closed resolved | The snapcraftctl override-step snapcraft_legacy import error was resolved in Snapcraft 8.3.2; it was absent on 8.3.2/edge, and the reporter later confirmed it no longer occurred. | |
| stealth/space-bunny-alpha | — | closed resolved | The snapcraft_legacy import error from snapcraftctl in override steps was resolved in Snapcraft 8.3.2; the reporter confirmed it was no longer reproducible. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved in Snapcraft 8.3.2. The ModuleNotFoundError for snapcraft_legacy triggered by snapcraftctl commands in override steps was fixed and is no longer reproducible in 8.3.2 or later versions. | |
| qwen/qwen3.6-35b-a3b | — | — | The snapcraft_legacy ModuleNotFoundError in override-build and override-pull was fixed in version 8.3.2. Maintainers confirmed the bug persisted through 8.3.1 but was resolved in 8.3.2, with subsequent testing verifying it is no longer reproducible. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Snapcraft 8.3.2. The ModuleNotFoundError for snapcraft_legacy triggered by snapcraftctl commands in override steps is no longer reproducible in version 8.3.2 and later. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in Snapcraft 8.3.2. The snapcraft_legacy module error triggered by snapcraftctl commands is no longer reproducible in 8.3.2 and later, and the issue has been closed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5426 `snapcraft pack` should run the lifecycle for core18|20 in Snapcraft 7 | snapcraft | closed | Closed as won't-fix-for-Snapcraft-7 by maintainer mr-cal: legacy core18|20 `snapcraft pack` now runs the lifecycle via merged PR #5616 (b511004af), shipped in Snapcraft 8.11, tracking #5425. | |
| #1976221 Missing linker base while building with core22 base | snapcraft (launchpad) | closed | Resolved by upgrading from legacy Snapcraft to Snapcraft 7.x, which correctly builds core22 snaps; no code fix or linked PR was recorded. |