Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep response files used for crossgenning the framework #43183

Merged
merged 3 commits into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion src/coreclr/src/tools/r2rtest/BuildFolderSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ public bool CompileFramework()

if (_options.Composite)
{
const string FrameworkOutputFileName = "framework-r2r.dll";

File.Delete(Path.Combine(_options.CoreRootDirectory.FullName, FrameworkOutputFileName));

var processes = new ProcessInfo[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in frameworkRunners)
{
Expand All @@ -259,7 +263,7 @@ public bool CompileFramework()

if (inputFrameworkDlls.Count > 0)
{
string outputFileName = runner.GetOutputFileName(_options.CoreRootDirectory.FullName, "framework-r2r.dll");
string outputFileName = runner.GetOutputFileName(_options.CoreRootDirectory.FullName, FrameworkOutputFileName);
ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, outputFileName, inputFrameworkDlls));
compilationsToRun.Add(compilationProcess);
processes[(int)runner.Index] = compilationProcess;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/tools/r2rtest/BuildOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public IEnumerable<CompilerRunner> CompilerRunners(bool isFramework, IEnumerable
List<string> cpaotReferencePaths = new List<string>();
cpaotReferencePaths.Add(CoreRootOutputPath(CompilerIndex.CPAOT, isFramework));
cpaotReferencePaths.AddRange(overrideReferencePaths != null ? overrideReferencePaths : ReferencePaths());
runners.Add(new Crossgen2Runner(this, new Crossgen2RunnerOptions(), cpaotReferencePaths, overrideOutputPath));
runners.Add(new Crossgen2Runner(this, new Crossgen2RunnerOptions() { Composite = this.Composite }, cpaotReferencePaths, overrideOutputPath));
}

if (Crossgen)
Expand Down
11 changes: 7 additions & 4 deletions src/coreclr/src/tools/r2rtest/CompilerRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public sealed class FrameworkExclusion
{
new FrameworkExclusion(ExclusionType.Ignore, "CommandLine", "Not a framework assembly"),
new FrameworkExclusion(ExclusionType.Ignore, "R2RDump", "Not a framework assembly"),
new FrameworkExclusion(ExclusionType.Ignore, "xunit.performance.api", "Not a framework assembly"),

// TODO (DavidWr): IBC-related failures
new FrameworkExclusion(ExclusionType.DontCrossgen2, "Microsoft.CodeAnalysis.CSharp", "Ibc TypeToken 6200019a has type token which resolves to a nil token"),
Expand Down Expand Up @@ -65,11 +64,15 @@ public static bool Exclude(string simpleName, CompilerIndex index, out string re
reason = exclusion.Reason;
return true;
}
else

if (simpleName.StartsWith("xunit.", StringComparison.OrdinalIgnoreCase))
{
reason = null;
return false;
reason = "XUnit";
return true;
}

reason = null;
return false;
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/tests/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ set __msbuildArgs=/p:TargetOS=%__TargetOS% /p:Configuration=%__BuildType% /p:Tar

echo %__MsgPrefix%Commencing CoreCLR test build

set "__BinDir=%__RootBinDir%\bin\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%"
set "__OSPlatformConfig=%__TargetOS%.%__BuildArch%.%__BuildType%"
set "__BinDir=%__RootBinDir%\bin\coreclr\%__OSPlatformConfig%"
set "__TestRootDir=%__RootBinDir%\tests\coreclr"
set "__TestBinDir=%__TestRootDir%\%__TargetOS%.%__BuildArch%.%__BuildType%"
set "__TestBinDir=%__TestRootDir%\%__OSPlatformConfig%"
set "__TestIntermediatesDir=%__TestRootDir%\obj\%__OSPlatformConfig%"

if not defined XunitTestBinBase set XunitTestBinBase=%__TestBinDir%\
set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root"
Expand Down Expand Up @@ -629,10 +631,14 @@ exit /b 1

:PrecompileFX

set __CrossgenCmd="%__RepoRootDir%\dotnet.cmd" "%CORE_ROOT%\R2RTest\R2RTest.dll" compile-framework -cr "%CORE_ROOT%" --output-directory "%CORE_ROOT%\crossgen.out" --large-bubble --release --target-arch %__BuildArch% -dop %NUMBER_OF_PROCESSORS%
set "__CrossgenOutputDir=%__TestIntermediatesDir%\crossgen.out"

set __CrossgenCmd="%__RepoRootDir%\dotnet.cmd" "%CORE_ROOT%\R2RTest\R2RTest.dll" compile-framework -cr "%CORE_ROOT%" --output-directory "%__CrossgenOutputDir%" --release --nocleanup --target-arch %__BuildArch% -dop %NUMBER_OF_PROCESSORS%

if defined __CompositeBuildMode (
set __CrossgenCmd=%__CrossgenCmd% --composite
) else (
set __CrossgenCmd=%__CrossgenCmd% --large-bubble
)

set __CrossgenDir=%__BinDir%
Expand Down Expand Up @@ -666,7 +672,6 @@ if %__exitCode% neq 0 (
exit /b 1
)

move "%CORE_ROOT%\crossgen.out\*.dll" %CORE_ROOT% > nul
del /q /s "%CORE_ROOT%\crossgen.out" > nul
move "%__CrossgenOutputDir%\*.dll" %CORE_ROOT% > nul

exit /b 0
15 changes: 8 additions & 7 deletions src/tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ precompile_coreroot_fx()
__NumProc=$(nproc --all)
fi

local crossgenCmd="\"$__DotNetCli\" \"$CORE_ROOT/R2RTest/R2RTest.dll\" compile-framework -cr \"$CORE_ROOT\" --output-directory \"$CORE_ROOT/crossgen.out\" --target-arch $__BuildArch -dop $__NumProc"
local outputDir="$__TestIntermediatesDir/crossgen.out"
local crossgenCmd="\"$__DotNetCli\" \"$CORE_ROOT/R2RTest/R2RTest.dll\" compile-framework -cr \"$CORE_ROOT\" --output-directory \"$outputDir\" --large-bubble --release --nocleanup --target-arch $__BuildArch -dop $__NumProc"

if [[ "$__CompositeBuildMode" != 0 ]]; then
crossgenCmd="$crossgenCmd --composite"
Expand All @@ -196,8 +197,7 @@ precompile_coreroot_fx()
return 1
fi

mv "$CORE_ROOT"/crossgen.out/*.dll "$CORE_ROOT"
rm -r "$CORE_ROOT/crossgen.out"
mv "$outputDir"/*.dll "$CORE_ROOT"

return 0
}
Expand Down Expand Up @@ -626,13 +626,14 @@ __LogsDir="$__RootBinDir/log"
__MsbuildDebugLogsDir="$__LogsDir/MsbuildDebugLogs"

# Set the remaining variables based upon the determined build configuration
__BinDir="$__RootBinDir/bin/coreclr/$__TargetOS.$__BuildArch.$__BuildType"
__OSPlatformConfig="$__TargetOS.$__BuildArch.$__BuildType"
__BinDir="$__RootBinDir/bin/coreclr/$__OSPlatformConfig"
__PackagesBinDir="$__BinDir/.nuget"
__TestDir="$__RepoRootDir/src/tests"
__TryRunDir="$__RepoRootDir/src/coreclr"
__TestWorkingDir="$__RootBinDir/tests/coreclr/$__TargetOS.$__BuildArch.$__BuildType"
__IntermediatesDir="$__RootBinDir/obj/coreclr/$__TargetOS.$__BuildArch.$__BuildType"
__TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__TargetOS.$__BuildArch.$__BuildType"
__TestWorkingDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig"
__IntermediatesDir="$__RootBinDir/obj/coreclr/$__OSPlatformConfig"
__TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig"
__CrossComponentBinDir="$__BinDir"
__CrossCompIntermediatesDir="$__IntermediatesDir/crossgen"

Expand Down