micro-ROS / micro-ROS/micro-ROS-Agent

Can't build agent because of fmt

未關閉
#255 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C++
星號
201
分支
111
平均合併
1 天 6 小時
30 天內合併 PR
10

描述

- Hardware description: Personnal computer running Ubuntu 24.04
- Installation type: Micro-ros-setup, colcon-build, snap
- Version or commit hash: jazzy
- Current spdlog version: 1.15.0

**Context:**
I'm building a ros2 package based on [linorobot2](https://github.com/linorobot/linorobot2) which requires micro ros agent.

#### Behavior
Following the [installation tutorial](https://micro.ros.org/docs/tutorials/core/first_application_linux/), I execute the ```ros2 run build_agent.sh``` command and get this error:

```
In file included from /home/darkadius/anaconda3/include/fmt/format.h:41,
from /home/darkadius/anaconda3/include/fmt/core.h:5,
from /home/darkadius/anaconda3/include/spdlog/fmt/fmt.h:28,
from /home/darkadius/anaconda3/include/spdlog/common.h:50,
from /home/darkadius/anaconda3/include/spdlog/spdlog.h:12,
from /home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/include/uxr/agent/logger/Logger.hpp:23,
from /home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/include/uxr/agent/transport/SessionManager.hpp:18,
from /home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/include/uxr/agent/transport/Server.hpp:20,
from /home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/include/uxr/agent/transport/tcp/TCPv6AgentLinux.hpp:19,
from /home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/src/cpp/transport/tcp/TCPv6AgentLinux.cpp:15:

/home/darkadius/anaconda3/include/fmt/base.h: In instantiation of ‘fmt::v11::detail::value::value(const T&, fmt::v11::detail::custom_tag) [with T = dds::xrce::TransportAddress; typename std::enable_if<(! has_formatter()), int>::type = 0; Context = fmt::v11::context]’:
/home/darkadius/anaconda3/include/fmt/base.h:2208:65: required from ‘fmt::v11::detail::value::value(T&) [with T = dds::xrce::TransportAddress; typename std::enable_if<(std::integral_constant::value || std::is_enum::value) || std::is_union::value) || std::is_array<_Up>::value) && (! fmt::v11::detail::has_to_string_view::value)) && (! fmt::v11::detail::is_named_arg::value)) && (! fmt::v11::detail::use_format_as::value)) && (! fmt::v11::detail::use_format_as_member::type, std::integral_constant >::value))>::value || (!1)), int>::type = 0; Context = fmt::v11::context]’
/home/darkadius/anaconda3/include/fmt/base.h:2781:20: required from ‘constexpr fmt::v11::detail::format_arg_store fmt::v11::make_format_args(T& ...) [with Context = context; T = {const char [24], dds::xrce::TransportAddress}; int NUM_ARGS = 2; int NUM_NAMED_ARGS = 0; long long unsigned int DESC = 252]’
/home/darkadius/anaconda3/include/spdlog/logger.h:328:75: required from ‘void spdlog::logger::log_(spdlog::source_loc, spdlog::level::level_enum, spdlog::string_view_t, Args&& ...) [with Args = {const char (&)[24], dds::xrce::TransportAddress&}; spdlog::string_view_t = fmt::v11::basic_string_view]’
/home/darkadius/anaconda3/include/spdlog/logger.h:80:13: required from ‘void spdlog::logger::log(spdlog::source_loc, spdlog::level::level_enum, fmt::v11::format_string, Args&& ...) [with Args = {const char (&)[24], dds::xrce::TransportAddress&}; fmt::v11::format_string = fmt::v11::fstring]’
/home/darkadius/ros2_ws/build/micro_ros_agent/agent/src/xrceagent/include/uxr/agent/transport/util/InterfaceLinux.hpp:63:17: required from here

/home/darkadius/anaconda3/include/fmt/base.h:2235:45: error: ‘fmt::v11::detail::type_is_unformattable_for _’ has incomplete type
2235 | type_is_unformattable_for _;
```
#### Solutions tried:
-**Downgrading spdlog:** Jazzy's rclpy requires spdlog 1.15.0
-**Building libfmt from source** from [here](https://github.com/micro-ROS/micro-ROS-Agent/issues/50#issuecomment-2131215009) : Gives the above error as the new libfmt wasn't detected
-**Using the DUAGENT flag (both on/off)** from [here](https://github.com/micro-ROS/micro_ros_setup/issues/455#issuecomment-1042635375) : Still gives me the above error
-**Using the snap version** from [here](https://github.com/micro-ROS/micro-ROS-Agent/issues/186#issuecomment-1494091767) : The package does build successfully, however, the only micro-ros-agent package on snap was the foxy version, which causes fatal compatibility issues upon launching the linorobot2 package

It feels like I've tried everything short of a complete ros2/ubuntu reinstall (which I'd like to avoid, obviously). Does anyone has some advice?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先使用 build_agent.sh 重現 Jazzy 建置,並檢查第 63 行附近的 InterfaceLinux.hpp,fmt/spdlog 錯誤就是在此處實例化的。追蹤建置所選取的 fmt 和 spdlog 安裝,接著確認 micro-ROS Agent 能夠建置,並且仍與回報的 linorobot2 設定相容。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
cpp
領域
build-system
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。