Charmcraft no longer builds from scratch using edge release of snapcraft
Metadata
Current evaluation
Closed as stale. The edge snapcraft build failure from a pip version conflict remains unfixed. A proposed workaround breaks stable, so the issue was abandoned pending further reports.
Suggested action: —
No scores available.
Issue body
### Bug Description
Doing a clean build of charmcraft breaks on the latest (core22-based) snapcraft available from edge. It works fine on stable, and it works fine if you upgrade from stable but don't run `snapcraft clean`.
Removing `python3-pip` from `stage-packages` appears to be sufficient to resolve the issue, but the config hook is then unable to find `charmcraft`. (See: https://github.com/canonical/charmcraft/pull/1146)
### To Reproduce
In a new VM (tested in multipass with both focal and jammy):
1. `git clone https://github.com/canonical/charmcraft.git`
2. `sudo snap install --edge snapcraft`
3. `snapcraft --use-lxd`
### Environment
```
ubuntu@jammy:~/charmcraft$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
ubuntu@jammy:~/charmcraft$ snapcraft --version
snapcraft 7.4.3.post44+git4d0d7511
```
### snapcraft.yaml
```shell
https://github.com/canonical/charmcraft/blob/main/snap/snapcraft.yaml
```
### Relevant log output
```shell
Pulling charmcraft
+ snapcraftctl pull
+ git config --global --add safe.directory /root/parts/charmcraft/src
++ python3 setup.py --version
+ version=2.3.0.post15+git2c06b8c
+ snapcraftctl set-version 2.3.0.post15+git2c06b8c
Pulling craftctl
+ snapcraftctl pull
Skipping build cryptography-deps (already ran)
Skipping build python3 (already ran)
Building charmcraft
+ snapcraftctl build
+ python3 -m venv /root/parts/charmcraft/install
+ SNAPCRAFT_PYTHON_VENV_INTERP_PATH=/root/parts/charmcraft/install/bin/python3
+ pip install -U wheel
Traceback (most recent call last):
File "/root/parts/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/root/parts/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/root/parts/charmcraft/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/9453/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/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "/root/parts/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/root/parts/charmcraft/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/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/root/parts/charmcraft/install/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/root/parts/charmcraft/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 'charmcraft'.
Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. The edge snapcraft build failure from a pip version conflict remains unfixed. A proposed workaround breaks stable, so the issue was abandoned pending further reports. | |
| qwen/qwen3.6-35b-a3b | — | — | The report was closed as stale and abandoned. Maintainers declined to apply the proposed fix because it breaks stable builds and did not investigate further. The build failure remains unresolved. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale without resolution. Clean builds fail with edge snapcraft due to a pip version conflict. A proposed workaround breaks stable builds. The issue remains unresolved and will be revisited if reported again. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as stale without resolution. The edge snapcraft build failure remains unfixed due to pip version conflicts. A proposed workaround breaks stable builds. Investigation was deferred pending new reports. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as stale without a fix. The edge snapcraft build failure caused by a pip version conflict remains unresolved. A workaround breaks stable builds. Maintainer declined to investigate and will revisit if reported again. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #646 Failed to inject host Charmcraft snap into target environment | charmcraft | closed | Closed. Maintainer confirmed the issue is resolved in recent Charmcraft versions and cannot be reproduced. A user workaround suggested running charmcraft clean --verbose prior to building. | |
| #566 Error when building with charmcraft from edge | charmcraft | closed | Closed as a duplicate of #551. Resolved via a config workaround adding setuptools to charm-python-packages. A follow-up confirmed adding pip alongside setuptools fixed circular dependency build failures. |