← Back to issue list

SNAPCRAFT_PARALLEL_BUILD_COUNT not respected if set in `override-build:`

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1988748
Type
issue
State
closed
Author
~saviq
Labels
—
Created
Updated
Closed

Current evaluation

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).

Resolution: closed not a bug

Reason: The only comment, from maintainer ~sergiusens (2023-08-17), states the behaviour is correct: exported environment does not affect calls to craftctl, so the bug was closed without a code fix. The variable is injected by snapcraft itself from the build settings (snapcraft#1154, commit 9da78e45a), not read from the scriptlet's shell environment.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Given snapcraft.yaml: ```yaml name: plel base: core20 version: '0.1' summary: plel description: | plel less grade: devel confinement: devmode parts: my-part: plugin: make build-environment: - SNAPCRAFT_PARALLEL_BUILD_COUNT: '4' override-build: export SNAPCRAFT_PARALLEL_BUILD_COUNT=1 snapcraftctl build ``` ```plain $ nproc 16 $ snapcraft --destructive-mode Skipping pull my-part (already ran) Building my-part + export SNAPCRAFT_PARALLEL_BUILD_COUNT=1 + SNAPCRAFT_PARALLEL_BUILD_COUNT=1 + snapcraftctl build + make -j4 # ... ``` The one from `build-environment` is picked up, but not that exported in `override-build`.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug 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).
stealth/space-bunny-alpha — closed not a bug Closed as working as intended: craftctl uses the configured parallel-build count; exporting SNAPCRAFT_PARALLEL_BUILD_COUNT inside override-build cannot change it.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/snapcraft#1154 (commit 9da78e45a), which exposed parallel_build_count to scriptlets; the build count remained available inside override-build.
qwen/qwen3.6-35b-a3b — — Abandoned without resolution. The bug reports that SNAPCRAFT_PARALLEL_BUILD_COUNT set in override-build is ignored, with build-environment values taking precedence. No fix or follow-up was provided.
qwen/qwen3.6-35b-a3b — — 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.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The report details that SNAPCRAFT_PARALLEL_BUILD_COUNT values in override-build are ignored, deferring to build-environment settings. No comments or linked PRs indicate a fix or status change.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution. The report highlights SNAPCRAFT_PARALLEL_BUILD_COUNT being ignored when exported in override-build instead of build-environment. No fix or follow-up comments were recorded.

Update history

Date Change
created

Related work

  • Related To: canonical/snapcraft#1154 (confidence 80%)

    Merged PR that exposes parallel_build_count to scriptlets as SNAPCRAFT_PARALLEL_BUILD_COUNT, explaining why the override-build export is ignored.

  • Duplicate Of: canonical/craft-providers#212 (confidence 25%)

    Separate report on SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT not being honoured; related area but different variable and provider-side behaviour.

Related issues

Issue Project State Summary Similarity
#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.
77%
#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.
75%
#3997 providers: pass SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT to instance snapcraft merged 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.
73%
#631 Read `CRAFT_PARALLEL_BUILD_COUNT` craft-parts closed Closed without code changes after parallel build-count configuration was moved upstream; craft-parts no longer needed to read CRAFT_PARALLEL_BUILD_COUNT.
72%
#502 Incorrect value for $CRAFT_PARALLEL_BUILD_COUNT in project metadata craft-application closed Fixed project YAML expansion to use the resolved parallel-build count instead of always exposing 1; implemented by PR #517 in commit b508b6c0.
70%
#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.
70%