diff --git a/Cargo.toml b/Cargo.toml index 7bbdccc..2830ac0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,9 @@ anyhow = "1" cargo-manifest = "0.17" pico-args = "0.4" +# Pinning a transitive dependency of cargo-manifest to the last major version that could build with rust 1.75 +indexmap = "=2.11.0" + [dev-dependencies] tempfile = { version = "3" } diff --git a/src/main.rs b/src/main.rs index 60366c1..6f7609b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,8 +64,22 @@ fn fallible_main() -> Result { // Putting marker file creation after the actual build command means that // we create less garbage if the build command failed. create_package_marker(&args.install_base, "packages", package_name)?; - // This marker is used by colcon-ros-cargo when looking for dependencies - create_package_marker(&args.install_base, "rust_packages", package_name)?; + + // If this package should be re-exported by rclrs, we do not want `colcon-ros-cargo` to + // find the package as it should not be patched. + let reexport_rclrs = package + .metadata + .as_ref() + .and_then(|m| m.get("rclrs")) + .and_then(|r| r.get("reexport")) + .and_then(|v| v.as_bool()) + .unwrap_or(false); + + if !reexport_rclrs { + // This marker is used by colcon-ros-cargo when looking for dependencies + create_package_marker(&args.install_base, "rust_packages", package_name)?; + } + install_package( &args.install_base, package_path,