untitaker/hyperlink

Publish mac-arm binary in release?

Closed this issue · 9 comments

Hi there, just a little feature request, would love for this to run natively on M1 Mac.

On https://github.com/untitaker/hyperlink/releases/tag/0.1.20, I only see x64_64 though:
hyperlink-linux-x86_646.38 MB
hyperlink-mac-x86_642.78 MB
hyperlink-windows-x86_64.exe2.04 MB

Thanks!

Thanks. Let me brain dump where I got up to.

Looks like it's building on different OS's to achieve cross compilation today (

), and I don't think GitHub Actions offers an M1 Mac yet. However, I think(?) Rust can cross-compile to any OS, from any OS, with a bit of configuration: https://rust-lang.github.io/rustup/cross-compilation.html. Might need a migration to move to compiling from one host OS to the client OS. Or maybe there's some way to build M1 from Intel mac, with some extra Cargo flags.

we'll have to see, i am not sure if hyperlink's deptree is pure-rust at the moment. i have seen that people attempt using qemu in github actions to build the entire thing, but it appears to be horrifically slow

oh btw, also happy to add other CI providers as long as I don't have to pay for them

this was fairly easy, 0.1.21 now has an arm binary for macos, but no idea if it works, really

Very cool. Nice, those commits look like it wasn't the big hassle I expected!

I can confirm it works on my ARM macbook.

And, as you might expect, it's faster!

$ hyperfine -i "~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/" "~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/"
Benchmark #1: ~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/
  Time (mean ± σ):     221.0 ms ±   4.2 ms    [User: 438.3 ms, System: 40.1 ms]
  Range (min … max):   214.2 ms … 227.0 ms    13 runs
 
  Warning: Ignoring non-zero exit code.
 
Benchmark #2: ~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/
  Time (mean ± σ):     153.9 ms ±   1.4 ms    [User: 314.6 ms, System: 43.2 ms]
  Range (min … max):   152.3 ms … 158.1 ms    18 runs
 
  Warning: Ignoring non-zero exit code.
 
Summary
  '~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/' ran
    1.44 ± 0.03 times faster than '~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/'

Also faster when checking anchors:

$ hyperfine -i "~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/ --check-anchors" "~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/ --check-anchors"
Benchmark #1: ~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/ --check-anchors
  Time (mean ± σ):     850.5 ms ±   7.0 ms    [User: 1.245 s, System: 0.045 s]
  Range (min … max):   843.1 ms … 867.7 ms    10 runs
 
  Warning: Ignoring non-zero exit code.
 
Benchmark #2: ~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/ --check-anchors
  Time (mean ± σ):     685.4 ms ±   1.3 ms    [User: 992.4 ms, System: 46.5 ms]
  Range (min … max):   683.5 ms … 687.6 ms    10 runs
 
  Warning: Ignoring non-zero exit code.
 
Summary
  '~/Downloads/hyperlink-mac-aarch64 ~/projects/graphviz.gitlab.io/public/ --check-anchors' ran
    1.24 ± 0.01 times faster than '~/Downloads/hyperlink-mac-x86_64  ~/projects/graphviz.gitlab.io/public/ --check-anchors'