← 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
2025-05-28 16:29:54+00:00
Updated
2025-05-28 16:29:54+00:00
Closed

Current evaluation

uv plugin rewrites non-Python shebangs in staged packages, breaking dpkg scripts and causing build failures. Open, unassigned, and inactive for over a year.

Suggested action: needs triage

Reason: The issue presents a clear bug with reproduction steps but has been inactive for over a year with no labels or maintainer interaction. It requires triage to assess current relevance, update labels, and determine if it should be prioritized or closed as outdated.

Staleness: 85 Complexity: 45 Confidence: 75 Support Request: 10

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
2026-06-16 08:29:01.561747+00:00 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.
2026-06-16 08:26:36.878651+00:00 pending