Repository navigation
ci: re-enable macOS smoke tests without Homebrew libgit2 - #2907
Omjaiswal26 wants to merge 5 commits into
Conversation
| assert dylibs.is_dir(), 'expected vendored libgit2 from a pygit2 wheel' | ||
| print(f'pygit2 {pygit2.__version__} libgit2 {pygit2.LIBGIT2_VERSION}') | ||
| " | ||
| - name: Check for fully-configured multipass |
There was a problem hiding this comment.
We actually have to do significantly more for multipass now. We debugged this at canonical/multipass#4588
The short version is to copy these bits: https://github.com/lengau/setup-multipass/blob/d7ac69cac08d7d82da2518868b1ffe742a607e33/action.yaml#L35-L46
There was a problem hiding this comment.
Thanks — applied the setup-multipass workaround from the linked action (wait on multipass list, find --force-update, passphrase + sudo wrapper for canonical/multipass#4588). Also pinned the smoke-job Actions to SHAs for zizmor. Ready for another look / CI once workflows are approved.
fafdf71 to
48a7338
Compare
| - name: Checkout code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| charmcraft init --profile=machine | ||
| # Machine profile uses the uv plugin, which requires a lockfile to pack. | ||
| uv lock | ||
| charmcraft pack |
There was a problem hiding this comment.
2026-10-05 16:19:44.655 Project file found at /root/project/charmcraft.yaml
Traceback (most recent call last):
File "/snap/charmcraft/8265/bin/charmcraft", line 12, in <module>
sys.exit(main())
^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/charmcraft/application/main.py", line 201, in main
return app.run()
^^^^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/application.py", line 544, in run
self._initialize_craft_parts()
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/application.py", line 643, in _initialize_craft_parts
self._register_default_plugins()
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/application.py", line 460, in _register_default_plugins
if plugins := self._get_app_plugins():
^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/charmcraft/application/main.py", line 129, in _get_app_plugins
full_build_plan = self.services.get("build_plan").create_build_plan(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/services/buildplan.py", line 143, in create_build_plan
raw_project = project_service.get_raw()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/services/project.py", line 208, in get_raw
return copy.deepcopy(self._load_raw_project())
^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/charmcraft/8265/lib/python3.12/site-packages/craft_application/services/project.py", line 197, in _load_raw_project
with project_path.open() as project_file:
^^^^^^^^^^^^^^^^^^^
File "/snap/charmcraft/current/usr/lib/python3.12/pathlib.py", line 1015, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/root/project/charmcraft.yaml'
Interesting... I would guess this is some side-effect of the permissions stuff we did with multipass?
There was a problem hiding this comment.
Agreed that this looks like a side-effect of the sudo multipass wrapper: mounts run as root while the project is owned by the runner user.
Would chmod -R a+rX . before pack be an acceptable smoke-test workaround, or do you prefer something else (e.g. UID maps in craft-providers)?
There was a problem hiding this comment.
Yeah I think the permissions stuff is fine. We're already deviating from what a macos desktop would look like. Thanks!
| # libgit2 is provided by the pygit2 macOS wheel; do not brew install libgit2@1.7 | ||
| # (deprecated/unavailable). See https://github.com/canonical/charmcraft/issues/2605 | ||
| endif |
There was a problem hiding this comment.
| # libgit2 is provided by the pygit2 macOS wheel; do not brew install libgit2@1.7 | |
| # (deprecated/unavailable). See https://github.com/canonical/charmcraft/issues/2605 | |
| endif | |
| endif |
Use the pygit2 wheel's vendored libgit2 and run uv lock before pack so the machine profile smoke test can succeed. Fixes canonical#2605.
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
218fcd8 to
88ac61c
Compare
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
|
@Omjaiswal26 it looks like there's still a permissions issue with the macos smoke test :-/ |
lengau
left a comment
There was a problem hiding this comment.
This is still failing :/
|
yeah, chmod didn't fix it. ci still fails opening /root/project/charmcraft.yaml inside the vm. i've found two possible ways to keep pack:
i'd rather do (1). what do you think? |
Summary
macos-smoke-testonmacos-14/macos-14-largewithout Homebrewlibgit2@1.7, using the pygit2 wheel's vendored libgit2.install-macos-build-deps.uv lockaftercharmcraft initso the machine-profile (uv plugin) pack can succeed.Fixes #2605
Test plan
make setupon Apple Silicon (no Homebrew libgit2).dylibsinit+uv lock+pack→*.charmmake test-fast(3 pre-existingplatforms-multi-basefailures on Apple Silicon; unrelated)macos-smoke-testpasses onmacos-14andmacos-14-largemake lint && make test. (N/A — CI/Makefile smoke re-enable; verified with local Multipass pack, pre-commit, andmake test-fast)