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

Set ros2cs_tests CSHARP_TARGET_FRAMEWORK #39

Closed
Deric-W opened this issue Jan 27, 2023 · 1 comment
Closed

Set ros2cs_tests CSHARP_TARGET_FRAMEWORK #39

Deric-W opened this issue Jan 27, 2023 · 1 comment

Comments

@Deric-W
Copy link
Contributor

Deric-W commented Jan 27, 2023

Currently the package ros2cs_tests does not set CSHARP_TARGET_FRAMEWORK in cmake leading to the default version being used which can cause unexpected build failures in case of upgrades.

The latest commit in the cmake module for C# changed the default version from netcoreapp3.1 to netstandard2.0 causing the following build failure on Ubuntu 22.04 and Windows 10 with ROS2 Humble:

C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
    All projects are up-to-date for restore.
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
CSC : warning CS1668: Invalid search path 'lib\um\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(66,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(81,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(101,17): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(123,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(148,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(184,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
  
  Build FAILED.
  
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
CSC : warning CS1668: Invalid search path 'lib\um\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(66,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(81,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(101,17): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(123,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(148,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(184,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
      5 Warning(s)
      6 Error(s)

I suggest setting it to netcoreapp6.0 since the the tests are not distributed as far as I know and netcoreapp3.1 requires dotnet 3.1 which is not available on ubuntu 22.04.

If you agree I could make a PR and update the Windows / Ubuntu Readme.

Deric-W added a commit to Deric-W/ros2cs that referenced this issue Mar 20, 2023
This fixes build failures reported in issue RobotecAI#39
Deric-W added a commit to Deric-W/ros2cs that referenced this issue Mar 20, 2023
This fixes build failures reported in issue RobotecAI#39
@pijaro
Copy link
Collaborator

pijaro commented Mar 29, 2023

Resolved in #46 👍

@pijaro pijaro closed this as completed Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants