How to set environment variables for parts?

You can use the build-environment property, however it’s a Snapcraft 3 feature and will require you using the new snapcraft syntax(i.e. with the base keyword, without the remote parts)

Refer https://github.com/snapcore/snapcraft/pull/2322 for more info.

For legacy Snapcraft syntax you have to override the build step and build the part manually, or write a local plugin to replace/complement the python plugin.

2 Likes