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

Add aarch64-linux bindist CI job and mirroring logic #18

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/aarch64-linux-bindist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: ghc-wasm-aarch64-linux-bindist

on:
pull_request:
paths:
- .github/workflows/aarch64-linux-bindist.yml
workflow_dispatch:
schedule:
- cron: '0 6 * * 0'

jobs:
ghc-wasm-aarch64-linux-bindist:
name: ghc-wasm-aarch64-linux-bindist
runs-on: makima
steps:

- name: update-system-deps
run: |
sudo dnf upgrade -y

- name: setup-haskell
uses: haskell-actions/setup@v2

- name: setup-cabal-deps
run: |
cabal install \
--overwrite-policy=always \
alex \
happy

- name: setup-ghc-wasm-meta
run: |
curl https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/raw/master/bootstrap.sh | PREFIX=${{ runner.temp }}/.ghc-wasm SKIP_GHC=1 sh
${{ runner.temp }}/.ghc-wasm/add_to_github_path.sh

- name: build-hadrian
working-directory: ${{ runner.temp }}
run: |
git clone --depth=1 --recurse-submodules --shallow-submodules --jobs 32 https://gitlab.haskell.org/ghc/ghc.git
cd ghc
./hadrian/build --version

- name: configure-ghc
working-directory: ${{ runner.temp }}/ghc
run: |
./boot
./configure $CONFIGURE_ARGS

- name: build-ghc
working-directory: ${{ runner.temp }}/ghc
run: |
hadrian/build --no-color --no-progress --no-time --flavour=perf --hash-unit-ids --docs=none -j binary-dist-dir test:all_deps _build/stage0/bin/wasm32-wasi-{haddock,hpc,runghc}

- name: build-bindist
working-directory: ${{ runner.temp }}/ghc
run: |
BINDIST_NAME=$(basename _build/bindist/*)
gtar --sort=name --mtime="@$(git log -1 --pretty=%ct)" --owner=0 --group=0 --numeric-owner --use-compress-program="zstd --ultra -22 --threads=0" -cf _build/bindist/$BINDIST_NAME.tar.zst -C _build/bindist $BINDIST_NAME

- name: upload-bindist
uses: actions/upload-artifact@v4
with:
name: ghc-wasm-aarch64-linux-bindist
path: ${{ runner.temp }}/ghc/_build/bindist/*.tar.zst

- name: test-ghc
working-directory: ${{ runner.temp }}/ghc
run: |
hadrian/build --no-color --no-progress --no-time --flavour=perf --hash-unit-ids --docs=none -j test
12 changes: 12 additions & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,18 @@ bindistInfos =
artifactName = "ghc-wasm-x86_64-darwin-bindist"
}
},
(,)
"wasm32-wasi-ghc-gmp-aarch64-linux"
BindistInfo
{ isGhcBindist = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only noticing this now: We currently can't set this to True for the GHA-built bindists for at least two reasons:

  • The GHA bindists use zstd instead of lzma, and the current ghc subdir logic only supports lzma (should be easy to fix).
  • GHA artifacts are wrapped in another .zip layer, so that would also have to be removed.

However, fixing this isn't a big priority; this mechanism was added in #6 mostly as convenient metadata for downstream consumers like ghcup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. We should definitely remove the zip layer, though I believe this is better suited for a follow-up PR. As for zstd, it's largely my personal preference, we can also fix subdir logic for it later.

src =
GitHubArtifact
{ ownerRepo = "tweag/ghc-wasm-bindists",
branch = "main",
workflowName = "ghc-wasm-aarch64-linux-bindist",
artifactName = "ghc-wasm-aarch64-linux-bindist"
}
},
(,)
"wasi-sdk"
BindistInfo
Expand Down