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

Charmcraft cannot parse a dev version build for multipass #1917

Open
jat-canonical opened this issue Sep 24, 2024 · 6 comments
Open

Charmcraft cannot parse a dev version build for multipass #1917

jat-canonical opened this issue Sep 24, 2024 · 6 comments
Labels
blocked Waiting on a third party to finish something before this can be further processed Bug Something isn't working triaged

Comments

@jat-canonical
Copy link

Bug Description

charmcraft throws invalid version for a dev build of multipass which follows sematic versioning spec.

To Reproduce

  • Install a dev build of multipass
  • Run charmcraft pack

Environment

OSX 15.0 (Sequioa)

charmcraft.yaml

N/A

Relevant log output

charmcraft internal error: InvalidVersion("Invalid version: '1.15.0-dev.2929.pr661'")
Full execution log: '/Users/X/Library/Logs/charmcraft/charmcraft-y-z.log'
@jat-canonical jat-canonical added the Bug Something isn't working label Sep 24, 2024
@lengau
Copy link
Collaborator

lengau commented Sep 24, 2024

Thanks for the report @jat-canonical! Could you attach the contents of the full execution log? (I can't reproduce this on my machine, so the logs would be really useful for seeing where this is occurring).

@jat-canonical
Copy link
Author

Here you go:

2024-09-24 19:00:16.856 Starting charmcraft, version 3.2.1
2024-09-24 19:00:16.857 Log verbosity level set to BRIEF
2024-09-24 19:00:16.857 Configuring application...
2024-09-24 19:00:16.857 Preparing application...
2024-09-24 19:00:16.857 Build plan: platform=None, build_for=None
2024-09-24 19:00:16.866 Loading project file '/Users/X/canonical/anbox-cloud-charms/charms/ams-ops/charmcraft.yaml'
2024-09-24 19:00:16.875 Processing grammar (on arm64 for arm64)
2024-09-24 19:00:16.875 Not processing grammar for non-grammar enabled keyword charm-requirements
2024-09-24 19:00:16.875 Processing grammar for override-build: cp /usr/bin/rustc-1.76 /usr/bin/rustc
craftctl default
2024-09-24 19:00:16.875 Processing grammar for build-packages: ['libffi-dev', 'libssl-dev', 'rustc-1.76', 'cargo', 'pkg-config']
2024-09-24 19:00:16.879 Running charmcraft:ubuntu-22.04-arm64 in arm64 instance...
2024-09-24 19:00:16.879 Setting up ProviderService
2024-09-24 19:00:16.879 Preparing managed instance 'charmcraft-ams-on-arm64-for-arm64-44531000'
2024-09-24 19:00:16.880 Using hostname 'charmcraft-ams-on-arm64-for-arm64-44531000'
2024-09-24 19:00:16.880 Not loading snap config because charmcraft is not running as a snap.
2024-09-24 19:00:16.880 No snap config found.
2024-09-24 19:00:16.880 Using default provider 'multipass' on non-linux system.
2024-09-24 19:00:16.880 Executing on host: multipass version
2024-09-24 19:00:16.926 charmcraft internal error: InvalidVersion("Invalid version: '1.15.0-dev.2929.pr661'")
2024-09-24 19:00:16.928 Traceback (most recent call last):
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/application.py", line 543, in run
2024-09-24 19:00:16.928     self.run_managed(platform, build_for)
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/charmcraft/application/main.py", line 154, in run_managed
2024-09-24 19:00:16.928     super().run_managed(platform, build_for)
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/application.py", line 368, in run_managed
2024-09-24 19:00:16.928     with self.services.provider.instance(
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/lib/python3.10/contextlib.py", line 135, in __enter__
2024-09-24 19:00:16.928     return next(self.gen)
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/charmcraft/services/provider.py", line 119, in instance
2024-09-24 19:00:16.928     with super().instance(
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/lib/python3.10/contextlib.py", line 135, in __enter__
2024-09-24 19:00:16.928     return next(self.gen)
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_application/services/provider.py", line 126, in instance
2024-09-24 19:00:16.928     provider.ensure_provider_is_available()
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/multipass_provider.py", line 165, in ensure_provider_is_available
2024-09-24 19:00:16.928     ensure_multipass_is_ready()
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/_ready.py", line 41, in ensure_multipass_is_ready
2024-09-24 19:00:16.928     if not multipass.is_supported_version():
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/craft_providers/multipass/multipass.py", line 161, in is_supported_version
2024-09-24 19:00:16.928     return packaging.version.parse(version) >= minimum_version
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/packaging/version.py", line 56, in parse
2024-09-24 19:00:16.928     return Version(version)
2024-09-24 19:00:16.928   File "/Users/X/.pyenv/versions/3.10.11/envs/charms/lib/python3.10/site-packages/packaging/version.py", line 202, in __init__
2024-09-24 19:00:16.928     raise InvalidVersion(f"Invalid version: '{version}'")
2024-09-24 19:00:16.928 packaging.version.InvalidVersion: Invalid version: '1.15.0-dev.2929.pr661'
2024-09-24 19:00:16.928 Full execution log: '/Users/X/Library/Logs/charmcraft/charmcraft-20240924-190016.856344.log'

@lengau lengau added triaged blocked Waiting on a third party to finish something before this can be further processed labels Sep 24, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@lengau
Copy link
Collaborator

lengau commented Sep 24, 2024

Thanks! That confirmed my suspicion that the error was coming via craft-providers, but provided me enough info to give a good upstream bug report too: canonical/craft-providers#661

@lengau
Copy link
Collaborator

lengau commented Sep 24, 2024

@jat-canonical a follow-up: could you send me the output of multipass version on the machine? I want to ensure the regression test uses a real-world example.

@jat-canonical
Copy link
Author

➜ multipass --version
multipass   1.15.0-dev.2929.pr661+gc67ef6641.mac
multipassd  1.15.0-dev.2929.pr661+gc67ef6641.mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting on a third party to finish something before this can be further processed Bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants