From a8f2067a0ae5612145d9839cc8f45203e289efd5 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Mon, 24 Jun 2024 17:36:14 +0200 Subject: [PATCH 1/2] python-cmake-module: Use correct shared library extension on MacOS This fixes the following error: make[2]: *** No rule to make target '/nix/store/03q8gn91mj95y5bqbcl90hyvmpqpz738-python3-3.11.7/lib/libpython3.11.so', needed by 'rosidl_generator_py/builtin_interfaces/libbuiltin_interfaces__rosidl_generator_py.dylib'. Stop. --- distros/ros2-overlay.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distros/ros2-overlay.nix b/distros/ros2-overlay.nix index 4f3d45a006..091fd14d2d 100644 --- a/distros/ros2-overlay.nix +++ b/distros/ros2-overlay.nix @@ -88,9 +88,10 @@ rosSelf: rosSuper: with rosSelf.lib; { python-cmake-module = rosSuper.python-cmake-module.overrideAttrs ({ ... }: let python = rosSelf.python; + libExt = if self.stdenv.isDarwin then "dylib" else "so"; in { pythonExecutable = python.pythonOnBuildForHost.interpreter; - pythonLibrary = "${python}/lib/lib${python.libPrefix}.so"; + pythonLibrary = "${python}/lib/lib${python.libPrefix}.${libExt}"; pythonIncludeDir = "${python}/include/${python.libPrefix}"; setupHook = ./python-cmake-module-setup-hook.sh; outputs = [ "out" "dev" ]; From ad535a4da9afd7d396777e2d53fcc400418678ad Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 6 Jul 2024 12:05:27 +0200 Subject: [PATCH 2/2] rmw-implementation: Don't build with CycloneDDS support on MacOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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" --- distros/ros2-overlay.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/distros/ros2-overlay.nix b/distros/ros2-overlay.nix index 091fd14d2d..994f3fe6a0 100644 --- a/distros/ros2-overlay.nix +++ b/distros/ros2-overlay.nix @@ -119,13 +119,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 ({