Ensure that version resolution works offline

And so, even for unpinned package. In this case, we can't do a HEAD request. So we fallback by looking at what's available in the cache and using the most recently downloaded version from the cache. This is only a best effort as the most recently downloaded one may not be the actual latest. But common, this is a case where (a) someone didn't pin any version, (b) is trying to build on in an offline setup. We could possibly make that edge-case better but, let's see if anyone ever complains about it first.
This commit is contained in:
KtorZ
2023-09-08 14:55:08 +02:00
committed by Lucas
parent 87087a1811
commit 76ff09ba0e
4 changed files with 122 additions and 35 deletions

View File

@@ -11,6 +11,7 @@ use crate::{
error::Error,
package_name::PackageName,
paths::{self, CacheKey},
telemetry::EventListener,
};
use super::manifest::Package;