Retry source requests
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m4s
Build / Build Nuget package (NuGet) (push) Successful in 1m6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m10s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m54s
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (SharedCringe) (push) Successful in 1m4s
Build / Build Nuget package (NuGet) (push) Successful in 1m6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m10s
Build / Build Nuget package (CringePlugins) (push) Successful in 1m18s
Build / Build Launcher (push) Successful in 1m54s
Handle missing sources Minor Optimizations Move thread pool improvement to debug while we fix it
This commit is contained in:
@@ -43,7 +43,7 @@ public class PluginsLifetime(string gameFolder) : ILoadingStage
|
||||
var configPath = Path.Join(_dir.FullName, "packages.json");
|
||||
if (File.Exists(configPath))
|
||||
await using (var stream = File.OpenRead(configPath))
|
||||
packagesConfig = JsonSerializer.Deserialize<PackagesConfig>(stream, NuGetClient.SerializerOptions)!;
|
||||
packagesConfig = await JsonSerializer.DeserializeAsync<PackagesConfig>(stream, NuGetClient.SerializerOptions)!;
|
||||
|
||||
if (packagesConfig == null)
|
||||
{
|
||||
@@ -114,7 +114,15 @@ public class PluginsLifetime(string gameFolder) : ILoadingStage
|
||||
foreach (var package in packages)
|
||||
{
|
||||
if (builtInPackages.ContainsKey(package.Package.Id)) continue;
|
||||
|
||||
|
||||
var client = await sourceMapping.GetClientAsync(package.Package.Id);
|
||||
|
||||
if (client == null)
|
||||
{
|
||||
Log.Warn("Client not found for {Package}", package.Package.Id);
|
||||
continue;
|
||||
}
|
||||
|
||||
var dir = Path.Join(package.Directory.FullName, "lib", package.ResolvedFramework.GetShortFolderName());
|
||||
|
||||
var path = Path.Join(dir, $"{package.Package.Id}.deps.json");
|
||||
@@ -123,6 +131,8 @@ public class PluginsLifetime(string gameFolder) : ILoadingStage
|
||||
try
|
||||
{
|
||||
await using var stream = File.Create(path);
|
||||
|
||||
//client should not be null for calls to this
|
||||
await manifestBuilder.WriteDependencyManifestAsync(stream, package.Entry, _runtimeFramework);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -132,8 +142,7 @@ public class PluginsLifetime(string gameFolder) : ILoadingStage
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
var client = await sourceMapping.GetClientAsync(package.Package.Id);
|
||||
|
||||
var sourceName = packagesConfig.Sources.First(b => b.Url == client.ToString()).Name;
|
||||
LoadComponent(plugins, Path.Join(dir, $"{package.Package.Id}.dll"),
|
||||
new(package.Package.Id, package.Package.Version, sourceName));
|
||||
|
@@ -20,6 +20,9 @@ public class PackageResolver(NuGetFramework runtimeFramework, ImmutableArray<Pac
|
||||
{
|
||||
var client = await packageSources.GetClientAsync(reference.Id);
|
||||
|
||||
if (client == null)
|
||||
continue; //todo: check cached files. test with Internet disconnected
|
||||
|
||||
RegistrationRoot? registrationRoot;
|
||||
|
||||
try
|
||||
@@ -67,7 +70,7 @@ public class PackageResolver(NuGetFramework runtimeFramework, ImmutableArray<Pac
|
||||
{
|
||||
var client = await packageSources.GetClientAsync(package.Id);
|
||||
|
||||
if (!catalogEntry.DependencyGroups.HasValue)
|
||||
if (client == null || !catalogEntry.DependencyGroups.HasValue)
|
||||
continue;
|
||||
|
||||
var nearestGroup = NuGetFrameworkUtility.GetNearest(catalogEntry.DependencyGroups.Value, runtimeFramework,
|
||||
@@ -92,6 +95,9 @@ public class PackageResolver(NuGetFramework runtimeFramework, ImmutableArray<Pac
|
||||
foreach (var (id, versionRange) in dependencies)
|
||||
{
|
||||
var client = await packageSources.GetClientAsync(id);
|
||||
|
||||
if (client == null)
|
||||
continue;
|
||||
|
||||
RegistrationRoot? registrationRoot;
|
||||
|
||||
|
@@ -512,7 +512,7 @@ internal class PluginListComponent : IRenderComponent
|
||||
|
||||
await foreach (var source in _sourceMapping)
|
||||
{
|
||||
if (_selectedSources is not null && _selectedSources.All(b => b.Url != source.ToString()))
|
||||
if (source == null || _selectedSources is not null && _selectedSources.All(b => b.Url != source.ToString()))
|
||||
continue;
|
||||
|
||||
try
|
||||
|
Reference in New Issue
Block a user