Skip to content

Build failed on ESP-IDF 5.5 - due to flags being passed via response file #327

@Narukara

Description

@Narukara

ESP-IDF 5.5.4 uses response files for compiler and linker flags. It might originate from this commit.

As a result, these two variables

CFLAGS_INTERNAL := $(X_CFLAGS) -ffunction-sections -fdata-sections
CXXFLAGS_INTERNAL := $(X_CXXFLAGS) -ffunction-sections -fdata-sections

will become:

@"/path-to/micro_ros_espidf_component/examples/int32_publisher/build/toolchain/cflags" -ffunction-sections -fdata-sections
@"/path-to/micro_ros_espidf_component/examples/int32_publisher/build/toolchain/cxxflags" -ffunction-sections -fdata-sections

which corrupts these two sed commands:

sed "s/@CFLAGS@/$(subst /,\/,$(CFLAGS_INTERNAL))/g" | \
sed "s/@CXXFLAGS@/$(subst /,\/,$(CXXFLAGS_INTERNAL))/g" | \

An empty esp32_toolchain.cmake will be generated.

The build will end with an error message like this:

--- stderr: microxrcedds_client
In file included from /path-to/micro_ros_espidf_component/micro_ros_src/src/Micro-XRCE-DDS-Client/include/uxr/client/transport.h:24,
                 from /path-to/micro_ros_espidf_component/micro_ros_src/src/Micro-XRCE-DDS-Client/include/uxr/client/util/ping.h:28,
                 from /path-to/micro_ros_espidf_component/micro_ros_src/src/Micro-XRCE-DDS-Client/src/c/util/ping.c:1:
/path-to/micro_ros_espidf_component/micro_ros_src/src/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/ip/udp/udp_transport_posix.h:24:10: fatal error: sys/socket.h: No such file or directory
   24 | #include <sys/socket.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
gmake[3]: *** [CMakeFiles/microxrcedds_client.dir/build.make:286: CMakeFiles/microxrcedds_client.dir/src/c/util/ping.c.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/microxrcedds_client.dir/all] Error 2
gmake[1]: *** [Makefile:136: all] Error 2
---
Failed   <<< microxrcedds_client [1.04s, exited with code 2]
Aborted  <<< rosidl_runtime_c [0.56s]
Aborted  <<< rosidl_parser [0.01s]
Aborted  <<< rcl_logging_interface [0.64s]
Aborted  <<< tracetools_test [0.58s]

Summary: 12 packages finished [2.74s]
  1 package failed: microxrcedds_client
  4 packages aborted: rcl_logging_interface rosidl_parser rosidl_runtime_c tracetools_test
  7 packages had stderr output: microxrcedds_client rcutils ros2trace tracetools_launch tracetools_read tracetools_test tracetools_trace
  48 packages not processed
make: *** [libmicroros.mk:89: /path-to/micro_ros_espidf_component/micro_ros_src/install] Error 2
CMake Error at /path-to/micro_ros_espidf_component/CMakeLists.txt:90 (message):
  FAILED: 2


-- Configuring incomplete, errors occurred!
See also "/path-to/micro_ros_espidf_component/examples/int32_publisher/build/CMakeFiles/CMakeOutput.log".
See also "/path-to/micro_ros_espidf_component/examples/int32_publisher/build/CMakeFiles/CMakeError.log".
cmake failed with exit code 1, output of the command is in the /path-to/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stderr_output_40569 and /path-to/micro_ros_espidf_component/examples/int32_publisher/build/log/idf_py_stdout_output_40569

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions