ros / resource_retriever

Package used to retrieve resources of different kinds, e.g. http://, file://, the ROS specific package://, etc.
8 stars 42 forks source link

Fails to build on Windows 10 #38

Closed adamleon closed 4 years ago

adamleon commented 4 years ago

Hello, I've been struggling to build this package on ROS2 Eloquent on Windows 10.

All other packages (except those dependent on this) build fine, and running the command: colcon build --merge-install --packages-select resource_retriever --event-handler console_cohesion+

Outputs

Starting >>> resource_retriever
--- output: resource_retriever
[6.968s] -- Found ament_cmake_ros: 0.8.0
(C:/dev/ros2_eloquent/install/share/ament_cmake_ros/cmake)
[7.375s] -- Using PYTHON_EXECUTABLE: C:/Python37/python.exe
[8.640s] -- Found ament_index_cpp: 0.7.2` `(C:/dev/ros2_eloquent/install/share/ament_index_cpp/cmake)
[8.703s] -- Found libcurl_vendor: 2.2.1` `(C:/dev/ros2_eloquent/install/share/libcurl_vendor/cmake)
[8.796s] -- library:
C:/dev/ros2_eloquent/install/opt/libcurl_vendor/bin/libcurl.dll
[9.234s] -- Configuring done
[9.828s] -- Generating done
[9.875s] -- Build files have been written to:` `C:/dev/ros2_eloquent/build/resource_retriever
[10.234s] Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
[10.234s] Copyright (C) Microsoft Corporation. All rights reserved.
[10.234s]
[11.125s]` `C:\dev\ros2_eloquent\install\opt\libcurl_vendor\bin\libcurl.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x310` `[C:\dev\ros2_eloquent\build\resource_retriever\resource_retriever.vcxproj]
---
Failed   <<< resource_retriever [ Exited with code 1 ]

Summary: 0 packages finished [12.6s]
1 package failed: resource_retriever

I've been looking at it and found that the source might come from # TODO(wjwwood): remove libcurl_vendor and just use system curl when possible find_package(libcurl_vendor REQUIRED)

In the CMakeLists.txt file, but I have no idea how to start and solve it.

sloretz commented 4 years ago

I don't know why the build isn't succeeding on that machine; however, there's no need to try to build it from windows unless you're trying to build all of ROS 2 from source. This package is included in the Windows archive shipped with ROS Eloquent releases. See the link ros2-eloquent-20200124-windows-release-amd64.zip at https://github.com/ros2/ros2/releases/tag/release-eloquent-20200124

Also see the ROS 2 Windows install documentation.

If you really want to build it from source, the error is complaining about libcurl_vendor.dll. I'd try rebuilding the package libcurl_vendor with colcon build --merge-install --packages-select libcurl_vendor. If that doesn't fix it, I'd try a clean build by deleting C:/dev/ros2_eloquent/install/ and C:/dev/ros2_eloquent/build/ and trying again.

adamleon commented 4 years ago

I don't really need to build it, and I have successfully installed the release version. I just wanted to try to build it, and noticed the error.

Building libcurl_vendor does not fix the problem and does not produce any errors, neither does cleaning and trying again.

It's a heads up that there is a problem in the code somewhere, but as I said earlier, I can use the release version no problem. If you want to try to fix the problem I can assist, but if not, I can just close the issue

sloretz commented 4 years ago

It's a heads up that there is a problem in the code somewhere, but as I said earlier, I can use the release version no problem. If you want to try to fix the problem I can assist, but if not, I can just close the issue

Thanks for the report! It looks like resource_retriever successfully built in the windows nightly. I don't have enough info to identify a problem in this repo, so I'll close this issue for now. I would be happy to reopen if that turns out not to be the case.

