Skip to content

Commit

Permalink
rmw-implementation: Don't build with CycloneDDS support on MacOS
Browse files Browse the repository at this point in the history
CycloneDDS depends on Linux-only libraries such as acl and cannot be
built on MacOS. Removing CycloneDDS from rmw-implementation
dependencies is OK, because there are other RMW implementations, which
build fine on MacOS. For example FastDDS, which is the default one.

The result of this change is that on MacOS one cannot switch to
CycloneDDS at run-time by selecting it in the RMW_IMPLEMENTATION
environment variable.

Specifically, this commit avoids to following error:

       error: Package ‘acl-2.3.1’ in
       /nix/store/.../pkgs/development/libraries/acl/default.nix:40 is
       not available on the requested hostPlatform:
       hostPlatform.config = "aarch64-apple-darwin"
  • Loading branch information
wentasah authored and lopsided98 committed Jul 20, 2024
1 parent 385faff commit 6cbeea1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion distros/ros2-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,18 @@ rosSelf: rosSuper: with rosSelf.lib; {
};

rmw-implementation = rosSuper.rmw-implementation.overrideAttrs ({
propagatedBuildInputs ? [], ...
propagatedBuildInputs ? [], buildInputs ? [], ...
}: {
# The default implementation must be available to all dependent packages
# at build time.
propagatedBuildInputs = with rosSelf; [
rmw-fastrtps-cpp
] ++ propagatedBuildInputs;
# rmw-cyclonedds-cpp fails to build on MacOS.
buildInputs = if self.stdenv.isDarwin then
builtins.filter (p: p.pname != "ros-${p.rosDistro}-rmw-cyclonedds-cpp") buildInputs
else
buildInputs;
});

rosidl-generator-py = rosSuper.rosidl-generator-py.overrideAttrs ({
Expand Down

0 comments on commit 6cbeea1

Please sign in to comment.