Repository navigation
Conversation
rosterloh
added a commit
to rosterloh/ros2_rust
that referenced
this pull request
Nov 23, 2026
…T_PREFIX_PATH changes
build.rs emits a rustc-link-search path for every prefix from get_search_paths(), which reads AMENT_PREFIX_PATH, but declares only ROS_DISTRO as a rerun trigger. Once a build script emits any rerun-if line, Cargo reruns it only for the listed triggers, so the search paths stay whatever they were on the first build. Reproduced with a crate that depends on rclrs 0.8.0 and ros-env 0.3.0: build it, source a workspace that adds an interface package, and rebuild without `cargo clean`. ros-env declares rerun-if-env-changed=AMENT_PREFIX_PATH, so it reruns and compiles the new package in, with a #[link] to its typesupport library. rclrs and rosidl_runtime_rs, which emit the per-prefix link search paths, do not rerun, so the final link fails with "library not found for -l<pkg>__rosidl_typesupport_c" although the library is on the new prefix. With this change the rebuild links. Assisted-by: Claude Code:claude-opus-5-5
rosterloh
force-pushed
the
build/rerun-on-ament-prefix-path
branch
from
November 30, 2026 09:47
e995775 to
a4cc3e0
Compare
Author
|
@esteve do you think you might be able to review this? It has been hanging around for quite some time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rclrs/build.rsadds a link search path for every prefix inAMENT_PREFIX_PATH, but only declaresROS_DISTROas a rerun trigger, so Cargo keeps the paths from the first build. After sourcing a workspace that adds an interface package, the build fails with:until you
cargo clean -p rclrs -p rosidl_runtime_rs. This PR declaresAMENT_PREFIX_PATHas a rerun trigger next to where it is read.Companion to ros2-rust/rosidl_runtime_rs#31, which does the same there.
This pull request was assisted by: Claude:claude-opus-5-5