Skip to content

Commit

Permalink
Run native aot runtime tests on cet compatible machines (dotnet#105288)
Browse files Browse the repository at this point in the history
Enabling CET and CFG for the native aot runtime tests that run on windows_x64.
  • Loading branch information
eduardo-vp authored and sirntar committed Sep 30, 2024
1 parent 4aec78b commit 952fdd7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
35 changes: 34 additions & 1 deletion eng/pipelines/coreclr/runtime-nativeaot-outerloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ extends:

#
# CoreCLR NativeAOT checked build and Pri0 tests
# Only when CoreCLR is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
Expand Down Expand Up @@ -189,3 +188,37 @@ extends:
parameters:
testGroup: innerloop
liveLibrariesBuildConfig: Release

#
# CoreCLR NativeAOT checked build and Pri0 tests
# Test windows_x64 with CET and CFG
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
helixQueueGroup: cet
buildConfig: Checked
platforms:
- windows_x64
variables:
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
timeoutInMinutes: 300 # doesn't normally take this long, but we have had Helix queues backed up for over an hour
nameSuffix: NativeAOT_Pri0_CET_CFG
buildArgs: -s clr.aot+libs -rc $(_BuildConfig) -lc Release /p:RunAnalyzers=false
postBuildSteps:
- template: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
parameters:
creator: dotnet-bot
testBuildArgs: 'nativeaot /p:IlcUseServerGc=false /p:ControlFlowGuard=Guard'
liveLibrariesBuildConfig: Release
testRunNamePrefixSuffix: NativeAOT_Pri0_CET_CFG_$(_BuildConfig)
extraVariablesTemplates:
- template: /eng/pipelines/common/templates/runtimes/test-variables.yml
parameters:
testGroup: innerloop
liveLibrariesBuildConfig: Release
1 change: 1 addition & 0 deletions src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@
<GroupBuildCmd Condition="'$(ServerGarbageCollection)' != ''">$(GroupBuildCmd) "/p:ServerGarbageCollection=$(ServerGarbageCollection)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:CLRTestBuildAllTargets=$(CLRTestBuildAllTargets)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:UseCodeFlowEnforcement=$(UseCodeFlowEnforcement)"</GroupBuildCmd>
<GroupBuildCmd Condition="'$(ControlFlowGuard)' != ''">$(GroupBuildCmd) "/p:ControlFlowGuard=$(ControlFlowGuard)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:__TestGroupToBuild=$(__TestGroupToBuild)"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) "/p:__SkipRestorePackages=1"</GroupBuildCmd>
<GroupBuildCmd>$(GroupBuildCmd) /nodeReuse:false</GroupBuildCmd>
Expand Down
7 changes: 7 additions & 0 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,13 @@
</ExcludeList>
</ItemGroup>

<!-- NativeAOT ControlFlowGuard specific -->
<ItemGroup Condition="'$(XunitTestBinBase)' != '' and '$(TestBuildMode)' == 'nativeaot' and '$(RuntimeFlavor)' == 'coreclr' and '$(ControlFlowGuard)' == 'Guard'">
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b425314/b425314/**">
<Issue>https://github.com/dotnet/runtime/issues/107418</Issue>
</ExcludeList>
</ItemGroup>

<!-- run.proj finds all the *.cmd/*.sh scripts in a test folder and creates corresponding test methods.
Exclude these scripts to avoid creating such methods for the superpmicollect dependent test projects
and running them separately from superpmicollect test. These should be excluded regardless of RuntimeFlavor/os/arch-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(CLRTestBashPreCommands)

<CLRTestBatchPreCommands><![CDATA[
$(CLRTestBatchPreCommands)
powershell -Command "(Add-Type -MemberDefinition '[DllImport(\"kernel32.dll\")] public static extern int IsProcessorFeaturePresent(int ProcessorFeature);' -Name W -PassThru)::IsProcessorFeaturePresent(41)"
powershell -Command "exit (Add-Type -MemberDefinition '[DllImport(\"kernel32.dll\")] public static extern int IsProcessorFeaturePresent(int ProcessorFeature)%3B' -Name W -PassThru)::IsProcessorFeaturePresent(41)"
IF %ERRORLEVEL% EQU 0 (
echo No support for AVX512, test not applicable.
exit /B 0
Expand Down

0 comments on commit 952fdd7

Please sign in to comment.