Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Failure February 2024 #136

Closed
1 task done
traversaro opened this issue Feb 9, 2024 · 11 comments
Closed
1 task done

Windows Failure February 2024 #136

traversaro opened this issue Feb 9, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@traversaro
Copy link
Member

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

.

Installed packages

.

Environment info

.
@traversaro traversaro added the bug Something isn't working label Feb 9, 2024
@traversaro
Copy link
Member Author

ros-humble-hardware-interface from https://github.com/RoboStack/ros-humble/actions/runs/7822959925/job/21362114531

generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\fake_components.vcxproj]
%SRC_DIR%\build\Release\fake_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\fake_components.vcxproj]
  Building Custom Rule C:/bld/ros-humble-hardware-interface-0_1707395987970/work/ros-humble-hardware-interface/src/work/CMakeLists.txt
  generic_system.cpp
generic_system.obj : error LNK2019: unresolved external symbol "double __cdecl hardware_interface::stod(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?stod@hardware_interface@@YANAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: void __cdecl mock_components::GenericSystem::initialize_storage_vectors(class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::vector<struct hardware_interface::ComponentInfo,class std::allocator<struct hardware_interface::ComponentInfo> > const &)" (?initialize_storage_vectors@GenericSystem@mock_components@@AEAAXAEAV?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@0AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@AEBV?$vector@UComponentInfo@hardware_interface@@V?$allocator@UComponentInfo@hardware_interface@@@std@@@4@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
%SRC_DIR%\build\Release\mock_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\mock_components.vcxproj]

@traversaro
Copy link
Member Author

ros-humble-parameter-traits:

-- Found FastRTPS: C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/include  
-- Using RMW implementation 'rmw_fastrtps_cpp' as default
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE  
-- Found tcb_span: 1.0.2 (C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/share/tcb_span/cmake)
-- Found tl_expected: 1.0.2 (C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/share/tl_expected/cmake)
CMake Error at C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/share/rsl/cmake/rsl-targets.cmake:86 (message):
  The imported target "rsl::rsl" references the file

     "C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/lib/rsl.lib"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/share/rsl/cmake/rsl-targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  C:/bld/ros-humble-parameter-traits-0_1707397532934/_h_env/Library/share/rsl/cmake/rsl-config.cmake:9 (include)
  CMakeLists.txt:8 (find_package)

@traversaro
Copy link
Member Author

ros-humble-hardware-interface from https://github.com/RoboStack/ros-humble/actions/runs/7822959925/job/21362114531

generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\fake_components.vcxproj]
%SRC_DIR%\build\Release\fake_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\fake_components.vcxproj]
  Building Custom Rule C:/bld/ros-humble-hardware-interface-0_1707395987970/work/ros-humble-hardware-interface/src/work/CMakeLists.txt
  generic_system.cpp
generic_system.obj : error LNK2019: unresolved external symbol "double __cdecl hardware_interface::stod(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?stod@hardware_interface@@YANAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: void __cdecl mock_components::GenericSystem::initialize_storage_vectors(class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::vector<struct hardware_interface::ComponentInfo,class std::allocator<struct hardware_interface::ComponentInfo> > const &)" (?initialize_storage_vectors@GenericSystem@mock_components@@AEAAXAEAV?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@0AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@AEBV?$vector@UComponentInfo@hardware_interface@@V?$allocator@UComponentInfo@hardware_interface@@@std@@@4@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
%SRC_DIR%\build\Release\mock_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\mock_components.vcxproj]

This issue is more subtle, I need more time to work on this.

@traversaro
Copy link
Member Author

ros-humble-hardware-interface from https://github.com/RoboStack/ros-humble/actions/runs/7822959925/job/21362114531

generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\fake_components.vcxproj]
%SRC_DIR%\build\Release\fake_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\fake_components.vcxproj]
  Building Custom Rule C:/bld/ros-humble-hardware-interface-0_1707395987970/work/ros-humble-hardware-interface/src/work/CMakeLists.txt
  generic_system.cpp
