Skip to content

Commit 8d02c67

Browse files
authored
Merge branch 'main' into patch-31
2 parents 0a1fa05 + 1da2ea4 commit 8d02c67

File tree

10 files changed

+77
-49
lines changed

10 files changed

+77
-49
lines changed

eng/Subsets.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@
386386
PgoInstrument=false;
387387
NoPgoOptimize=true;
388388
TargetOS=linux;
389+
BuildSubdirectory=$(CrossDacHostArch);
389390
CMakeArgs=$(CMakeArgs) -DCLR_CROSS_COMPONENTS_BUILD=1" Category="clr" />
390391
</ItemGroup>
391392

@@ -398,6 +399,7 @@
398399
PgoInstrument=false;
399400
NoPgoOptimize=true;
400401
TargetOS=alpine;
402+
BuildSubdirectory=$(CrossDacHostArch);
401403
CMakeArgs=$(CMakeArgs) -DCLR_CROSS_COMPONENTS_BUILD=1" Category="clr" />
402404
</ItemGroup>
403405

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageVersionNet8>8.0.8</PackageVersionNet8>
1212
<PackageVersionNet7>7.0.20</PackageVersionNet7>
1313
<PackageVersionNet6>6.0.$([MSBuild]::Add($([System.Version]::Parse('$(PackageVersionNet8)').Build),25))</PackageVersionNet6>
14-
<PreReleaseVersionLabel>alpha</PreReleaseVersionLabel>
14+
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
1515
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>
1616
<!-- Enable to remove prerelease label. -->
1717
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# Linux arm
2727
- ${{ if eq(parameters.platform, 'linux_arm') }}:
2828
- ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
29-
- (Debian.12.Arm32.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
29+
- (Debian.13.Arm32.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-arm32v7
3030

3131
# Linux armv6
3232
- ${{ if eq(parameters.platform, 'linux_armv6') }}:
@@ -36,7 +36,7 @@ jobs:
3636
- ${{ if eq(parameters.platform, 'linux_arm64') }}:
3737
- (Ubuntu.2410.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-24.10-helix-arm64v8
3838
- ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
39-
- (Debian.12.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-arm64v8
39+
- (Debian.13.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-arm64v8
4040

4141
# Linux musl x64
4242
- ${{ if eq(parameters.platform, 'linux_musl_x64') }}:
@@ -57,22 +57,22 @@ jobs:
5757
- (Centos.9.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-stream9-helix
5858
- (Fedora.41.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:fedora-41-helix
5959
- (Ubuntu.2204.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64
60-
- (Debian.12.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-amd64
60+
- (Debian.13.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-amd64
6161
- ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
6262
- ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
6363
- SLES.15.Amd64.Open
6464
- (Fedora.41.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:fedora-41-helix
6565
- Ubuntu.2204.Amd64.Open
66-
- (Debian.12.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-amd64
66+
- (Debian.13.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-amd64
6767
- (AzureLinux.3.0.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64
6868
- (openSUSE.15.6.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:opensuse-15.6-helix-amd64
6969
- ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
7070
- (Centos.9.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-stream9-helix
71-
- (Debian.12.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-amd64
71+
- (Debian.13.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-amd64
7272
- Ubuntu.2204.Amd64.Open
7373
- ${{ if or(eq(parameters.jobParameters.interpreter, 'true'), eq(parameters.jobParameters.isSingleFile, true)) }}:
7474
# Limiting interp runs as we don't need as much coverage.
75-
- (Debian.12.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-amd64
75+
- (Debian.13.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-amd64
7676

7777
# Linux s390x
7878
- ${{ if eq(parameters.platform, 'linux_s390x') }}:

eng/pipelines/runtime-official.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ extends:
4040
#
4141
# Localization build
4242
#
43-
44-
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/9.0') }}:
43+
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
4544
- template: /eng/common/templates-official/job/onelocbuild.yml
4645
parameters:
4746
MirrorRepo: runtime
48-
MirrorBranch: release/9.0
47+
MirrorBranch: main
4948
LclSource: lclFilesfromPackage
5049
LclPackageId: 'LCL-JUNO-PROD-RUNTIME'
5150

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeBuilder.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ internal void ParseNativeLayoutInfo(InstantiatedMethod method)
296296

297297
InstantiatedMethod nonTemplateMethod = method;
298298

299-
// Templates are always non-unboxing stubs
300-
if (method.UnboxingStub)
299+
// Templates are always unboxing stubs for valuetype instance methods
300+
if (!method.UnboxingStub && method.OwningType.IsValueType && !TypeLoaderEnvironment.IsStaticMethodSignature(method.NameAndSignature))
301301
{
302-
// Strip unboxing stub, note the first parameter which is false
303-
nonTemplateMethod = (InstantiatedMethod)method.Context.ResolveGenericMethodInstantiation(false, (DefType)method.OwningType, method.NameAndSignature, method.Instantiation);
302+
// Make it an unboxing stub, note the first parameter which is true
303+
nonTemplateMethod = (InstantiatedMethod)method.Context.ResolveGenericMethodInstantiation(true, (DefType)method.OwningType, method.NameAndSignature, method.Instantiation);
304304
}
305305

306306
uint nativeLayoutInfoToken;
@@ -311,11 +311,15 @@ internal void ParseNativeLayoutInfo(InstantiatedMethod method)
311311
throw new MissingTemplateException();
312312
}
313313

314-
// We might have a mismatch between unboxing/non-unboxing variants so only remember it for static methods
315-
if (TypeLoaderEnvironment.IsStaticMethodSignature(templateMethod.NameAndSignature)
316-
&& templateMethod.FunctionPointer != IntPtr.Zero)
314+
if (templateMethod.FunctionPointer != IntPtr.Zero)
317315
{
318316
nonTemplateMethod.SetFunctionPointer(templateMethod.FunctionPointer);
317+
318+
// Compensate for the template being an unboxing stub
319+
if (nonTemplateMethod != method)
320+
{
321+
method.SetFunctionPointer(TypeLoaderEnvironment.ConvertUnboxingFunctionPointerToUnderlyingNonUnboxingPointer(templateMethod.FunctionPointer, templateMethod.OwningType.RuntimeTypeHandle));
322+
}
319323
}
320324

321325
// Ensure that if this method is non-shareable from a normal canonical perspective, then

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,17 @@ public bool TryGetGenericVirtualMethodPointer(InstantiatedMethod method, out Int
258258
}
259259
}
260260

261+
InstantiatedMethod nonTemplateMethod = method;
262+
263+
// Templates are always unboxing stubs for valuetype instance methods
264+
if (!method.UnboxingStub && method.OwningType.IsValueType && !IsStaticMethodSignature(method.NameAndSignature))
265+
{
266+
// Make it an unboxing stub, note the first parameter which is true
267+
nonTemplateMethod = (InstantiatedMethod)method.Context.ResolveGenericMethodInstantiation(true, (DefType)method.OwningType, method.NameAndSignature, method.Instantiation);
268+
}
269+
261270
// If we cannot find an exact method entry point, look for an equivalent template and compute the generic dictionary
262-
InstantiatedMethod templateMethod = TemplateLocator.TryGetGenericMethodTemplate(method, out _, out _);
271+
InstantiatedMethod templateMethod = TemplateLocator.TryGetGenericMethodTemplate(nonTemplateMethod, out _, out _);
263272
if (templateMethod == null)
264273
{
265274
methodPointer = default;

src/coreclr/tools/ILVerify/README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,34 @@ The test project itself is under [src/tests/ilverify](../../../tests/ilverify)
4848

4949
General instructions to build this library can be found [here](https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/coreclr/testing.md).
5050

51-
As the test project is marked with priority=1, simply building the test projects from the root of the project is not enough. For the initial build of priority=1 in release mode, run the following:
51+
As quick snippet which should be enough to build CoreCLR
52+
```
53+
./build.cmd -s clr+libs -c release
54+
```
5255

53-
```sh
54-
src/tests/build.(cmd/sh) release -priority=1
56+
As the test project is marked with priority=1, simply building the test projects from the root of the project is not enough. Run the following to build ilverify tests:
57+
58+
```shell
59+
src/tests/build.(cmd/sh) release tree ilverify
5560
```
5661

5762
It is important to not attempt to build the test project using `dotnet build` or `dotnet test`, as this will invalidate the state of the build and requires a full rebuild of both (see this [issue](https://github.com/dotnet/runtime/issues/43967)).
5863

5964
To incrementally build the ILVerify tests in isolation, run the following:
6065

6166
```sh
62-
dotnet.(cmd/sh) msbuild ./src/tests/ilverify/ILVerification.Tests.csproj /p:Configuration=Release
67+
dotnet.(cmd/sh) msbuild ./src/tests/ilverify/ILVerificationTests.csproj /p:Configuration=Release
6368
```
6469

6570
In order to run the tests, execute:
6671

72+
on Linux
6773
```sh
68-
artifacts/tests/coreclr/(windows/linux).x64.Release/ilverify/ILVerification.Tests.(cmd/sh) -coreroot=artifacts/tests/coreclr/(windows/linux).x64.Release/Tests/Core_Root
74+
artifacts/tests/coreclr/linux.x64.Release/ilverify/ILVerificationTests.sh -coreroot=<repo_root>artifacts/tests/coreclr/linux.x64.Release/Tests/Core_Root
75+
```
76+
on Windows
77+
```shell
78+
artifacts\tests\coreclr\windows.x64.Release\ilverify\ILVerificationTests.cmd -coreroot=<repo_root>artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root
6979
```
7080

7181

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public enum MethodEntryFlags
107107

108108
public MethodDesc Method => _method;
109109

110+
public virtual bool IsUnboxingStub => _method.OwningType.IsValueType && !_method.Signature.IsStatic;
111+
110112
public NativeLayoutMethodEntryVertexNode(NodeFactory factory, MethodDesc method, MethodEntryFlags flags)
111113
{
112114
_method = method;
@@ -148,7 +150,7 @@ public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFacto
148150

149151
if ((_flags & MethodEntryFlags.SaveEntryPoint) != 0)
150152
{
151-
IMethodNode methodEntryPointNode = GetMethodEntrypointNode(context, out _);
153+
IMethodNode methodEntryPointNode = GetMethodEntrypointNode(context);
152154
dependencies.Add(new DependencyListEntry(methodEntryPointNode, "NativeLayoutMethodEntryVertexNode entrypoint"));
153155
}
154156

@@ -187,17 +189,17 @@ public override Vertex WriteVertex(NodeFactory factory)
187189
}
188190
}
189191

192+
if (IsUnboxingStub)
193+
flags |= MethodFlags.IsUnboxingStub;
194+
190195
uint fptrReferenceId = 0;
191196
if ((_flags & MethodEntryFlags.SaveEntryPoint) != 0)
192197
{
193198
flags |= MethodFlags.HasFunctionPointer;
194199

195-
bool unboxingStub;
196-
IMethodNode methodEntryPointNode = GetMethodEntrypointNode(factory, out unboxingStub);
200+
IMethodNode methodEntryPointNode = GetMethodEntrypointNode(factory);
197201
fptrReferenceId = factory.MetadataManager.NativeLayoutInfo.ExternalReferences.GetIndex(methodEntryPointNode);
198202

199-
if (unboxingStub)
200-
flags |= MethodFlags.IsUnboxingStub;
201203
if (methodEntryPointNode.Method.IsCanonicalMethod(CanonicalFormKind.Universal))
202204
flags |= MethodFlags.FunctionPointerIsUSG;
203205
}
@@ -219,10 +221,9 @@ private Vertex GetContainingTypeVertex(NodeFactory factory)
219221
}
220222
}
221223

222-
protected virtual IMethodNode GetMethodEntrypointNode(NodeFactory factory, out bool unboxingStub)
224+
protected virtual IMethodNode GetMethodEntrypointNode(NodeFactory factory)
223225
{
224-
unboxingStub = _method.OwningType.IsValueType && !_method.Signature.IsStatic;
225-
IMethodNode methodEntryPointNode = factory.MethodEntrypoint(_method, unboxingStub);
226+
IMethodNode methodEntryPointNode = factory.MethodEntrypoint(_method, IsUnboxingStub);
226227
return methodEntryPointNode;
227228
}
228229
}
@@ -748,15 +749,11 @@ public override Vertex WriteVertex(NodeFactory factory)
748749
return SetSavedVertex(factory.MetadataManager.NativeLayoutInfo.TemplatesSection.Place(methodEntryVertex));
749750
}
750751

751-
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory, out bool unboxingStub)
752+
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory)
752753
{
753754
Debug.Assert(NeedsEntrypoint(_method));
754-
unboxingStub = _method.OwningType.IsValueType && !_method.Signature.IsStatic;
755755
// TODO-SIZE: this is only address taken if it's a target of a delegate
756-
IMethodNode methodEntryPointNode = factory.AddressTakenMethodEntrypoint(_method, unboxingStub);
757-
// Note: We don't set the IsUnboxingStub flag on template methods (all template lookups performed at runtime are performed with this flag not set,
758-
// since it can't always be conveniently computed for a concrete method before looking up its template)
759-
unboxingStub = false;
756+
IMethodNode methodEntryPointNode = factory.AddressTakenMethodEntrypoint(_method, IsUnboxingStub);
760757
return methodEntryPointNode;
761758
}
762759

@@ -1677,7 +1674,7 @@ public WrappedMethodDictionaryVertexNode(NodeFactory factory, MethodDesc method)
16771674
{
16781675
}
16791676

1680-
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory, out bool unboxingStub)
1677+
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory)
16811678
{
16821679
throw new NotSupportedException();
16831680
}
@@ -1903,16 +1900,17 @@ private sealed class WrappedMethodEntryVertexNode : NativeLayoutMethodEntryVerte
19031900
public bool _unboxingStub;
19041901
public IMethodNode _functionPointerNode;
19051902

1903+
public override bool IsUnboxingStub => _unboxingStub;
1904+
19061905
public WrappedMethodEntryVertexNode(NodeFactory factory, MethodDesc method, bool unboxingStub, IMethodNode functionPointerNode) :
19071906
base(factory, method, functionPointerNode != null ? MethodEntryFlags.SaveEntryPoint : default(MethodEntryFlags))
19081907
{
19091908
_unboxingStub = unboxingStub;
19101909
_functionPointerNode = functionPointerNode;
19111910
}
19121911

1913-
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory, out bool unboxingStub)
1912+
protected override IMethodNode GetMethodEntrypointNode(NodeFactory factory)
19141913
{
1915-
unboxingStub = _unboxingStub;
19161914
return _functionPointerNode;
19171915
}
19181916

src/libraries/Microsoft.Extensions.DependencyModel/tests/PackageResolverTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using FluentAssertions;
8-
using Microsoft.DotNet.XUnitExtensions;
98
using Microsoft.Extensions.DependencyModel.Resolution;
109
using Xunit;
1110
using F = Microsoft.Extensions.DependencyModel.Tests.TestLibraryFactory;
@@ -28,7 +27,7 @@ public void ShouldUseEnvironmentVariableToGetDefaultLocation()
2827
result.Should().Contain(PackagesPath);
2928
}
3029

31-
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/runtime/issues/21430
30+
[Fact]
3231
public void ShouldUseNugetUnderUserProfile()
3332
{
3433
var environment = EnvironmentMockBuilder.Create()

0 commit comments

Comments
 (0)