-
Notifications
You must be signed in to change notification settings - Fork 49
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
Warn when overriding packages at build time #449
Conversation
Signed-off-by: Shane Loretz <[email protected]>
…text Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
ae3edca
to
3a73414
Compare
Made draft while pushing debug commits to see what's happening in Window CI |
Signed-off-by: Shane Loretz <[email protected]>
3cfcbf8
to
a0e64df
Compare
Signed-off-by: Shane Loretz <[email protected]>
Added unit tests and fixed CI! Ready for review :) |
Codecov Report
@@ Coverage Diff @@
## master #449 +/- ##
==========================================
+ Coverage 80.27% 80.80% +0.53%
==========================================
Files 58 59 +1
Lines 3442 3517 +75
Branches 640 668 +28
==========================================
+ Hits 2763 2842 +79
- Misses 623 630 +7
+ Partials 56 45 -11
Continue to review full report at Codecov.
|
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
…o override_warning
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dirk-thomas would you like to review this and colcon/colcon-ros#129, or may I merge them? |
@sloretz since I don't have the bandwidth to review On a very brief look the reduction in coverage might be something to consider addressing. Also the core changes will likely need to be released first, with a proper version dependency in the non-core package. |
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
I added a couple more tests for edge cases, which I think is the maximum amount of testable code in this PR.
Noted 👍 |
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes also LGTM
Part of ros2/ros2#1150
This PR adds a new warning to
colcon build
when a package to be built would override one in an underlay workspace. It also adds an option--alow-overriding
to disable the a warning and allow building it anyways.Trying this PR out
ros-rolling-desktop
[email protected]:ros2/rcutils.git
and[email protected]:ros2/rcl.git
)/opt/ros/rolling/setup.bash
colcon build
How it works
This adds an extension point
FindInstalledPackagesExtensionPoint
which allows extensions to add to the packages found whenfind_installed_packages(...)
is called. This hook allowscolcon-ros
to implement an extension point that reads the ament index to find packages. In themain()
of theBuild
verb it finds all installed packages in chained prefixes, and checks if any package being built already exists in one of them. If so, the warning is emitted.Limitations
Warning at build time is not perfect, because it's possible a user will install a package into the underlay
/opt/ros/...
later that was built by this overlay beforehand. I tried looking at how to make the setup scripts warn when they're sourced, but it seems difficult to do cleanly in the case of/opt/ros/...
.