← 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

Documented SNAPCRAFT_BUILD_ENVIRONMENT_CPU/MEMORY are ignored on macOS; maintainer confirms Multipass CPU/memory hardcoded and points to upstream craft-providers#531. Docs still promise the vars work.

Suggested action: keep open

Reason: Confirmed valid and already triaged (labels 'Status: Triaged', 'Type: Enhancement'; internal tickets SNAPCRAFT-1293/SNAPCRAFT-1294). Maintainer @mr-cal stated 'CPU and memory for Multipass is hardcoded without a workaround' and linked the outstanding upstream task craft-providers#531, which is still open, so nothing in snapcraft resolves this — but it must not be closed. Repo evidence confirms the gap: docs/how-to/set-up-snapcraft.rst still tells users to 'export SNAPCRAFT_BUILD_ENVIRONMENT_CPU=8 / _MEMORY=16G' (lines 147-148), while snapcraft/providers.py:325-326 simply returns a bare MultipassProvider() with no CPU/memory plumbing, and no commit touches these vars. The in-repo portion (correcting the stale tip, which also references core20 despite core20 being dropped in #6019) is actionable now, which is why actionability is moderate rather than high; the real fix is blocked upstream.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 14 Complexity: 50 Confidence: 85 Actionability: 62

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
stealth/space-bunny-alpha
Impact: 45
Quick Win: 14
Complexity: 50
Confidence: 85
Actionability: 62
keep open Documented SNAPCRAFT_BUILD_ENVIRONMENT_CPU/MEMORY are ignored on macOS; maintainer confirms Multipass CPU/memory hardcoded and points to upstream craft-providers#531. Docs still promise the vars work.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 16
Complexity: 50
Confidence: 90
Actionability: 80
keep open SNAPCRAFT_BUILD_ENVIRONMENT_CPU and SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY env vars are ignored on macOS with Multipass; maintainer confirmed CPU/memory are hardcoded and referenced craft-providers#531 as the blocking task.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 25
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.

Update history

No update history recorded yet.

Related work

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

    Explicitly cited by maintainer @mr-cal; open enhancement 'Provide a way to set Multipass CPU and memory' where MultipassProvider still hardcodes cpus=2/mem_gb=2.

  • Duplicate Of: snapcraft (launchpad)#2008003 (confidence 70%)

    Same defect tracked on Launchpad ('Multipass build provider does not support resource settings core core22 snaps'), also pointing at craft-providers#531.

  • Related To: snapcraft (launchpad)#1814729 (confidence 65%)

    Older Launchpad report of SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY/ CPU being ignored when an existing Multipass instance is reused; same root cause.

Related issues

Issue Project State Summary Similarity
#1814729 Setting SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY doesn't take effect snapcraft (launchpad) open Feature request: SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY/CPU are ignored when an existing Multipass VM is reused; maintainer confirmed the vars only apply at VM creation and advised purging the instance. Not implemented
81%
#2008003 Multipass build provider does not support resource settings core core22 snaps snapcraft (launchpad) open Multipass builds of core22+ snaps ignore SNAPCRAFT_BUILD_ENVIRONMENT_CPU/MEMORY; provider hardcodes 2 CPUs/2GB RAM. Maintainer confirmed unsupported; fix tracked upstream in craft-providers#531.
75%
#1822265 SNAPCRAFT_BUILD_ENVIRONMENT_* change doesn't apply to existing VMs snapcraft (launchpad) closed Closed by maintainer sergiusens (2019-04-17) as intended behaviour: SNAPCRAFT_BUILD_ENVIRONMENT_* are development/debugging-only variables, so no change was made to apply them to an existing Multipass VM.
74%
#1809068 SNAPCRAFT_ environment variables not exposed to version-script snapcraft (launchpad) closed Closed after maintainers directed users from version-script to snapcraftctl set-version; no fix was cited for the missing SNAPCRAFT_* variables.
70%