Skip to content

Commit

Permalink
Crossgen2 outer loop fixes (#108819)
Browse files Browse the repository at this point in the history
* Crossgen2 outer loop fixes

* Test musl arm

* Fix SingleFileHostSourcePath property for UseLocalAppHostPack=false

* Unrelated typo

* Fix crossgen executable name

* Fix python

* Executable permissions
  • Loading branch information
jkotas authored Oct 15, 2024
1 parent 2098981 commit 6a9e153
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<_NativeAotSupportedOS Condition="'$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd'">true</_NativeAotSupportedOS>
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true'">true</NativeAotSupported>
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true' and ('$(TargetsLinuxMusl)' != 'true' or '$(TargetArchitecture)' != 'arm')">true</UseNativeAotForComponents>
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true'">true</UseNativeAotForComponents>

<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
<UseNativeAotCoreLib Condition="'$(TestNativeAot)' == 'true' or ($(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">true</UseNativeAotCoreLib>
Expand Down
4 changes: 3 additions & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
<CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsWindows)' == 'true'">x86</CoreCLRCrossTargetComponentDirName>
<CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName>
<CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'armel' and '$(BuildArchitecture)' != 'armel' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName>
</PropertyGroup>

<AppHostSourcePath Condition="'$(UseLocalAppHostPack)' == 'true'">$([MSBuild]::NormalizePath('$(DotNetHostBinDir)', 'apphost$(ExeSuffix)'))</AppHostSourcePath>
<PropertyGroup Condition="'$(UseLocalAppHostPack)' == 'true'">
<AppHostSourcePath>$([MSBuild]::NormalizePath('$(DotNetHostBinDir)', 'apphost$(ExeSuffix)'))</AppHostSourcePath>
<SingleFileHostSourcePath>$([MSBuild]::NormalizePath('$(CoreCLRArtifactsPath)', 'corehost', 'singlefilehost$(ExeSuffix)'))</SingleFileHostSourcePath>
</PropertyGroup>

Expand Down
8 changes: 3 additions & 5 deletions eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ jobs:
WorkItemCommand:
echo $(displayname_comparison_job) ;
echo Targeting $(targetFlavor) ;
chmod +x $HELIX_WORKITEM_PAYLOAD/corerun;
chmod +x $HELIX_WORKITEM_PAYLOAD/crossgen2/crossgen2;
mkdir -p $HELIX_WORKITEM_PAYLOAD/log;
export CORE_ROOT=$HELIX_WORKITEM_PAYLOAD;
python3 -u $HELIX_CORRELATION_PAYLOAD/crossgen2_comparison.py crossgen_framework
--crossgen $HELIX_WORKITEM_PAYLOAD/crossgen2/crossgen2.dll
--dotnet $HELIX_WORKITEM_PAYLOAD/corerun
--crossgen $HELIX_WORKITEM_PAYLOAD/crossgen2/crossgen2
--core_root $HELIX_WORKITEM_PAYLOAD/prebuiltWork/dlls
--result_dir $HELIX_WORKITEM_UPLOAD_ROOT
--target_os $(target_crossgen2_os)
Expand All @@ -145,8 +144,7 @@ jobs:
md %HELIX_WORKITEM_PAYLOAD%\log &
set CORE_ROOT=%HELIX_WORKITEM_PAYLOAD%&
python -u %HELIX_CORRELATION_PAYLOAD%\crossgen2_comparison.py crossgen_framework
--crossgen %HELIX_WORKITEM_PAYLOAD%\crossgen2\crossgen2.dll
--dotnet %HELIX_WORKITEM_PAYLOAD%\corerun.exe
--crossgen %HELIX_WORKITEM_PAYLOAD%\crossgen2\crossgen2.exe
--core_root %HELIX_WORKITEM_PAYLOAD%\prebuiltWork\dlls
--result_dir %HELIX_WORKITEM_UPLOAD_ROOT%
--target_os $(target_crossgen2_os)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ internal static unsafe ProcessInfo[] GetProcessInfos(int? processIdFilter = null

while (true)
{
void* bufferPtr = NativeMemory.Alloc(bufferSize); // some platforms require the buffer to be 64-bit aligned and NativeLibrary.Alloc guarantees sufficient alignment.
void* bufferPtr = NativeMemory.Alloc(bufferSize); // some platforms require the buffer to be 64-bit aligned and NativeMemory.Alloc guarantees sufficient alignment.

try
{
Expand Down
5 changes: 3 additions & 2 deletions src/tests/Common/scripts/crossgen2_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def build_argument_parser():
collects information about all the runs."""

framework_parser = subparsers.add_parser('crossgen_framework', description=framework_parser_description)
framework_parser.add_argument('--dotnet', dest='dotnet', required=True)
framework_parser.add_argument('--dotnet', dest='dotnet')
framework_parser.add_argument('--crossgen', dest='crossgen_executable_filename', required=True)
framework_parser.add_argument('--target_os', dest='target_os', required=True)
framework_parser.add_argument('--target_arch', dest='target_arch', required=True)
Expand Down Expand Up @@ -523,7 +523,8 @@ async def create_debugging_file(self, ni_filename, debugging_files_dirname, plat

def _build_args_crossgen_il_file(self, il_filename, ni_filename, platform_assemblies_paths, target_os, target_arch):
args = []
args.append(self.dotnet)
if self.dotnet:
args.append(self.dotnet)
args.append(self.crossgen_executable_filename)
args.append('-r')
args.append('"' + platform_assemblies_paths + self.platform_directory_sep + '*.dll"' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
<PropertyGroup>
<!-- Needed for CLRTestTargetUnsupported, GCStressIncompatible, CrossGenTest -->
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<!-- Disabled for GCStress due to test failure tracked by https://github.com/dotnet/runtime/issues/58699 -->
<!-- Running Crossgen2 under GCStress takes too long -->
<GCStressIncompatible>true</GCStressIncompatible>
<CLRTestTargetUnsupported Condition="'$(RuntimeFlavor)' != 'coreclr'">true</CLRTestTargetUnsupported>
<!-- This is an explicit crossgen test -->
<CrossGenTest>false</CrossGenTest>
<!-- We skip the ReadyToRun tests when sanitized due to build complexity -->
<DisableProjectBuild Condition="'$(EnableNativeSanitizers)' != ''">true</DisableProjectBuild>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Tracking issue: https://github.com/dotnet/runtime/issues/90427 -->
<CLRTestTargetUnsupported Condition="'$(RuntimeFlavor)' == 'mono' and ('$(RuntimeVariant)' == 'minifullaot' or '$(RuntimeVariant)' == 'llvmfullaot')">true</CLRTestTargetUnsupported>
<CLRTestTargetUnsupported Condition="'$(RuntimeFlavor)' != 'coreclr'">true</CLRTestTargetUnsupported>
</PropertyGroup>
<ItemGroup>
<MergedWrapperProjectReference Include="coreroot_determinism.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<GCStressIncompatible>true</GCStressIncompatible>
<!-- This is an explicit crossgen test -->
<CrossGenTest>false</CrossGenTest>
<OldToolsVersion>2.0</OldToolsVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
Expand Down

0 comments on commit 6a9e153

Please sign in to comment.