Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!--
TODO: Remove pinned version once arcade supplies a compiler that enables the repo to compile.
-->
<MicrosoftNetCompilersToolsetVersion>4.4.0-1.22358.14</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>4.4.0-2.22412.11</MicrosoftNetCompilersToolsetVersion>
<StaticCsVersion>0.2.0</StaticCsVersion>
<!-- SDK dependencies -->
<MicrosoftDotNetApiCompatTaskVersion>7.0.100-rc.1.22402.1</MicrosoftDotNetApiCompatTaskVersion>
Expand Down
3 changes: 1 addition & 2 deletions eng/testing/linker/SupportFiles/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<SkipConfigureTrimming>true</SkipConfigureTrimming>
<PublishTrimmed>true</PublishTrimmed>
<SkipImportRepoLinkerTargets>true</SkipImportRepoLinkerTargets>
<TrimmerDefaultAction>link</TrimmerDefaultAction>
<TrimMode>link</TrimMode>
<TrimMode>full</TrimMode>
<TrimmerRemoveSymbols>false</TrimmerRemoveSymbols>
<SelfContained>true</SelfContained>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
38 changes: 37 additions & 1 deletion eng/testing/tests.singlefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<RunScriptCommand Condition="'$(TargetOS)' == 'windows'">$(AssemblyName).exe</RunScriptCommand>
<RunScriptCommand Condition="'$(TargetOS)' != 'windows'">chmod +rwx $(AssemblyName) &amp;&amp; ./$(AssemblyName)</RunScriptCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(TestNativeAot)' != 'true'">
<PublishSingleFile>true</PublishSingleFile>
<UseAppHost>true</UseAppHost>
Expand All @@ -27,11 +27,47 @@
<IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath>
<IlcFrameworkPath>$(NetCoreAppCurrentTestHostSharedFrameworkPath)</IlcFrameworkPath>
<NoWarn>$(NoWarn);IL3050;IL3051;IL3052;IL3054;IL3055;IL1005;IL3002</NoWarn>
<TrimMode>partial</TrimMode>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>

<!-- Forced by ILLink targets; we should fix the SDK -->
<SelfContained>true</SelfContained>

