Skip to content

fix: enable compilation on macOS (Darwin) for testing and CI #4

Description

@levonk

Summary

Fix compilation errors on macOS (Darwin) by adding platform-specific guards for Wayland-only APIs.

Current problem

The codebase has unguarded Wayland-specific imports and method calls that prevent compilation on macOS:

  • winit::platform::wayland::WindowAttributesExtWayland import
  • with_name() method calls on WindowAttributes

This blocks:

  • Running tests on macOS in CI
  • Developers on macOS from building/test the codebase
  • Cross-platform development workflows

Root cause

handterm is Wayland-native, but the code doesn't guard Linux/Wayland-specific code with #[cfg(target_os = "linux")].

Proposed fix

Add #[cfg(target_os = "linux")] guards around:

  1. Wayland platform imports in src/app.rs, src/gpu_runtime.rs, src/remote_app.rs
  2. with_name() method calls in window attribute builders

Implementation

Fixed in commit: (add commit hash after commit)

Changes:

  • src/app.rs: guarded Wayland import and with_name() call
  • src/gpu_runtime.rs: guarded Wayland import and with_name() call
  • src/remote_app.rs: guarded Wayland import and with_name() call

Testing

After fixes:

  • 211 tests pass on macOS
  • 10 font-related tests fail (pre-existing macOS font configuration issues, not compilation errors)
  • Compilation succeeds on macOS

Notes

handterm will still not run on macOS (requires Wayland compositor), but this enables:

  • CI testing on macOS
  • Development builds for testing non-Wayland code paths
  • Cross-platform collaboration

The app will gracefully fail at runtime on macOS with a clear error about Wayland requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions