← Back to issue list

Modifying a part's `build-environment` doesn't trigger a rebuild

View original Github issue

Metadata

Project
snapcraft
Number
#5735
Type
issue
State
open
Author
dilyn-corner
Labels
Type: Bug
Created
Updated
Closed

Current evaluation

Bug report: modifying a part's build-environment in snapcraft.yaml does not trigger a rebuild. Maintainer mr-cal commented it is the same as #5734 and that craft-parts should manage this. Issue is open, unlabelled beyond Type: Bug, and inactive for ~1 year.

Suggested action: keep open

Reason: Maintainer mr-cal acknowledged the issue on 2025-09-02, confirming it is a real bug (same as #5734) and that craft-parts should handle build-environment change detection. The issue is triaged and valid, but no fix has been implemented in craft-parts yet (no relevant commits found). It should remain open until craft-parts adds build-environment to its dirty-check logic.

Impact: 50 Quick Win: 30.0 Staleness: 70 Complexity: 40 Confidence: 75 Support Request: 0

Issue body

### Bug Description If the `build-environment` of a part is modified, a rebuild of the part will not be triggered. ### To Reproduce Create a snap with a part declaring a build-environment as so: ``` build-environment: - FOO: bar ``` Build the snap and then modify `bar` to some other value. Rerun the build and notice that the build step for the part is not retriggered. You can also add a key key to `build-environment` such as `- FIZZ: buzz` and no rebuild of the part will be triggered. ### Environment Ubuntu 25.04, building with snapcraft 8.11.1 and LXD latest/edge. ### snapcraft.yaml ```yaml name: test # you probably want to 'snapcraft register <name>' base: core24 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' # adopt-info: my-part summary: Single-line elevator pitch for your amazing snap # 79 char long summary description: | This is my-snap's description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots parts: my-part: # See 'snapcraft plugins' plugin: nil build-environment: # Run the build, change bar to baz, then rerun the build - FOO: bar # Run the build, add -FIZZ: buzz, then rerun the build - FIZZ: buzz ``` ### Relevant log output ```shell  snapcraft pack --shell Starting snapcraft, version 8.11.1.post53 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20250828-142159.558898.log' Launching managed ubuntu 24.04 instance... Starting instance Starting snapcraft, version 8.11.1.post53 Logging execution to '/tmp/snapcraft.log' Initialising lifecycle Installing build-packages Installing build-snapsc Skipping pull for my-part (already ran) Skipping build for my-part (already ran) Skipping stage for my-part (already ran) Skipping prime for my-part (already ran) Launching shell on build environment... snapcraft-test-amd64-4235994 ../project# cd ../parts/my-part/build/ build environment set for part 'parts' snapcraft-test-amd64-4235994 ../parts/my-part/build# echo $FOO bar snapcraft-test-amd64-4235994 ../parts/my-part/build# echo $FIZZ snapcraft-test-amd64-4235994 ../parts/my-part/build# exit ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 30.0
Staleness: 70
Complexity: 40
Confidence: 75
Support Request: 0
keep open Bug report: modifying a part's build-environment in snapcraft.yaml does not trigger a rebuild. Maintainer mr-cal commented it is the same as #5734 and that craft-parts should manage this. Issue is open, unlabelled beyond Type: Bug, and inactive for ~1 year.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 40
Confidence: 90
Support Request: 10
close stale Modifying a part's build-environment doesn't trigger a rebuild. Issue is 327 days old, last activity 322 days ago. Maintainer linked it to a duplicate issue in craft-parts, indicating it's a known limitation/bug in an upstream dependency.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 80
Support Request: 10
needs triage Bug report stating that changing a part's build-environment variables in snapcraft.yaml does not trigger a rebuild. Issue is over 10 months old with one comment pointing to a related issue, awaiting maintainer triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 80
Support Request: 5
keep open Changing a part's build-environment variables in snapcraft.yaml does not trigger a rebuild. Linked to craft-parts issue #5734, awaiting upstream resolution to properly track environment changes and invalidate cached steps.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/snapcraft#5734 (confidence 85%)

    Maintainer mr-cal explicitly stated 'Same as https://github.com/canonical/snapcraft/issues/5734, craft-parts should be managing this.' Both issues concern craft-parts not tracking changes to part properties (build-snap in #5734, build-environment here) for rebuild triggering.

Related issues

Issue Project State Summary Similarity
#5734 Modifying a build-snap doesn't trigger a change snapcraft open Changing a build-snap channel (e.g. node/12/stable to node/18/stable) does not trigger a rebuild of the part in snapcraft 8.11.1. A maintainer commented that craft-parts should be tracking this, but the issue remains open with no fix or follow-up.
78%