Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish mac-arm binary in release? #140

Closed
mhansen opened this issue Jan 27, 2022 · 9 comments · Fixed by #143
Closed

Publish mac-arm binary in release? #140

mhansen opened this issue Jan 27, 2022 · 9 comments · Fixed by #143
Labels
help wanted This is a call for feedback or is not going to happen without third-party contribution

Comments

@mhansen
Copy link
Contributor

mhansen commented Jan 27, 2022

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!

@untitaker
Copy link
Owner

untitaker commented Jan 27, 2022 via email

@mhansen
Copy link
Contributor Author

mhansen commented Jan 27, 2022

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.

@untitaker
Copy link
Owner

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

@untitaker
Copy link
Owner

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

@untitaker untitaker added the help wanted This is a call for feedback or is not going to happen without third-party contribution label Jan 29, 2022
@mhansen
Copy link
Contributor Author

mhansen commented Jan 29, 2022 via email

@untitaker
Copy link
Owner

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

@mhansen
Copy link
Contributor Author

mhansen commented Jan 29, 2022

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/'

@mhansen
Copy link
Contributor Author

mhansen commented Jan 29, 2022

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This is a call for feedback or is not going to happen without third-party contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants