Skip to content

Align NativeAOT WASM runtime artifact names - #136999

Open
MichalStrehovsky wants to merge 4 commits into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasm-runtime-artifact-names
Open

MichalStrehovsky wants to merge 4 commits into
dotnet:mainfrom
MichalStrehovsky:nativeaot-wasm-runtime-artifact-names

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Rename the portable runtime library to Runtime.WorkstationGC and generate AsmOffsets.cs. Update the WASM linker and CoreLib consumers without changing runtime sources or defines.

I originally started with just deleting Runtime/Portable/CMakeLists.txt, but then realized the Runtime/CMakeLists.txt and Runtime/Full/CMakeLists.txt split then stops making sense, so we'd also need to delete Full/CMakeLists.txt, but then the structuring in Runtime/CMakeLists.txt would also become nonsensical and we'd need to restructure it and lose any remnants of the portable runtime flavor.

This should address dotnet/dotnet#10703 (comment).

Rename the portable runtime library to Runtime.WorkstationGC and generate AsmOffsets.cs. Update the WASM linker and CoreLib consumers without changing runtime sources or defines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b3e871f9-f4ec-4d90-91ad-fd5697b4b31b
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas

jkotas commented Nov 5, 2026

Copy link
Copy Markdown
Member

If we want to reduce the 3 CMakeLists to 1,

I think it would make sense.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 67e21777-f3d8-4031-a350-84b9e2001764
@MichalStrehovsky
MichalStrehovsky requested a balanced review from Copilot November 5, 2026 14:15
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The NativeAOT-wide CMake scoping changes require cross-platform build, link, and toolchain validation that was unavailable in this static review.

No open issues 🎉

What changed in this PR

This PR aligns NativeAOT WASM artifact names with other targets and consolidates runtime build configuration into a single CMake file.

Changes:

  • Rename the WASM runtime archive to Runtime.WorkstationGC and update its linker reference.
  • Generate Runtime/AsmOffsets.cs at a shared location and update both CoreLib consumers.
  • Remove the separate Full and Portable CMake files, moving their target definitions into Runtime/CMakeLists.txt.
File Description
src/​coreclr/​nativeaot/​Test.CoreLib/​src/​Test.CoreLib.csproj Use the shared Runtime/AsmOffsets.cs path.
src/​coreclr/​nativeaot/​System.Private.CoreLib/​src/​System.Private.CoreLib.csproj Unify WASM and non-WASM assembly-offset inputs.
src/​coreclr/​nativeaot/​Runtime/​Portable/​CMakeLists.txt Remove the separate portable runtime build configuration.
src/​coreclr/​nativeaot/​Runtime/​Full/​CMakeLists.txt Remove the separate full runtime build configuration.
src/​coreclr/​nativeaot/​Runtime/​CMakeLists.txt Consolidate runtime targets, helper selection, and offset generation.
src/​coreclr/​nativeaot/​BuildIntegration/​Microsoft.NETCore.Native.Wasm.targets Link WASM applications against libRuntime.WorkstationGC.a.

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 404e37e0-40b9-42e0-a486-b369c16cc301

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move install_static_library to be next to what it is installing, so that the optional and non-optional targets have the same flow

endif()
if(FEATURE_EVENT_TRACE AND CLR_CMAKE_TARGET_WIN32)
add_dependencies(standalonegc-disabled aot_etw_headers)
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
endif()
endif()
install_static_library(standalonegc-disabled aotsdk nativeaot)

endif()
if(NOT FEATURE_PORTABLE_HELPERS)
target_link_libraries(Runtime.WorkstationGC PRIVATE Runtime.AsmHelpers)
endif()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
endif()
endif()
install_static_library(Runtime.WorkstationGC aotsdk nativeaot)

Comment on lines +592 to +608
if(CLR_CMAKE_TARGET_WIN32)
set_target_properties(aotminipal PROPERTIES
COMPILE_PDB_NAME "aotminipal"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()

add_custom_command(
# AsmOffsets.cs is consumed later by the managed build.
TARGET Runtime.WorkstationGC
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS}
-I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
)

install_static_library(Runtime.WorkstationGC aotsdk nativeaot)
install_static_library(standalonegc-disabled aotsdk nativeaot)
install_static_library(aotminipal aotsdk nativeaot)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if(CLR_CMAKE_TARGET_WIN32)
set_target_properties(aotminipal PROPERTIES
COMPILE_PDB_NAME "aotminipal"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()
add_custom_command(
# AsmOffsets.cs is consumed later by the managed build.
TARGET Runtime.WorkstationGC
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS}
-I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
)
install_static_library(Runtime.WorkstationGC aotsdk nativeaot)
install_static_library(standalonegc-disabled aotsdk nativeaot)
install_static_library(aotminipal aotsdk nativeaot)
if(CLR_CMAKE_TARGET_WIN32)
set_target_properties(aotminipal PROPERTIES
COMPILE_PDB_NAME "aotminipal"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()
install_static_library(aotminipal aotsdk nativeaot)
add_custom_command(
# AsmOffsets.cs is consumed later by the managed build.
TARGET Runtime.WorkstationGC
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${COMPILER_LANGUAGE} ${DEFINITIONS} ${PREPROCESSOR_FLAGS}
-I"${ARCH_SOURCES_DIR}" "${ASM_OFFSETS_CSPP}" >"${CMAKE_CURRENT_BINARY_DIR}/AsmOffsets.cs"
)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25b5a402-5d11-4d2d-a2b9-5d62a73b3e4d

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants