Fix downloading libraries for Forge 1.7.2 (#4808)

* wip: fix Forge 1.7.2 downloads

* Bump recursion limit
This commit is contained in:
aecsocket
2025-11-21 22:45:34 +00:00
committed by GitHub
parent 130c2863ab
commit bcf14a4c51
2 changed files with 29 additions and 9 deletions

View File

@@ -2,6 +2,7 @@
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
#![recursion_limit = "256"]
use native_dialog::{DialogBuilder, MessageLevel};
use std::env;

View File

@@ -395,17 +395,36 @@ pub async fn download_libraries(
.unwrap_or("https://libraries.minecraft.net/")
);
let bytes =
fetch(&url, None, &st.fetch_semaphore, &st.pool)
.await?;
write(&path, &bytes, &st.io_semaphore).await?;
tracing::trace!(
"Fetched library {} to path {:?}",
&library.name,
&path
"Attempting to fetch {} from {url}",
library.name,
);
// It's OK for this fetch to fail, since the URL might not even be valid.
// We're constructing a download URL basically out of thin air, and hoping
// that it's valid. Since PrismLauncher ignores the library (see above), a
// failed download here is not a fatal condition.
//
// See DEV-479.
match fetch(&url, None, &st.fetch_semaphore, &st.pool).await
{
Ok(bytes) => {
write(&path, &bytes, &st.io_semaphore).await?;
tracing::debug!(
"Fetched library {} to path {:?}",
&library.name,
&path
);
}
Err(err) => {
tracing::debug!(
"Failed to download library {} from {url} - \
this is not necessarily an error: {err:#?}",
&library.name
);
}
}
}
}