Does this not need any xcode/macos license?
Why would it? You can cross compile for macos with the go toolchain on Linux too and that doesn't even require an additional compiler. Just GOOS=darwin GOARCH=arm64 and then the regular command. Apple can't regulate everything
Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
21–30 of 76 posts
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#22Speaking of cross compilers - I was able to use the zig toolchain in order to cross compile for macos apple silicon, arm Linux, windows x64, windows arm and x86_64 Linux musl (statically linked). It's super handy and works as a drop in.
Interestingly you can use zig within your Rust build to more easily cross-compile: https://github.com/rust-cross/cargo-zigbuild I’m curious what the blockers are for rustc to cross-compile like zig does natively.
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#23Speaking of cross compilers - I was able to use the zig toolchain in order to cross compile for macos apple silicon, arm Linux, windows x64, windows arm and x86_64 Linux musl (statically linked). It's super handy and works as a drop in.
Interestingly you can use zig within your Rust build to more easily cross-compile: https://github.com/rust-cross/cargo-zigbuild I’m curious what the blockers are for rustc to cross-compile like zig does natively.
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#24The good part of this is that I can use a standard Linux host now to just build everything. Very nice!
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#25macos 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...
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#26Does this not need any xcode/macos license?
Why would it? You can cross compile for macos with the go toolchain on Linux too and that doesn't even require an additional compiler. Just GOOS=darwin GOARCH=arm64 and then the regular command. Apple can't regulate everything
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#27What is happening with that first picture?? Is that an extra penguin arm coming out of the apple?
I wanted to add some sort of image to the repository README, and it seemed like the simplest way to do so.
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#28Earlier quoted context omitted.
Interestingly you can use zig within your Rust build to more easily cross-compile: https://github.com/rust-cross/cargo-zigbuild I’m curious what the blockers are for rustc to cross-compile like zig does natively.
Just add another arch with rustup. Am I missing something?
Now, you can download all the necessary files from a Mac and build a cross-compilation toolchain on your Linux system. I believe you could not legally distribute a project doing this and that is why these projects don't exist or are usually short-lived (with the notable exception of zig).
We will see how that goes for OP.
So, solutions like osxcross resort to shipping scripts that help you to acquire the necessary files and make that process easier.
The OP builds on osxcross, but is "batteries included".
zig has an even more difficult problem to solve because it tries to compile and link for many platforms. Shipping all the different requirements in their original form would make a zig distribution huge. So it does some clever magic I do not fully understand to create the necessary files from just the necessary subset of data. This reduces the size because there is overlap between platforms. It also means that they are not shipping the Mac files in their complete and original form and have gotten away with this legally so far.
At least that is what I believe is happening. I hope someone with more knowledge about zig could explain it better.
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#29Speaking of cross compilers - I was able to use the zig toolchain in order to cross compile for macos apple silicon, arm Linux, windows x64, windows arm and x86_64 Linux musl (statically linked). It's super handy and works as a drop in.
Re: Show HN: macOS-cross-compiler – Compile binaries for macOS on Linux
#30Earlier quoted context omitted.
Apple ships extra stickers with their logo in the box with a lot of their products, maybe slap one on your computer and see how far it gets you in court?
Which is why they changed the wording from "Apple-labeled" to "Apple-branded" around the time of Snow Leopard IIRC.