← Back to issue list

Missing CRAFT_DEFAULT_* env var when aliasing the default partition

View original Github issue

Metadata

Project
craft-parts
Number
#1171
Type
issue
State
closed
Author
upils
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Fixed by merged PR #1185 (commit 11eca6ee): CRAFT_DEFAULT_* variables are now set when the default partition uses an alias. Shipped in 2.19.0.

Resolution: closed resolved

Reason: PR #1185 was merged as commit 11eca6ee, adding CRAFT_DEFAULT_STAGE, PRIME, and OVERLAY values for aliased default partitions. The fix is documented in the 2.19.0 changelog.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description When using an alias for the default partition (using a different name than `default` for the first entry in the partitions list), `CRAFT_DEFAULT_*` env vars are not created. These env vars should always be defined when the partition feature is enabled. ### To Reproduce python3 -mcraft_parts --partitions test --overlay-base /tmp/overlay --trace -v prime ### part yaml ```shell parts: part1: plugin: nil overlay-script: | echo $CRAFT_DEFAULT_STAGE ``` ### Relevant log output ```shell DEBUG:craft_parts.utils.os_utils:umount mountpoint='/home/paul/scratch/craft-parts/overlay/overlay', args=() Error: 'overlay-script' in part 'part1' failed with code 1. :: /tmp/tmphwhrhumu/scriptlet.sh: line 5: CRAFT_DEFAULT_STAGE: unbound variable Review the scriptlet and make sure it's correct. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #1185 (commit 11eca6ee): CRAFT_DEFAULT_* variables are now set when the default partition uses an alias. Shipped in 2.19.0.
stealth/space-bunny-alpha — closed resolved Merged PR #1185 (commit 11eca6ee) fixed #1171 by ensuring CRAFT_DEFAULT_* variables are defined when the default partition has an alias.
qwen/qwen3.6-35b-a3b — — Closed without a repository fix. The missing CRAFT_DEFAULT_* environment variable bug when aliasing the default partition was deferred and tracked internally via Jira CRAFT-4653.
qwen/qwen3.6-35b-a3b — — Closed and synced to Jira ticket CRAFT-4653. No fix, merge, or resolution was applied. The missing CRAFT_DEFAULT_* env var bug when aliasing the default partition remains unresolved.
qwen/qwen3.6-35b-a3b — — Closed and synced to Jira (CRAFT-4653) for internal tracking. No fix was provided, indicating the issue was deferred or abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Closed and deferred to Jira ticket CRAFT-4653. No fix was merged. The missing CRAFT_DEFAULT_* environment variables when aliasing the default partition remain unresolved.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-parts#1185 (confidence 100%)

    Merged fix for the missing CRAFT_DEFAULT_* variables when the default partition is aliased.

Related issues

Issue Project State Summary Similarity
#1185 fix: Set CRAFT_DEFAULT_* env vars when the default partition is aliased craft-parts merged Merged PR #1185 as commit 11eca6ee, fixing CRAFT_DEFAULT_* variables when the default partition is aliased. The correction shipped in craft-parts 2.19.0.
91%
#170 feat: Use partition alias feature imagecraft closed PR #170 (partition alias mechanism for redefining the default partition) was closed unmerged; the author superseded it with canonical/imagecraft#178, merged as commit 8f5fab0 adding default-partition alias support plus required snap libraries (IMAGECRAFT-37).
71%