Skip to content

Commit 2866c8c

Browse files
committed
Skip system dlls from NuGet, rebuild docker
1 parent 899f4d9 commit 2866c8c

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Runner/Jobs/JitDiffJob.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,20 @@ async Task DiffExtraProjectsAsync(string coreRootFolder, string checkedClrFolder
359359
projectsRoot = topDirs[0];
360360
}
361361

362+
// Skip projects whose main DLL shares a name with a system library in core_root
363+
var systemDlls = new HashSet<string>(
364+
Directory.GetFiles(coreRootFolder, "*.dll").Select(Path.GetFileName)!,
365+
StringComparer.OrdinalIgnoreCase);
366+
362367
var projectDirs = new Queue<string>(Directory.GetDirectories(projectsRoot)
368+
.Where(d =>
369+
{
370+
string diffAssembliesPath = Path.Combine(d, "DiffAssemblies.txt");
371+
string mainDll = File.Exists(diffAssembliesPath)
372+
? File.ReadLines(diffAssembliesPath).FirstOrDefault(l => l.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) ?? $"{Path.GetFileName(d)}.dll"
373+
: $"{Path.GetFileName(d)}.dll";
374+
return !systemDlls.Contains(mainDll);
375+
})
363376
.OrderByDescending(d => Directory.GetFiles(d, "*.dll").Sum(f => new FileInfo(f).Length)));
364377
if (projectDirs.Count == 0)
365378
{

Runner/Jobs/NuGetExtraAssembliesJob.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,27 @@ private async Task BuildRuntimeAsync()
116116

117117
private async Task ProcessApprovedPackagesAsync(List<(string Id, string Version, string PkgDir, string Dll, Dictionary<string, string> Deps)> approvedPackages)
118118
{
119+
// Skip packages whose main DLL shares a name with a system library in core_root
120+
var systemDlls = new HashSet<string>(
121+
Directory.GetFiles("artifacts-main", "*.dll").Select(Path.GetFileName)!,
122+
StringComparer.OrdinalIgnoreCase);
123+
124+
int skippedSystem = 0;
125+
approvedPackages.RemoveAll(p =>
126+
{
127+
if (systemDlls.Contains(p.Dll))
128+
{
129+
skippedSystem++;
130+
return true;
131+
}
132+
return false;
133+
});
134+
135+
if (skippedSystem > 0)
136+
{
137+
await LogAsync($"Skipped {skippedSystem} packages with DLLs already in core_root");
138+
}
139+
119140
int included = 0, skippedJitDiff = 0;
120141
string diffOutputDir = "nuget-diff-temp";
121142
Directory.CreateDirectory(diffOutputDir);

0 commit comments

Comments
 (0)