From bcf14a4c5190a0b4b56f0e5453d1a7c9b382f02b Mon Sep 17 00:00:00 2001 From: aecsocket Date: Fri, 21 Nov 2025 22:45:34 +0000 Subject: [PATCH] Fix downloading libraries for Forge 1.7.2 (#4808) * wip: fix Forge 1.7.2 downloads * Bump recursion limit --- apps/app/src/main.rs | 1 + packages/app-lib/src/launcher/download.rs | 37 +++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index 731565dc..7047f1eb 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -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; diff --git a/packages/app-lib/src/launcher/download.rs b/packages/app-lib/src/launcher/download.rs index 5d911df5..72fd08e4 100644 --- a/packages/app-lib/src/launcher/download.rs +++ b/packages/app-lib/src/launcher/download.rs @@ -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 + ); + } + } } }