Environment variables that Snapcraft consumes


#1

NOTE:

  • This table is NOT complete nor error-free, feel free to extend/fix it.
  • Environment variables are mostly for experimental/internal usage and shouldn’t be considered stable
Name & Description Typical Values
SNAPCRAFT_BUILD_ENVIRONMENT
Refer The SNAPCRAFT_BUILD_ENVIRONMENT environment variable for more info
[host|managed-host|multipass]
(The value lxd has been obsoleted in Snapcraft 3.0 new syntax)
SNAPCRAFT_BUILD_ENVIRONMENT_DISK
The allocated virtual storage size for the VM build environment
Default value: 256G
Source: snapcraft/_multipass.py at 9d353a6305b8006e0bc0e984c87591e5f08fb09d · snapcore/snapcraft
NOTE: This environment variable is only honored when the VM is not created yet
256G
SNAPCRAFT_BUILD_ENVIRONMENT_CPU
The allocated processor cores for the VM build environment
Default value: 2
Source: snapcraft/_multipass.py at 9d353a6305b8006e0bc0e984c87591e5f08fb09d · snapcore/snapcraft
NOTE: This environment variable is only honored when the VM is not created yet
2
SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY
The allocated primary memory size for the VM build environment
Default value: 4G
Source: snapcraft/_multipass.py at 9d353a6305b8006e0bc0e984c87591e5f08fb09d · snapcore/snapcraft
NOTE: This environment variable is only honored when the VM is not created yet
2G
(Should be the same argument of multipass launch --mem, amount of memory to allocate in bytes, or with K, M, G suffix)
SNAPCRAFT_ENABLE_DEVELOPER_DEBUG
Enable verbose debugging messages, refer Debugging snapcraft for more info
[y|yes|t|true|on|1|n|no|f|false|off|0]
(A Python distutils.util.strtobool boolean value) (source)

Error report: snapcraft fails on host with 1 GiB of memory
#2

@admins, I forget to set this topic as wiki, can one of you help me out?


#3

@admins reping…


#4

Oops - sorry for missing this before. It’s a wiki now. Thank you!


#5

Thank you.

However, when I set this one to, say, 8G:

It seems to be ignored. In my process, I still see qmey consuming 2G.

EDIT: nevermind, it just requires snapcraft clean beforehand.


#6

I was going the note that here, but at the time this page is not editable. :slight_smile: