← Back to issue list

uv plugin fails on core26: dispatch script uses system Python instead of venv

View original Github issue

Metadata

Project
craft-parts
Number
#1641
Type
issue
State
open
Author
zyga
Labels
Created
Updated
Closed

Current evaluation

uv plugin fails on core26: craft-parts removes python symlinks from venv/bin/ and dispatch script falls back to system Python without venv packages

Suggested action: needs triage

Reason: The issue has no labels, no maintainer response, and 0 comments after 52 days. It presents a clear bug with reproduction steps and root cause analysis for the uv plugin failing on core26. The referenced issue #1580 was closed without resolution, suggesting this is an unresolved problem that needs proper triage and investigation.

Impact: 55 Quick Win: 30.25 Staleness: 50 Complexity: 45 Confidence: 65 Support Request: 15

Issue body

## Problem The uv plugin fails when building charms on Ubuntu 26.04 (core26) because craft-parts removes python symlinks from `venv/bin/` and the dispatch script's fallback uses the system Python interpreter, which doesn't have venv packages installed. ## Root Cause On core26, the base snap does NOT include Python. The uv plugin flow: 1. Creates a venv with `uv venv --relocatable --python /usr/bin/python3.14` 2. Runs `uv sync` to install dependencies (ops, cosl, etc.) 3. craft-parts removes `python*` symlinks from `venv/bin/` 4. craft-parts tries to find Python in the payload - fails (core26 has no Python) 5. craft-parts falls back to system interpreter path `/usr/bin/python3.14` 6. The dispatch script checks if `venv/bin/python` exists - it doesn't 7. The dispatch script creates `ln -s $(which python3) venv/bin/python` 8. This symlinks to the system Python, which doesn't have `ops` installed Result: `ModuleNotFoundError: No module named 'ops'` at runtime. ## Reproduction ```yaml base: ubuntu@26.04 parts: charm: plugin: uv source: . build-snaps: - astral-uv ``` ## Build Output ``` :: + uv venv --relocatable --allow-existing --python /usr/bin/python3.14 /root/parts/charm/install/venv :: + uv sync --no-dev --no-editable --reinstall --no-install-project :: + rm /root/parts/charm/install/venv/bin/python /root/parts/charm/install/venv/bin/python3 /root/parts/charm/install/venv/bin/python3.14 :: + echo 'Python interpreter not found in payload.' :: Python interpreter not found in payload. :: + symlink_target=/usr/bin/python3.14 ``` The dispatch script then creates `venv/bin/python -> /usr/bin/python3`, which doesn't have venv packages. ## Runtime Error ``` File "/var/lib/juju/agents/unit-image-garden-stream-0/charm/src/charm.py", line 20, in <module> from ops.charm import CharmBase ModuleNotFoundError: No module named 'ops' ``` ## Related - craft-parts #1580 - claims "core26+ and bare are fine" but this shows they are not ## Suggested Fix Options: 1. On core26, automatically include python3 as a dependency in the payload 2. Don't remove python symlinks from venv/bin/ when the interpreter is not in the payload 3. Have craft-parts copy the interpreter to the payload when it's not available 4. Document that core26 requires additional configuration for the uv plugin

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 55
Quick Win: 30.25
Staleness: 50
Complexity: 45
Confidence: 65
Support Request: 15
needs triage uv plugin fails on core26: craft-parts removes python symlinks from venv/bin/ and dispatch script falls back to system Python without venv packages
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 60
Confidence: 90
Support Request: 0
needs triage Bug: uv plugin fails on Ubuntu 26.04 (core26) because craft-parts removes venv Python symlinks and falls back to system Python lacking required packages.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 65
Confidence: 85
Support Request: 5
needs triage Bug report detailing uv plugin failure on Ubuntu core26 due to craft-parts removing venv Python symlinks and falling back to system Python lacking required packages. Awaiting maintainer review.

Update history

No update history recorded yet.

Related work

  • Related To: craft-parts#1580 (confidence 80%)

    Issue #1580 was closed without resolution and claimed 'core26+ and bare are fine', but this issue demonstrates they are not. The same underlying problem persists.

Related issues

Issue Project State Summary Similarity
#2788 uv plugin fails on core26: dispatch script uses system Python instead of venv charmcraft open uv plugin fails on core26: craft-parts removes python symlinks from venv/bin/, dispatch script falls back to system Python without venv packages. Triaged and moved to Charmcraft by maintainer.
96%