core18 built python snap not usable from override-build snippet in another snap's snapcraft.yaml
Metadata
Current evaluation
Closed as stale. The core18 Python snap path resolution bug in override-build was superseded by substantial changes in newer Python plugin versions, rendering the reported sitecustomize.py behavior obsolete.
Suggested action: —
No scores available.
Issue body
Python plugin snaps, such as remarshal: https://github.com/anonymouse64/remarshal/blob/master/snap/snapcraft.yaml, are not directly usable as build-snaps from another python plugin snapcraft.yaml's override-build snippet.
Trying to use the snap fails like this:
```
+ /snap/bin/toml2json /root/parts/streamdeck-ui/build/pyproject.toml
Traceback (most recent call last):
File "/snap/remarshal/19/bin/toml2json", line 10, in <module>
from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/snap/remarshal/19/bin/toml2json", line 13, in <module>
from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/snap/remarshal/19/bin/toml2json", line 15, in <module>
from pkg_resources import load_entry_point
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3238, in <module>
@_call_aside
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3222, in _call_aside
f(*args, **kwargs)
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3251, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 567, in _build_master
ws.require(__requires__)
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 884, in require
needed = self.resolve(parse_requirements(requirements))
File "/root/parts/streamdeck-ui/install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 770, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'remarshal==0.10.0' distribution was not found and is required by the application
```
note the paths from the Traceback all have prefixes of $SNAPCRAFT_PART_INSTALL for the snap that is being built, NOT for the snap that was built. In other words the strictly confined, built snap at runtime is tricked into trying to run python from the environment of the currently building snap. One way to work around this as pointed out by cjp256 is to unset the $SNAPCRAFT_PART_INSTALL and $SNAPCRAFT_STAGE environment variables like in this snippet:
```
env -u SNAPCRAFT_PART_INSTALL -u SNAPCRAFT_STAGE -- /snap/bin/toml2json ....
```
however these env vars will always be set for override-build snippets so it's inconvenient and totally unexpected that having these vars set will change the behavior of a strictly confined built snap.
To be clear, this bug is about the behavior of the remarshal snap, not about anything in the override-build snippet.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. The core18 Python snap path resolution bug in override-build was superseded by substantial changes in newer Python plugin versions, rendering the reported sitecustomize.py behavior obsolete. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. Pre-core20 Python snaps incorrectly used Snapcraft environment variables in sitecustomize.py, breaking override-build usage. Newer Python plugin versions changed substantially, resolving the issue. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
70
Confidence:
85
Support Request:
10
|
close stale | Python snaps built on core18 fail when used as build-snaps due to environment variable pollution causing incorrect path resolution. Untriaged and inactive for over five years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
35
Confidence:
90
Support Request:
10
|
close stale | Core18-based Python snap fails as a build dependency due to environment variable path conflicts. Unlabelled, zero maintainer interaction, inactive for over 5 years, and core18 is EOL. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
60
Confidence:
90
Support Request:
20
|
close stale | Unresolved issue from ~5.5 years ago regarding core18 Python snaps failing when used as build dependencies due to SNAPCRAFT_PART_INSTALL pollution. No maintainer interaction or labels. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
45
Confidence:
90
Support Request:
15
|
close stale | core18 Python snaps fail as build-snaps in override-build snippets because SNAPCRAFT_PART_INSTALL and SNAPCRAFT_STAGE env vars pollute the confined runtime. Open, unassigned, inactive for over five years. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4285 Snapcraft v7 fails to build core18 snap with local plugins | snapcraft | closed | Snapcraft v7 failed to build core18 snaps with local plugins due to an unredirected snapcraft.sources import. Snapcraft v7.5.3 resolved this by implementing the required legacy import redirection, enabling successful builds. | |
| #5408 Unable to build usable Python snaps which use Ubuntu-provided python3-* dependencies using strict confinement with core24 using snapcraft 8.8.0 (8.x/stable) | snapcraft | closed | Closed as completed. The author applied a PYTHONPATH workaround in snapcraft.yaml to access staged packages. Maintainers declined a code fix, marking the issue as a reference for a future Python plugin rewrite. | |
| #1820843 re-running snapcraft when override-build dirty fails complaining about pip | snapcraft (launchpad) | closed | Closed as stale. The python plugin has changed significantly since the report, rendering the original pip issue obsolete. A snapcraft clean workaround was noted, but no direct fix was applied. | |
| #1815202 Python site-packages are not found in core18 classic snaps | snapcraft (launchpad) | closed | Closed without resolution. The report details Python site-packages failing to load in core18 classic snaps, with a PYTHONPATH workaround provided. No comments or fix were recorded. |