snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

Expose the build base name in snapcraft.yaml

Open bschimke95 opened this issue 5 months ago • 2 comments

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

bschimke95 avatar Jul 15 '25 06:07 bschimke95

As you noted as a workaround, you can use core22 since a snapcraft.yaml is always tied to a particular base.

I agree that an environment variable is better for base-independent code.

mr-cal avatar Jul 21 '25 13:07 mr-cal

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/SNAPCRAFT-1187.

This message was autogenerated