Skip to content

Fix Linux build of the codexbar crate - #909

Merged
Finesssee merged 1 commit into
mainfrom
fix/linux-build-muse-cache
Oct 17, 2026
Merged

Finesssee merged 1 commit into
mainfrom
fix/linux-build-muse-cache

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The codexbar crate did not compile on Linux, and several tests assumed Windows paths. This makes cargo test and cargo clippy -D warnings on rust/ pass on Linux. Windows behavior is unchanged.

  • Muse file identity: platform_file_identity in muse/local_usage/cache.rs called Windows APIs with no #[cfg(windows)]. The Unix version in mod.rs sat under a stray #[cfg(windows)] plus #[cfg(unix)], so it never compiled anywhere. All three platform variants now live in cache.rs, matching spend_contract/opencodex/cache.rs.
  • Windows-only imports: std::process::Command (codex_cli.rs) and LazyLock (core/timezone.rs) are now scoped to the Windows code that uses them.
  • Claude Desktop discovery: the traversal stays platform-neutral so tests cover it, but only Windows calls it. Non-Windows builds allow dead_code there with a reason.
  • Tests: tests of Windows path semantics (drive letters, WSL UNC paths, DPAPI wrapping, case-insensitive paths) are gated to Windows. The hooks tests use a platform-native absolute executable path, so they still run on Linux.

Commands run

On a Linux VM (Ubuntu 24.04, Rust stable 1.99.1):

  • cargo fmt --all -- --check: clean
  • cargo test --manifest-path rust/Cargo.toml: 4750 passed, 0 failed, 2 ignored
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: clean

Windows is covered by ci/circleci: pr-check. The Tauri shell crate is not built on Linux.

No UI changes.

Summary by CodeRabbit

  • Improvements
    • Improved cross-platform compatibility for local usage tracking, timezone lookup, and application checks.
    • Platform-specific path and configuration checks now run on the appropriate operating systems, while shared checks use paths suited to the current platform.
    • These changes help keep behavior and validation consistent across supported platforms.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: nesszer/Win-CodexBar/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d826aee9-1fca-4354-9220-2e0283d80da7
📥 Commits

Reviewing files that changed from the base of the PR and between 54f6027 and d49b0c6.

📒 Files selected for processing: 11
  • rust/src/agent_sessions/claude_desktop.rs
  • rust/src/agent_sessions/pi_family/roots.rs
  • rust/src/agent_sessions/pi_family_tests.rs
  • rust/src/codex_cli.rs
  • rust/src/codex_sessions.rs
  • rust/src/core/hooks/tests.rs
  • rust/src/core/timezone.rs
  • rust/src/providers/codex/reset_observations.rs
  • rust/src/providers/jetbrains/ide.rs
  • rust/src/providers/muse/local_usage/cache.rs
  • rust/src/providers/muse/local_usage/mod.rs
💤 Files with no reviewable changes: 1
  • rust/src/providers/muse/local_usage/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Rust code and tests now use platform-specific compilation conditions and paths. File identity implementations now cover Unix and other non-Windows, non-Unix targets alongside the Windows implementation.

Changes: Rust platform portability

Layer / File(s) Summary
Platform-scoped compilation
rust/src/agent_sessions/claude_desktop.rs, rust/src/agent_sessions/pi_family/roots.rs, rust/src/codex_cli.rs, rust/src/core/timezone.rs
Non-Windows builds allow unused platform-neutral traversal code. The Command import and timezone state are restricted to Windows.
Platform file identity
rust/src/providers/muse/local_usage/cache.rs, rust/src/providers/muse/local_usage/mod.rs
File identity uses device and inode metadata on Unix, creation time on other non-Windows, non-Unix targets, and the existing Windows implementation. The previous helpers are removed from mod.rs.
Platform-aligned tests
rust/src/agent_sessions/pi_family_tests.rs, rust/src/codex_sessions.rs, rust/src/core/hooks/tests.rs, rust/src/providers/codex/reset_observations.rs, rust/src/providers/jetbrains/ide.rs
Windows-specific tests compile only on Windows. Path validation and hook test paths now use platform-appropriate cases and absolute paths.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d49b0

No actionable regression is evident in the supplied change context. The changes align compilation and tests with their target platforms; the PR appears mergeable after normal checks.

Pre-merge checks: Passed 8
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is a short imperative summary that accurately describes the primary change: fixing Linux compilation for the codexbar crate.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed Passed The diff does not introduce cross-provider or cross-account data flow. The only identity-related change is platform_file_identity for Muse local-usage file stamps, and it remains under `rust/src/pro…
Secrets Handled Safely Passed PASS. The PR diff contains only platform gates, import scoping, test-path changes, and relocation of platform_file_identity. Added code does not log or persist token, cookie, API-key, OAuth, or auth…
No Unapproved Dependencies Passed The pull request changes 11 Rust source files only. The authoritative diff contains no Cargo.toml, package.json, npm/yarn lockfile, or pnpm-lock.yaml changes. It also cannot change a pinned pnpm packa…
Ui Changes Include Windows Proof Passed PASS. The pull request changes only Rust backend logic and tests under rust/src. It does not modify apps/desktop-tauri/src, rust/src/tray, float bar, settings, or window chrome. The UI-proof requireme…
Full details: Provider Data Stays Siloed

Explanation

The diff does not introduce cross-provider or cross-account data flow. The only identity-related change is platform_file_identity for Muse local-usage file stamps, and it remains under rust/src/providers/muse/local_usage/cache.rs. Other changes only gate Windows code/tests, adjust test paths, or scope imports. No new provider/account/plan/email display, payload, storage, or ProviderId branching appears.

Full details: Secrets Handled Safely

Explanation

PASS. The PR diff contains only platform gates, import scoping, test-path changes, and relocation of platform_file_identity. Added code does not log or persist token, cookie, API-key, OAuth, or authorization-header values. The only credential-adjacent test remains based on secure_file; no credential-file or keyring deletion or overwrite was introduced.

Full details: No Unapproved Dependencies

Explanation

The pull request changes 11 Rust source files only. The authoritative diff contains no Cargo.toml, package.json, npm/yarn lockfile, or pnpm-lock.yaml changes. It also cannot change a pinned pnpm packageManager version without changing a manifest file. Therefore, the explicit failure conditions are not present.

Full details: Ui Changes Include Windows Proof

Explanation

PASS. The pull request changes only Rust backend logic and tests under rust/src. It does not modify apps/desktop-tauri/src, rust/src/tray, float bar, settings, or window chrome. The UI-proof requirement is therefore not applicable.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit 9c1f829 into main Oct 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant