From d98cd31f15c1b73fd19ea4456dc8abe638649496 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:37:21 +0200 Subject: [PATCH 1/6] Update dependencies and MSRV to Rust 1.82 --- .github/workflows/rust.yml | 6 +++--- Cargo.toml | 15 +++++++-------- clippy.toml | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5ae33fb2..969b796b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macOS-latest ] - toolchain: [ "1.80", stable ] + toolchain: [ "1.82", stable ] runs-on: ${{ matrix.os }} env: RUSTFLAGS: -D warnings @@ -27,10 +27,10 @@ jobs: - name: Run tests run: cargo test -p baseview --all-features --verbose - name: Build examples - if: matrix.toolchain != '1.80' + if: matrix.toolchain != '1.82' run: cargo build --workspace --all-targets --verbose - name: Clippy - if: matrix.toolchain != '1.80' + if: matrix.toolchain != '1.82' run: cargo clippy --all --all-features -- -D warnings checks: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 737fc97e..6c45ce4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ categories = ["gui"] repository = "https://github.com/RustAudio/baseview" exclude = [".github"] -rust-version = "1.80" +rust-version = "1.82" [features] default = [] @@ -40,15 +40,14 @@ dpi = "0.1.2" [target.'cfg(target_os="linux")'.dependencies] x11rb = { version = "0.13.2", features = ["cursor", "resource_manager", "allow-unsafe-code", "dl-libxcb"], default-features = false } -xkbcommon-dl = { version = "0.4", features = ["x11"] } -x11-dl = { version = "2.21" } +xkbcommon-dl = { version = "0.4.2", features = ["x11"] } +x11-dl = { version = "2.21.0" } polling = "3.11.0" -percent-encoding = "2.3.1" -bytemuck = "1.15.0" +percent-encoding = "2.3.2" +bytemuck = "1.25.0" [target.'cfg(target_os="windows")'.dependencies] -# Later versions of the windows crates need MSRV 1.80 -windows = { version = "=0.61.3", features = [ +windows = { version = "0.62.2", features = [ "Win32_Graphics_Gdi", "Win32_Graphics_OpenGL", "Win32_System_Com_StructuredStorage", @@ -70,7 +69,7 @@ windows-sys = { version = "0.61.2", features = [ "Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", ] } -windows-core = { version = "=0.61.2" } +windows-core = { version = "0.62.2" } [target.'cfg(target_os="macos")'.dependencies] objc2 = "0.6.4" diff --git a/clippy.toml b/clippy.toml index 00ec9b8c..56e58f14 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,2 +1,2 @@ -msrv = '1.80' +msrv = '1.82' check-private-items = true From 09cd2ade39e82df2b5d42de8c0ec487fee488dc1 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:40:29 +0200 Subject: [PATCH 2/6] Fix windows-core update --- src/wrappers/win32.rs | 6 +++--- src/wrappers/win32/cursor.rs | 2 +- src/wrappers/win32/dpi.rs | 6 +++--- src/wrappers/win32/h_instance.rs | 2 +- src/wrappers/win32/user32.rs | 2 +- src/wrappers/win32/window.rs | 2 +- src/wrappers/win32/window/handle.rs | 24 +++++++++++------------ src/wrappers/win32/window/window_class.rs | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/wrappers/win32.rs b/src/wrappers/win32.rs index 829413d0..d024dfb7 100644 --- a/src/wrappers/win32.rs +++ b/src/wrappers/win32.rs @@ -36,9 +36,9 @@ pub fn run_thread_message_loop_until(until: impl Fn() -> bool) -> Result<()> { let result = unsafe { GetMessageW(&mut msg, null_mut(), 0, 0) }; match result { - -1 => return Err(Error::from_win32()), // -1 means error - 0 => return Ok(()), // 0 means WM_QUIT was received - _ => {} // Nonzero means a message was retrieved + -1 => return Err(Error::from_thread()), // -1 means error + 0 => return Ok(()), // 0 means WM_QUIT was received + _ => {} // Nonzero means a message was retrieved } // SAFETY: The msg pointer is valid since it comes from a reference. diff --git a/src/wrappers/win32/cursor.rs b/src/wrappers/win32/cursor.rs index 921fdd4e..2072b56a 100644 --- a/src/wrappers/win32/cursor.rs +++ b/src/wrappers/win32/cursor.rs @@ -23,7 +23,7 @@ impl SystemCursor { match NonNull::new(result) { Some(res) => Ok(Self(res)), - None => Err(Error::from_win32()), + None => Err(Error::from_thread()), } } diff --git a/src/wrappers/win32/dpi.rs b/src/wrappers/win32/dpi.rs index 77367bf9..579c0dfc 100644 --- a/src/wrappers/win32/dpi.rs +++ b/src/wrappers/win32/dpi.rs @@ -35,7 +35,7 @@ impl<'a> DpiAwarenessContext<'a> { unsafe { set_thread_dpi_awareness_context(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) }; if previous.is_null() { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(DpiAwarenessContext { previous, user32 }) @@ -48,7 +48,7 @@ impl<'a> DpiAwarenessContext<'a> { let result = unsafe { AdjustWindowRectEx(&mut rect.0, style.style, 0, style.style_ex) }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } return Ok(rect); @@ -61,7 +61,7 @@ impl<'a> DpiAwarenessContext<'a> { }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(rect) diff --git a/src/wrappers/win32/h_instance.rs b/src/wrappers/win32/h_instance.rs index 74748772..b9e5359f 100644 --- a/src/wrappers/win32/h_instance.rs +++ b/src/wrappers/win32/h_instance.rs @@ -22,7 +22,7 @@ impl HInstance { let Some(result) = NonNull::new(result) else { panic!( "Failed to get HInstance pointer: GetModuleHandleW failed: {}", - Error::from_win32() + Error::from_thread() ) }; diff --git a/src/wrappers/win32/user32.rs b/src/wrappers/win32/user32.rs index aaf7fdd3..2f260b5b 100644 --- a/src/wrappers/win32/user32.rs +++ b/src/wrappers/win32/user32.rs @@ -67,7 +67,7 @@ struct LibraryModule(NonNull); impl LibraryModule { pub unsafe fn load(module_name: PCSTR) -> Result { let library = unsafe { LoadLibraryA(module_name.as_ptr()) }; - let Some(library) = NonNull::new(library) else { return Err(Error::from_win32()) }; + let Some(library) = NonNull::new(library) else { return Err(Error::from_thread()) }; Ok(Self(library)) } diff --git a/src/wrappers/win32/window.rs b/src/wrappers/win32/window.rs index f1786786..a8f4d39b 100644 --- a/src/wrappers/win32/window.rs +++ b/src/wrappers/win32/window.rs @@ -77,7 +77,7 @@ pub fn create_window( }; if hwnd.is_null() { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(hwnd) diff --git a/src/wrappers/win32/window/handle.rs b/src/wrappers/win32/window/handle.rs index a1a7d6fe..8051a7d6 100644 --- a/src/wrappers/win32/window/handle.rs +++ b/src/wrappers/win32/window/handle.rs @@ -50,8 +50,8 @@ impl HWnd { } // We can't know if a return value of 0 is indicative of an error, or if it's just because the - // previous value was 0. So we check GetLastError instead (called by Error::from_win32). - let error = Error::from_win32(); + // previous value was 0. So we check GetLastError instead (called by Error::from_thread). + let error = Error::from_thread(); if error.code() == HRESULT(0) { return Ok(()); } @@ -69,8 +69,8 @@ impl HWnd { } // We can't know if a return value of 0 is indicative of an error, or if it's just because the - // value was actually 0. So we check GetLastError instead (called by Error::from_win32). - let error = Error::from_win32(); + // value was actually 0. So we check GetLastError instead (called by Error::from_thread). + let error = Error::from_thread(); if error.code() == HRESULT(0) { return Ok(result); } @@ -92,7 +92,7 @@ impl HWnd { // SAFETY: This type guarantees the HWND is safe to use. match unsafe { get_dpi_for_window(self.0) } { - 0 => Err(Error::from_win32()), + 0 => Err(Error::from_thread()), dpi => Ok(Dpi(dpi)), } } @@ -131,7 +131,7 @@ impl HWnd { }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(()) @@ -172,7 +172,7 @@ impl HWnd { }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(()) @@ -182,7 +182,7 @@ impl HWnd { let result = unsafe { SetTimer(self.0, timer_id.get(), elapse, None) }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(()) @@ -195,8 +195,8 @@ impl HWnd { } // We can't know if a return value of 0 is indicative of an error, or if it's just because the - // previous value was 0. So we check GetLastError instead (called by Error::from_win32). - let error = Error::from_win32(); + // previous value was 0. So we check GetLastError instead (called by Error::from_thread). + let error = Error::from_thread(); if error.code() == HRESULT(0) { return Ok(()); } @@ -208,7 +208,7 @@ impl HWnd { let result = unsafe { DestroyWindow(self.0) }; if result == 0 { - return Err(Error::from_win32()); + return Err(Error::from_thread()); } Ok(()) @@ -240,7 +240,7 @@ impl HWnd { // SAFETY: eventtrack pointer comes from a reference, and the struct it points to is filled // correctly match unsafe { TrackMouseEvent(&mut track) } { - 0 => Err(Error::from_win32()), + 0 => Err(Error::from_thread()), _ => Ok(()), } } diff --git a/src/wrappers/win32/window/window_class.rs b/src/wrappers/win32/window/window_class.rs index 70539035..10a42454 100644 --- a/src/wrappers/win32/window/window_class.rs +++ b/src/wrappers/win32/window/window_class.rs @@ -34,7 +34,7 @@ impl RegisteredClass { let class_atom = unsafe { RegisterClassW(&class_info) }; let Some(class_atom) = NonZeroU16::new(class_atom) else { - return Err(Error::from_win32()); + return Err(Error::from_thread()); }; Ok(Self(Arc::new(RegisteredClassInner(class_atom, instance)))) From 7376e8cf6eaf23eeb09901f90f0a3df7e26cff74 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:48:44 +0200 Subject: [PATCH 3/6] Harden Github Actions for future msrv changes --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 969b796b..9aee8bb6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macOS-latest ] - toolchain: [ "1.82", stable ] + toolchain: [ msrv, stable ] runs-on: ${{ matrix.os }} env: RUSTFLAGS: -D warnings @@ -18,7 +18,7 @@ jobs: - name: Install rust stable uses: dtolnay/rust-toolchain@stable with: - toolchain: ${{ matrix.toolchain }} + toolchain: ${{ case(matrix.toolchain == 'msrv', '1.82', 'stable') }} components: clippy - name: Build Default run: cargo build -p baseview --verbose @@ -27,10 +27,10 @@ jobs: - name: Run tests run: cargo test -p baseview --all-features --verbose - name: Build examples - if: matrix.toolchain != '1.82' + if: matrix.toolchain != 'msrv' run: cargo build --workspace --all-targets --verbose - name: Clippy - if: matrix.toolchain != '1.82' + if: matrix.toolchain != 'msrv' run: cargo clippy --all --all-features -- -D warnings checks: runs-on: ubuntu-latest From 81bba866d9cdd99c7d57df77b77640b517ee7d19 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:50:20 +0200 Subject: [PATCH 4/6] Harden Github Actions for future msrv changes --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9aee8bb6..6e2a5591 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -6,6 +6,7 @@ env: jobs: build: + name: "build" strategy: matrix: os: [ ubuntu-latest, windows-latest, macOS-latest ] From e38ca82899e919f5cefd873eeea34722864cad73 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:51:37 +0200 Subject: [PATCH 5/6] Harden Github Actions for future msrv changes --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e2a5591..4a286802 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,5 +1,3 @@ -name: Rust - on: [ push, pull_request ] env: CARGO_TERM_COLOR: always From a05cf09a1949bf8b6d95937df8cbc92d6cbadf34 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:52:13 +0200 Subject: [PATCH 6/6] Harden Github Actions for future msrv changes --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a286802..6e2a5591 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,3 +1,5 @@ +name: Rust + on: [ push, pull_request ] env: CARGO_TERM_COLOR: always