Skip to content

Enforce Linux-only compilation and remove non-Linux code and test branches #1667

Closed

Description

@JacobStephens2

Parent

#1665

What to build

Make thirdshift's codebase and test suite unconditionally Linux-only and reject non-Linux compilation targets with a clear error message:

  • Add a crate-root #[cfg(not(target_os = "linux"))] compile_error!(...) that fails compilation on non-Linux targets with a message stating that thirdshift supports Linux only and directing macOS users to run it inside an Ubuntu 24.04 Linux VM (such as Lima) and Windows users to use WSL2.
  • Remove all macOS and non-Linux conditional compilation branches (#[cfg(target_os = "macos")], #[cfg(not(target_os = "linux"))], redundant #[cfg(target_os = "linux")], and runtime cfg!(target_os = ...) checks) across production modules:
    • Process start identity and Stop signaling use Linux /proc and pidfd_open / pidfd_send_signal unconditionally, with the macOS proc_pidinfo and proc_signal_with_audittoken implementation removed.
    • Console live process-exit watching uses Linux pidfd_open unconditionally, with the macOS kqueue implementation removed.
    • Console service installation (thirdshift console install) runs without a runtime cfg!(target_os = "linux") refusal check.
    • Setup's Security sandbox probe runs the live bwrap check unconditionally, with the non-Linux unavailable_report fallback and its unit tests removed.
    • Embedded Factory skills directory handles use Linux O_PATH | O_DIRECTORY | O_NOFOLLOW descriptors unconditionally.
    • Child Ticket run and Base fix spawning use /proc/self/exe and prctl(PR_SET_NAME) unconditionally.
    • Trial and Grader systemd --user scope creation runs without a cfg!(target_os = "linux") guard.
  • Remove all #[cfg(target_os = ...)] and #![cfg_attr(not(target_os = "linux"), ...)] attributes and cfg!(target_os = "macos") branches across unit and integration tests, deleting dead non-Linux test stubs so every test in the suite is compiled and run unconditionally on Linux.

Acceptance criteria

  • Compiling on a non-Linux target fails immediately at the crate root compile_error! naming Linux, Lima on macOS, and WSL2 on Windows.
  • No target_os = "macos" or not(target_os = "linux") branches remain in src/ or tests/ (aside from the crate-root compile_error!).
  • cargo clippy --all-targets -- -D warnings and the unit and integration test suites pass on Linux with zero dead-code or unused warnings.
  • scripts/affected-tests main passes.

Activity

  1. added
    ready-for-agent
    on Oct 30, 2026
  2. JacobStephens2 commented on Oct 30, 2026

    @JacobStephens2
    OwnerAuthor

    Closed by #1676, merged into issue-1665 by a thirdshift Ticket run with Self-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions