Show HN: macOS-cross-compiler ā€“ Compile binaries for macOS on Linux

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • macos-cross-compiler

    Compile binaries for macOS on Linux

  • cargo-zigbuild

    Compile Cargo project with zig as linker

  • https://github.com/rust-cross/cargo-zigbuild

    Iā€™m curious what the blockers are for rustc to cross-compile like zig does natively.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • bazel-pycross-zstandard-example

    Example building zstandard using Bazel and zig cc

  • I'll plug some work I've been doing to (attempt to) enable cross compilation of Python wheels. I put together a small example [1] that builds the zstandard wheel, and can build macos wheels on linux and linux wheels on macos using zig cc.

    macos wheels must still be adhoc signed (codesign) and binary patched (install_name_tool), so I re-implemented those functions in Python [2].

    [1] https://github.com/jvolkman/bazel-pycross-zstandard-example

    [2] https://github.com/jvolkman/repairwheel/tree/main/src/repair...

  • repairwheel

    Repair any wheel, anywhere

  • I'll plug some work I've been doing to (attempt to) enable cross compilation of Python wheels. I put together a small example [1] that builds the zstandard wheel, and can build macos wheels on linux and linux wheels on macos using zig cc.

    macos wheels must still be adhoc signed (codesign) and binary patched (install_name_tool), so I re-implemented those functions in Python [2].

    [1] https://github.com/jvolkman/bazel-pycross-zstandard-example

    [2] https://github.com/jvolkman/repairwheel/tree/main/src/repair...

  • msvc-wine-rust

    Cross compile Rust programs to the MSVC Windows target using Wine

  • AFAIK, there are no blockers really, it's just that Rust does not have its own linker, it delegates linkage to the system linker depending on the target. <https://rust-lang.github.io/rustup/cross-compilation.html?hi...>

    You can specify your own linker if you want, mold is a very popular one, and cargo-zigbuild does the same behind the scenes with zig cc as the linker.

    I did something similar a couple of months ago (or a year ago? I don't remember exactly). I managed to cross-compile to windows-msvc on Linux using Wine, there's a project that provides the scripts to make this easier, including the linker wrapper: <https://github.com/est31/msvc-wine-rust>. It was just for fun because Rust can already target windows-gnu and it'll use mingw64 linker.

    Rust's approach to things is normally to provide the basic foundation and let the community build on top of it. I personally like this approach, but it also has this downside of people not knowing they may need an external/community built tool to accomplish what they want.

  • goreleaser-cross

    Docker image for Golang cross-compiling with CGO

  • zstd

    Zstandard - Fast real-time compression algorithm

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts