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

M1 (aarch64 darwin) runner support #46

Closed
elopez opened this issue Oct 2, 2023 · 1 comment · Fixed by #47
Closed

M1 (aarch64 darwin) runner support #46

elopez opened this issue Oct 2, 2023 · 1 comment · Fixed by #47

Comments

@elopez
Copy link
Contributor

elopez commented Oct 2, 2023

Hi! GitHub announced M1 runners today: https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/

I tried using this action on one of our repositories (with runs-on: macos-latest-xlarge) but it seems that ghcup chooses to install an intel build for some reason, even though there's an aarch64 one available on the yml metadata. Ideally I would expect it would install the native version of the tools when available. Do you have any idea about what might be going on? Thanks!

Run haskell-actions/setup@v2
  with:
    ghc-version: 9.2
    enable-stack: true
    stack-version: latest
    cabal-version: latest
    cabal-update: true
  env:
    CACHE_VERSION: v6
  
Preparing to setup a Haskell environment
Resolved ghc 9.2 to 9.2.8
Resolved cabal latest to 3.10.1.0
Resolved stack latest to 2.13.1
Preparing ghc environment
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup unset ghc
  [ Info  ] GHC successfully unset
Installing ghc version 9.2.8
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup whereis ghc 9.2.8
  [ Error ] [�
  
  
  Attempting to access tool ghc at location /Users/runner/.ghcup/bin
  Succeeded accessing tool ghc at location /Users/runner/.ghcup/bin
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup set ghc 9.2.8
  [ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /Users/runner/.ghcup/cache/ghcup-0.0.7.yaml
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  100  306k  100  306k    0     0  4908k      0 --:--:-- --:--:-- --:--:-- 5673k
  [ Error ] [�
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup unset ghc
  [ Info  ] GHC successfully unset
  Attempting to install ghc 9.2.8 using ghcup
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup install ghc 9.2.8
  [ Info  ] downloading: https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-x86_64-apple-darwin.tar.xz as file /Users/runner/.ghcup/tmp/ghcup-95ebcf9d9beaedd5/ghc-9.2.8-x86_64-apple-darwin.tar.xz
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   40  169M   40 68.1M    0     0  79.0M      0  0:00:02 --:--:--  0:00:02 79.3M
   84  169M   84  144M    0     0  78.3M      0  0:00:02  0:00:01  0:00:01 78.4M
  100  169M  100  169M    0     0  78.3M      0  0:00:02  0:00:02 --:--:-- 78.5M
  [ Info  ] verifying digest of: ghc-9.2.8-x86_64-apple-darwin.tar.xz
  [ Info  ] Unpacking: ghc-9.2.8-x86_64-apple-darwin.tar.xz to /Users/runner/.ghcup/tmp/ghcup-760615249947cfaa
  [ Info  ] Installing GHC (this may take a while)
  
  
 
  
  
  [ Info  ] Merging file tree from "/Users/runner/.ghcup/tmp/ghcup-4819e735bb1f57fa/Users/runner/.ghcup/ghc/9.2.8" to "/Users/runner/.ghcup/ghc/9.2.8"
  [ Info  ] GHC installation successful
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup set ghc 9.2.8
  [ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.6.3'
  [ Info  ] GHC 9.2.8 successfully set as default version
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup whereis ghc 9.2.8
  /Users/runner/.ghcup/ghc/9.2.8/bin/ghc
  
  Attempting to access tool ghc at location /Users/runner/.ghcup/bin
  Succeeded accessing tool ghc at location /Users/runner/.ghcup/bin
  /Users/runner/hostedtoolcache/ghcup/0.1.19.5/arm64/ghcup set ghc 9.2.8
  [ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.6.3'
  [ Info  ] GHC 9.2.8 successfully set as default version
  Found ghc 9.2.8 in cache at path /Users/runner/.ghcup/bin. Setup successful.

(full log here)

@elopez
Copy link
Contributor Author

elopez commented Oct 2, 2023

I was able to get a working build with the changes in #47, example run here

andreasabel pushed a commit that referenced this issue Dec 1, 2023
This enables native compilations on M1 Mac runners.

Closes: #46
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

Successfully merging a pull request may close this issue.

1 participant