Open mjcarroll opened 3 years ago
As far as I can tell, there are a few ways to solve it.
1) If you aren't actively using bazel in colcon workspaces, remove the colcon-bazel
extension
2) Alter the PRIORITY
setting the colcon-bazel
extension point to give CMake higher priority
colcon.pkg
to all ignition packages to make CMake
explicitAnother alternative is to use a colcon.meta
file in the root of your colcon workspace.
{
"paths": {
"src/ign-utils": {
"type": "cmake"
},
"src/ign-math": {
"type": "cmake"
},
"src/ign-common": {
"type": "cmake"
},
}
}
I remember having this issue before:
https://github.com/ignitionrobotics/ign-plugin/pull/31#pullrequestreview-532959529
Option 1. sounds like a tough ask for all users and I'd like to avoid option 3 so we don't have one more file to maintain.
I didn't quite understand how a user can set the PRIORITY
for option 2, is this something that can be set from ~/.colcon/defaults.yaml
or something like that?
The colcon.meta
option also sounds promising.
I didn't quite understand how a user can set the
PRIORITY
for option 2, is this something that can be set from~/.colcon/defaults.yaml
or something like that?The
colcon.meta
option also sounds promising.
+1 to both options, I also wonder if a different default priority for Bazel should be pushed upstream? While I understand that it would be an arbitrary choice to say what's higher priority between CMake and Bazel, it sounds like anything better than the current behavior (skipping the package altogether) would be better?
I didn't quite understand how a user can set the PRIORITY for option 2, is this something that can be set from ~/.colcon/defaults.yaml or something like that?
Setting the priority wouldn't be a user choice. The bazel extension itself would have to be modified upstream so that it had a higher/lower priority than CMake so that one will always "win".
From my observations, colcon is used more widely with cmake/ros projects, so it seems like that would be the sane default, and users could use one of the approaches above to "force" bazel.
I believe the colcon-bazel pull request will address this. You can install that version via pip:
pip3 install -e git://github.com/colcon/colcon-bazel@reduce_priority#egg=colcon-bazel --upgrade --user
For future visitors to this issue, I needed to tweak @mjcarroll 's command to this:
pip3 install git+https://github.com/colcon/colcon-bazel@master#egg=colcon-bazel --upgrade --user
in particular I needed to use git+https:
instead of only git:
, otherwise GitHub hung up on me. The other changes in my command are just to (1) not leave an editable version of the package hanging around, and (2) use the master
branch of colcon-bazel
since the relevant PR has been merged.
Environment
Description
Steps to reproduce
colcon
as well as thecolcon-bazel
extension: https://github.com/colcon/colcon-bazelcolcon
Output
An example of
colcon list
shows thatign-math
andign-utils
are both ignored because they match against both CMake and Bazel.