mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-11 21:59:56 +00:00
Fallback from unsupported netcoreapp assets in nugetfuzz
When a package only offers a newer netcoreapp asset than the available stable Microsoft.NETCore.App.Ref package, nugetfuzz cannot build a reference set for that asset. Prefer the net48 asset when one is available so the package can still be included in a corpus sweep. Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
This commit is contained in:
@@ -230,6 +230,16 @@ async Task ProcessPackage(string spec)
|
||||
matchTarget = net48;
|
||||
pick = PickLib(dir, matchTarget);
|
||||
}
|
||||
else if (await ShouldPreferNetFxAsset(pick.Value.fw))
|
||||
{
|
||||
var netFxPick = PickLib(dir, net48);
|
||||
if (netFxPick != null)
|
||||
{
|
||||
Console.WriteLine($" ! ref pack {NetCoreRefPack}: nothing published for {pick.Value.fw.Version}, using {netFxPick.Value.fw.GetShortFolderName()} instead of {pick.Value.fw.GetShortFolderName()}");
|
||||
matchTarget = net48;
|
||||
pick = netFxPick;
|
||||
}
|
||||
}
|
||||
if (pick == null)
|
||||
{
|
||||
Console.WriteLine(" no compatible lib assemblies, skipping");
|
||||
@@ -336,6 +346,17 @@ async Task<List<string>> CollectDependencies(string rootDir, NuGetFramework matc
|
||||
return null;
|
||||
}
|
||||
|
||||
async Task<bool> ShouldPreferNetFxAsset(NuGetFramework libFw)
|
||||
{
|
||||
if (libFw.Framework != FrameworkConstants.FrameworkIdentifiers.NetCoreApp)
|
||||
return false;
|
||||
var versions = await GetVersions(NetCoreRefPack);
|
||||
if (versions == null)
|
||||
return true;
|
||||
return !versions.Any(v => !v.IsPrerelease && v.Major == libFw.Version.Major && v.Minor == libFw.Version.Minor)
|
||||
&& !versions.Any(v => !v.IsPrerelease && v.Major <= libFw.Version.Major);
|
||||
}
|
||||
|
||||
// Classic .NET Framework has no reference assemblies on this machine; fetch the
|
||||
// matching Microsoft.NETFramework.ReferenceAssemblies package instead.
|
||||
async Task<List<string>> GetNetFxRefDirs(NuGetFramework libFw)
|
||||
|
||||
Reference in New Issue
Block a user