← Back to issue list

Charmcraft no longer builds from scratch using edge release of snapcraft

View original Github issue

Metadata

Project
snapcraft
Number
#4266
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Closed as stale without a Snapcraft fix; Charmcraft PR #1146 proposed a workaround but was closed unmerged because it broke stable Snapcraft.

Resolution: closed stale

Reason: mr-cal explicitly closed the report as stale on 2025-04-24, stating it had not been properly investigated. Charmcraft PR #1146 was closed unmerged because removing python3-pip fixed edge builds but broke stable Snapcraft.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed stale Closed as stale without a Snapcraft fix; Charmcraft PR #1146 proposed a workaround but was closed unmerged because it broke stable Snapcraft.
stealth/space-bunny-alpha — closed stale Closed as stale; the Snapcraft edge pip-conflict build failure remains unfixed. Charmcraft PR #1146 was closed unmerged, and its workaround breaks stable Snapcraft.
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#1146 (confidence 99%)

    Proposed removing python3-pip, but the workaround was unmerged because it broke stable Snapcraft.

Related issues

Issue Project State Summary Similarity
#646 Failed to inject host Charmcraft snap into target environment charmcraft closed Report of charmcraft 1.4.0 failing to inject the host snap into the LXD build env. Closed without a code fix: a user fixed it with `charmcraft clean --verbose` and lengau closed it in Jan 2024 as not reproducible on current versions.
73%
#2833 charmcraft no longer available for `armhf` charmcraft closed Closed as not planned: #2412 deliberately dropped armhf from the charmcraft snap with Charmcraft 4. Charmcraft 3.x track still works; LXD will keep its last armhf revision in the store and stop publishing new ones.
73%
#320 charmcraft release doesn't pay attention to resources charmcraft closed Closed 2021-11-17 without a charmcraft fix: maintainers agreed resource validation belongs in Charmhub, tracking it as Launchpad snapstore-server bug #1951271.
72%
#365 What's going on with charmcraft versions? charmcraft closed Maintainers confirmed the snap versioning split was intentional: stable tracks numbered releases, while edge follows master using development git-hash versions; no code change was needed.
71%
#2465 fix(snap): workaround for snapcraft/craft-application bug charmcraft merged Merged charmcraft#2465, adding a three-line Snap build workaround for the craft-application bug tracked in snapcraft#5831; it was the only change for 4.0.1.
70%
#1160 `charmcraft pack` does not recognize updated `charmcraft.yaml` file charmcraft open Tracked upstream: charmcraft pack ignores build-snaps channel changes in charmcraft.yaml unless clean is run. Root cause is craft-parts#496 (build-snaps missing from properties_of_interest), still unfixed; charmcraft only needs a craft-parts bump once patched.
70%