Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 374f105

Browse files
committed
Merge branch 'main' of github.com:dotnet/runtime into endswith
2 parents e21d634 + c768315 commit 374f105

File tree

14 files changed

+306
-20
lines changed

14 files changed

+306
-20
lines changed

eng/DotNetBuild.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<!-- Pass through special build modes controlled by properties -->
6262
<InnerBuildArgs Condition="'$(DotNetBuildRuntimeWasmEnableThreads)' == 'true'">$(InnerBuildArgs) /p:WasmEnableThreads=true</InnerBuildArgs>
6363
<InnerBuildArgs Condition="'$(DotNetBuildRuntimeNativeAOTRuntimePack)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)s clr.nativeaotlibs+clr.nativeaotruntime+libs+packs /p:BuildNativeAOTRuntimePack=true /p:SkipLibrariesNativeRuntimePackages=true</InnerBuildArgs>
64+
<InnerBuildArgs Condition="'$(PgoInstrument)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)pgoinstrument</InnerBuildArgs>
6465

6566
<!-- This prop needs to be passed to the inner build manually as the BaseInnerSourceBuildCommand gets overriden above -->
6667
<InnerBuildArgs Condition="'$(DotNetBuildRepo)' == 'true'">$(InnerBuildArgs) /p:DotNetBuildRepo=true</InnerBuildArgs>

eng/Subsets.props

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
<DefaultSubsets Condition="('$(DotNetBuildSourceOnly)' == 'true' and '$(PrimaryRuntimeFlavor)' != 'Mono') or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' != 'x86' and '$(TargetArchitecture)' != 'x64')">clr+libs+tools+host+packs</DefaultSubsets>
4444
</PropertyGroup>
4545

46+
<PropertyGroup>
47+
<!-- If we're building in the VMR, then we want to build all of the assets even in a PGO-instrumented build as downstream repos will not be able to pull assets from a matching non-PGO-instrumented build. -->
48+
<BuildOnlyPgoInstrumentedAssets Condition="'$(PgoInstrument)' == 'true' and '$(DotNetBuild)' != 'true'">true</BuildOnlyPgoInstrumentedAssets>
49+
</PropertyGroup>
50+
4651
<!-- Init _subset here to allow RuntimeFlavor to be set as early as possible -->
4752
<PropertyGroup>
4853
<_subset Condition="'$(Subset)' != ''">+$(Subset.ToLowerInvariant())+</_subset>
@@ -79,7 +84,7 @@
7984
'$(BuildTargetFramework)' == '' or
8085
'$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets>
8186
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.sfx+libs.oob+libs.pretest</DefaultLibrariesSubsets>
82-
<!-- Respect the DotNetBuildTests product flag when building the product. -->
87+
<!-- Respect the DotNetBuildTests product flag when building the product. -->
8388
<DefaultLibrariesSubsets Condition="'$(DotNetBuildTests)' == 'true'">$(DefaultLibrariesSubsets)+libs.tests</DefaultLibrariesSubsets>
8489

8590
<DefaultToolsSubsets>tools.illink</DefaultToolsSubsets>
@@ -391,7 +396,7 @@
391396
<ProjectToBuild Include="$(CoreClrProjectRoot)crossgen-corelib.proj" Category="clr" />
392397
</ItemGroup>
393398

394-
<ItemGroup Condition="$(_subset.Contains('+clr.packages+')) and '$(PgoInstrument)' != 'true'">
399+
<ItemGroup Condition="$(_subset.Contains('+clr.packages+')) and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
395400
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\coreclr-packages.proj" Pack="true" Category="clr" />
396401
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(RuntimeFlavor)' != 'Mono'"/>
397402
</ItemGroup>
@@ -448,7 +453,7 @@
448453
<ProjectToBuild Include="@(ManagedProjectToBuild)" BuildInParallel="true" Pack="true" Category="host" />
449454
</ItemGroup>
450455

451-
<ItemGroup Condition="$(_subset.Contains('+host.pkg+')) and '$(PgoInstrument)' != 'true'">
456+
<ItemGroup Condition="$(_subset.Contains('+host.pkg+')) and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
452457
<PkgprojProjectToBuild Include="$(InstallerProjectRoot)pkg\projects\host-packages.proj" SignPhase="MsiFiles" />
453458
<ProjectToBuild Include="@(PkgprojProjectToBuild)" Pack="true" Category="host" />
454459
</ItemGroup>
@@ -508,10 +513,10 @@
508513

