Skip to content
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

Skip install step when a package has nothing to install #2

Conversation

mxgrey
Copy link

@mxgrey mxgrey commented Aug 22, 2024

While testing out colcon test for colcon-cargo, I found that we get a build error from colcon build if there's a Rust package that does not contain any binary crates (i.e. it only contains a library crate).

This PR avoids that problem by checking each cargo package before running cargo install to ensure it contains at least one binary crate. If there are no binary crates in the package then we simply skip the cargo install step to avoid the spurious error code.

With this, we can successfully use colcon build followed by colcon test to run tests for library-only cargo packages.

luca-della-vedova and others added 4 commits August 22, 2024 17:18
Signed-off-by: Luca Della Vedova <[email protected]>
Add tests and fix CI for skipping install for pure library packages
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
@luca-della-vedova luca-della-vedova merged commit c654869 into luca-della-vedova:luca/cargo_test_support Aug 23, 2024
17 checks passed
@mxgrey mxgrey deleted the skip_install_when_only_library branch August 23, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants