← Back to issue list

uv plugin rewrites non-python shebangs

View original Github issue

Metadata

Project
rockcraft
Number
#889
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

uv plugin rewrites shebangs on all executable files (including non-Python shell scripts from stage packages), breaking dpkg maintainer scripts. Bug still present in code; no maintainer response or labels in 460 days.

Suggested action: needs triage

Reason: The issue has no labels, no comments, and no maintainer interaction in 460 days. The bug is confirmed still present: uv_plugin.py _get_rewrite_shebangs_commands() uses find -type f -executable to rewrite shebangs on ALL executables, not just Python scripts. The uv plugin is now restricted to v1 bases (20.04/22.04/24.04) per get_python_plugins(), but the underlying bug remains unfixed for those bases.

Impact: 55 Quick Win: 33.0 Staleness: 75 Complexity: 40 Confidence: 70 Support Request: 5

Issue body

### Bug Description The `uv` plugin rewrites shebangs for all scripts. It unintentionally modifies scripts included by staged packages. This is a problem because the uv plugin needs `python3-venv` as a stage package, which brings in dpkg-related shell scripts. It's also a problem if another part includes stage packages with similar dependencies, because the contents will no longer be identical and they will conflict. ### To Reproduce Build a rock using the uv plugin that calls `apt install`. See [here](https://github.com/mr-cal/rockcraft/commit/f0a4fc85edec43e4ce39a90f12b0a9ad534a87eb) for a reproducer. ### Environment rockcraft 1.11.0 ### rockcraft.yaml ```yaml name: test-uv base: ubuntu@24.04 version: '0.1' summary: hello description: hello platforms: amd64: parts: test-uv: plugin: uv source: src build-snaps: - astral-uv stage-packages: - python3-venv ``` ### Relevant log output ```shell > docker run --rm plugin-uv exec test-uv ... Selecting previously unselected package linux-libc-dev:amd64. Preparing to unpack .../64-linux-libc-dev_6.8.0-60.63_amd64.deb ... Unpacking linux-libc-dev:amd64 (6.8.0-60.63) ... Selecting previously unselected package libcrypt-dev:amd64. Preparing to unpack .../65-libcrypt-dev_1%3a4.4.36-4build1_amd64.deb ... File "/usr/bin/dpkg-maintscript-helper", line 63 preinst) ^ SyntaxError: closing parenthesis ')' does not match opening parenthesis '[' on line 45 dpkg: error processing archive /tmp/apt-dpkg-install-YeVPuW/65-libcrypt-dev_1%3a4.4.36-4build1_amd64.deb (--unpack): new libcrypt-dev:amd64 package pre-installation script subprocess returned error exit status 1 File "/usr/bin/dpkg-maintscript-helper", line 63 preinst) ^ SyntaxError: closing parenthesis ')' does not match opening parenthesis '[' on line 45 dpkg: error while cleaning up: new libcrypt-dev:amd64 package post-removal script subprocess returned error exit status 1 Selecting previously unselected package rpcsvc-proto. Preparing to unpack .../66-rpcsvc-proto_1.4.2-0ubuntu7_amd64.deb ... Unpacking rpcsvc-proto (1.4.2-0ubuntu7) ... Selecting previously unselected package libc6-dev:amd64. Preparing to unpack .../67-libc6-dev_2.39-0ubuntu8.4_amd64.deb ... Unpacking libc6-dev:amd64 (2.39-0ubuntu8.4) ... Selecting previously unselected package libheif-plugin-aomenc:amd64. Preparing to unpack .../68-libheif-plugin-aomenc_1.17.6-1ubuntu4.1_amd64.deb ... Unpacking libheif-plugin-aomenc:amd64 (1.17.6-1ubuntu4.1) ... Selecting previously unselected package manpages-dev. Preparing to unpack .../69-manpages-dev_6.7-2_all.deb ... Unpacking manpages-dev (6.7-2) ... Errors were encountered while processing: /tmp/apt-dpkg-install-YeVPuW/25-cpp_4%3a13.2.0-7ubuntu1_amd64.deb /tmp/apt-dpkg-install-YeVPuW/27-fonts-dejavu-core_2.37-8_all.deb /tmp/apt-dpkg-install-YeVPuW/28-fontconfig-config_2.15.0-1.1ubuntu2_amd64.deb /tmp/apt-dpkg-install-YeVPuW/65-libcrypt-dev_1%3a4.4.36-4build1_amd64.deb > docker run --rm test-uv exec head -n5 /usr/bin/dpkg-maintscript-helper #!/bin/python3 # # Copyright © 2007, 2011-2015 Guillem Jover <guillem@debian.org> # Copyright © 2010 Raphaël Hertzog <hertzog@debian.org> # Copyright © 2008 Joey Hess <joeyh@debian.org> ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 55
Quick Win: 33.0
Staleness: 75
Complexity: 40
Confidence: 70
Support Request: 5
needs triage uv plugin rewrites shebangs on all executable files (including non-Python shell scripts from stage packages), breaking dpkg maintainer scripts. Bug still present in code; no maintainer response or labels in 460 days.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 40
Confidence: 85
Support Request: 5
needs triage The uv plugin incorrectly rewrites non-Python shebangs in staged packages, causing script execution errors. The report lacks labels and maintainer response, remaining unassessed for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
needs triage The uv plugin incorrectly rewrites shebangs for non-Python scripts, breaking staged packages like python3-venv. Unassessed, no maintainer comments or labels after over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 45
Confidence: 85
Support Request: 5
close stale The uv plugin incorrectly rewrites shebangs for non-Python scripts, breaking dpkg-related shell scripts. The issue remains unlabelled and has been inactive for over a year with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 75
Support Request: 10
needs triage uv plugin rewrites non-Python shebangs in staged packages, breaking dpkg scripts and causing build failures. Open, unassigned, and inactive for over a year.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.