Merge branch 'cargo-test' into 'master'

Fix flaky cargo test

See merge request redox-os/redox!2227
This commit is contained in:
Jeremy Soller 2026-07-12 08:24:26 -06:00
commit 6797dbbec9
2 changed files with 8 additions and 1 deletions

View File

@ -209,6 +209,11 @@ pub fn get_config() -> &'static CookbookConfig {
return CONFIG.get().expect("Configuration is not initialized");
}
/// Fallible version of get_config(), because it's not loaded when testing
pub fn try_get_config() -> Option<&'static CookbookConfig> {
return CONFIG.get();
}
pub fn translate_mirror(original_url: &str) -> String {
let config = CONFIG.get().expect("Configuration is not initialized");

View File

@ -23,7 +23,9 @@ fn auto_deps_from_dynamic_linking(
) -> BTreeSet<PackageName> {
let mut paths = BTreeSet::new();
let mut visited = BTreeSet::new();
let verbose = crate::config::get_config().cook.verbose;
let verbose = crate::config::try_get_config()
.map(|s| s.cook.verbose)
.unwrap_or(true);
// Base directories may need to be updated for packages that place binaries in odd locations.
let mut walk = VecDeque::new();