<!-- Works around https://github.com/dotnet/runtime/issues/73926 -->
<!-- RequiresUnreferenceCodeAttribute method called -->
<NoWarn>$(NoWarn);IL2026;IL2116</NoWarn>
<!-- Invalid use of DynamicallyAccessedMembersAttribute -->
<NoWarn>$(NoWarn);IL2041;IL2042;IL2043;IL2056</NoWarn>
<!-- Reference to removed attribute type -->
<NoWarn>$(NoWarn);IL2045</NoWarn>
<!-- RequiresUnreferencedCodeAttribute mismatch on virtual override -->
<NoWarn>$(NoWarn);IL2046</NoWarn>
<!-- COM marshalling warning -->
<NoWarn>$(NoWarn);IL2050</NoWarn>
<!-- Reflection intrinsics with unknown arguments -->
<NoWarn>$(NoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061;IL2096</NoWarn>
<!-- Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
<NoWarn>$(NoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</NoWarn>
<!-- Unsatisfied DynamicallyAccessedMembers requirements -->
<NoWarn>$(NoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091</NoWarn>
<!-- DynamicallyAccessedMembersAttribute mismatch on virtual override -->
<NoWarn>$(NoWarn);IL2092;IL2093;IL2094;IL2095</NoWarn>
<!-- DynamicallyAccessedMembersAttribute used on unsupported member -->
<NoWarn>$(NoWarn);IL2097;IL2098;IL2099;IL2106</NoWarn>
<!-- Unknown value passed to Expression.Property -->
<NoWarn>$(NoWarn);IL2103</NoWarn>
<!-- Multiple methods associated with state machine type or user method -->
<NoWarn>$(NoWarn);IL2107;IL2117</NoWarn>
<!-- Unannotated type derived from base type with RequiresUnreferencedCode -->
<NoWarn>$(NoWarn);IL2109</NoWarn>
<!-- Reflection access to members with DynamicallyAccessedMembers requirements -->
<NoWarn>$(NoWarn);IL2110;IL2111;IL2114;IL2115</NoWarn>
<!-- Reflection access to members with RequiresUnreferencedCode -->
<NoWarn>$(NoWarn);IL2112;IL2113</NoWarn>
<!-- Reflection access to compiler-generated code -->
<NoWarn>$(NoWarn);IL2118;IL2119;IL2120</NoWarn>

</PropertyGroup>

<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.targets" Condition="'$(TestNativeAot)' == 'true'" />
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"sdk": {
"version": "7.0.100-preview.5.22307.18",
"version": "7.0.100-preview.7.22377.5",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
"dotnet": "7.0.100-preview.5.22307.18"
"dotnet": "7.0.100-preview.7.22377.5"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public sealed class IsByRefLikeAttribute : Attribute

public static class RuntimeFeature
{
public const string ByRefFields = nameof(ByRefFields);
public const string VirtualStaticsInInterfaces = nameof(VirtualStaticsInInterfaces);
}
}
2 changes: 0 additions & 2 deletions src/coreclr/tools/aot/crossgen2/crossgen2.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<Configurations>Debug;Release;Checked</Configurations>
<ServerGarbageCollection>true</ServerGarbageCollection>
<!-- Trim all dependent assemblies as though they were all marked IsTrimmable. -->
<TrimmerDefaultAction>link</TrimmerDefaultAction>
</PropertyGroup>

<ItemGroup Label="Embedded Resources">
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/tools/dotnet-pgo/SPGO/LbrEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public unsafe struct LbrTraceEventData32
public Span<LbrEntry32> Entries(int totalSize)
{
IntPtr entriesOffset = Unsafe.ByteOffset(ref Unsafe.As<LbrTraceEventData32, byte>(ref this), ref Unsafe.As<LbrEntry32, byte>(ref _entries));
return MemoryMarshal.CreateSpan(ref _entries, (totalSize - (int)entriesOffset) / sizeof(LbrEntry32));
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<LbrEntry32>(Unsafe.AsPointer(ref _entries)), (totalSize - (int)entriesOffset) / sizeof(LbrEntry32));
}
}

Expand All @@ -74,7 +74,7 @@ public unsafe struct LbrTraceEventData64
public Span<LbrEntry64> Entries(int totalSize)
{
IntPtr entriesOffset = Unsafe.ByteOffset(ref Unsafe.As<LbrTraceEventData64, byte>(ref this), ref Unsafe.As<LbrEntry64, byte>(ref _entries));
return MemoryMarshal.CreateSpan(ref _entries, (totalSize - (int)entriesOffset) / sizeof(LbrEntry64));
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<LbrEntry64>(Unsafe.AsPointer(ref _entries)), (totalSize - (int)entriesOffset) / sizeof(LbrEntry64));
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't that cause a GC hole? Same with above.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch. We either need to make this a ref struct with a big "DO NOT CLEAN UP THE REF PART" comment, or use fixed to grab the pointer instead.

Copy link
Member

Choose a reason for hiding this comment

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

Yes it will. I'll push a fix.

Copy link
Member

Choose a reason for hiding this comment

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

We either need to make this a ref struct with a big "DO NOT CLEAN UP THE REF PART" comment, or use fixed to grab the pointer instead.

I think we can make these static functions that take the owning struct by ref.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we make it

Suggested change
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<LbrEntry64>(Unsafe.AsPointer(ref _entries)), (totalSize - (int)entriesOffset) / sizeof(LbrEntry64));
return MemoryMarshal.CreateSpan(ref _entries, (totalSize - (int)entriesOffset) / sizeof(LbrEntry64));

and add [UnscopedRef] to the method?

Copy link
Member

Choose a reason for hiding this comment

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

Since I've also got the owner here, can we get this moved to build against the live build? Building against the repo's SDK is the root issue here.

Copy link
Member

Choose a reason for hiding this comment

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

I can look into it, I'm not totally sure on the constraints about that (we are publishing dotnet-pgo as a nuget package, would that be affected?). I probably need to involve @davidwrighton here.
I assume it can be done separately?

Copy link
Member

Choose a reason for hiding this comment

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

I assume it can be done separately?

Absolutely. My only concern is this project is the only one I found that seems to use the repo's SDK and could be heavily impacted by complex language changes that force updates to the public API surface. This is a longer-term concern and just something to keep in mind as the language evolves to have more of these low-level friendly features.

Copy link
Member

Choose a reason for hiding this comment

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

My only concern is this project is the only one I found that seems to use the repo's SDK and could be heavily impacted by complex language changes that force updates to the public API surface

Everything under src/coreclr/tools builds against the repo's SDK. Building against live bits has build sequencing issues where one wouldn't be able to build crossgen2 without building libs first, or run crossgen2 without building the host.

If we want to switch to live, I would want to know what the VS debug experience for live built things looks like. I would still prefer we don't do that because I kind of like I don't need to build coreclr VM, host, or other stuff for NativeAOT development.

Copy link
Member

Choose a reason for hiding this comment

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

Building against live bits has build sequencing issues

Ah. Thanks @MichalStrehovsky. This is an important consideration to note. Perhaps this wouldn't justify the resulting dev-loop pain.

}
}
}
7 changes: 0 additions & 7 deletions src/tests/nativeaot/Directory.Build.props

This file was deleted.