Colcon build failed with extension ros2-humble-ros-base
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
When I, build my ros2 package for the first with using as a
``` yaml
extensions: [ros2-humble-ros-base]
```
I have error with building packages with msg and srv files.
``` bash
:: ModuleNotFoundError: No module named 'lark'
```
But when I first build snap with basic options using like here https://github.com/snapcraft-docs/ros2-talker-listener-core22/blob/main/snapcraft.yaml, and than I switch to content sharing, so remove `stage-packages` from parts and add switch extensions to `[ros2-humble-ros-base]`. It starts building messages packages
### To Reproduce
1. Build snap for the first time using Content-sharing setup from here: https://snapcraft.io/docs/ros2-applications, but use ros package with msg pack.
### Environment
- LXD
- Ubuntu 22.04 LTS on ARM chip
### snapcraft.yaml
```yaml
name: my-ros2-snap
description: |
This is a snap for testing ros2
version: '1.0'
summary: Test for ros2
confinement: devmode
base: core22
parts:
ros2-workspace-test:
plugin: colcon
source: src/
local-files:
plugin: dump
source: snap/local/
organize:
'*.sh': usr/bin/
apps:
my-component:
command: ros2 run wisevision_action_executor automatic_action_service
plugs: [network, network-bind]
extensions: [ros2-humble-ros-base]
```
### Relevant log output
```shell
*EXPERIMENTAL* extension 'ros2-humble-ros-base' enabled
*EXPERIMENTAL* extension 'ros2-humble-ros-base' enabled
Installed package repositories
Repulling ros2-workspace-test ('stage-packages' property changed) :: Downloading package: ros-humble-rcpputils/snap/snapcraft/13867/lib/python3.12/site-packages/apt/package.py:810: Warning: W:Download is performed unsandboxed as root as file '/root/.cache/snapcraft/download/ros-humble-rcpputils_2.4.4-1jammy.20241128.002909_arm64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
acq.run()
Failed to run the build script for part 'ros2-workspace-test'.
:: + colcon build --base-paths /root/parts/ros2-workspace-test/src --build-base /root/parts/ros2-workspace-test/build --merge-install --install-base /root/parts/ros2-workspace-test/install/opt/ros/snap --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PREFIX_PATH=/snap/ros-humble-ros-base-dev/current/usr --parallel-workers 2
:: --- stderr: notification_msgs
:: Traceback (most recent call last):
:: File "/root/parts/ros2-workspace-test/install/opt/ros/humble/share/rosidl_generator_c/cmake/../../../lib/rosidl_generator_c/rosidl_generator_c", line 8, in <module>
:: from rosidl_generator_c import generate_c
:: File "/root/parts/ros2-workspace-test/install/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_c/__init__.py", line 15, in <module>
:: from rosidl_cmake import convert_camel_case_to_lower_case_underscore
:: File "/root/parts/ros2-workspace-test/install/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_cmake/__init__.py", line 24, in <module>
:: from rosidl_parser.parser import parse_idl_file
:: File "/root/parts/ros2-workspace-test/install/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_parser/parser.py", line 20, in <module>
:: from lark import Lark
:: ModuleNotFoundError: No module named 'lark'
:: gmake[2]: *** [CMakeFiles/notification_msgs__rosidl_generator_c.dir/build.make:87: rosidl_generator_c/notification_msgs/msg/notification.h] Error 1
:: gmake[1]: *** [CMakeFiles/Makefile2:212: CMakeFiles/notification_msgs__rosidl_generator_c.dir/all] Error 2
:: gmake: *** [Makefile:146: all] Error 2
:: ---
:: Failed <<< notification_msgs [1.21s, exited with code 2]
Check the build output and verify the project can work with the 'colcon' plugin.
Failed to execute pack in instance.
Recommended resolution: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
Full execution log: '/home/cezary/.local/state/snapcraft/log/snapcraft-20250312-150713.792155.log'
```
### Additional context
_No response_
Evaluation history
No evaluation history available.