Skip to content
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
1 change: 1 addition & 0 deletions src/coreclr/src/tools/r2rtest/BuildOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class BuildOptions
public bool Release { get; set; }
public bool LargeBubble { get; set; }
public bool Composite { get; set; }
public bool PartialComposite { get; set; }
public int Crossgen2Parallelism { get; set; }
public int CompilationTimeoutMinutes { get; set; }
public int ExecutionTimeoutMinutes { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/src/tools/r2rtest/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Command CompileSerp() =>
CoreRootDirectory(),
AspNetPath(),
Composite(),
PartialComposite(),
},
handler: CommandHandler.Create<BuildOptions>(CompileSerpCommand.CompileSerpAssemblies));

Expand Down Expand Up @@ -267,6 +268,9 @@ Option PackageList() =>
//
Option AspNetPath() =>
new Option(new[] { "--asp-net-path", "-asp" }, "Path to SERP's ASP.NET Core folder", new Argument<DirectoryInfo>().ExistingOnly());

Option PartialComposite() =>
new Option(new[] { "--partial-composite", "-pc" }, "Add references to framework and asp.net instead of unrooted inputs", new Argument<bool>());
}
}
}
16 changes: 15 additions & 1 deletion src/coreclr/src/tools/r2rtest/Commands/CompileSerpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,26 @@ public static int CompileSerpAssemblies(BuildOptions options)
referenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "mscorlib.dll"));
referenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "netstandard.dll"));

//
// binFiles is now all the assemblies that we want to compile (either individually or as composite)
// referenceAssemblies is all managed assemblies that are referenceable
//

// Remove all bin files except serp.dll so they're just referenced (eventually we'll be able to compile all these in a single composite)
foreach (string item in new HashSet<string>(File.ReadAllLines(whiteListFilePath)))
{
if (item == "Serp.dll")
continue;

binFiles.Remove(Path.Combine(binDir, item));
}

List<ProcessInfo> fileCompilations = new List<ProcessInfo>();
if (options.Composite)
{
string serpDll = Path.Combine(binDir, "Serp.dll");
var runner = new CpaotRunner(options, referenceAssemblies);
var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, Path.ChangeExtension(serpDll, ".ni.dll"), referenceAssemblies));
var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, Path.ChangeExtension(serpDll, ".ni.dll"), binFiles));
fileCompilations.Add(compilationProcess);
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/tools/r2rtest/CpaotRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected override IEnumerable<string> BuildCommandLineArguments(IEnumerable<str
// This is useful for crossgen2-specific scenarios since crossgen2 expects a list of files unlike crossgen1
foreach (var reference in _referenceFiles)
{
yield return (_options.Composite ? "-u:" : "-r:") + reference;
yield return (_options.Composite && !_options.PartialComposite ? "-u:" : "-r:") + reference;
}
}
}
Expand Down