Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/coreclr/interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ else()
add_custom_target(clrinterpreter_exports DEPENDS ${EXPORTS_FILE})
endif()

add_library_clr(clrinterpreter_objects OBJECT ${INTERPRETER_SOURCES})
if(CLR_CMAKE_TARGET_WIN32)
set(INTERPRETER_RESOURCES Native.rc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does adding a native resource file change the build?

Copy link
Author

@Alikhalesi Alikhalesi Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as #118581, after adding clrinterpreter.dll as PlatformManifestEntry,
another build error is raised, due to not setting file version on clrinterpreter.dll:

C:\Users\kg\.nuget\packages\microsoft.dotnet.sharedframework.sdk\10.0.0-beta.25406.102\targets\sharedfx.targets(527,5): error : Missing FileVersion in 1 shared framework files: [Z:\runtime\src\installer\pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.
CoreCLR.sfxproj]
C:\Users\kg\.nuget\packages\microsoft.dotnet.sharedframework.sdk\10.0.0-beta.25406.102\targets\sharedfx.targets(527,5): error : Z:\runtime\artifacts\bin\coreclr\windows.x64.Checked\sharedFramework\clrinterpreter.dll [Z:\runtime\src\installer\pkg\sfx\Microsoft.NET
Core.App\Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj]
Z:\runtime\src\installer\pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj(35,5): error MSB4181: The "MSBuild" task returned false but did not log an error.

This resource adds file version, product detail, ... to the dll and fixes the issue, then the build is fine.

endif(CLR_CMAKE_TARGET_WIN32)

convert_to_absolute_path(INTERPRETER_RESOURCES ${INTERPRETER_RESOURCES})

add_library_clr(clrinterpreter_objects OBJECT ${INTERPRETER_SOURCES} ${INTERPRETER_RESOURCES})

if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
set_target_properties(clrinterpreter_objects PROPERTIES EXCLUDE_FROM_ALL $<NOT:${FEATURE_INTERPRETER}>)
Expand All @@ -46,6 +52,10 @@ else()
add_library_clr(clrinterpreter STATIC $<TARGET_OBJECTS:clrinterpreter_objects> $<TARGET_OBJECTS:dn-containers>)
endif()

if(CLR_CMAKE_TARGET_WIN32)
target_compile_definitions(clrinterpreter_objects PRIVATE FX_VER_INTERNALNAME_STR=clrinterpreter.dll)
endif(CLR_CMAKE_TARGET_WIN32)

target_include_directories(clrinterpreter INTERFACE "interpreter/inc")

if (NOT CMAKE_GENERATOR MATCHES "Visual Studio")
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/interpreter/Native.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#define FX_VER_FILEDESCRIPTION_STR ".NET Runtime Just-In-Time Compiler"

#include <fxver.h>
#include <fxver.rc>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PlatformManifestFileEntry Include="libhostpolicy.so" IsNative="true" />
<PlatformManifestFileEntry Include="libhostpolicy.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="hostfxr.dll" IsNative="true" />
<PlatformManifestFileEntry Include="clrinterpreter.dll" IsNative="true" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interpreter dll isn't ready for shipping yet. This is not the desired fix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe the interpreter will ever be shipped on windows. It is a feature intended for ios/wasm.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what would be the fix? I assume clrinterpreter.dll should be excluded. How can I manage that?

<PlatformManifestFileEntry Include="libhostfxr.so" IsNative="true" />
<PlatformManifestFileEntry Include="libhostfxr.dylib" IsNative="true" />

Expand Down