Skip to content

fix: cross-platform support for macOS and Windows#2

Merged
farhan-syah merged 9 commits intomainfrom
fix/mac-errno-location
Apr 14, 2026
Merged

fix: cross-platform support for macOS and Windows#2
farhan-syah merged 9 commits intomainfrom
fix/mac-errno-location

Conversation

@farhan-syah
Copy link
Copy Markdown
Collaborator

@farhan-syah farhan-syah commented Apr 14, 2026

Summary

  • Fix macOS compilation — replace Linux-only libc::__errno_location with portable std::io::Error::last_os_error (fixes Fail to install on Mac #1)
  • Fix Windows compilation — replace missing windows crate with taskkill for process termination
  • Fix macOS dylib loading — add install_name_tool fixup in cell compiler for proper rpath resolution
  • Fix flaky watcher test — canonicalize paths to handle macOS /tmp/private/tmp symlink
  • Fix cranelift tests — use platform-correct dylib extensions (.so/.dylib/.dll) instead of hardcoded .so
  • Fix docs — correct "Cranelift JIT" to "Cranelift" across all docs and code
  • Add CI — GitHub Actions for lint, test (Linux/macOS/Windows), and tag-based release with cross-platform binaries
  • Code quality — apply cargo fmt and resolve all clippy warnings

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes (all 8 cranelift tests pass on macOS)
  • All examples run successfully (hello, simple, data-analysis, widgets)
  • venus serve starts and serves web UI correctly
  • CI runs on Linux, macOS, and Windows

Run cargo fmt across the workspace and fix clippy lints including
collapsible-if statements and map_or -> is_some_and conversions.
- Replace Linux-only libc::__errno_location with portable
  std::io::Error::last_os_error (fixes #1)
- Replace windows crate dependency with taskkill for process
  termination on Windows
- Fix macOS dylib install_name for rpath resolution in cell compiler
- Canonicalize paths in file watcher for macOS symlink compatibility
  (/tmp -> /private/tmp)
- Use platform-correct dylib extensions in cranelift integration tests
- Fix "Cranelift JIT" references to "Cranelift" across docs and code
- ci.yml: thin wrapper calling reusable test workflow, with concurrency
  control and draft PR skip
- test.yml: lint (fmt + clippy) and test on Linux, macOS, Windows with
  nightly Cranelift backend for integration tests
- release.yml: tag-based release pipeline with version validation,
  tiered crates.io publishing, cross-platform binary builds (5 targets),
  and GitHub Release with prerelease support
- Add development setup instructions to README
- Remove Windows job object code that depended on missing windows-sys
  types (JOBOBJECT_EXTENDED_LIMIT_INFORMATION, CreateJobObjectW);
  process cleanup already handled via PID tracking + taskkill
- Remove unused windows-sys dependency from venus-server
- Fix test_watcher_ignores_non_rust_files by watching directory instead
  of file to avoid FSEvents spurious events on macOS
macOS FSEvents emits directory-level events that can spuriously trigger
the .rs file filter when .rs files exist in the same directory. Use a
directory with no .rs files to reliably test extension filtering.
- source_editor tests: replace NamedTempFile with TempDir + manual file
  to avoid Windows exclusive file lock conflicts when SourceEditor opens
  the same file
- watcher test: use empty directory with no .rs files to prevent macOS
  FSEvents spurious directory-level events from triggering false matches
fs2 locks on Windows are mandatory and block all file access from other
handles, including fs::read_to_string and fs::write on the same file.
Restrict advisory locking to Unix where it doesn't interfere with I/O.
@farhan-syah farhan-syah force-pushed the fix/mac-errno-location branch from b94941b to 59628a0 Compare April 14, 2026 20:25
Cross-library linking tests (test_cranelift_compilation,
test_cross_library_call) use Unix-specific rpath and -l flags that don't
work on Windows where import libraries (.lib) are required instead.
Windows backslashes in path strings are treated as escape sequences in
TOML, causing parse errors (e.g. \v in D:\venus). Convert all paths to
forward slashes which work on all platforms.
@farhan-syah farhan-syah merged commit bffafbd into main Apr 14, 2026
4 checks passed
@farhan-syah farhan-syah deleted the fix/mac-errno-location branch April 14, 2026 20:51
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.

Fail to install on Mac

1 participant