From 3ef7163f315efb0de6c8ffaf1b711a53a6d34d8f Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Tue, 19 Aug 2025 14:48:03 -0500 Subject: [PATCH 1/2] fix: resolve getrandom v0.2.16 compilation issues in CI/CD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update Rust to 1.85.0 in flake.nix to support edition2024 feature - Add CARGO_CFG_TARGET_OS workaround for getrandom compilation: - Set to 'darwin' for iOS builds on macOS runners - Set to 'linux' for Linux builds - Fixes build failures related to getrandom crate platform detection This addresses the issue where getrandom v0.2.16 fails to correctly detect the target platform, causing multiple module definition errors. See: https://github.com/rust-random/getrandom/issues/641 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/claude.yml | 2 +- .github/workflows/desktop-build.yml | 2 ++ .github/workflows/mobile-build.yml | 2 ++ .github/workflows/testflight-on-comment.yml | 2 ++ flake.nix | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 44013a7e..948e1646 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -110,7 +110,7 @@ jobs: - name: Install Tauri CLI run: | if ! command -v cargo-tauri &> /dev/null; then - cargo install tauri-cli + CARGO_CFG_TARGET_OS=linux cargo install tauri-cli else echo "Tauri CLI already installed" fi diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index d539391e..940e6a8d 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -127,6 +127,8 @@ jobs: - name: Install Tauri CLI run: cargo install tauri-cli + env: + CARGO_CFG_TARGET_OS: linux - name: Build Tauri App (Linux) working-directory: ./frontend diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index 48aa3827..7faa4567 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -43,6 +43,8 @@ jobs: - name: Install Tauri CLI run: cargo install tauri-cli + env: + CARGO_CFG_TARGET_OS: darwin - name: Set up API Key run: | diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index 41987946..f2982d27 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -101,6 +101,8 @@ jobs: - name: Install Tauri CLI run: cargo install tauri-cli + env: + CARGO_CFG_TARGET_OS: darwin - name: Set up API Key run: | diff --git a/flake.nix b/flake.nix index 999344a8..16ed8dbf 100644 --- a/flake.nix +++ b/flake.nix @@ -16,7 +16,7 @@ }; # Use specific rust version required by Tauri - rustToolchain = pkgs.rust-bin.stable."1.78.0".default.override { + rustToolchain = pkgs.rust-bin.stable."1.85.0".default.override { extensions = [ "rust-src" ]; }; in From ac164a6e5e5b72cb2aa3bd59f71ec886a307b144 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Tue, 19 Aug 2025 15:09:49 -0500 Subject: [PATCH 2/2] fix: use 'macos' instead of 'darwin' for CARGO_CFG_TARGET_OS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeRabbit correctly pointed out that Rust's cfg(target_os) uses 'macos' for macOS, not 'darwin'. Since cargo install builds tauri-cli for the host OS (macOS runners), we need to use 'macos'. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/mobile-build.yml | 4 +++- .github/workflows/testflight-on-comment.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml index 7faa4567..0c81d3cc 100644 --- a/.github/workflows/mobile-build.yml +++ b/.github/workflows/mobile-build.yml @@ -44,7 +44,9 @@ jobs: - name: Install Tauri CLI run: cargo install tauri-cli env: - CARGO_CFG_TARGET_OS: darwin + # Workaround for getrandom v0.2.16 (https://github.com/rust-random/getrandom/issues/641) + # cargo install builds for the host; on macOS runners target_os is "macos" + CARGO_CFG_TARGET_OS: macos - name: Set up API Key run: | diff --git a/.github/workflows/testflight-on-comment.yml b/.github/workflows/testflight-on-comment.yml index f2982d27..5db263af 100644 --- a/.github/workflows/testflight-on-comment.yml +++ b/.github/workflows/testflight-on-comment.yml @@ -102,7 +102,9 @@ jobs: - name: Install Tauri CLI run: cargo install tauri-cli env: - CARGO_CFG_TARGET_OS: darwin + # Workaround for getrandom v0.2.16 (https://github.com/rust-random/getrandom/issues/641) + # cargo install builds for the host; on macOS runners target_os is "macos" + CARGO_CFG_TARGET_OS: macos - name: Set up API Key run: |