fd icon indicating copy to clipboard operation
fd copied to clipboard

Apple Silicon GitHub release?

Open karlhepler opened this issue 1 year ago • 6 comments

Looking in the GitHub releases, I don't see one for Apple Silicon. I might be overlooking it? I'm not sure. If I'm overlooking it, please let me know which artifact supports Apple Silicon. If it's not there, then would it be too much trouble to ask for it to be built into the GitHub releases in the near future?

karlhepler avatar Aug 23 '22 14:08 karlhepler

I think this will be very easy to implement once Github Actions has Apple Sillicon runners: https://github.com/actions/runner-images/issues/2187 https://github.com/github/roadmap/issues/528

From what I can see, it does not have an exact release yet. Set for the future in the roadmap. Only supported for self-hosted runners as of now.

Another option would be to cross-compile, but that would probably require some more setup.

themkat avatar Aug 23 '22 17:08 themkat

We already use cargo cross for cross-compilation. But I'm not sure if aarch64-apple-darwin is supported out of the box. It seems like it needs some macOS SDK?! (https://github.com/cross-rs/cross/issues/508)

Would be easy to check though, if someone wants to pick this up. Just try to add the new architecture somewhere here: https://github.com/sharkdp/fd/blob/a0062b9a1be36a4b1072b8e476462f71c3a1f78a/.github/workflows/CICD.yml#L75-L86

sharkdp avatar Aug 23 '22 18:08 sharkdp

It seems like it needs some macOS SDK?! (cross-rs/cross#508)

The macOS SDK is installed on GitHub Actions macOS runners. (You actually probably need it to use Rust at all on macOS.)

carlocab avatar Sep 01 '22 04:09 carlocab

@sharkdp Just coming by and I want to mention that it's possible to have ASi binaries compiled today on GitHub CI (I didn't even bother with cargo cross), and this is what I have been doing with my own project for months:

     - name: Set macOS environment variables
        # if: runner.os == 'macOS'
        run: |
          echo "SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)" >> $GITHUB_ENV
          echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)" >> $GITHUB_ENV
      - name: Test build for aarch64
        run: cargo build --verbose --release --locked --target=aarch64-apple-darwin
     

https://github.com/rami3l/pacaptr/blob/71eca518382fd24c26bef05b45b9173921e4cc18/.github/workflows/test.yml#L84-L97

... and then you can easily make a fat binary with the lipo tool:

lipo -create -output {out} {in1} {in2}

rami3l avatar Sep 10 '22 15:09 rami3l

Brew provide the package, but I also hope the arm64 darwin release.

> whereis fd
fd: /opt/homebrew/bin/fd
> file /opt/homebrew/bin/fd
/opt/homebrew/bin/fd: Mach-O 64-bit executable arm64

FulanXisen avatar Oct 16 '23 16:10 FulanXisen

I'm personally not going to work on this, but please go ahead and add this to the CI pipeline if you are interested.

sharkdp avatar Oct 21 '23 11:10 sharkdp