Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edge channel stricter about build-environment types in parts #4978

Closed
lengau opened this issue Aug 15, 2024 · 4 comments
Closed

edge channel stricter about build-environment types in parts #4978

lengau opened this issue Aug 15, 2024 · 4 comments
Assignees
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@lengau
Copy link
Contributor

lengau commented Aug 15, 2024

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

https://github.com/canonical/charmcraft/blob/0d3b27136fb9c21e6d7c091dc4ca4ac6bfee3aca/snap/snapcraft.yaml#L187

Relevant log output

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

@lengau lengau added the bug Actual bad behavior that don't fall into maintenance or documentation label Aug 15, 2024
@mr-cal mr-cal added the triaged label Aug 16, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3243.

This message was autogenerated

@mr-cal
Copy link
Collaborator

mr-cal commented Aug 16, 2024

This likely broke due to pydantic 2 dropping this behavior by default: https://docs.pydantic.dev/dev/api/config/#pydantic.config.ConfigDict.coerce_numbers_to_str

Snapcraft probably needs fixes in places like this:

build_environment: Grammar[list[SingleEntryDict[str, str]]] | None = None

Craft-parts probably needs fixes too: https://github.com/canonical/craft-parts/blob/7ea8655b596b359e8542d171bea011f672e1c996/craft_parts/parts.py#L67

@lengau
Copy link
Contributor Author

lengau commented Aug 16, 2024

Thanks @mr-cal - I've made an upstream PR for it. Once that's merged an update will fix this.

@mr-cal
Copy link
Collaborator

mr-cal commented Sep 20, 2024

Fixed via #5051

@mr-cal mr-cal closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

No branches or pull requests

2 participants