← Back to issue list

Lifecycle needs to track cross compilation

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1564192
Type
issue
State
closed
Author
~sergiusens
Labels
verification-done
Created
Updated
Closed

Current evaluation

Snapcraft didn't track target architecture in lifecycle dirty state, so rebuilding for a second arch was skipped. Fixed by merged PR canonical/snapcraft#450 (commit ab27f5587), shipped in snapcraft 2.9 for xenial; verified done.

Resolution: closed resolved

Reason: Kyle Fazzari's PR canonical/snapcraft#450 ('Make pull and build steps dirty if target arch changes') was merged as commit ab27f5587 and cited by ~kyrofa as the fix. The SRU changelog lists 'Make pull and build steps dirty if target arch changes. (#450) (LP: #1564192)' in snapcraft 2.9 (yakkety 2.9+16.10 and xenial 2.9); ~elopio verified on xenial that switching target-arch now marks the pull step out of date and the bug was moved through to -updates.

Evaluated by: mr-cal-bot

No scores available.

Issue body

[Impact] * If a snap is built using a specific target architecture, and one tries to build it again for a different architecture, Snapcraft says the snap is already built. [Test Case] 1. Build the 96boards-kernel example with `snapcraft --target-arch arm64`. 2. Build the 96boards-kernel example with `snapcraft --target-arch armhf`. 3. Note that Snapcraft doesn't try to rebuild the kernel for the new architecture, it says it's already done. 4. Apply the fix for this bug. 5. Build the 96boards-kernel example with `snapcraft --target-arch armhf`. 6. Note that Snapcraft now tries to rebuild the kernel using the new target architecture (which should fail-- all we care about is that it tries). [Regression Potential] * Dirty state tracking (rerunning steps if YAML sections change, bug #1477904) may not work correctly.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Snapcraft didn't track target architecture in lifecycle dirty state, so rebuilding for a second arch was skipped. Fixed by merged PR canonical/snapcraft#450 (commit ab27f5587), shipped in snapcraft 2.9 for xenial; verified done.
stealth/space-bunny-alpha — closed resolved Cross-architecture lifecycle tracking was fixed by PR ubuntu-core/snapcraft#450; Snapcraft 2.9 made pull/build steps dirty when target architecture changed.
stealth/space-bunny-alpha — closed stale Snapcraft failed to rebuild a snap after changing --target-arch because lifecycle state did not track the target architecture.
qwen/qwen3.6-35b-a3b — — Fixed lifecycle state tracking to account for cross-compilation target architectures. Snapcraft now correctly triggers rebuilds when the target architecture changes, preventing skipped builds. Verified and closed.
qwen/qwen3.6-35b-a3b — — Fixed Snapcraft lifecycle to track cross-compilation target architectures, resolving incorrect skip of rebuilds when switching architectures. Resolved and verified.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#450 (confidence 99%)

    Merged PR adding target-architecture state tracking so pull/build steps rerun on arch change; merge commit ab27f5587.

Related issues

Issue Project State Summary Similarity
#3418 project: always set target arch even if not cross compiling snapcraft merged Merged PR #3418 in commit a05e64594, setting an explicit target architecture for native and cross builds and consistently defining SNAPCRAFT_TARGET_ARCH.
70%