Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f45a66f
Add a .repos file for jazzy (#425)
mxgrey Oct 30, 2024
7b51249
Introduce Logger and LogParams
mxgrey Nov 3, 2024
d89121b
Add test for arbitrary string logger name
mxgrey Nov 3, 2024
e6bc456
merge with main
mxgrey Nov 4, 2024
69b43f0
Fix merge
mxgrey Nov 4, 2024
27f5bc8
Add safety comment
mxgrey Nov 4, 2024
57f879e
Fix formatting
mxgrey Nov 4, 2024
ef0d0a0
Allow &str to implement AsLogParams instead of &&str
mxgrey Nov 4, 2024
8451518
Add safety comment
mxgrey Nov 4, 2024
2d16985
Add test for function!() macro
mxgrey Nov 4, 2024
d27b407
Replace all uses of LazyLock with OnceLock to be compatible with 1.75
mxgrey Nov 5, 2024
188a331
Fix formatting
mxgrey Nov 5, 2024
75766f6
Investigating how to set a custom logging handler
mxgrey Nov 5, 2024
ec91f3d
Comply with Rust naming conventions
mxgrey Nov 5, 2024
474e4d2
Comply with clippy suggestions
mxgrey Nov 5, 2024
52c3f96
merge
mxgrey Nov 5, 2024
e9ef5db
Putting log handling into its own module
mxgrey Nov 5, 2024
0416551
Fix formatting with ToLogParams
mxgrey Nov 5, 2024
4324964
Merge branch 'logging_params' into clean_logging_tests
mxgrey Nov 5, 2024
5b76987
Able to override the log handling
mxgrey Nov 5, 2024
3934c32
Try to help cargo docs resolve macro links
mxgrey Nov 5, 2024
0ded7e8
Merge branch 'logging_params' into clean_logging_tests
mxgrey Nov 5, 2024
3db4183
Cleaner log testing
mxgrey Nov 5, 2024
a9f5b3f
Fork expectations based on distro version
mxgrey Nov 5, 2024
049a829
Account for rolling distro
mxgrey Nov 5, 2024
9453ed5
Merge remote-tracking branch 'mxgrey/logging_params' into clean_loggi…
mxgrey Nov 5, 2024
974f841
Fix clippy warnings
mxgrey Nov 5, 2024
4699fea
Fix function names generated by logger
mxgrey Nov 6, 2024
89809d1
Fix format string memory vulnerability while still being able to run …
mxgrey Nov 6, 2024
6630206
Fix formatting
mxgrey Nov 6, 2024
22021e2
More robust detection of using custom log handler
mxgrey Nov 6, 2024
88b7a69
Remember to reset USING_CUSTOM_HANDLER when the logger gets reset
mxgrey Nov 6, 2024
5925932
Merge remote-tracking branch 'geoff-imdex/main' into clean_logging_tests
mxgrey Nov 11, 2024
e80e704
Merge branch 'clean_logging_tests' of ssh://github.com/mxgrey/ros2_ru…
mxgrey Nov 11, 2024
295379f
Use cfg instead of suppressing warning
mxgrey Nov 11, 2024
0793954
Fix errors in documentation
mxgrey Nov 11, 2024
8c294d1
Add safety comment
mxgrey Nov 12, 2024
b4e975c
Use latest stable Rust CI + Fix Test Errors (#420)
mxgrey Nov 15, 2024
066dd7c
Update vendored interface packages (#423)
nwn Nov 15, 2024
c287fb2
Change API to use throttle
mxgrey Nov 18, 2024
1d29844
Merge remote-tracking branch 'origin/main' into clean_logging_tests
mxgrey Nov 18, 2024
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Rust
name: Rust Minimal

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *'
# Run the CI at 02:22 UTC every Tuesday
# We pick an arbitrary time outside of most of the world's work hours
# to minimize the likelihood of running alongside a heavy workload.
- cron: '22 2 * * 2'

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -51,7 +54,7 @@ jobs:
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@1.74.0
uses: dtolnay/rust-toolchain@1.75
with:
components: clippy, rustfmt

Expand Down
130 changes: 130 additions & 0 deletions .github/workflows/rust-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Rust Stable

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Run the CI at 02:22 UTC every Tuesday
# We pick an arbitrary time outside of most of the world's work hours
# to minimize the likelihood of running alongside a heavy workload.
- cron: '22 2 * * 2'

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
ros_distribution:
- humble
- iron
- rolling
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
ros_distribution: humble
ros_version: 2
# Iron Irwini (May 2023 - November 2024)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest
ros_distribution: iron
ros_version: 2
# Rolling Ridley (June 2020 - Present)
- docker_image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
ros_distribution: rolling
ros_version: 2
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.ros_distribution == 'rolling' }}
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v4

- name: Search packages in this repository
id: list_packages
run: |
echo ::set-output name=package_list::$(colcon list --names-only)

- name: Setup ROS environment
uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Install colcon-cargo and colcon-ros-cargo
run: |
sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git

- name: Check formatting of Rust packages
run: |
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
cd $path
rustup toolchain install nightly
cargo +nightly fmt -- --check
cd -
done

- name: Install cargo-ament-build
run: |
cargo install --debug cargo-ament-build

- name: Build and test
id: build
uses: ros-tooling/[email protected]
with:
package-name: ${{ steps.list_packages.outputs.package_list }}
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ros2_rust_${{ matrix.ros_distribution }}.repos

- name: Run clippy on Rust packages
run: |
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
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)
if [ "$(basename $path)" = "rclrs" ]; then
cargo clippy --all-targets -F default,dyn_msg -- -D warnings
else
cargo clippy --all-targets --all-features -- -D warnings
fi
cd -
done

- name: Run cargo test on Rust packages
run: |
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
. install/setup.sh
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)
if [ "$(basename $path)" = "rclrs" ]; then
cargo test -F default,dyn_msg
elif [ "$(basename $path)" = "rosidl_runtime_rs" ]; then
cargo test -F default
else
cargo test --all-features
fi
cd -
done

- name: Rustdoc check
run: |
cd ${{ steps.build.outputs.ros-workspace-directory-name }}
. /opt/ros/${{ matrix.ros_distribution }}/setup.sh
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 rustdoc check in $path"
cargo rustdoc -- -D warnings
cd -
done
7 changes: 6 additions & 1 deletion rclrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Esteve Fernandez <[email protected]>", "Nikolai Morin <nnmmgit@gmail
edition = "2021"
license = "Apache-2.0"
description = "A ROS 2 client library for developing robotics applications in Rust"
rust-version = "1.63"
rust-version = "1.75"

[lib]
path = "src/lib.rs"
Expand All @@ -29,6 +29,10 @@ libloading = { version = "0.8", optional = true }
# Needed for the Message trait, among others
rosidl_runtime_rs = "0.4"

# Needed for serliazation and deserialization of vendored messages
serde = { version = "1", optional = true, features = ["derive"] }
serde-big-array = { version = "0.5.1", optional = true }

[dev-dependencies]
# Needed for e.g. writing yaml files in tests
tempfile = "3.3.0"
Expand All @@ -46,6 +50,7 @@ cfg-if = "1.0.0"
[features]
default = []
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"]
Expand Down
Loading
Loading