Skip to content

Commit 9dcf95a

Browse files
authored
Remove support for running illink on runtime tests while testing (#122315)
1 parent 30a5c7c commit 9dcf95a

33 files changed

+11
-338
lines changed

docs/workflow/ci/triaging-failures.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ set RunningIlasmRoundTrip=1
6060
```
6161
triggers an ildasm/ilasm round-trip test (that is, the test assembly is disassembled, then re-assembled, then run).
6262

63-
And,
64-
```
65-
set DoLink=1
66-
```
67-
triggers ILLink testing.
68-
6963
## Product and test assets
7064

7165
To reproduce and/or debug a test failure, you'll need the product and test assets. You can either build these using the normal build processes,

src/tests/Common/CLRTest.Execute.Bash.targets

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -274,94 +274,6 @@ fi
274274
<Description>Run the tests using the test watcher.</Description>
275275
</BashCLRTestExecutionScriptArgument>
276276
</ItemGroup>
277-
278-
<PropertyGroup>
279-
<ReflectionRootsXml>$(AssemblyName).reflect.xml</ReflectionRootsXml>
280-
<BashLinkerTestLaunchCmds>
281-
<![CDATA[
282-
# Linker commands
283-
284-
LinkBin=__Link
285-
Assemblies="-a System.Private.CoreLib"
286-
ReflectionRoots=
287-
288-
shopt -s nullglob
289-
290-
if [ ! -z "$DoLink" ];
291-
then
292-
if [ ! -x "$ILLINK" ];
293-
then
294-
echo "Illink executable [$ILLINK] Invalid"
295-
exit 1
296-
fi
297-
298-
# Clean up old Linked binaries, if any
299-
rm -rf $LinkBin
300-
301-
# Remove Native images, since the goal is to run from Linked binaries
302-
rm -f *.ni.*
303-
304-
# Use hints for reflection roots, if provided in $(ReflectionRootsXml)
305-
if [ -f $(ReflectionRootsXml) ];
306-
then
307-
ReflectionRoots="-x $(ReflectionRootsXml)"
308-
fi
309-
310-
# Include all .exe files in this directory as entry points (some tests had multiple .exe file modules)
311-
for bin in *.exe *.dll;
312-
do
313-
Assemblies="$Assemblies -a ${bin%.*}"
314-
done
315-
316-
# Run dotnet-linker
317-
# Run the Linker such that all assemblies except System.Private.Corlib.dll are linked
318-
# Debug symbol generation needs some fixes, and is currently omitted.
319-
# Once this is fixed, add -b true option.
320-
echo "$ILLINK -out $LinkBin -d $CORE_ROOT -c link -l none -t $Assemblies $ReflectionRoots"
321-
$ILLINK -out $LinkBin -d $CORE_ROOT -c link -l none -t $Assemblies $ReflectionRoots
322-
ERRORLEVEL=$?
323-
if [ $ERRORLEVEL -ne 0 ]
324-
then
325-
echo ILLINK FAILED $ERRORLEVEL
326-
if [ -z "$KeepLinkedBinaries" ];
327-
then
328-
rm -rf $LinkBin
329-
fi
330-
exit 1
331-
fi
332-
333-
# Copy CORECLR native binaries and the test watcher to $LinkBin,
334-
# so that we can run the test based on that directory
335-
cp $CORE_ROOT/*.so $LinkBin/
336-
cp $CORE_ROOT/corerun $LinkBin/
337-
cp $CORE_ROOT/watchdog $LinkBin/
338-
339-
# Copy some files that may be arguments
340-
for f in *.txt;
341-
do
342-
[ -e "$f" ] && cp $f $LinkBin
343-
done
344-
345-
ExePath=$LinkBin/$(InputAssemblyName)
346-
export CORE_ROOT=$PWD/$LinkBin
347-
fi
348-
]]>
349-
</BashLinkerTestLaunchCmds>
350-
<BashLinkerTestCleanupCmds>
351-
<![CDATA[
352-
# Clean up the LinkBin directories after test execution.
353-
# Otherwise, RunTests may run out of disk space.
354-
355-
if [ ! -z "$DoLink" ];
356-
then
357-
if [ -z "$KeepLinkedBinaries" ];
358-
then
359-
rm -rf $LinkBin
360-
fi
361-
fi
362-
]]>
363-
</BashLinkerTestCleanupCmds>
364-
</PropertyGroup>
365277
<PropertyGroup>
366278
<CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"$CORE_ROOT/corerun" $(CoreRunArgs) ${__DotEnvArg}</CLRTestRunFile>
367279
<WatcherRunFile>"$CORE_ROOT/watchdog" $_WatcherTimeoutMins</WatcherRunFile>
@@ -386,8 +298,6 @@ $__Command msbuild $CORE_ROOT/wasm-test-runner/WasmTestRunner.proj /p:NetCoreApp
386298

387299
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And '$(TargetOS)' != 'browser' And '$(TargetOS)' != 'android'">
388300
<![CDATA[
389-
$(BashLinkerTestLaunchCmds)
390-
391301
_DebuggerArgsSeparator=
392302
if [[ "$_DebuggerFullPath" == *lldb* ]];
393303
then
@@ -425,8 +335,6 @@ CLRTestExitCode=$?
425335
if [ ! -z ${RunCrossGen2+x} ]%3B then
426336
ReleaseLock
427337
fi
428-
429-
$(BashLinkerTestCleanupCmds)
430338
]]></BashCLRTestLaunchCmds>
431339
<BashCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And '$(TargetOS)' == 'browser'">
432340
<![CDATA[

src/tests/Common/CLRTest.Execute.Batch.targets

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -253,75 +253,6 @@ Exit /b 0
253253
</BatchCLRTestExecutionScriptArgument>
254254
</ItemGroup>
255255

256-
<PropertyGroup>
257-
<ReflectionRootsXml>$(AssemblyName).reflect.xml</ReflectionRootsXml>
258-
<BatchLinkerTestLaunchCmds><![CDATA[
259-
REM Linker commands
260-
261-
set LinkBin=__Link
262-
set Assemblies=-a System.Private.CoreLib
263-
264-
IF defined DoLink (
265-
IF NOT EXIST !ILLINK! (
266-
ECHO ILLink executable [%ILLINK%] Invalid
267-
popd
268-
Exit /b 1
269-
)
270-
271-
REM Clean up old Linked binaries, if any
272-
IF EXIST %LinkBin% rmdir /s /q %LinkBin%
273-
274-
REM Remove Native images, since the goal is to run from Linked binaries
275-
del /q /f *.ni.* 2> nul
276-
277-
REM Use hints for reflection roots, if provided in $(ReflectionRootsXml)
278-
IF EXIST $(ReflectionRootsXml) set ReflectionRoots=-x $(ReflectionRootsXml)
279-
280-
REM Include all .exe files in this directory as entry points (some tests had multiple .exe file modules)
281-
FOR /F "delims=" %%E IN ('dir /b *.exe *.dll') DO SET Assemblies=!Assemblies! -a %%~nE
282-
283-
REM Run dotnet-linker
284-
REM Run the Linker such that all assemblies except System.Private.Corlib.dll are linked
285-
REM Debug symbol generation needs some fixes, and is currently omitted.
286-
REM Once this is fixed, add -b true option.
287-
ECHO %ILLINK% -out %LinkBin% -d %CORE_ROOT% -c link -l none -t !Assemblies! !ReflectionRoots!
288-
%ILLINK% -out %LinkBin% -d %CORE_ROOT% -c link -l none -t !Assemblies! !ReflectionRoots!
289-
IF NOT "!ERRORLEVEL!"=="0" (
290-
ECHO ILLINK FAILED !ERRORLEVEL!
291-
IF NOT defined KeepLinkedBinaries (
292-
IF EXIST %LinkBin% rmdir /s /q %LinkBin%
293-
)
294-
popd
295-
Exit /b 1
296-
)
297-
298-
REM Copy CORECLR native binaries and the test watcher to %LinkBin%, so that we can run the test based on that directory
299-
copy %CORE_ROOT%\clrjit.dll %LinkBin% > nul 2> nul
300-
copy %CORE_ROOT%\coreclr.dll %LinkBin% > nul 2> nul
301-
copy %CORE_ROOT%\CoreRun.exe %LinkBin% > nul 2> nul
302-
copy %CORE_ROOT%\watchdog.exe %LinkBin% > nul 2> nul
303-
304-
REM Copy some files that may be arguments
305-
copy *.txt %LinkBin% > nul 2> nul
306-
307-
set ExePath=%LinkBin%\$(InputAssemblyName)
308-
set CORE_ROOT=%scriptPath%\%LinkBin%
309-
)
310-
]]>
311-
</BatchLinkerTestLaunchCmds>
312-
<BatchLinkerTestCleanupCmds>
313-
<![CDATA[
314-
REM Clean up the LinkBin directories after test execution.
315-
REM Otherwise, RunTests may run out of disk space.
316-
317-
if defined DoLink (
318-
if not defined KeepLinkedBinaries (
319-
IF EXIST %LinkBin% rmdir /s /q %LinkBin%
320-
)
321-
)
322-
]]>
323-
</BatchLinkerTestCleanupCmds>
324-
</PropertyGroup>
325256
<PropertyGroup>
326257
<CLRTestRunFile Condition="'$(CLRTestIsHosted)'=='true'">"%CORE_ROOT%\corerun.exe" $(CoreRunArgs) %__DotEnvArg%</CLRTestRunFile>
327258
<WatcherRunFile>"%CORE_ROOT%\watchdog.exe" %_WatcherTimeoutMins%</WatcherRunFile>
@@ -333,7 +264,6 @@ COPY /y %CORE_ROOT%\CoreShim.dll .
333264
]]></BatchCopyCoreShimLocalCmds>
334265
<BatchCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And $(TargetOS) != 'android'">
335266
<![CDATA[
336-
$(BatchLinkerTestLaunchCmds)
337267
$(BatchCopyCoreShimLocalCmds)
338268
339269
IF NOT "%CLRCustomTestLauncher%"=="" (
@@ -360,7 +290,6 @@ set CLRTestExitCode=!ERRORLEVEL!
360290
if defined RunCrossGen2 (
361291
call :ReleaseLock
362292
)
363-
$(BatchLinkerTestCleanupCmds)
364293
]]></BatchCLRTestLaunchCmds>
365294
<BatchCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And $(TargetOS) == 'android'">
366295
<![CDATA[

src/tests/Common/CLRTest.Jit.targets

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This file contains the logic for generating command scripts for special GC tests
1313
WARNING: When setting properties based on their current state (for example:
1414
<Foo Condition="'$(Foo)'==''>Bar</Foo>). Be very careful. Another script generation
1515
target might be trying to do the same thing. It's better to avoid this by instead setting a new property.
16-
16+
1717
Additionally, be careful with itemgroups. Include will propagate outside of the target too!
1818
1919
***********************************************************************************************
@@ -57,10 +57,8 @@ export RunningIlasmRoundTrip=
5757

5858
<IlasmRoundTripBashScript Condition="'$(CLRTestKind)' == 'BuildAndRun'"><![CDATA[
5959
# IlasmRoundTrip Script
60-
# Disable Ilasm round-tripping for Linker tests.
61-
# Todo: Ilasm round-trip on linked binaries.
6260
63-
if [ -z "$DoLink" -a ! -z "$RunningIlasmRoundTrip" ];
61+
if [ -n "$RunningIlasmRoundTrip" ];
6462
then
6563
python3 $(AssemblyName)_ilasmroundtrip.py
6664
ERRORLEVEL=$?
@@ -95,13 +93,11 @@ REM IlasmRoundTrip Script
9593
REM Disable Ilasm round-tripping for Linker tests.
9694
REM Todo: Ilasm round-trip on linked binaries.
9795
98-
IF NOT DEFINED DoLink (
99-
IF DEFINED RunningIlasmRoundTrip (
100-
python $(AssemblyName)_ilasmroundtrip.py
101-
IF NOT "!ERRORLEVEL!"=="0" (
102-
ECHO ILASM ROUND-TRIP - FAILED !ERRORLEVEL!
103-
Exit /b 1
104-
)
96+
IF DEFINED RunningIlasmRoundTrip (
97+
python $(AssemblyName)_ilasmroundtrip.py
98+
IF NOT "!ERRORLEVEL!"=="0" (
99+
ECHO ILASM ROUND-TRIP - FAILED !ERRORLEVEL!
100+
Exit /b 1
105101
)
106102
)
107103
]]>
@@ -225,7 +221,7 @@ IF NOT "%DOTNET_JitDisasm%" == "" (
225221
***********************************************************************************************
226222
SuperPMI collection of CoreCLR tests
227223
***********************************************************************************************
228-
224+
229225
You shouldn't have to escape characters in a CDATA block, but it appears that you do actually need
230226
to escape semicolons with %3B here.
231227
-->
@@ -462,4 +458,4 @@ print("")
462458
Include="DOTNET_GCStress" Value="$(RunWithGcStress)" />
463459
</ItemGroup>
464460

465-
</Project>
461+
</Project>

src/tests/Common/scripts/bringup_runtest.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,6 @@ do
10861086
--jitforcerelocs)
10871087
export DOTNET_ForceRelocs=1
10881088
;;
1089-
--link=*)
1090-
export ILLINK=${i#*=}
1091-
export DoLink=true
1092-
;;
10931089
--tieredcompilation)
10941090
export DOTNET_TieredCompilation=1
10951091
;;

src/tests/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.reflect.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/tests/JIT/Regression/Dev11/External/dev11_13748/ReflectOnField.reflect.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/tests/Loader/classloader/MethodImpl/self_override1.reflect.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/tests/Loader/classloader/MethodImpl/self_override2.reflect.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/tests/Loader/classloader/MethodImpl/self_override3.reflect.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)