Closed jeffdelmerico closed 5 years ago
Hi @jeffdelmerico ,
May I see your compilation command? I am (just now!!) compiling for UWP 32 (for hololens) in my Windows10 64 bits machine without any problem.
Best
@jeffdelmerico thanks for trying out ros2-dotnet. It looks like the .NET Core runtime for x86 is not installed in your NuGet cache. The CI uses Azure Pipelines, so the test runners already have everything.
Could you type the following to check that the everything is correct?
dotnet --list-runtimes
And this to make sure that you can build .NET Core projects for win-x86:
dotnet new console -n foo
cd foo
dotnet restore -r win-x86
dotnet build -r win-x86
You should now have a file named foo.exe
in bin\Debug\netcoreapp2.1\win-x86
Thanks.
Hi @esteve and @fmrico
Thanks so much for developing the dotnet interface for ros2!
I'm a long time ROS user, but I am new to .NET and Windows development, so it's possible that I've gone off track with my local setup. However, here are the steps I've taken, starting from a clean terminal with no ROS or ROS2 distributions sourced:
md \workspaces\ament_ws\src
cd \workspaces\ament_ws
curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/master/ament_dotnet_uwp.repos -o ament_dotnet_uwp.repos
vcs import src < ament_dotnet_uwp.repos
python src\ament\ament_tools\scripts\ament.py build --cmake-args -G "Visual Studio 15 2017 Win64" --
call install\local_setup.bat
cd \workspaces
md ros2_dotnet_ws\src
cd ros2_dotnet_ws
curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/master/ros2_dotnet_uwp.repos -o ros2_dotnet_uwp.repos
vcs import src < ros2_dotnet_uwp.repos
ament build --parallel --cmake-args -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.14393 -DTHIRDPARTY=ON -DINSTALL_EXAMPLES=OFF -DCMAKE_FIND_ROOT_PATH="\workspaces\ament_ws\install;\workspaces\ros2_dotnet_ws\install" --
The ament step produces lots of output but no errors. The ros2_dotnet step produces the error I included initially, along with lots of output for successful package builds.
@esteve: Here is the output of the commands you suggested:
# dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
# dotnet new console -n foo
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on foo\foo.csproj...
Restoring packages for C:\tmp\foo\foo.csproj...
Generating MSBuild file C:\tmp\foo\obj\foo.csproj.nuget.g.props.
Generating MSBuild file C:\tmp\foo\obj\foo.csproj.nuget.g.targets.
Restore completed in 283.78 ms for C:\tmp\foo\foo.csproj.
Restore succeeded.
# dotnet restore -r win-x86
Restoring packages for C:\tmp\foo\foo.csproj...
Installing runtime.win-x86.Microsoft.NETCore.DotNetAppHost 2.2.0.
Installing runtime.win-x86.Microsoft.NETCore.DotNetHostResolver 2.2.0.
Installing runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy 2.2.0.
Installing runtime.win-x86.Microsoft.NETCore.App 2.2.0.
Restore completed in 9.7 sec for C:\tmp\foo\foo.csproj.
# dotnet build -r win-x86
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for C:\tmp\foo\foo.csproj...
Installing Microsoft.NETCore.DotNetAppHost 2.2.1.
Installing Microsoft.NETCore.DotNetHostResolver 2.2.1.
Installing Microsoft.NETCore.DotNetHostPolicy 2.2.1.
Installing Microsoft.NETCore.App 2.2.1.
Installing runtime.win-x86.Microsoft.NETCore.DotNetAppHost 2.2.1.
Installing runtime.win-x86.Microsoft.NETCore.DotNetHostResolver 2.2.1.
Installing runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy 2.2.1.
Installing runtime.win-x86.Microsoft.NETCore.App 2.2.1.
Generating MSBuild file C:\tmp\foo\obj\foo.csproj.nuget.g.props.
Generating MSBuild file C:\tmp\foo\obj\foo.csproj.nuget.g.targets.
Restore completed in 12.69 sec for C:\tmp\foo\foo.csproj.
C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(134,5): error NETSDK1032: The RuntimeIdentifier platform 'win-x86' and the PlatformTarget 'x64' must be compatible. [C:\tmp\foo\foo.csproj]
Build FAILED.
C:\Program Files\dotnet\sdk\2.2.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(134,5): error NETSDK1032: The RuntimeIdentifier platform 'win-x86' and the PlatformTarget 'x64' must be compatible. [C:\tmp\foo\foo.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:13.30
I've also verified that I already had the x86 runtime installed (on my system at least).
So do I understand correctly that this runtime is not being found when I go to build? How do I make sure that this is in my NuGet cache?
Thanks for your help!
@jeffdelmerico are you using the "x64 Native Tools Command Prompt for Visual Studio 2017" console when building this, or the "x64_x86 Cross Tools Command Prompt"?
As a workaround you can also unset the PlatformTarget environment variable (set PlatformTarget=
) and that should work.
I usually just use the normal prompt, ament
only needs to have CMake and MSBuild in %PATH%
, but that's it.
@esteve thank you very much for your response. That was indeed the problem. I realized last night that I had initially used the x64 command prompt, so I tried again this morning with the x86 one, which also didn't work, but I had forgotten about the cross tools prompt. The workspace builds now, but I get a few errors of the form:
error MSB3491: Could not write lines to file "visualization_msgs_InteractiveMarkerControl__rosidl_typesupport_introspection_c.dir\Release\visualiz.08EEEE21.tlog\visualization_msgs_InteractiveMarkerControl__rosidl_typesupport_introspection_c.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\workspaces\ros2_dotnet_ws\build\visualization_msgs\visualization_msgs_InteractiveMarkerControl__rosidl_typesupport_introspection_c.vcxproj]
However, I'm fairly certain that this is just due to my workspace path being too long, so I will try with \dev or whatever. I've actually tried to change the 260 character limit for my system according to these instructions, but it did not seem to work, at least in this context.
Thanks for your help!
@jeffdelmerico awesome! I'm glad it helped. Regarding the path length, yeah, unfortunately that's a limitation of Windows, but I think a workaround could be implemented in ros2-dotnet
. Anyway, let me know if you have any doubts with ros2-dotnet
for UWP and the HoloLens, I'll be happy to help.
Thanks! I will definitely be in touch as I move forward, and perhaps I can help contribute to ARViz if there is some overlap in our goals.
@jeffdelmerico that's great. I'm the sole developer of ros2-dotnet
, so any feedback you may have I'm more than happy to hear it and any contribution is definitely welcome.
Hi Esteve,
I'm trying to compile ros2_dotnet in order to deploy some ros2 applications to HoloLens, so I have been attempting to cross-compile for x86 on my x64 machine. I am following the instructions in the README, and despite CI saying that it passes for UWP x86, rcldotnet_common fails to build when I select "Visual Studio 15 2017" as the target generator. The primary error is:
but I've pasted the full output for that package below. Ament builds fine, and I can build successfully for UWP x64. Any help would be appreciated. Thanks!