The lpci snap build errors out when using snapcraft 8.x but works fine with 7.x
Metadata
Current evaluation
Snapcraft 8.x build failures due to a pip version conflict were reported. A maintainer suggested removing python3-pip from stage-packages, but the reporter did not respond. The report was closed as stale without a fix or merge.
Suggested action: —
No scores available.
Issue body
### Bug Description
We build the `lpci` snap on the `core20` base using the latest version of `snapcraft` and the builds are breaking with the 8.x versions of `snapcraft` due to mismatch between the installed `pip` version (`22.0.2`) and the expected version, `20.0.2`. https://launchpadlibrarian.net/709960065/buildlog_snap_ubuntu_focal_amd64_lpci_BUILDING.txt.gz contains the logs for a build failure due to this issue.
For now, we have worked around this issue on the Launchpad snap recipe for `lpci` by pinning `snapcraft` to the `7.x/stable` channel.
### To Reproduce
* Clone the `lpci` code locally from https://git.launchpad.net/lpci.
* Install the latest version of `snapcraft`.
* Navigate to the top-level directory of the `lpci` repository and run `snapcraft -v`.
* The build fails with an error about `pip` version conflict.
### Environment
Snapcraft 8.0.2 on Kubuntu 23.10
### snapcraft.yaml
```shell
https://git.launchpad.net/lpci/tree/snap/snapcraft.yaml
```
### Relevant log output
```shell
Building lpci
+ snapcraftctl build
+ python3 -m venv /root/parts/lpci/install
+ SNAPCRAFT_PYTHON_VENV_INTERP_PATH=/root/parts/lpci/install/bin/python3
+ pip install -U wheel
Traceback (most recent call last):
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 22.0.2 (/snap/snapcraft/10436/usr/lib/python3/dist-packages), Requirement.parse('pip==20.0.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/stage/usr/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/root/parts/lpci/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.0.2' distribution was not found and is required by the application
Failed to build 'lpci'.
Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.
```
### Additional context
I tried pinning `pip==20.0.2` in the `python-packages` list as suggested in a related conversation on the `#snapcraft` Matrix channel, but that didn't work because it just ran `pip install pip==20.0.2 wheel`, which will not work.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Snapcraft 8.x build failures due to a pip version conflict were reported. A maintainer suggested removing python3-pip from stage-packages, but the reporter did not respond. The report was closed as stale without a fix or merge. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. The snapcraft 8.x pip version conflict causing lpci build failures remains unresolved. A maintainer suggested removing python3-pip from stage-packages, but no fix was implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale without a fix. The report detailed a snapcraft 8.x build failure caused by a pip version mismatch. A maintainer suggested removing python3-pip from stage-packages, but the issue was abandoned due to inactivity. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Snapcraft 8.x build failures from a pip version conflict remain unresolved. A suggested fix involves removing python3-pip from stage-packages, but the report was closed as stale without implementation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Snapcraft 8.x build failures due to pip version conflicts were reported. Maintainers suggested removing python3-pip from stage-packages, but the issue was closed as stale without resolution. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. |