Skip to content

[wasm][coreclr] Make libs subset build #114548

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

Merged
merged 16 commits into from
Apr 25, 2025
Merged
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
1 change: 1 addition & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@

<!-- Android 32-bit builds blocked by https://github.com/dotnet/runtime/issues/111665 -->
<_CoreCLRSupportedOS Condition="'$(TargetsAndroid)' == 'true' and '$(TargetArchitecture)' != 'arm' and '$(TargetArchitecture)' != 'x86'">true</_CoreCLRSupportedOS>
<_CoreCLRSupportedOS Condition="'$(TargetsBrowser)' == 'true'">true</_CoreCLRSupportedOS>

<_CoreCLRSupportedArch Condition="'$(TargetArchitecture)' != 'armv6' and '$(TargetArchitecture)' != 'ppc64le' and '$(TargetArchitecture)' != 's390x'">true</_CoreCLRSupportedArch>
<CoreCLRSupported Condition="'$(_CoreCLRSupportedOS)' == 'true' and '$(_CoreCLRSupportedArch)' == 'true'">true</CoreCLRSupported>
2 changes: 1 addition & 1 deletion eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@ extends:
- browser_wasm
jobParameters:
nameSuffix: AllSubsets_CoreCLR
buildArgs: -s clr.runtime -rc Release -c Release -lc $(_BuildConfig)
buildArgs: -s clr.runtime+libs -rc Release -c Release -lc $(_BuildConfig)
timeoutInMinutes: 120
condition: >-
or(
12 changes: 8 additions & 4 deletions src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
Original file line number Diff line number Diff line change
@@ -11,16 +11,17 @@
<!-- Force System.Private.CoreLib.dll into a special IL output directory -->
<OutputPath>$(RuntimeBinDir)IL\</OutputPath>
<Configurations>Debug;Release;Checked</Configurations>
<Platforms>x64;x86;arm;arm64</Platforms>
<Platforms>x64;x86;arm;arm64;wasm</Platforms>

<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>

<ILLinkTrimAssembly>true</ILLinkTrimAssembly>
<ILLinkDescriptorsXml>$(IntermediateOutputPath)ILLink.Descriptors.xml</ILLinkDescriptorsXml>
<ILLinkDirectory>$(MSBuildThisFileDirectory)src\ILLink\</ILLinkDirectory>

<FeaturePortableThreadPool>true</FeaturePortableThreadPool>
<FeaturePortableTimer>true</FeaturePortableTimer>
<FeaturePortableThreadPool Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableThreadPool>
<FeaturePortableTimer Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableTimer>
<FeatureSingleThread Condition="'$(TargetsBrowser)' == 'true'">true</FeatureSingleThread>
</PropertyGroup>

<ItemGroup>
@@ -73,6 +74,9 @@
<PropertyGroup Condition="'$(Platform)' == 'riscv64'">
<DefineConstants>$(DefineConstants);TARGET_RISCV64</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'wasm'">
<DefineConstants>$(DefineConstants);TARGET_WASM</DefineConstants>
</PropertyGroup>

<!-- Configuration specific properties -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
@@ -281,7 +285,7 @@
<ItemGroup Condition="'$(FeatureCominterop)' != 'true'">
<Compile Include="$(BclSourcesRoot)\Internal\Runtime\InteropServices\ComActivator.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'" >
<Compile Include="$(BclSourcesRoot)\Internal\Runtime\InteropServices\InMemoryAssemblyLoader.PlatformNotSupported.cs" />
<Compile Include="$(BclSourcesRoot)\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\LowLevelLifoSemaphore.Unix.cs" />
69 changes: 69 additions & 0 deletions src/coreclr/System.Private.CoreLib/System.Private.CoreLib.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -50,6 +50,10 @@ class AsmOffsets
public const int SIZEOF__REGDISPLAY = 0xc60;
public const int OFFSETOF__REGDISPLAY__SP = 0xba8;
public const int OFFSETOF__REGDISPLAY__ControlPC = 0xbb0;
#elif TARGET_WASM
public const int SIZEOF__REGDISPLAY = 0x3c;
public const int OFFSETOF__REGDISPLAY__SP = 0x34;
public const int OFFSETOF__REGDISPLAY__ControlPC = 0x38;
#endif

#if TARGET_64BIT
@@ -107,6 +111,10 @@ class AsmOffsets
public const int SIZEOF__REGDISPLAY = 0xc50;
public const int OFFSETOF__REGDISPLAY__SP = 0xba0;
public const int OFFSETOF__REGDISPLAY__ControlPC = 0xba8;
#elif TARGET_WASM
public const int SIZEOF__REGDISPLAY = 0x3c;
public const int OFFSETOF__REGDISPLAY__SP = 0x34;
public const int OFFSETOF__REGDISPLAY__ControlPC = 0x38;
#endif

#if TARGET_64BIT
@@ -148,6 +156,8 @@ class AsmOffsets
public const int SIZEOF__PAL_LIMITED_CONTEXT = 0x220;
#elif TARGET_LOONGARCH64
public const int SIZEOF__PAL_LIMITED_CONTEXT = 0x520;
#elif TARGET_WASM
public const int SIZEOF__PAL_LIMITED_CONTEXT = 0x08;
#endif

#if TARGET_AMD64
@@ -168,6 +178,10 @@ class AsmOffsets
#elif TARGET_LOONGARCH64
public const int OFFSETOF__PAL_LIMITED_CONTEXT__IP = 0x108;
public const int OFFSETOF__PAL_LIMITED_CONTEXT__FP = 0xb8;
#elif TARGET_WASM
// offset to dummy field
public const int OFFSETOF__PAL_LIMITED_CONTEXT__IP = 0x04;
public const int OFFSETOF__PAL_LIMITED_CONTEXT__FP = 0x04;
#endif

// Offsets / sizes that are different in 64 / 32 bit mode
Original file line number Diff line number Diff line change
@@ -2750,7 +2750,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelLifoSemaphore.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelLifoSemaphore.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PreAllocatedOverlapped.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PreAllocatedOverlapped.Unix.cs" Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PreAllocatedOverlapped.Unix.cs" Condition="'$(TargetsUnix)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PreAllocatedOverlapped.Portable.cs" Condition="('$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true') or '$(FeatureWasmManagedThreads)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\RegisteredWaitHandle.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\RegisteredWaitHandle.Unix.cs" Condition="'$(TargetsWindows)' != 'true'" />
@@ -2761,6 +2761,14 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadPoolBoundHandleOverlapped.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadPoolCallbackWrapper.cs" Condition="'$(FeatureNativeAot)' != 'true'" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true') and '$(FeatureWasmManagedThreads)' != 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PreAllocatedOverlapped.Browser.cs"/>
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadPoolBoundHandle.Browser.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' == 'true' and '$(FeatureWasmManagedThreads)' != 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadPool.Browser.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\TimerQueue.Browser.cs" />
</ItemGroup>
<ItemGroup Condition="'$(FeatureObjCMarshal)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\ObjectiveC\ObjectiveCMarshal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\ObjectiveC\ObjectiveCTrackedTypeAttribute.cs" />
Original file line number Diff line number Diff line change
@@ -34,5 +34,11 @@ private static OperatingSystem GetOSVersion()
/// </summary>
/// <returns>Path of the executable that started the currently executing process</returns>
private static string? GetProcessPath() => null;

#if !MONO
// This is only used for delegate created from native host
private static string[] GetCommandLineArgsNative() => [];
#endif

}
}
8 changes: 4 additions & 4 deletions src/libraries/pretest.proj
Original file line number Diff line number Diff line change
@@ -19,13 +19,13 @@

