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

Compiling IJW tests fails with latest MSVC compiler #93856

Closed
filipnavara opened this issue Oct 23, 2023 · 3 comments
Closed

Compiling IJW tests fails with latest MSVC compiler #93856

filipnavara opened this issue Oct 23, 2023 · 3 comments
Labels
area-Interop-coreclr needs-author-action An issue or pull request that requires more info or actions from the author.

Comments

@filipnavara
Copy link
Member

cl.exe version:

Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33126.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

Errors:

D:\runtime\src\tests\Interop\IJW\NativeVarargs\IjwNativeVarargs.cpp(11): error C2220: the following warning is treated as an error
D:\runtime\src\tests\Interop\IJW\NativeVarargs\IjwNativeVarargs.cpp(11): warning C5271: consider replacing #using <System.Runtime.dll>  with command line argument /FU "D:\runtime\.dotnet\packs\Microsoft.NETCore.App.Ref\8.0.0-rc.1.23414.4\ref\net8.0\System.Runtime.dll"

D:\runtime\src\tests\Interop\IJW\NativeVarargs\IjwNativeVarargs.cpp(11): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
D:\runtime\src\tests\Interop\IJW\NativeVarargs\IjwNativeVarargs.cpp(12): warning C5271: consider replacing #using <System.Collections.dll>  with command line argument /FU "D:\runtime\.dotnet\packs\Microsoft.NETCore.App.Ref\8.0.0-rc.1.23414.4\ref\net8.0\System.Collections.dll"

D:\runtime\src\tests\Interop\IJW\NativeVarargs\IjwNativeVarargs.cpp(12): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
[6/8] Linking CXX shared library Interop\IJW\IjwNativeCallingManagedDll\IjwNativeCallingManagedDll.dll

Workaround:

diff --git a/src/native/corehost/test/ijw/CMakeLists.txt b/src/native/corehost/test/ijw/CMakeLists.txt
index 9e90cfdcf06..dd243fde46b 100644
--- a/src/native/corehost/test/ijw/CMakeLists.txt
+++ b/src/native/corehost/test/ijw/CMakeLists.txt
@@ -8,6 +8,8 @@ set(SOURCES

 include(${CLR_ENG_NATIVE_DIR}/ijw/IJW.cmake)

+add_compile_options(/Wv:18)
+
 add_library(ijw SHARED ${SOURCES})
 target_link_libraries(ijw PRIVATE ${LINK_LIBRARIES_ADDITIONAL})

diff --git a/src/tests/Interop/IJW/NativeVarargs/CMakeLists.txt b/src/tests/Interop/IJW/NativeVarargs/CMakeLists.txt
index a3c7c973a65..b08bd5d5342 100644
--- a/src/tests/Interop/IJW/NativeVarargs/CMakeLists.txt
+++ b/src/tests/Interop/IJW/NativeVarargs/CMakeLists.txt
@@ -4,6 +4,8 @@ include(${CLR_ENG_NATIVE_DIR}/ijw/IJW.cmake)
 include_directories( ${INC_PLATFORM_DIR} )
 set(SOURCES IjwNativeVarargs.cpp)

+add_compile_options(/Wv:18)
+
 # add the shared library
 add_library (IjwNativeVarargs SHARED ${SOURCES})
 target_link_libraries(IjwNativeVarargs PRIVATE ${LINK_LIBRARIES_ADDITIONAL})
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 23, 2023
@jkotas
Copy link
Member

jkotas commented Oct 23, 2023

This should have been fixed by #92878 . Do you have this change in your enlistment?

@jkotas jkotas added the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 23, 2023
@ghost
Copy link

ghost commented Oct 23, 2023

This issue has been marked needs-author-action and may be missing some important information.

@filipnavara
Copy link
Member Author

I could have been on a stale or release branch (which doesn't have a #92878 backport AFAICS). Anyway, I am happy to close this in favor of #92879 since it's not a blocker for me.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Oct 23, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

No branches or pull requests

2 participants