← Back to issue list

Snapcraft ignores SNAPCRAFT_BUILD_ENVIRONMENT_* environment variables on MacOS

View original Github issue

Metadata

Project
snapcraft
Number
#6025
Type
issue
State
open
Author
pachulo
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

SNAPCRAFT_BUILD_ENVIRONMENT_CPU/MEMORY env vars documented for Multipass VM sizing are ignored on macOS; maintainer confirmed values are hardcoded, fix blocked by upstream craft-providers#531 (open 2+ years). Triaged as enhancement, no progress since Feb 2026.

Suggested action: keep open

Reason: Maintainer @mr-cal explicitly confirmed the limitation ('CPU and memory for Multipass is hardcoded without a workaround') and pointed to upstream craft-providers#531 as the blocking task. The issue is triaged, valid, and blocked by an external dependency that remains open, so it should stay open until that work lands. The docs at set-up-snapcraft.rst:147-148 also need updating to clarify the macOS limitation.

Impact: 45 Quick Win: 24.75 Staleness: 55 Complexity: 45 Confidence: 82 Support Request: 25

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description I'm trying to build the nextcloud snap on my MacBook and setting the following env variables: ``` export SNAPCRAFT_BUILD_ENVIRONMENT_CPU=3 export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=8G ``` As documented [here](https://github.com/canonical/snapcraft/blob/main/docs/how-to/set-up-snapcraft.rst#install-multipass), but snapcraft keeps on creating a machine with just 2 CPUs and 2G or RAM, so the build fails. How can I make it create a bigger VM? Should the documentation be updated? ### Steps to reproduce 1. Install both multipass & snapcraft using brew: `brew install multipass snapcraft` 2. Update the PATH variable, so that the multipass CLI is available: `export PATH="/usr/local/bin:$PATH"` 3. Update the env variables: `export SNAPCRAFT_BUILD_ENVIRONMENT_CPU=4 && export SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=12G` 4. Build the snap: `snapcraft pack` ### Environment This is on a MacBook Pro with an Apple M2 Pro chip, on macOS Tahoe 26.2. ### Log output ```shell 2026-02-10 03:12:57.242 Starting snapcraft, version 8.13.2 2026-02-10 03:12:57.242 Log verbosity level set to BRIEF 2026-02-10 03:12:57.242 Setting up Project 2026-02-10 03:12:57.242 Project file found at '/Users/marc/Software/github.com/pachulo/nextcloud-snap/snap/snapcraft.yaml' 2026-02-10 03:12:57.242 Loading project file 'snap/snapcraft.yaml 2026-02-10 03:12:57.259 Preparing application... 2026-02-10 03:12:57.260 Setting up ConfigService 2026-02-10 03:12:57.260 App is not running as a snap - snap config handler not created. 2026-02-10 03:12:57.260 Falling back from craft-application to snapcraft. 2026-02-10 03:12:57.260 lifecycle command: 'pack', arguments: Namespace(destructive_mode=False, use_lxd=False, debug=True, enable_manifest=False, manifest_image_information=None, bind_ssh=False, build_for=None, http_proxy=None, https_proxy=None, ua_token=None, enable_experimental_ua_services=False, enable_experimental_plugins=False, enable_experimental_extensions=False, enable_developer_debug=False, enable_experimental_target_arch=False, target_arch=None, provider=None, directory=None, output=None) 2026-02-10 03:12:57.260 command: pack, arguments: Namespace(destructive_mode=False, use_lxd=False, debug=True, enable_manifest=False, manifest_image_information=None, bind_ssh=False, build_for=None, http_proxy=None, https_proxy=None, ua_token=None, enable_experimental_ua_services=False, enable_experimental_plugins=False, enable_experimental_extensions=False, enable_developer_debug=False, enable_experimental_target_arch=False, target_arch=None, provider=None, directory=None, output=None) 2026-02-10 03:12:57.286 CPU count (from multiprocessing): 10 2026-02-10 03:12:57.286 Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT '' 2026-02-10 03:12:57.286 Running on arm64 for arm64 2026-02-10 03:12:57.288 Checking if 'version' exists. 2026-02-10 03:12:57.288 Getting value for 'version'. 2026-02-10 03:12:57.288 Got 'git' (updated=False) for 'version'. 2026-02-10 03:12:57.288 'version' exists. 2026-02-10 03:12:57.288 Getting value for 'version'. 2026-02-10 03:12:57.288 Got 'git' (updated=False) for 'version'. 2026-02-10 03:12:57.288 Checking if 'grade' exists. 2026-02-10 03:12:57.288 Getting value for 'grade'. 2026-02-10 03:12:57.288 Got 'stable' (updated=False) for 'grade'. 2026-02-10 03:12:57.288 'grade' exists. 2026-02-10 03:12:57.288 Getting value for 'grade'. 2026-02-10 03:12:57.288 Got 'stable' (updated=False) for 'grade'. 2026-02-10 03:12:57.292 Checking build provider availability 2026-02-10 03:12:57.292 Not loading snap config because snapcraft is not running as a snap. 2026-02-10 03:12:57.292 Using default provider 'multipass' on non-linux system. 2026-02-10 03:12:57.292 Executing on host: multipass version 2026-02-10 03:12:57.322 Using snapcraft from snap store channel 'latest/stable' in instance because snap injection is only supported on Linux hosts. 2026-02-10 03:12:57.323 Using hostname 'snapcraft-nextcloud-on-arm64-for-arm64-1298853' 2026-02-10 03:12:57.323 Launching instance... 2026-02-10 03:12:57.323 Converted name 'snapcraft-nextcloud-on-arm64-for-arm64-1298853' to instance name 'snapcraft-nextcloud-on-arm64-for-arm64-1298853' 2026-02-10 03:12:57.323 Executing on host: multipass list --format json 2026-02-10 03:12:57.355 Executing on host: multipass launch snapcraft:22.04 --name snapcraft-nextcloud-on-arm64-for-arm64-1298853 --cpus 2 --memory 2G --disk 64G ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 24.75
Staleness: 55
Complexity: 45
Confidence: 82
Support Request: 25
keep open SNAPCRAFT_BUILD_ENVIRONMENT_CPU/MEMORY env vars documented for Multipass VM sizing are ignored on macOS; maintainer confirmed values are hardcoded, fix blocked by upstream craft-providers#531 (open 2+ years). Triaged as enhancement, no progress since Feb 2026.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 40
Confidence: 90
Support Request: 10
keep open Snapcraft on macOS ignores SNAPCRAFT_BUILD_ENVIRONMENT_* variables for Multipass VM resources. Maintainer confirmed it is hardcoded and linked to an uncompleted enhancement task. Currently triaged and awaiting implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 60
Confidence: 85
Support Request: 20
keep open User reports SNAPCRAFT_BUILD_ENVIRONMENT_* vars are ignored on macOS when using Multipass. Maintainer confirmed it is hardcoded and linked to an upstream tracking issue. Awaiting implementation.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 40
Confidence: 85
Support Request: 20
keep open Snapcraft ignores SNAPCRAFT_BUILD_ENVIRONMENT_CPU and MEMORY variables for macOS Multipass VMs. Triaged as an enhancement. Resources are hardcoded with no workaround. Feature request tracked in craft-providers, awaiting implementation.

Update history

No update history recorded yet.

Related work

  • Blocked By: craft-providers#531 (confidence 95%)

    Maintainer explicitly cited this as the outstanding task needed to add CPU/memory configuration for Multipass instances; it has been open for over two years with no triage.

Related issues

Issue Project State Summary Similarity
#1814729 Setting SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY doesn't take effect snapcraft (launchpad) open SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY change ignored when reusing existing Multipass VM; filed in 18.10 era, 0 comments, no maintainer interaction in 7.5 years, related LP bug closed without resolution
80%
#1822265 SNAPCRAFT_BUILD_ENVIRONMENT_* change doesn't apply to existing VMs snapcraft (launchpad) closed Closed without resolution. SNAPCRAFT_BUILD_ENVIRONMENT_* changes failing to apply to existing VMs were left unaddressed with zero comments, indicating the report was abandoned or marked stale.
74%
#1809068 SNAPCRAFT_ environment variables not exposed to version-script snapcraft (launchpad) closed Abandoned and closed without resolution. The missing SNAPCRAFT_ environment variables in version-script were never addressed.
73%
#2002474 Snapcraft does not take the environment variables into account during build snapcraft (launchpad) open Environment variables in snapcraft command field not expanded during build, causing pack failure
72%