<ProjectReference Include="$(CommonTestPath)AppleTestRunner\AppleTestRunner.csproj" Condition="'$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator'"/>
<ProjectReference Include="$(CommonTestPath)AndroidTestRunner\AndroidTestRunner.csproj" Condition="'$(TargetOS)' == 'android'" />
<ProjectReference Include="$(CommonTestPath)WasmTestRunner\WasmTestRunner.csproj" Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'" />
<ProjectReference Include="$(MonoProjectRoot)wasm\symbolicator\WasmSymbolicator.csproj" Condition="'$(TargetOS)' == 'browser'" />
<ProjectReference Include="$(CommonTestPath)WasmTestRunner\WasmTestRunner.csproj" Condition="('$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi') and '$(RuntimeFlavor)' == 'Mono'" />
<ProjectReference Include="$(MonoProjectRoot)wasm\symbolicator\WasmSymbolicator.csproj" Condition="'$(TargetOS)' == 'browser' and '$(RuntimeFlavor)' == 'Mono'" />

<!-- needed to test workloads for wasm -->
<ProjectReference Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.Mono.sfxproj"
Pack="true"
Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'" />
Condition="('$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi') and '$(RuntimeFlavor)' == 'Mono'" />
</ItemGroup>

<ItemGroup Condition="'$(TestReadyToRun)' == 'true'">
@@ -34,7 +34,7 @@
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)testing\wasm-provisioning.targets"
Condition="'$(TargetOS)' == 'browser' and '$(ContinuousIntegrationBuild)' == 'true'" />
Condition="'$(TargetOS)' == 'browser' and '$(ContinuousIntegrationBuild)' == 'true' and '$(RuntimeFlavor)' == 'Mono'" />

<Import Project="$(RepositoryEngineeringDir)testing\wasi-provisioning.targets"
Condition="'$(TargetOS)' == 'wasi' and '$(ContinuousIntegrationBuild)' == 'true'" />
Original file line number Diff line number Diff line change
@@ -269,15 +269,7 @@
<Compile Include="$(BclSourcesRoot)\System\Threading\PortableThreadPool.Browser.Threads.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPool.Browser.Threads.Mono.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' == 'true' and '$(FeatureWasmManagedThreads)' != 'true'">
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPoolBoundHandle.Browser.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\PreAllocatedOverlapped.Browser.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPool.Browser.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\TimerQueue.Browser.Mono.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsWasi)' == 'true'">
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPoolBoundHandle.Browser.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\PreAllocatedOverlapped.Browser.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPool.Wasi.Mono.cs" />
<Compile Include="$(BclSourcesRoot)\System\Threading\TimerQueue.Wasi.Mono.cs" />
</ItemGroup>
Loading
Oops, something went wrong.