From 6da942ccbb095f4a7311396f50ac70e27f81262c Mon Sep 17 00:00:00 2001 From: didirus4 Date: Tue, 8 Jul 2025 23:32:33 +0300 Subject: [PATCH 1/3] fix: Ignore x86 windows arch --- packages/app-lib/src/state/db.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/app-lib/src/state/db.rs b/packages/app-lib/src/state/db.rs index 607a345f..bede894b 100644 --- a/packages/app-lib/src/state/db.rs +++ b/packages/app-lib/src/state/db.rs @@ -84,6 +84,11 @@ Problem files: async fn fix_modrinth_issued_migrations( pool: &Pool, ) -> crate::Result<()> { + if cfg!(target_os = "windows") && cfg!(target_arch = "x86") { + tracing::warn!("🛑 Skipping migration checksum fix on Windows x86 platform."); + return Ok(()); + } + let started = Instant::now(); tracing::info!("Fixing modrinth issued migrations"); sqlx::query( @@ -95,7 +100,7 @@ async fn fix_modrinth_issued_migrations( ) .execute(pool) .await?; - tracing::info!("⚙️ Fixed first migration"); + tracing::info!("⚙️ Fixed checksum for first migration"); sqlx::query( r#" UPDATE "_sqlx_migrations" @@ -105,7 +110,7 @@ async fn fix_modrinth_issued_migrations( ) .execute(pool) .await?; - tracing::info!("⚙️ Fixed second migration"); + tracing::info!("⚙️ Fixed checksum for second migration"); sqlx::query( r#" UPDATE "_sqlx_migrations" @@ -115,7 +120,7 @@ async fn fix_modrinth_issued_migrations( ) .execute(pool) .await?; - tracing::info!("⚙️ Fixed third migration"); + tracing::info!("⚙️ Fixed checksum for third migration"); sqlx::query( r#" UPDATE "_sqlx_migrations" @@ -125,10 +130,10 @@ async fn fix_modrinth_issued_migrations( ) .execute(pool) .await?; - tracing::info!("⚙️ Fixed fourth migration"); + tracing::info!("⚙️ Fixed checksum for fourth migration"); let elapsed = started.elapsed(); tracing::info!( - "✅ Fixed all known modrinth-issued migrations in {:.2?}", + "✅ Fixed all known Modrinth checksums for migrations in {:.2?}", elapsed ); Ok(()) From e2e21c14964c92ad0462fc9b78ccb9b438852d92 Mon Sep 17 00:00:00 2001 From: didirus4 Date: Tue, 8 Jul 2025 23:40:55 +0300 Subject: [PATCH 2/3] fix: another try to fix x86 windows arch --- packages/app-lib/src/state/db.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/app-lib/src/state/db.rs b/packages/app-lib/src/state/db.rs index bede894b..e74b30b6 100644 --- a/packages/app-lib/src/state/db.rs +++ b/packages/app-lib/src/state/db.rs @@ -3,6 +3,7 @@ use sqlx::sqlite::{ SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions, }; use sqlx::{Pool, Sqlite}; +use std::env; use tokio::time::Instant; use std::str::FromStr; use std::time::Duration; @@ -84,8 +85,13 @@ Problem files: async fn fix_modrinth_issued_migrations( pool: &Pool, ) -> crate::Result<()> { - if cfg!(target_os = "windows") && cfg!(target_arch = "x86") { - tracing::warn!("🛑 Skipping migration checksum fix on Windows x86 platform."); + let arch = env::consts::ARCH; + let os = env::consts::OS; + + tracing::info!("Running on OS: {}, ARCH: {}", os, arch); + + if os == "windows" && arch == "x86" { + tracing::warn!("🛑 Skipping migration checksum fix on Windows x86 (runtime-detected)"); return Ok(()); } From c5e67a5c6f946ffa9893b6ae28ea56d7639bea86 Mon Sep 17 00:00:00 2001 From: didirus4 Date: Tue, 8 Jul 2025 23:43:50 +0300 Subject: [PATCH 3/3] fix: typo --- packages/app-lib/src/state/db.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-lib/src/state/db.rs b/packages/app-lib/src/state/db.rs index e74b30b6..331d9cb4 100644 --- a/packages/app-lib/src/state/db.rs +++ b/packages/app-lib/src/state/db.rs @@ -90,8 +90,8 @@ async fn fix_modrinth_issued_migrations( tracing::info!("Running on OS: {}, ARCH: {}", os, arch); - if os == "windows" && arch == "x86" { - tracing::warn!("🛑 Skipping migration checksum fix on Windows x86 (runtime-detected)"); + if os == "windows" && arch == "x86_64" { + tracing::warn!("🛑 Skipping migration checksum fix on Windows x86_64 (runtime-detected)"); return Ok(()); }