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 #780

Closed
johnalanwoods opened this issue Dec 31, 2020 · 24 comments
Closed

Support for Apple Silicon #780

johnalanwoods opened this issue Dec 31, 2020 · 24 comments

Comments

@johnalanwoods
Copy link

Is there any plan to support Apple Silicon/ARM64?

@alexclst
Copy link

alexclst commented Jan 1, 2021

I'm curious about this too, but more for when a version installable from Homebrew itself is released, as that is how I used to have this installed. For the time being I've copied the x86_64 version from a backup, but longterm want exa installed via Homebrew again.

@johnalanwoods
Copy link
Author

@alexclst homebrew for ARM64 is already working great. I only have one formula I need the intel version for, and that's Exa.

@alexclst
Copy link

alexclst commented Jan 1, 2021

@alexclst homebrew for ARM64 is already working great. I only have one formula I need the intel version for, and that's Exa.

Yeah, same here. Homebrew working fine, but Exa the one remaining formula.

@ariasuni
Copy link
Collaborator

ariasuni commented Jan 1, 2021

The extent of the issue is unclear to me. Is exa compiling fine on macOS ARM64? Do we need to do something in this repository regarding the Howebrew formula? I suppose this issue is also asking for a build on GitHub releases too; I’ve no idea how this works so I don’t know if it’s possible.

@sschlesier
Copy link

sschlesier commented Jan 1, 2021

After installing rust, libgit2, and cmake (all via Apple Silicon homebrew) I was able to compile exa from source no problem at all.

However the homebrew formula is not working.

I'm seeing

running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64│ 38     system "cargo", "install", *std_cargo_args
    -apple-darwin" "-I" "/private/tmp/exa-20210101-5273-1oljzkq/exa-0.9.0/target/release/build│ 39
    /libgit2-sys-bfdf0b7a51881d0e/out/include" "-I" "libgit2/src" "-I" "libgit2/deps/http-pars│ 40     # Remove in 0.9+
    er" "-I" "libgit2/deps/regex" "-fvisibility=hidden" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DS│ 41     if build.head?
    HA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\│ 42       bash_completion.install "completions/completions.bash
    "" "-o" "/private/tmp/exa-20210101-5273-1oljzkq/exa-0.9.0/target/release/build/libgit2-sys│    " => "exa"
    -bfdf0b7a51881d0e/out/build/libgit2/src/commit_list.o" "-c" "libgit2/src/commit_list.c"   │ 43       zsh_completion.install  "completions/completions.zsh"
166   cargo:warning=error: unknown target triple 'unknown-apple-macosx11.0.0', please use -tri│      => "_exa"
    ple or -arch                                                                              │ 44       fish_completion.install "completions/completions.fish
167   exit code: 1

I'm guessing this is the source of the problem, maybe related to how homebrew uses superenv, but I'm no homebrew build formula expert. I'm plugging away at it and will update here if I make any progress.

@ariasuni
Copy link
Collaborator

ariasuni commented Jan 1, 2021

I investigated. Support for aarch64-apple-darwin has been added in Rust 1.49.0 released 2020-12-31. The Homebrew formula is still using Rust 1.48.0, but Homebrew was already using Rust 1.49.0 beta instead of 1.48.0 for macOS ARM.

It seems update to Rust stable 1.49.0 is ongoing at Howebrew/homebrew-core#68089; let’s see if that fixes the Homebrew problem or not.

@carlocab
Copy link

carlocab commented Jan 2, 2021

Switching to Rust 1.49 on its own doesn't seem to be enough to fix build failures for exa: Homebrew/homebrew-core#68089 (comment)

@johnalanwoods
Copy link
Author

So I was able to compile manually using Rust 1.49. I have a stable ARM exa binary on my M1 Mac.

Is this then something to do with the build script in brew?

@carlocab
Copy link

carlocab commented Jan 2, 2021

By compile manually, do you mean using cargo install exa?

Anyway, the explanation for why it doesn't work for brew is in the comment just after the one I linked. The formula passes --locked to cargo install (we don't like unversioned dependencies), and that seems to be causing the build failure.

@johnalanwoods
Copy link
Author

@carlocab got it.

Yep that's what I meant.

So this should resolve in time. And certainly when GHC becomes ARM64 compatible?

@johnalanwoods
Copy link
Author

cool thanks @carlocab - looks like a simple fix.

cc: @ogham @ariasuni

@infa-jowoods
Copy link

@ariasuni - I see there hasn't been a release in over a year, is it likely that it will take a long time for a release with the updated cargo.lock file?

@carlocab
Copy link

Does brew install --HEAD exa also not work for you, @johnalanwoods?

@johnalanwoods
Copy link
Author

johnalanwoods commented Jan 13, 2021

@carlocab - nah because GHC 8.8 fails as x86 only.

Also --HEAD wouldn't be updated unless manually removed and installed/reinstalled.

I see lots of dev work on Exa, but very few releases.

@carlocab
Copy link

carlocab commented Jan 13, 2021

Yes, of course, I meant after removing the pandoc dependency + lines that build the manuals. I only ask because if it did, then I could probably open a PR to fix it at homebrew/core.

Anyway, that said, let's see if pulling in a newer Cargo.lock file will help...

@carlocab
Copy link

carlocab commented Jan 14, 2021

I've taken the latest Cargo.lock file and patched it into the stable release (Homebrew/homebrew-core#68973). It seems to work, so I guess you might get your brewed exa reasonably soon.

@carlocab
Copy link

Above PR has been merged. Though it would still be nice to see a proper new release of exa that actually supports Apple Silicon, rather than having to patch the latest stable release to get it.

@johnalanwoods
Copy link
Author

@carlocab - thanks you're a star 👍🏼

@johnalanwoods
Copy link
Author

@carlocab - if/when exa does release a new update, will that then flow down via homebrew, or require a new update by someone on homebrew side to reverse the formula change?

@carlocab
Copy link

Not sure what you mean. When there is a new version of exa, the Homebrew formula will be updated in the same way any other formula is updated. If the new version uses a new enough lock file, then the lock file patch can be removed.

@ariasuni
Copy link
Collaborator

ariasuni commented Apr 6, 2021

Since Homebrow is providing exa 0.10.0 for Apple Silicon, I believe this issue can be closed.
https://formulae.brew.sh/formula/exa#default

@ariasuni ariasuni closed this as completed Apr 6, 2021
@jritsema
Copy link

Hello. I tried to install exa via asdf on an m1 and got the following error.

asdf install exa 0.10.1
* Downloading exa release 0.10.1...
curl: (22) The requested URL returned error: 404
asdf-exa: Could not download https://github.com/ogham/exa/releases/download/v0.10.1/exa-macos-armv7-v0.10.1.zip
asdf-exa: An error ocurred while installing exa 0.10.1.

It seems like if this project published a exa-macos-armv7-v0.10.1.zip, then the asdf install would start working. Thoughts?

@dumindu
Copy link

dumindu commented Feb 6, 2022

@ogham @ariasuni Please add native Apple Silicon target builds to releases as well. Thanks :)

@carlocab
Copy link

carlocab commented Feb 6, 2022

If you're in a pinch...

curl -sL -H 'Authorization: Bearer QQ==' -o exa.tar.gz "$(curl -s https://formulae.brew.sh/api/bottle/exa.json | jq -j '.bottles.arm64_big_sur.url')"

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

8 participants