← Back to issue list

python shebang rewriting can fail in presence of a stage-package

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1766662
Type
issue
State
closed
Author
~jocave
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged canonical/snapcraft PR #2112 (commit 829adaec4), broadening Python shebang rewriting from bin directories to all stage-packages so later parts stage successfully.

Resolution: closed resolved

Reason: The proposed stage-packages shebang fix was merged in PR #2112 as commit 829adaec4. The issue is listed as fixed by that change.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Attempt to snap the following yaml: --- name: python-with-two-parts-stage-packages version: 0 summary: test the python plugin description: | This is a snap with two python parts and stage-packages confinement: strict grade: devel parts: part1: source: . plugin: python stage-packages: - python3-yaml part2: source: . plugin: python python-packages: - bitstring after: [part1] --- Note that after the build step of `part1` some files will have a shebang line (on xenial here): #! /usr/bin/python3.5 This will prevent staging of `part2` whose shebang lines appear to modified to the desired: #!/usr/bin/env python3.5

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged canonical/snapcraft PR #2112 (commit 829adaec4), broadening Python shebang rewriting from bin directories to all stage-packages so later parts stage successfully.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#2112 (commit 829adaec4), which rewrites all Python shebangs in stage-packages so later parts stage successfully.
stealth/space-bunny-alpha — closed resolved Python stage-package shebang rewriting was fixed by merged PR canonical/snapcraft#2112 (commit 829adaec4), allowing later parts to be staged successfully.
qwen/qwen3.6-35b-a3b — — Abandoned. Closed without resolution after over eight years due to zero comments or patches, likely superseded by newer snapcraft versions.
qwen/qwen3.6-35b-a3b — — Abandoned due to inactivity. Reported that python shebang rewriting fails during staging when a stage-package is present in a multi-part snap.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#2112 (confidence 100%)

    Merged PR #2112 resolved the issue by rewriting Python shebangs throughout stage-packages; resolving commit: 829adaec4.

Related issues

Issue Project State Summary Similarity
#2112 repo: fix all python shebangs in stage-packages snapcraft merged PR #2112 (commit 829adaec4) merged: snapcraft now rewrites Python shebangs across the whole part instead of only bin/, and drops archived sitecustomize.py, fixing LP: #1766662.
82%
#1730472 Python shebang rewrite doesn't support shebang args snapcraft (launchpad) closed Python shebang rewriting now preserves interpreter arguments; fixed by merged PR snapcraft#1719 in commit 8ed95e68a.
72%