← Back to issue list

Expose the build base name in snapcraft.yaml

View original Github issue

Metadata

Project
snapcraft
Number
#5614
Type
issue
State
open
Author
bschimke95
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Enhancement request to expose the build base name (e.g. core22) as an environment/project variable usable in snapcraft.yaml env and parts, avoiding hardcoding. Triaged; mr-cal agreed an env var is better than hardcoding; tracked internally as SNAPCRAFT-1187. Not implemented.

Suggested action: keep open

Reason: The feature is valid, triaged (labels 'Status: Triaged', 'Type: Enhancement') and has explicit maintainer buy-in: mr-cal stated "I agree that an environment variable is better for base-independent code", with an internal ticket SNAPCRAFT-1187 logged. Code inspection confirms no SNAPCRAFT_BUILD_BASE exists — set_global_environment() in snapcraft/parts/lifecycle.py only exposes SNAPCRAFT_PROJECT_NAME/VERSION/GRADE, so the request is still unimplemented. Implementation is a small, well-precedented addition (same mechanism as PR #3748) plus docs and spread tests, with the only subtlety being that `build-base: devel` maps to a concrete base (cf. commit 17666fb25 "return correct base when using devel for build-base"). Impact is moderate: a recipe-quality/DX improvement with an acceptable hardcoding workaround, not a broken behaviour.

Evaluated by: mr-cal-bot

Impact: 38 Quick Win: 19 Complexity: 32 Confidence: 80 Actionability: 74

Issue body

### What needs to get done I would like to access the build base name (e.g. `core22`) in other sections (e.g. environment and parts) of the `snapcraft.yaml` to avoid hardcoding and duplication. ### Why it needs to get done I have these two use-cases but I'm sure there are also others: 1. I need to reference the build base in an environment variable (`OPENSSL_MODULES: /snap/core22/current/usr/lib/x86_64-linux-gnu/ossl-modules-3/`) 2. I need to manually modify a path in a parts `override-build` based on the build base

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 38
Quick Win: 19
Complexity: 32
Confidence: 80
Actionability: 74
keep open Enhancement request to expose the build base name (e.g. core22) as an environment/project variable usable in snapcraft.yaml env and parts, avoiding hardcoding. Triaged; mr-cal agreed an env var is better than hardcoding; tracked internally as SNAPCRAFT-1187. Not implemented.
qwen/qwen3.6-35b-a3b
Impact: 60
Quick Win: 34
Complexity: 30
Confidence: 85
Actionability: 80
keep open Request to expose the build base (e.g. core22) as an environment variable in snapcraft.yaml to avoid hardcoding. Triaged and acknowledged by maintainers.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 30
Staleness: 75
Complexity: 25
Confidence: 70
Support Request: 10
keep open Feature request to expose the build base name (e.g. core22) as an environment variable in snapcraft.yaml to avoid hardcoding. Triaged and acknowledged by a maintainer who noted a workaround exists but agreed an env var would be better. Inactive for over a year.
qwen/qwen3.6-35b-a3b
Staleness: 80
Complexity: 35
Confidence: 85
Support Request: 5
keep open Feature request to expose the build base name in snapcraft.yaml to avoid hardcoding. Triaged and acknowledged by a maintainer, but inactive for approximately one year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 75
Support Request: 10
keep open Enhancement request to expose the build base name in snapcraft.yaml for use in environment variables and parts. Triaged, but inactive for over a year with no implementation.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#3748 (confidence 62%)

    Merged PR that introduced the global SNAPCRAFT_* project variables and yaml expansion this request would extend with a build-base variable.

Related issues

No related issues found above the similarity threshold.