Skip to content

Commit

Permalink
Rework Darwin jobs
Browse files Browse the repository at this point in the history
* Use `arch` explicitly in both jobs. I don't know why x86_64 is the
  default, and I don't like it.

* Stop using brew. This means a toolchain needs to already be installed
  where CI is run. This is the case today, although it's a bit fragile
  and I'll probably revisit it.

* Use a matrix build to clean up the yml.

* Use GHC 9.8.2 to work around GHC#24050

(cherry picked from commit 1f60a97)
  • Loading branch information
chreekat authored and mergify[bot] committed Apr 16, 2024
1 parent 155541d commit cb290f1
Showing 1 changed file with 15 additions and 37 deletions.
52 changes: 15 additions & 37 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,48 +91,26 @@ alpine-linux:
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"

build-x86_64-darwin:
darwin:
extends: .build
parallel:
matrix:
# Help me with names pls
- ARCH: x86_64
ARCHARCH: x86_64
- ARCH: aarch64
ARCHARCH: arm64
tags:
- x86_64-darwin
variables:
TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""

build-aarch64-darwin:
stage: build
tags:
- aarch64-darwin-m1
before_script:
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
- arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
# C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
script: |
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
export LD=ld
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
arch -arm64 /bin/bash ./.gitlab/ci.sh
after_script:
- rm -Rf /private/tmp/.brew_tmp
- ${ARCH}-darwin-m1
variables:
MACOSX_DEPLOYMENT_TARGET: "10.7"
TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
# Using 9.8.2 to work around
# https://gitlab.haskell.org/ghc/ghc/-/issues/24050
GHC_VERSION: 9.8.2
TARBALL_ARCHIVE_SUFFIX: ${ARCH}-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
# Update periodically.
BREW_VERSION: 4.0.5
artifacts:
expire_in: 2 week
paths:
- out/*
cache:
paths:
- .brew
script:
- arch -${ARCHARCH} /bin/bash .gitlab/ci.sh

x86_64-windows:
extends: .build
Expand Down

0 comments on commit cb290f1

Please sign in to comment.