snapcraft leaks build-environment across parts

Bug #1815658 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

Just came across this while testing the build-environment keyword, here is a simple reproducer:

name: test
version: "1.0"
summary: foo bar
description: foo bar baz

confinement: strict
grade: stable
base: core18

parts:
  first:
    plugin: nil
    build-environment:
      - FOO: bar
  second:
    plugin: nil
    after: [ first ]
    override-build: "echo FOO: $FOO"

I would expect the build-environment for part "second" to be empty, but it looks like the build-environment for part "first" is leaked into other parts that are built afterward:

$ SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft
Pulling first
'second' has dependencies that need to be staged: first
Skipping pull first (already ran)
Building first
Staging first
Pulling second
Skipping build first (already ran)
Building second
FOO: bar
Skipping stage first (already ran)
Staging second
Priming first
Priming second
Snapping 'test' |
Snapped test_1.0_amd64.snap

Changed in snapcraft:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 3.2
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This should probably be all that is needed http://paste.ubuntu.com/p/ZFYf2hxjfM/

Changed in snapcraft:
status: Triaged → In Progress
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
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.

Other bug subscribers

Remote bug watches

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