509514
<Choose>
510515
<When Condition="$(_subset.Contains('+packs.product+'))">
511-
<ItemGroup Condition="'$(PgoInstrument)' != 'true'">
516+
<ItemGroup Condition="'$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
512517
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj" />
513518
</ItemGroup>
514-
<ItemGroup Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(PgoInstrument)' != 'true'">
519+
<ItemGroup Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
515520
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Host.sfxproj" />
516521
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Crossgen2.sfxproj" />
517522
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-host.proj" />
@@ -521,7 +526,7 @@
521526
<SharedFrameworkProjectToBuild Condition="'$(MonoCrossAOTTargetOS)' != ''" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\monocrossaot.sfxproj" Pack="true" />
522527
</ItemGroup>
523528
<ItemGroup>
524-
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(PgoInstrument)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
529+
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
525530
</ItemGroup>
526531
<ItemGroup>
527532
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.sfxproj" />
@@ -531,12 +536,12 @@
531536
</When>
532537
</Choose>
533538

534-
<ItemGroup Condition="$(_subset.Contains('+packs.installers+')) AND '$(PgoInstrument)' != 'true'">
539+
<ItemGroup Condition="$(_subset.Contains('+packs.installers+')) AND '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
535540
<InstallerProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\installers.proj" />
536541
<ProjectToBuild Include="@(InstallerProjectToBuild)" Category="packs" />
537542
</ItemGroup>
538543

539-
<ItemGroup Condition="$(_subset.Contains('+packs.tests+')) AND '$(PgoInstrument)' != 'true'">
544+
<ItemGroup Condition="$(_subset.Contains('+packs.tests+')) AND '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
540545
<TestProjectToBuild Include="$(InstallerProjectRoot)tests\Microsoft.DotNet.CoreSetup.Packaging.Tests\Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj" />
541546
<ProjectToBuild Include="@(TestProjectToBuild)" BuildInParallel="true" Test="true" Category="packs" />
542547
</ItemGroup>

eng/pipelines/common/templates/pipeline-with-resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ resources:
101101
ROOTFS_DIR: /crossrootfs/x64
102102

103103
- container: tizen_armel
104-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-armel-tizen
104+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen
105105
env:
106106
ROOTFS_DIR: /crossrootfs/armel
107107

src/coreclr/dlls/mscorrc/mscorrc.rc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,12 @@ BEGIN
309309
IDS_CLASSLOAD_GENERICTYPE_RECURSIVE "Could not load type '%1' from assembly '%2' because it has recursive generic definition."
310310
IDS_CLASSLOAD_TOOMANYGENERICARGS "Could not load type '%1' from assembly '%2'. Internal limitation: Too many generic arguments."
311311

312-
IDS_CLASSLOAD_INLINE_ARRAY_FIELD_COUNT "InlineArrayAttribute requires that the target type has a single instance field. Type: '%1'. Assembly: '%2'."
313-
IDS_CLASSLOAD_INLINE_ARRAY_LENGTH "InlineArrayAttribute requires that the length argument is greater than 0. Type: '%1'. Assembly: '%2'."
314-
IDS_CLASSLOAD_INLINE_ARRAY_EXPLICIT "InlineArrayAttribute cannot be applied to a type with explicit layout. Type: '%1'. Assembly: '%2'."
312+
IDS_CLASSLOAD_INLINE_ARRAY_FIELD_COUNT "InlineArrayAttribute requires that the target type has a single instance field. Type: '%1'. Assembly: '%2'."
313+
IDS_CLASSLOAD_INLINE_ARRAY_LENGTH "InlineArrayAttribute requires that the length argument is greater than 0. Type: '%1'. Assembly: '%2'."
314+
IDS_CLASSLOAD_INLINE_ARRAY_EXPLICIT "InlineArrayAttribute cannot be applied to a type with explicit layout. Type: '%1'. Assembly: '%2'."
315+
316+
IDS_CLASSLOAD_BYREF_OF_BYREF "Could not create a ByRef of a ByRef. Type: '%1'. Assembly: '%2'."
317+
IDS_CLASSLOAD_POINTER_OF_BYREF "Could not create a pointer to a ByRef. Type: '%1'. Assembly: '%2'."
315318

316319
IDS_INVALID_RECURSIVE_GENERIC_FIELD_LOAD "Could not load type '%1' from assembly '%2' because of an invalid self-referential generic field."
317320

src/coreclr/dlls/mscorrc/resource.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@
174174
#define IDS_CLASSLOAD_INLINE_ARRAY_LENGTH 0x17ad
175175
#define IDS_CLASSLOAD_INLINE_ARRAY_EXPLICIT 0x17ae
176176