generic_system.obj : error LNK2019: unresolved external symbol "double __cdecl hardware_interface::stod(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?stod@hardware_interface@@YANAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: void __cdecl mock_components::GenericSystem::initialize_storage_vectors(class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > > &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::vector<struct hardware_interface::ComponentInfo,class std::allocator<struct hardware_interface::ComponentInfo> > const &)" (?initialize_storage_vectors@GenericSystem@mock_components@@AEAAXAEAV?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@0AEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@4@AEBV?$vector@UComponentInfo@hardware_interface@@V?$allocator@UComponentInfo@hardware_interface@@@std@@@4@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
generic_system.obj : error LNK2019: unresolved external symbol "bool __cdecl hardware_interface::parse_bool(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?parse_bool@hardware_interface@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual enum rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn __cdecl mock_components::GenericSystem::on_init(struct hardware_interface::HardwareInfo const &)" (?on_init@GenericSystem@mock_components@@UEAA?AW4CallbackReturn@LifecycleNodeInterface@node_interfaces@rclcpp_lifecycle@@AEBUHardwareInfo@hardware_interface@@@Z) [%SRC_DIR%\build\mock_components.vcxproj]
%SRC_DIR%\build\Release\mock_components.dll : fatal error LNK1120: 2 unresolved externals [%SRC_DIR%\build\mock_components.vcxproj]

This issue is more subtle, I need more time to work on this.

For sure ros-controls/ros2_control#1382 should help, but I still have local failures that not appear in CI.

@traversaro
Copy link
Member Author

New error:

2024-02-09T12:37:26.0605099Z   1>Checking Build System
2024-02-09T12:37:26.0605949Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707480098180/work/ros-humble-rosbag2-storage/src/work/CMakeLists.txt
2024-02-09T12:37:26.0606749Z   metadata_io.cpp
2024-02-09T12:37:26.0606981Z   Defining YAML_CPP_API for DLL import
2024-02-09T12:37:26.0607280Z   ros_helper.cpp
2024-02-09T12:37:26.0607495Z   storage_factory.cpp
2024-02-09T12:37:26.0607742Z   Defining YAML_CPP_API for DLL import
2024-02-09T12:37:26.0608035Z   storage_options.cpp
2024-02-09T12:37:26.0608279Z   Defining YAML_CPP_API for DLL import
2024-02-09T12:37:26.0608570Z   base_io_interface.cpp
2024-02-09T12:37:26.0608824Z   Defining YAML_CPP_API for DLL import
2024-02-09T12:37:26.0609109Z   Generating Code...
2024-02-09T12:37:26.0609633Z LINK : fatal error LNK1181: cannot open input file 'yaml-cpp.lib' [%SRC_DIR%\build\rosbag2_storage.vcxproj]
2024-02-09T12:37:26.0610128Z 
2024-02-09T12:37:26.0610132Z 
2024-02-09T12:37:26.0610221Z Work directory: 
2024-02-09T12:37:26.0610628Z C:\Users\runneradmin\micromamba\envs\testpr_env\conda-bld\ros-0_1707480098180\w
2024-02-09T12:37:26.0611083Z ork

@Tobias-Fischer
Copy link
Contributor

Have attempted to fix by using yaml-cpp directly instead of the vendored version.

@traversaro
Copy link
Member Author

Have attempted to fix by using yaml-cpp directly instead of the vendored version.

That worked, we have no a similar failure on a related package:

2024-02-10T12:10:12.3963108Z   1>Checking Build System
2024-02-10T12:10:12.3964700Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1707563690380/work/ros-humble-rosbag2-storage-default-plugins/src/work/CMakeLists.txt
2024-02-10T12:10:12.3966339Z   sqlite_wrapper.cpp
2024-02-10T12:10:12.3966770Z   Defining YAML_CPP_API for DLL import
2024-02-10T12:10:12.3967385Z   sqlite_storage.cpp
2024-02-10T12:10:12.3967802Z   Defining YAML_CPP_API for DLL import
2024-02-10T12:10:12.3968324Z   sqlite_statement_wrapper.cpp
2024-02-10T12:10:12.3968796Z   Generating Code...
2024-02-10T12:10:12.3969881Z LINK : fatal error LNK1181: cannot open input file 'yaml-cpp.lib' [%SRC_DIR%\build\rosbag2_storage_default_plugins.vcxproj]

@traversaro
Copy link
Member Author

traversaro commented Feb 10, 2024

Ok, I investigated more the issue. The core problem is that yaml-cpp <= 0.7.0 uses the yaml-cpp as exported target, while yaml-cpp >= 0.8.0 uses yaml-cpp::yaml-cpp (see https://github.com/jbeder/yaml-cpp/blob/yaml-cpp-0.7.0/CMakeLists.txt#L150 vs https://github.com/jbeder/yaml-cpp/blob/0.8.0/CMakeLists.txt#L171). yaml_cpp_vendor is not aware of this, so it always set the yaml_cpp_vendor_TARGETS variable as yaml-cpp (see https://github.com/ros2/yaml_cpp_vendor/blob/4f17f410b1251b24142b3d1af809e6a65a33168d/yaml_cpp_vendor-extras.cmake.in#L14). The error probably goes unnoticed on Linux as it the yaml-cpp target does not exists, it is interpreted when passed to target_link_libraries in https://github.com/ament/ament_cmake/blob/6b310f5e3078fe4473904bac8415aa3622f8868a/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake#L152 as simple library, and the linker automatically finds the libyaml-cpp.so library or similar, but this is not happening on Windows for some reason.

Interestingly, everything would work fine with master yaml-cpp, as that provides both yaml-cpp::yaml-cpp and yaml-cpp targets (see jbeder/yaml-cpp@c26e047#diff-d2d2bab1fd2c176e4a5f1d4b5ad2ed98ae2407df5b11906bed3d5e7ba206fc2dR22-R28), even if the yaml-cpp target will be removed in yaml-cpp 0.10.0 .

@traversaro
Copy link
Member Author

Ok, I investigated more the issue. The core problem is that yaml-cpp <= 0.7.0 uses the yaml-cpp as exported target, while yaml-cpp >= 0.8.0 uses yaml-cpp::yaml-cpp (see https://github.com/jbeder/yaml-cpp/blob/yaml-cpp-0.7.0/CMakeLists.txt#L150 vs https://github.com/jbeder/yaml-cpp/blob/0.8.0/CMakeLists.txt#L171). yaml_cpp_vendor is not aware of this, so it always set the yaml_cpp_vendor_TARGETS variable as yaml-cpp (see https://github.com/ros2/yaml_cpp_vendor/blob/4f17f410b1251b24142b3d1af809e6a65a33168d/yaml_cpp_vendor-extras.cmake.in#L14). The error probably goes unnoticed on Linux as it the yaml-cpp target does not exists, it is interpreted when passed to target_link_libraries in https://github.com/ament/ament_cmake/blob/6b310f5e3078fe4473904bac8415aa3622f8868a/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake#L152 as simple library, and the linker automatically finds the libyaml-cpp.so library or similar, but this is not happening on Windows for some reason.

Interestingly, everything would work fine with master yaml-cpp, as that provides both yaml-cpp::yaml-cpp and yaml-cpp targets (see jbeder/yaml-cpp@c26e047#diff-d2d2bab1fd2c176e4a5f1d4b5ad2ed98ae2407df5b11906bed3d5e7ba206fc2dR22-R28), even if the yaml-cpp target will be removed in yaml-cpp 0.10.0 .

I proposed an upstream fix for this in ros2/yaml_cpp_vendor#46 .

@traversaro
Copy link
Member Author

I proposed an upstream fix for this in ros2/yaml_cpp_vendor#46 .

I backported this in the PR in ac9b73e . @Tobias-Fischer any idea on how to force the rebuild of the ros-humble-yaml-cpp-vendor package? Thanks!

@Tobias-Fischer
Copy link
Contributor

All fixed - thanks @traversaro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants