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

Bug #1766662 reported by Jonathan Cave
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Kyle Fazzari

Bug Description

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

Revision history for this message
Jonathan Cave (jocave) wrote :
Changed in snapcraft:
milestone: none → 2.43
importance: Undecided → High
assignee: nobody → Kyle Fazzari (kyrofa)
status: New → Triaged
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

I propose fixing all python shebangs in stage-packages rather than just the bin directories. This proposal is available in code form here: https://github.com/snapcore/snapcraft/pull/2112

Changed in snapcraft:
status: Triaged → In Progress
Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.