177+
#define IDS_CLASSLOAD_BYREF_OF_BYREF 0x17af
178+
#define IDS_CLASSLOAD_POINTER_OF_BYREF 0x17b0
179+
177180
#define IDS_DEBUG_USERBREAKPOINT 0x17b6
178181

179182
#define IDS_PERFORMANCEMON_FUNCNOTFOUND 0x17bb

src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<_hostOS>$(NETCoreSdkPortableRuntimeIdentifier.SubString(0, $(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))))</_hostOS>
66

77
<_originalTargetOS>$(RuntimeIdentifier.SubString(0, $(RuntimeIdentifier.LastIndexOf('-'))))</_originalTargetOS>
8-
<_indexOfPeriod>$(_originalTargetOS.IndexOf('.'))</_indexOfPeriod>
9-
<_originalTargetOS Condition="'$(_indexOfPeriod)' &gt; -1">$(_originalTargetOS.SubString(0, $(_indexOfPeriod)))</_originalTargetOS>
8+
<_originalTargetOS Condition="$(_originalTargetOS.Contains('.'))">$(_originalTargetOS.SubString(0, $(_originalTargetOS.IndexOf('.')))</_originalTargetOS>
109
<_originalTargetOS Condition="$(_originalTargetOS.StartsWith('win'))">win</_originalTargetOS>
1110

1211
<!-- On non-Windows, determine _hostArchitecture from NETCoreSdkPortableRuntimeIdentifier -->

src/coreclr/pal/prebuilt/inc/corerror.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
#define CORDIAGIPC_E_UNKNOWN_ERROR EMAKEHR(0x1387)
215215
#define CORPROF_E_SUSPENSION_IN_PROGRESS EMAKEHR(0x1388)
216216
#define CORPROF_E_NOT_GC_OBJECT EMAKEHR(0x1389)
217+
#define CORPROF_E_MODULE_IS_ENC EMAKEHR(0x138A)
217218
#define CORSEC_E_POLICY_EXCEPTION EMAKEHR(0x1416)
218219
#define CORSEC_E_MIN_GRANT_FAIL EMAKEHR(0x1417)
219220
#define CORSEC_E_NO_EXEC_PERM EMAKEHR(0x1418)

src/coreclr/vm/clsload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ TypeHandle ClassLoader::CreateTypeHandleForTypeKey(const TypeKey* pKey, AllocMem
27512751
// no parameterized type allowed on a reference
27522752
if (paramType.GetInternalCorElementType() == ELEMENT_TYPE_BYREF)
27532753
{
2754-
ThrowTypeLoadException(pKey, IDS_CLASSLOAD_GENERAL);
2754+
ThrowTypeLoadException(pKey, (kind == ELEMENT_TYPE_BYREF) ? IDS_CLASSLOAD_BYREF_OF_BYREF : IDS_CLASSLOAD_POINTER_OF_BYREF);
27552755
}
27562756

27572757
// We do allow parameterized types of ByRefLike types. Languages may restrict them to produce safe or verifiable code,

src/coreclr/vm/rejit.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ HRESULT ReJitManager::UpdateActiveILVersions(
508508
continue;
509509
}
510510

511+
if (pModule->IsEditAndContinueEnabled())
512+
{
513+
ReportReJITError(pModule, rgMethodDefs[i], NULL, CORPROF_E_MODULE_IS_ENC);
514+
continue;
515+
}
516+
511517
if (!pModule->GetMDImport()->IsValidToken(rgMethodDefs[i]))
512518
{
513519
ReportReJITError(pModule, rgMethodDefs[i], NULL, E_INVALIDARG);

src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,19 @@ public static void CollectionEqual<T>(IEnumerable<T> expected, IEnumerable<T> ac
504504
}
505505
}
506506

507+
/// <summary>
508+
/// Validates that the actual span is not equal to the expected span.
509+
/// </summary>
510+
/// <param name="expected">The sequence that <paramref name="actual"/> should be not be equal to.</param>
511+
/// <param name="actual">The actual sequence.</param>
512+
public static void SequenceNotEqual<T>(ReadOnlySpan<T> expected, ReadOnlySpan<T> actual) where T : IEquatable<T>
513+
{
514+
if (expected.SequenceEqual(actual))
515+
{
516+
throw new XunitException($"Expected: Contents of expected to differ from actual but were the same.");
517+
}
518+
}
519+
507520
/// <summary>
508521
/// Validates that the actual span is equal to the expected span.
509522
/// If this fails, determine where the differences are and create an exception with that information.

0 commit comments

Comments
 (0)