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:
- Wayland platform imports in src/app.rs, src/gpu_runtime.rs, src/remote_app.rs
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.
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::WindowAttributesExtWaylandimportwith_name()method calls on WindowAttributesThis blocks:
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:with_name()method calls in window attribute buildersImplementation
Fixed in commit: (add commit hash after commit)
Changes:
with_name()callwith_name()callwith_name()callTesting
After fixes:
Notes
handterm will still not run on macOS (requires Wayland compositor), but this enables:
The app will gracefully fail at runtime on macOS with a clear error about Wayland requirement.