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

🚀 Support for Apple Silicon/ARM64 #484

Closed
johnalanwoods opened this issue Jan 1, 2021 · 19 comments
Closed

🚀 Support for Apple Silicon/ARM64 #484

johnalanwoods opened this issue Jan 1, 2021 · 19 comments

Comments

@johnalanwoods
Copy link

Is there any plan to support Apple Silicon/ARM64?

Thanks

Building with Cargo 1.48.0 I get:

warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch

@dandavison
Copy link
Owner

Hi @johnalanwoods, the honest answer here is that I do not know what I would need to do to go about this! (I am a mac user but not Silicon/ARM). Maybe someone can chime in here who knows what if anything it's appropriate to do currently, or whether we just wait for developments. cc @MarcoIeni

I noticed that when the latest release of delta went up on homebrew yesterday that the homebrew maintainers checked whether it would build on ARM, and that it didn't work: Homebrew/homebrew-core#68056 (comment). Quick googling brings up actions/runner#805 and rust-lang/rust#73908.

@johnalanwoods
Copy link
Author

@dandavison - thanks for the quick reply. No probs I'll see what I can do to try and get it building... also it's such a great project thanks for your creation.

@MarcoIeni - quick question, do you think this is something that will resolve as Rust support matures or do you have any pointers I can investigate?

@MarcoIeni
Copy link
Contributor

Have you tried with rust 1.49? See here.

Anyway, we are relying on cross for cross compilation. So when it will support M1 we will add it to Continuous Deployment and the binary will be in releases.

@domoritz
Copy link

domoritz commented Jan 4, 2021

cargo install git-delta worked fine for me with the latest rust stable.

Unfortunately, homebrew did not work

brew install --build-from-source git-delta
==> Downloading https://github.com/dandavison/delta/archive/0.5.0.tar.gz
==> Downloading from https://codeload.github.com/dandavison/delta/tar.gz/0.5.0
# #=O#- #
==> cargo install
Last 15 lines from /Users/dominik/Library/Logs/Homebrew/git-delta/01.cargo:


  error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-apple-darwin" "-Wall" "-Wextra" "-o" "/private/tmp/git-delta-20210104-90319-x2yzxi/delta-0.5.0/target/release/build/ansi_colours-d354c876e404800b/out/src/ansi256.o" "-c" "src/ansi256.c" with args "clang" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch
warning: error: unknown target triple 'unknown-apple-macosx11.0.0', please use -triple or -arch

error: failed to compile `git-delta v0.5.0 (/private/tmp/git-delta-20210104-90319-x2yzxi/delta-0.5.0)`, intermediate artifacts can be found at `/private/tmp/git-delta-20210104-90319-x2yzxi/delta-0.5.0/target`

Caused by:
  build failed

Do not report this issue to Homebrew/brew or Homebrew/core!

@johnalanwoods
Copy link
Author

Sorry for late reply!

Yep I see this too. Can build manually using cargo. Maybe an issue with the brew formula?

@dandavison
Copy link
Owner

dandavison commented Jan 4, 2021

Hi @domoritz @johnalanwoods, see #487 and 5b627ce. It looks like I have a bad workflow which is resulting in Cargo.lock becoming stale. Do tell me if you have recommendations for what my workflow should be!

@johnalanwoods
Copy link
Author

@dandavison I think all we need is a new release with an updated cargo.lock file. I think its easy to update using cargo update.

@dandavison
Copy link
Owner

@johnalanwoods thanks, do you know what the workflow should be? I.e. When ought I to run cargo update?

@johnalanwoods
Copy link
Author

johnalanwoods commented Jan 5, 2021

Thanks for quick reply @dandavison.

I'll defer if I may to @carlocab on that... @carlocab, do you know when best to run update?

@dandavison
Copy link
Owner

dandavison commented Jan 5, 2021

@johnalanwoods I've released 0.5.1 with the update Cargo.lock. Assuming the ARM build on Homebrew succeeds (see Homebrew/homebrew-core#68333), is anything more needed here?

@johnalanwoods
Copy link
Author

@dandavison - nope I think that's everything, thanks!

@carlocab
Copy link

carlocab commented Jan 5, 2021

delta successfully built on the ARM runner: https://github.com/Homebrew/homebrew-core/pull/68333/checks?check_run_id=1650854158

@carlocab
Copy link

carlocab commented Jan 5, 2021

Oh, and as for cargo update, I'm not sure, sorry! I was actually under the impression you always wanted the lock file you get out of cargo build because that should always produce a known-good lock file. (At least, a good one for the architecture you've built on.)

@johnalanwoods
Copy link
Author

Thanks all, will close this issue as soon as I see git-delta work through normal brew install.

@carlocab
Copy link

carlocab commented Jan 5, 2021

@johnalanwoods git-delta PR has been merged. Do brew update then give it a try.

Oh, and if you have time to chip In at Homebrew/homebrew-core#68301, it'd be much appreciated.

@johnalanwoods
Copy link
Author

@carlocab , @dandavison working perfectly on ARM!:

Screenshot 2021-01-05 at 15 49 15

@carlocab will take a look at the issue you linked, happy to help.

@JacobEvelyn
Copy link

Anyway, we are relying on cross for cross compilation. So when it will support M1 we will add it to Continuous Deployment and the binary will be in releases.

I don't know much about rust/cross but would it now be possible to generate an Apple Silicon binary in the CD system and add the binary to future releases?

@MarcoIeni
Copy link
Contributor

Yeah, I can look at it this week 👍

@dandavison
Copy link
Owner

Hi @MarcoIeni, nice to hear from you -- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants