Part environment variables¶
When building a part to construct a snap, Snapcraft creates the following sets of environment variables that can optionally be used by a part’s build mechanism:
Configuration¶
For all environment variables related to system architectures, see Project variables.
In addition to architecture-related variables, the following environment variables are also set:
core22 and core24¶
|
The preferred number of jobs to build the project with. |
|
The Snapcraft project name set by the project file’s |
|
The Snapcraft project version set by the project file’s |
|
The Snapcraft project grade set in the project file. |
|
The part currently being processed, as set by the part’s name in the project file. |
|
The step currently being executed. |
core20¶
|
The preferred number of jobs to build the project with. |
|
The Snapcraft project name set by the project file’s |
|
The Snapcraft project version set by the project file’s |
|
The Snapcraft project grade set in the project file. |
Directories¶
See Parts lifecycle for details on which directories are created when building a part.
core22 and core24¶
Snapcraft exposes the following directory-related environment variables when building with core22 and core24:
|
The absolute path to where a part’s sources are pulled. It’s also the part’s working directory for the pull step. |
|
The absolute path to the part source subdirectory, if any. Defaults to the part source directory |
|
The absolute path to the sources used for the part’s build step. It is also the working directory of the build step. |
|
The absolute path to the part build subdirectory in case of out-of-tree builds. Defaults to the part source directory. |
|
The absolute path to the results of the part’s build step. It also contains the staged packages of that part. |
|
The absolute path to where files are primed. |
|
The absolute path to the root of the Snapcraft project. |
|
The absolute path to where files are staged. |
For more details on the Craft Parts step execution environment, see Step execution environment.
core20¶
Snapcraft exposes the following directory-related environment variables when building a part with core20:
|
The absolute path to where a part’s sources are pulled. It’s also the part’s working directory for the pull step. |
|
The absolute path to the sources used for the part’s build step. It is also the working directory of the build step. |
|
The absolute path to the results of the part’s build step. It also contains the staged packages of that part. |
|
The absolute path to where files are primed. |
|
The absolute path to the root of the Snapcraft project. |
|
The absolute path to where files are staged. |