← Back to issue list

providers: pass SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT to instance

View original Github issue

Metadata

Project
snapcraft
Number
#3997
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

PR #3997 merged (commit 31a3990c8) forwarding SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT into the build provider instance, so parallel build limits are honored inside the build environment.

Resolution: closed resolved

Reason: Merged into main as commit 31a3990c8 ("providers: pass SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT to instance") after being re-targeted from hotfix/7.2 to main for the next minor release, fixing LP bug #1997874 where the env var was not passed into the build environment.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [X] Have you successfully run `make lint`? - [X] Have you successfully run `pytest tests/unit`? ----- Report from https://bugs.launchpad.net/snapcraft/+bug/1997874 `SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT` was not being passed into the build environment. Inside the build environment, the [default build count](https://github.com/snapcore/snapcraft/blob/0f49a754d515ffd26cd95404c0891c2dbf1de2a7/snapcraft/utils.py#L205) would be used, since the user's environment variable did not exist.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #3997 merged (commit 31a3990c8) forwarding SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT into the build provider instance, so parallel build limits are honored inside the build environment.
stealth/space-bunny-alpha — closed resolved Merged PR #3997 (commit 31a3990c8) into main, forwarding SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT into the build instance so parallel build limits are honored.
stealth/space-bunny-alpha — closed resolved Merged #3997 (31a3990c8) into main, passing SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT into the build instance so configured parallel-build limits are honored.
qwen/qwen3.6-35b-a3b — — Merged into main. Resolves a bug where the SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT environment variable was not passed to the build instance, ensuring correct parallel build limits during snap creation.
qwen3.6-35b-a3b-mtp-q6 — — Merged into main for the next minor release. Resolves a bug where SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT was not passed to the build instance, forcing builds to fall back to the default parallel count.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#4041 (confidence 70%)

    Follow-up merged PR (commit 1f8bef63c) adding a debug log when SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT is invalid, in the same get_parallel_build_count code path.

  • Related To: snapcraft#2670 (confidence 45%)

    Earlier related work forwarding parallel build count in the colcon plugin (commit bd0480688), same class of env-var forwarding issue.

Related issues

Issue Project State Summary Similarity
#212 Incorrectly handling SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT craft-providers open SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT not honored and Multipass instances hardcoded to 2 CPUs. Maintainer triaged; still unfixed in craft-providers (cpus=2 at multipass_provider.py:300), provider-side work split out to #531, snapcraft-side partly fixed in 8.4.4.
79%
#1997874 SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT doesn't seem to be passed through to lxd container snapcraft (launchpad) closed SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT was not forwarded into the LXD/Multipass build instance. Fixed by merged PR snapcore/snapcraft#3997 (commit 31a3990c8, 'providers: pass SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT to instance'), released in snapcraft 7.3.
78%
#1154 Expose parallel_build_count to scriptlets (LP: #1666271). snapcraft merged Merged PR #1154 in commit 9da78e45a, exposing parallel_build_count to scriptlets as SNAPCRAFT_PARALLEL_BUILD_COUNT after the requested rename.
74%
#4041 utils: log envvar SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT when invalid snapcraft merged Merged PR #4041 (commit 1f8bef63c): snapcraft/utils.py get_parallel_build_count() now emits a debug log with the invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT value. No functional change.
74%
#1988748 SNAPCRAFT_PARALLEL_BUILD_COUNT not respected if set in `override-build:` snapcraft (launchpad) closed Closed as working as intended: maintainer sergiusens explained craftctl reads the configured parallel-build count, so exporting SNAPCRAFT_PARALLEL_BUILD_COUNT inside override-build cannot change it (it is set by snapcraft itself, per PR #1154).
73%
#1666271 Expose parallel_build_count as a well-known variable to scriptlets snapcraft (launchpad) closed Feature request fulfilled: PR snapcore/snapcraft#1154 (commit 9da78e45a, "project: expose parallel_build_count to scriptlets") added SNAPCRAFT_PARALLEL_BUILD_COUNT to scriptlet env vars; author confirmed implementation, issue closed.
73%
#3775 provider: forward SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS snapcraft merged Merged PR #3775, forwarding SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS into provider build environments so experimental extensions work; merge commit 17fe9e48c.
71%
#764 fix(ProviderService): forward the parallel build count vars craft-application merged Merged #764 via commit ded4f5ec, fixing ProviderService to forward parallel build-count environment variables by default.
71%