← Back to issue list

edge channel stricter about `build-environment` types in parts

View original Github issue

Metadata

Project
snapcraft
Number
#4978
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged PR canonical/snapcraft#5051 (commit 0e2cfbf56), upgrading craft-grammar to 2.0.1 and restoring numeric-to-string coercion for build-environment values.

Resolution: closed resolved

Reason: PR canonical/snapcraft#5051 was merged as commit 0e2cfbf56. Its craft-grammar 2.0.1 upgrade restored coercion of integer environment values to strings.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description The `edge` channel can no longer build charmcraft due to a value error in `parts.spread.build-environment` ### To Reproduce 1. Clone charrmcraft (I'm on commit `0d3b27136fb9c21e6d7c091dc4ca4ac6bfee3aca`) 2. `snapcraft pack` with snapcraft revision 12433 (`8.3.2.post34+git655e543a`) ### Environment KDE Neon noble ### snapcraft.yaml ```shell https://github.com/canonical/charmcraft/blob/0d3b27136fb9c21e6d7c091dc4ca4ac6bfee3aca/snap/snapcraft.yaml#L187 ``` ### Relevant log output ```shell lengau@ratel:~/Work/Code/charmcraft-2$ snapcraft pack Bad snapcraft.yaml content: - Value error, value must be a list of Annotated: [{'CGO_ENABLED': 0}] (in field 'parts.spread.build-environment') Full execution log: '/home/lengau/.local/state/snapcraft/log/snapcraft-20240815-165625.696525.log' ``` ### Additional context Changing the value of `CGO_ENABLED` from `0` to `"0"`resolved it

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#5051 (commit 0e2cfbf56), upgrading craft-grammar to 2.0.1 and restoring numeric-to-string coercion for build-environment values.
stealth/space-bunny-alpha — closed resolved Pydantic 2 migration made snapcraft reject integer build-environment values (CGO_ENABLED: 0). Fixed by merged PR #5051 (commit 0e2cfbf56) bumping craft-grammar to 2.0.1 / craft-store 3.0.1, restoring number-to-string coercion; tracked as CRAFT-3243.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#5051 (commit 0e2cfbf56), which upgraded craft-grammar to 2.0.1 and restored numeric-to-string coercion for integer build-environment values.
qwen/qwen3.6-35b-a3b — — Fixed via upstream PR #5051. Pydantic 2 updates caused snapcraft pack to reject integer values in build-environment fields. The upstream merge resolves the validation error by properly handling type coercion.
qwen/qwen3.6-35b-a3b — — Resolved a Pydantic 2 type validation error in build-environment that caused build failures. Fixed via upstream PR #5051, which updated type handling to accept numeric values.
qwen/qwen3.6-35b-a3b — — Snapcraft build failures caused by Pydantic 2 strict type validation on build-environment values were resolved by updating type annotations in snapcraft and craft-parts. The fix was merged via PR #5051.
qwen/qwen3.6-35b-a3b — — Fixed via upstream PR #5051. Stricter Pydantic 2 validation caused snapcraft pack to fail when build-environment values were integers instead of strings. The upstream merge resolves the type mismatch error.
qwen3.6-35b-a3b-mtp-q6 — — Fixed via upstream PR #5051. Pydantic 2 stricter type validation caused build-environment integer values to fail. Snapcraft and craft-parts were updated to enforce string types, resolving the build error.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#5051 (confidence 100%)

    Merged dependency update that fixed this issue and closed it.

  • Related To: canonical/snapcraft#5017 (confidence 95%)

    A separate Pydantic 2 coercion regression fixed by the same PR.

Related issues

No related issues found above the similarity threshold.