Incorrect value for $CRAFT_PARALLEL_BUILD_COUNT in project metadata
Metadata
Current evaluation
Fixed project YAML expansion to use the resolved parallel-build count instead of always exposing 1; implemented by PR #517 in commit b508b6c0.
Resolution: closed resolved
Reason: PR #517, commit b508b6c0, moved parallel-build calculation into the utility layer and passes its result into craft-parts ProjectInfo during environment expansion, correcting project metadata.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### What needs to get done
Call [`_get_parallel_build_count()`](https://github.com/canonical/craft-application/blob/0b10cf663bc96c5ccf2791a03180c045a3adbd28/craft_application/services/lifecycle.py#L349) when [expanding the environment](https://github.com/canonical/craft-application/blob/0b10cf663bc96c5ccf2791a03180c045a3adbd28/craft_application/application.py#L710) in the application.
Probably requires moving that function to a `util` module.
### Why it needs to get done
$CRAFT_PARALLEL_BUILD_COUNT always evaluates to 1 in a project yaml file
So the desktop team can build the core24 firefox snap in a reasonable amount of time (https://github.com/canonical/snapcraft/issues/4785)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed project YAML expansion to use the resolved parallel-build count instead of always exposing 1; implemented by PR #517 in commit b508b6c0. | |
| stealth/space-bunny-alpha | — | closed stale | Closed without a recorded maintainer rationale. PR #517 addressed CRAFT-3524’s script build count, but no evidence confirms it fixed parallel-count expansion in project metadata. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The bug causing $CRAFT_PARALLEL_BUILD_COUNT to always evaluate to 1 in project metadata remains unaddressed, with only an automated Jira sync comment present. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. Synced to Jira as CRAFT-3524, but no fix or pull request was merged. The $CRAFT_PARALLEL_BUILD_COUNT metadata evaluation bug remains unaddressed. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#4785
(confidence 100%)
The downstream Firefox snap build problem that motivated correct parallel-build expansion.
-
Likely Fixed By:
canonical/craft-application#517
(confidence 95%)
The associated fix introduced util.get_parallel_build_count and uses it for project environment expansion.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #180 Support setting a parallel build count | craft-application | closed | Parallel build-count controls landed in canonical/craft-application#191 via commit 35b49c8f, adding app/CRAFT fixed settings and CPU-capped maximum settings. | |
| #517 fix: set correct parallel build count in scripts | craft-application | merged | Merged #517 as b508b6c0, fixing CRAFT_PARALLEL_BUILD_COUNT in override scripts; released in 4.2.7 and replacing #509. | |
| #5108 bump craft-application, check parallel build count in project metadata | snapcraft | merged | Merged #5108 bumped craft-application and validated parallel build count in project metadata, fixing #4785. The change shipped in Snapcraft 8.4.4. | |
| #540 Document parallel build count environment variables | craft-application | open | Documentation request to define and explain CRAFT_PARALLEL_BUILD_COUNT and CRAFT_MAX_PARALLEL_BUILD_COUNT; docs/reference/environment-variables.rst still omits them while util/system.py defines precedence. | |
| #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). |