fix(desktop): make Windows release compile cleanly#1029
Open
wpfleger96 wants to merge 1 commit into
Open
Conversation
The release workflow's Windows job failed to compile two source files containing platform-conditional code never validated on Windows: PR CI builds the desktop app for macOS/Linux only, so these surfaced only at release time. migration.rs called std::os::unix::fs::symlink unconditionally in the dev-only worktree-sync helper; gate it behind a #[cfg]-selected symlink helper (no-op on non-unix), matching the existing copy_dir_all convention. media.rs cast a file handle to isize, but windows-sys 0.61 changed HANDLE to *mut c_void; cast to the matching type. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v0.3.20 release workflow's Windows job fails to compile two desktop source files that contain platform-conditional code never validated on Windows. PR CI builds the desktop app for macOS and Linux only, so these errors surface only at release time — which is why every prior Windows release stopped at the same point.
desktop/src-tauri/src/migration.rssync_shared_agent_data(the dev-only worktree-sync helper) calledstd::os::unix::fs::symlinkunconditionally at three sites.std::os::unixdoes not exist on Windows. This adds a#[cfg]-selectedsymlinkhelper —std::os::unix::fs::symlinkon unix, a no-opOk(())on non-unix — and routes the three sites through it. This matches the convention already used bycopy_dir_allin the same file. Worktree sync only runs whenBUZZ_SHARE_IDENTITY=1, a dev-only env var no release user sets, so the non-unix no-op path is unreachable in production.desktop/src-tauri/src/commands/media.rsfd_real_pathcast a file handle withas isize, butwindows-sys 0.61changedHANDLEto*mut core::ffi::c_void. The cast now targets the matching pointer type.macOS and Linux builds are unaffected — the
#[cfg(unix)]branch is byte-identical to the previous behavior.Verification
cargo check(native, unix) passes clean. Localcargo check --target x86_64-pc-windows-msvcfrom macOS does not reach typechecking: theaws-lc-sysbuild script fails to compile its C sources againstwindows.h(no MSVC headers on the host) — a*-systoolchain gap unrelated to this change. The Windows release CI job is the authoritative gate.