Ros2-humble on manjaro

I’ve been trying to install ros2-humble on my system for quite some time now, but I cannot seem to be able to build mimick_vendor since I am getting this error:

Starting >>> mimick_vendor
--- stderr: mimick_vendor
Cloning into 'mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7'...
HEAD is now at de11f83 Support raspberry pi zero (#21)
In file included from /usr/include/errno.h:25,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/include/mimick/mock.h:27,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/include/mimick/mimick.h:401,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/test/test.c:1:
/usr/include/features.h:414:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
  414 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
In file included from /usr/include/errno.h:25,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/include/mimick/mock.h:27,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/include/mimick/mimick.h:401,
                 from /home/emanuele/.cache/yay/ros2-humble/src/build/mimick_vendor/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7/sample/strdup/test.c:1:
/usr/include/features.h:414:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
  414 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [sample/strdup/CMakeFiles/strdup_test.dir/build.make:76: sample/strdup/CMakeFiles/strdup_test.dir/test.c.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:318: sample/strdup/CMakeFiles/strdup_test.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[5]: *** [test/CMakeFiles/mmk_test_c.dir/build.make:76: test/CMakeFiles/mmk_test_c.dir/test.c.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:238: test/CMakeFiles/mmk_test_c.dir/all] Error 2
make[3]: *** [Makefile:146: all] Error 2
make[2]: *** [CMakeFiles/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7.dir/build.make:86: mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-prefix/src/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-stamp/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed   <<< mimick_vendor [4.20s, exited with code 2]

from this issue on github I understand that the lines

unset CPPFLAGS
CFLAGS=$(sed "s/-Wp,-D_FORTIFY_SOURCE=3\s//g" <(echo $CFLAGS))
CXXFLAGS=$(sed "s/-Wp,-D_FORTIFY_SOURCE=3\s//g" <(echo $CXXFLAGS))

that are already present in the package’s PKGBUILD should fix the issue, but for some reason it is not working for me.

I also created an issue on the package’s github page but if you have some ideas please let me know :smile:

You were almost there :slight_smile: If you look at the issue referred to in the commit you correctly suspected;

Since the newest version of pacman 6.1.0-3 the flags CFLAGS and CXXFLAGS got updated, so in the build() function the flags need then to be replaced accordingly for building the package

On Manjaro you don’t have pacman 6.1.0-3 yet.

1 Like