Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
cd $path
echo "Running clippy in $path"
# Run clippy for all features except generate_docs (needed for docs.rs)
# Run clippy for all features except use_ros_shim (needed for docs.rs)
if [ "$(basename $path)" = "rclrs" ]; then
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
else
Expand All @@ -115,7 +115,7 @@ jobs:
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
cd $path
echo "Running cargo test in $path"
# Run cargo test for all features except generate_docs (needed for docs.rs)
# Run cargo test for all features except use_ros_shim (needed for docs.rs)
if [ "$(basename $path)" = "rclrs" ]; then
cargo test -F default,dyn_msg
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
cd $path
echo "Running clippy in $path"
# Run clippy for all features except generate_docs (needed for docs.rs)
# Run clippy for all features except use_ros_shim (needed for docs.rs)
if [ "$(basename $path)" = "rclrs" ]; then
cargo clippy --no-deps --all-targets -F default,dyn_msg -- -D warnings
else
Expand All @@ -115,7 +115,7 @@ jobs:
for path in $(colcon list | awk '$3 == "(ament_cargo)" && $1 != "examples_rclrs_minimal_pub_sub" && $1 != "examples_rclrs_minimal_client_service" && $1 != "rust_pubsub" { print $2 }'); do
cd $path
echo "Running cargo test in $path"
# Run cargo test for all features except generate_docs (needed for docs.rs)
# Run cargo test for all features except use_ros_shim (needed for docs.rs)
if [ "$(basename $path)" = "rclrs" ]; then
cargo test -F default,dyn_msg
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
Expand Down
4 changes: 2 additions & 2 deletions rclrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dyn_msg = ["ament_rs", "libloading"]
serde = ["dep:serde", "dep:serde-big-array", "rosidl_runtime_rs/serde"]
# This feature is solely for the purpose of being able to generate documetation without a ROS installation
# The only intended usage of this feature is for docs.rs builders to work, and is not intended to be used by end users
generate_docs = ["rosidl_runtime_rs/generate_docs"]
use_ros_shim = ["rosidl_runtime_rs/use_ros_shim"]

[package.metadata.docs.rs]
features = ["generate_docs"]
features = ["use_ros_shim"]
2 changes: 1 addition & 1 deletion rclrs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() {
let error_msg =
"ROS_DISTRO environment variable not set - please source ROS 2 installation first.";
cfg_if::cfg_if! {
if #[cfg(feature="generate_docs")] {
if #[cfg(feature="use_ros_shim")] {
println!("{}", error_msg);
return;
} else {
Expand Down
2 changes: 1 addition & 1 deletion rclrs/src/rcl_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![allow(missing_docs)]

cfg_if::cfg_if! {
if #[cfg(feature="generate_docs")] {
if #[cfg(feature="use_ros_shim")] {
#[repr(C)]
#[derive(Debug)]
pub struct rcl_allocator_t;
Expand Down
Loading