console output from nightly ``` --- output: resource_retriever 00:57:49 [21.750s] Not searching for unused variables given on the command line. 00:57:49 [21.782s] -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363. 00:57:49 [35.578s] -- The C compiler identification is MSVC 19.25.28611.0 00:57:49 [40.766s] -- The CXX compiler identification is MSVC 19.25.28611.0 00:57:49 [40.828s] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe 00:57:49 [45.328s] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe -- works 00:57:49 [45.360s] -- Detecting C compiler ABI info 00:57:49 [53.391s] -- Detecting C compiler ABI info - done 00:57:49 [53.391s] -- Detecting C compile features 00:57:49 [53.422s] -- Detecting C compile features - done 00:57:49 [53.453s] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe 00:57:49 [64.266s] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe -- works 00:57:49 [64.391s] -- Detecting CXX compiler ABI info 00:57:49 [77.453s] -- Detecting CXX compiler ABI info - done 00:57:49 [77.532s] -- Detecting CXX compile features 00:57:49 [77.532s] -- Detecting CXX compile features - done 00:57:49 [77.578s] -- Found ament_cmake_ros: 0.8.0 (C:/ci/ws/install/share/ament_cmake_ros/cmake) 00:57:49 [79.516s] -- Found PythonInterp: C:/Python37/python.exe (found suitable version "3.7.6", minimum required is "3") 00:57:49 [79.516s] -- Using PYTHON_EXECUTABLE: C:/Python37/python.exe 00:57:49 [81.828s] -- Found ament_index_cpp: 0.7.2 (C:/ci/ws/install/share/ament_index_cpp/cmake) 00:57:49 [81.828s] -- Found libcurl_vendor: 2.2.0 (C:/ci/ws/install/share/libcurl_vendor/cmake) 00:57:49 [82.438s] -- library: C:/ci/ws/install/opt/libcurl_vendor/lib/libcurl_imp.lib 00:57:49 [84.828s] -- Configuring done 00:57:49 [86.485s] -- Generating done 00:57:49 [86.594s] -- Build files have been written to: C:/ci/ws/build/resource_retriever 00:57:49 [90.547s] Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework 00:57:49 [90.547s] Copyright (C) Microsoft Corporation. All rights reserved. 00:57:49 [90.547s] 00:57:49 [93.469s] Checking Build System 00:57:49 [94.375s] Building Custom Rule C:/ci/ws/src/ros/resource_retriever/resource_retriever/CMakeLists.txt 00:57:49 [94.719s] retriever.cpp 00:57:49 [97.485s] Creating library C:/ci/ws/build/resource_retriever/Release/resource_retriever.lib and object C:/ci/ws/build/resource_retriever/Release/resource_retriever.exp 00:57:49 [97.907s] resource_retriever.vcxproj -> C:\ci\ws\build\resource_retriever\Release\resource_retriever.dll 00:57:49 [98.063s] Building Custom Rule C:/ci/ws/src/ros/resource_retriever/resource_retriever/CMakeLists.txt 00:57:49 [98.469s] -- Installing: C:/ci/ws/install/lib/resource_retriever.lib 00:57:49 [98.516s] -- Installing: C:/ci/ws/install/bin/resource_retriever.dll 00:57:49 [98.532s] -- Up-to-date: C:/ci/ws/install/include 00:57:49 [98.547s] -- Installing: C:/ci/ws/install/include/resource_retriever 00:57:49 [98.547s] -- Installing: C:/ci/ws/install/include/resource_retriever/retriever.h 00:57:49 [98.547s] -- Installing: C:/ci/ws/install/include/resource_retriever/visibility_control.hpp 00:57:49 [98.547s] -- Installing: C:/ci/ws/install/share/ament_index/resource_index/package_run_dependencies/resource_retriever 00:57:49 [98.563s] -- Installing: C:/ci/ws/install/share/ament_index/resource_index/parent_prefix_path/resource_retriever 00:57:49 [98.563s] -- Installing: C:/ci/ws/install/share/resource_retriever/environment/ament_prefix_path.bat 00:57:49 [98.563s] -- Installing: C:/ci/ws/install/share/resource_retriever/environment/ament_prefix_path.dsv 00:57:49 [98.578s] -- Installing: C:/ci/ws/install/share/resource_retriever/environment/path.bat 00:57:49 [98.594s] -- Installing: C:/ci/ws/install/share/resource_retriever/environment/path.dsv 00:57:49 [98.594s] -- Installing: C:/ci/ws/install/share/resource_retriever/local_setup.bat 00:57:49 [98.594s] -- Installing: C:/ci/ws/install/share/resource_retriever/local_setup.dsv 00:57:49 [98.610s] -- Installing: C:/ci/ws/install/share/resource_retriever/package.dsv 00:57:49 [98.610s] -- Installing: C:/ci/ws/install/share/ament_index/resource_index/packages/resource_retriever 00:57:49 [98.610s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/resource_retrieverExport.cmake 00:57:49 [98.610s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/resource_retrieverExport-release.cmake 00:57:49 [98.610s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/ament_cmake_export_include_directories-extras.cmake 00:57:49 [98.625s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/ament_cmake_export_interfaces-extras.cmake 00:57:49 [98.625s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/ament_cmake_export_dependencies-extras.cmake 00:57:49 [98.625s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/resource_retrieverConfig.cmake 00:57:49 [98.625s] -- Installing: C:/ci/ws/install/share/resource_retriever/cmake/resource_retrieverConfig-version.cmake 00:57:49 [98.625s] -- Installing: C:/ci/ws/install/share/resource_retriever/package.xml 00:57:49 --- 00:57:49 Finished <<< resource_retriever [1min 39s] ```
Karsten1987 commented 4 years ago

@adamleon I am running into the same problem. Do you have any new insights into this?

sloretz commented 4 years ago

Reopened. This post in another project has the same error. Is something supposed to reference libcurl.lib instead of libcurl.dll?

https://www.codeproject.com/Questions/779686/Gets-fatal-error-LNK-invalid-or-corrupt-file-canno

Karsten1987 commented 4 years ago

I've just read a similar post. #39 tries to address this problem. At least it fixes it on my local workspace.

jacobperron commented 4 years ago

For the record, we're seeing this error on CI now, for example: https://ci.ros2.org/job/ci_windows/9849/console

sloretz commented 4 years ago

Fixed by #40 :tada: