providers: pass SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT to instance
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT is now correctly passed to the build instance, preventing fallback to default parallel limits. Retargeted from hotfix/7.2 for the next minor release. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4041 utils: log envvar SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT when invalid | snapcraft | merged | Merged into main. Adds logging for the SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT environment variable when invalid. Approved by reviewer, passed CI, and contains no functional changes. | |
| #212 Incorrectly handling SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT | craft-providers | open | Issue with SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT handling and incorrect CPU counts in Multipass. Maintainer is addressing via craft-application integration. | |
| #1154 Expose parallel_build_count to scriptlets (LP: #1666271). | snapcraft | merged | Merged after exposing parallel_build_count to scriptlets. A reviewer requested renaming the variable to SNAPCRAFT_PARALLEL_BUILD_COUNT, which the author agreed to. Approved and merged with 29 additions and 1 deletion across 4 files. | |
| #1988748 SNAPCRAFT_PARALLEL_BUILD_COUNT not respected if set in `override-build:` | snapcraft (launchpad) | closed | Closed without resolution or merge. The report details a bug where SNAPCRAFT_PARALLEL_BUILD_COUNT set in override-build is ignored, but no developer response or fix was provided, indicating the issue was abandoned or marked stale. | |
| #4785 bug: snapcraft uses '1' for CRAFT_PARALLEL_BUILD_COUNT on multi-core machine | snapcraft | closed | Snapcraft incorrectly set CRAFT_PARALLEL_BUILD_COUNT to 1 on multi-core machines due to an environment expansion bug in craft-application. Resolved and fixed in Snapcraft 8.4.4. | |
| #4088 providers: allow parallel installations when not running as a snap | snapcraft | merged | Merged into main. Checks if snapcraft runs as a snap before reading SNAP_INSTANCE_NAME, enabling parallel installations outside the snap. Follows PR #4084, approved, passed CI, 100% diff coverage. | |
| #1997874 SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT doesn't seem to be passed through to lxd container | snapcraft (launchpad) | closed | SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT not being passed to LXD containers was closed and abandoned. No comments, resolution, or fix were provided. |