canonical / colcon-in-container

Colcon extension to build a colcon workspace in a container
GNU General Public License v3.0
25 stars 0 forks source link

Install packages produced by colcon release_in_container to satisfy dependencies of subsequently discovered packages. #25

Open aosmw opened 3 weeks ago

aosmw commented 3 weeks ago
mkdir -p tryit/src
cd tryit/src
git clone git@github.com:Fields2cover/ortools_vendor
git clone git@github.com:Fields2cover/Fields2cover
colcon --log-level=info release-in-container --ros-distro humble --bloom-generator rosdebian --debug 
INFO:colcon.colcon_core.location:Using log path 'log/release-in-container_2024-06-10_16-40-00'
[1.752s] INFO:colcon.colcon-in-container:Downloading the image then creating the LXD instance
[7.522s] INFO:colcon.colcon-in-container:Waiting for ROS 2 to be installed
[191.008s] INFO:colcon.colcon-in-container:Initialising rosdep
[192.088s] INFO:colcon.colcon-in-container:Updating rosdep
[214.000s] INFO:colcon.colcon_core.package_discovery:Crawling recursively for packages in '/home/aosmw/lxd'
[214.031s] INFO:colcon.colcon-in-container:Discovered 2 packages, uploading the selected ones in the instance
[214.031s] INFO:colcon.colcon-in-container:uploading src/ortools_vendor into the instance /ws/src/ortools_vendor
[214.725s] INFO:colcon.colcon-in-container:uploading src/Fields2cover into the instance /ws/src/Fields2cover
[216.111s] INFO:colcon.colcon-in-container:Installing dependencies with rosdep
[336.569s] INFO:colcon.colcon-in-container:Bloom generating ortools_vendor
[338.204s] INFO:colcon.colcon-in-container:Generating binary for ortools_vendor

[2935.279s] INFO:colcon.colcon-in-container:Saving results for ortools_vendor
[2935.894s] INFO:colcon.colcon-in-container:Package ortools_vendor released!
[2935.894s] INFO:colcon.colcon-in-container:Installing dependencies with rosdep
[2936.507s] INFO:colcon.colcon-in-container:Bloom generating fields2cover
[2937.115s] ERROR:colcon.colcon-in-container:Release package fields2cover failed: Failed to run command: functools.partial(<bound method ReleaseInContainerVerb._bloom_generate of <colcon_in_container.verb.release_in_container.ReleaseInContainerVerb object at 0x7462e6a254b0>>, 'fields2cover', 'rosdebian') in container.Error code is 1
[2937.116s] WARNING:colcon.colcon-in-container:Debug was selected, entering the instance

The actual error was due to a cmake check where Fields2cover tests for a function provided by a newly packaged ortools_vendor.

Manually installing the ortools_vendor package with dpkg -i /ws/release/ortools_vendor/ros-humble-ortools-vendor_9.9.0-0jammy_amd64.deb

and then manually restarting the Fields2cover build showed that it satisfied the dependency.

Maybe there is a way to inject the /ws/release directory into the places searched by rosdep.

Guillaumebeuzeboc commented 3 weeks ago

Indeed, for now, non-upstream dependencies are not working with in-container. Being able to pass .deb file could be a solution.

For build-in-container and test-in-container the source of the dependency can be passed to satisfy the dependency.

artivis commented 3 weeks ago

Since the packages are processed in order, maybe we could come up with a --install-deb flag or such that would install the newly generated deb package before moving on to the next one.