diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6e56eb1..00c8c110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,13 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: actions/setup-node@v4 with: node-version: 20 @@ -38,7 +44,13 @@ jobs: components: clippy, rustfmt - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: Swatinem/rust-cache@v2 - name: Check formatting run: cargo fmt --all -- --check @@ -60,7 +72,13 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: Swatinem/rust-cache@v2 - name: Run tests run: cargo test --workspace --all-features --locked @@ -81,7 +99,13 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: actions/setup-node@v4 with: node-version: 20 @@ -101,7 +125,13 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: Swatinem/rust-cache@v2 - name: Build docs run: cargo doc --workspace --no-deps diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92767366..5612afd3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,13 @@ jobs: components: clippy, rustfmt - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - uses: Swatinem/rust-cache@v2 - name: Format check run: cargo fmt --all -- --check @@ -110,7 +116,13 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install Linux system dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config + run: | + for i in 1 2 3 4 5; do + sudo apt-get update && break + echo "apt-get update failed (attempt $i); retrying in 15s" + sleep 15 + done + sudo apt-get install -y libdbus-1-dev pkg-config - name: Install zig if: runner.os == 'Linux' uses: goto-bus-stop/setup-zig@v2 diff --git a/crates/tui/Cargo.toml b/crates/tui/Cargo.toml index 6e93ed88..99f93e6f 100644 --- a/crates/tui/Cargo.toml +++ b/crates/tui/Cargo.toml @@ -80,4 +80,4 @@ libc = "0.2" libc = "0.2" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.60", features = ["Win32_Foundation", "Win32_UI_WindowsAndMessaging"] } +windows = { version = "0.60", features = ["Win32_Foundation", "Win32_UI_WindowsAndMessaging", "Win32_System_Diagnostics_Debug"] } diff --git a/crates/tui/src/tui/notifications.rs b/crates/tui/src/tui/notifications.rs index e6583a16..2d777cb2 100644 --- a/crates/tui/src/tui/notifications.rs +++ b/crates/tui/src/tui/notifications.rs @@ -6,7 +6,9 @@ //! running inside a tmux session. #[cfg(target_os = "windows")] -use windows::Win32::UI::WindowsAndMessaging::MessageBeep; +use windows::Win32::System::Diagnostics::Debug::MessageBeep; +#[cfg(target_os = "windows")] +use windows::Win32::UI::WindowsAndMessaging::MESSAGEBOX_STYLE; use std::io::{self, Write}; use std::time::Duration; @@ -52,9 +54,11 @@ impl Method { /// API directly to produce the standard notification sound. #[cfg(target_os = "windows")] fn windows_bell() { - // MB_OK = 0x00000000 — plays the default system sound. + // MB_OK = 0x00000000 — plays the default system sound. Best-effort: a + // failed beep is not worth surfacing to the caller, so the Result is + // discarded. unsafe { - MessageBeep(0x00000000); + let _ = MessageBeep(MESSAGEBOX_STYLE(0)); } }