diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 31066604616..00000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,126 +0,0 @@ -stages: - - build - -variables: - # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: "a9297a370025101b479cfd4977f8f910814e03ab" - - GHC_VERSION: 9.6.4 - CABAL_INSTALL_VERSION: 3.10.2.0 - -workflow: - rules: - - if: $CI_COMMIT_TAG - when: always - # Triggered if you start it from the gitlab web ui - - if: '$CI_PIPELINE_SOURCE == "web"' - when: always - - when: never - -.build: - stage: build - script: - - bash .gitlab/ci.sh - artifacts: - expire_in: 2 week - paths: - - out/* - -linux: - extends: .build - parallel: - matrix: - - ARCH: i386 - TAG: x86_64-linux - OS: - - deb9 - - deb10 - - ARCH: x86_64 - TAG: x86_64-linux - OS: - - centos7 - - deb9 - - deb10 - - deb11 - - deb12 - - fedora33 - - fedora36 - - fedora38 - - rocky8 - - ubuntu18_04 - - ubuntu20_04 - - ubuntu22_04 - - ARCH: aarch64 - TAG: aarch64-linux - OS: - - deb10 - - deb11 - - deb12 - tags: - - $TAG - image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV" - variables: - PLATFORM: "${ARCH}-linux-${OS}" - TARBALL_ARCHIVE_SUFFIX: $PLATFORM - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "--enable-split-sections" - -alpine-linux: - extends: .build - parallel: - matrix: - - ARCH: [i386, x86_64] - OS: [alpine3_12, alpine3_15, alpine3_17] - TAG: x86_64-linux - # Was 3_18 for i386 intentionally left off? - - ARCH: x86_64 - OS: alpine3_18 - TAG: x86_64-linux - - ARCH: [aarch64] - OS: [alpine3_18] - TAG: aarch64-linux - tags: - - $TAG - before_script: - # for cabal build - - sudo apk add --no-cache zlib zlib-dev zlib-static - image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV" - variables: - PLATFORM: "${ARCH}-linux-${OS}" - TARBALL_ARCHIVE_SUFFIX: $PLATFORM - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" - -darwin: - extends: .build - parallel: - matrix: - # Help me with names pls - - ARCH: x86_64 - ARCHARCH: x86_64 - - ARCH: aarch64 - ARCHARCH: arm64 - tags: - - ${ARCH}-darwin-m1 - variables: - # 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: "" - script: - - arch -${ARCHARCH} /bin/bash .gitlab/ci.sh - -x86_64-windows: - extends: .build - script: - - $env:CHERE_INVOKING = "yes" - - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh" - tags: - - new-x86_64-windows - variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-windows - TARBALL_EXT: zip - ADD_CABAL_ARGS: "" - retry: 2 diff --git a/.gitlab/brew.sh b/.gitlab/brew.sh deleted file mode 100644 index b2771811d47..00000000000 --- a/.gitlab/brew.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -# Install brew locally in the project dir. Packages will also be installed here. -# FIXME: Use brew in supported way. See -# https://docs.brew.sh/Installation#untar-anywhere-unsupported -brew_dir="${CI_PROJECT_DIR}/.brew" - -if [ ! -e "${brew_dir}" ]; then - mkdir -p "${brew_dir}" - curl --fail -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}" -fi - -export PATH="${brew_dir}/bin:${brew_dir}/sbin:$PATH" - -# make sure to not pollute the machine with temp files etc -mkdir -p $CI_PROJECT_DIR/.brew_cache -export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache -mkdir -p $CI_PROJECT_DIR/.brew_logs -export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs -mkdir -p /private/tmp/.brew_tmp -export HOMEBREW_TEMP=/private/tmp/.brew_tmp - -# update and install packages -brew update -brew install ${1+"$@"} diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh deleted file mode 100755 index 1515a6afe22..00000000000 --- a/.gitlab/ci.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -source "$CI_PROJECT_DIR/.gitlab/common.sh" - -if [[ "$(uname)" == "Linux" ]]; then - export PATH="/opt/ghc/${GHC_VERSION}/bin:${PATH}" -# Not all runners use ci-images, so ghcup is used. -else - . "$CI_PROJECT_DIR/.gitlab/ghcup.sh" -fi - -export CABAL_DIR="$CI_PROJECT_DIR/cabal" - -case "$(uname)" in - MSYS_*|MINGW*) - export CABAL_DIR="$(cygpath -w "$CABAL_DIR")" - EXE_EXT=".exe" - ;; - *) - EXE_EXT="" - ;; -esac - -mkdir -p "$CABAL_DIR" - -# https://github.com/haskell/cabal/issues/7313#issuecomment-811851884 -# and -# https://github.com/haskellari/lukko/issues/17 -# -# $PLATFORM comes from CI. -if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7" ] ; then - echo 'constraints: lukko -ofd-locking' >> cabal.release.project.local -fi - -# In February 2024, cabal started using zlib-0.7.0.0, which uses pkg-config by -# default. The GitLab CI environment doesn't (yet) supply pkg-config, and zlib -# does just fine without it on modern GHCs. That said, the CI environment -# probably *should* have pkg-config installed. See -# https://github.com/haskell/cabal/issues/9774. -echo 'constraints: zlib -pkg-config' >> cabal.release.project.local -# Furthermore, on Windows, zlib claims that libz is shipped with GHC, so it just -# uses @extra-libraries: z@ if pkg-config is False. If you are reading this -# comment, however, this didn't work. Thus we switch to using the bundled libz, -# as was done in zlib <0.7.0.0. -case "$(uname)" in - MSYS_*|MINGW*) - echo 'constraints: zlib +bundled-c-zlib' >> cabal.release.project.local - ;; -esac - -args=( - --disable-profiling - --enable-executable-stripping - --project-file=cabal.release.project - ${ADD_CABAL_ARGS} -) - -run cabal update hackage.haskell.org,HEAD -run cabal v2-build ${args[@]} cabal-install - -mkdir "$CI_PROJECT_DIR/out" -cp "$(cabal list-bin ${args[@]} cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$EXE_EXT" -cp dist-newstyle/cache/plan.json "$CI_PROJECT_DIR/out/plan.json" -cd "$CI_PROJECT_DIR/out/" - -# create tarball/zip -TARBALL_PREFIX="cabal-install-$("$CI_PROJECT_DIR/out/cabal" --numeric-version)" -case "${TARBALL_EXT}" in - zip) - zip "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json - ;; - tar.xz) - tar caf "${TARBALL_PREFIX}-${TARBALL_ARCHIVE_SUFFIX}.${TARBALL_EXT}" "cabal${EXE_EXT}" plan.json - ;; - *) - fail "Unknown TARBALL_EXT: ${TARBALL_EXT}" - ;; -esac - -rm cabal plan.json diff --git a/.gitlab/common.sh b/.gitlab/common.sh deleted file mode 100644 index b6bce698c91..00000000000 --- a/.gitlab/common.sh +++ /dev/null @@ -1,49 +0,0 @@ -# Common bash utilities -# ---------------------- - -# Colors -BLACK="0;30" -GRAY="1;30" -RED="0;31" -LT_RED="1;31" -BROWN="0;33" -LT_BROWN="1;33" -GREEN="0;32" -LT_GREEN="1;32" -BLUE="0;34" -LT_BLUE="1;34" -PURPLE="0;35" -LT_PURPLE="1;35" -CYAN="0;36" -LT_CYAN="1;36" -WHITE="1;37" -LT_GRAY="0;37" - -# GitLab Pipelines log section delimiters -# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664 -start_section() { - name="$1" - echo -e "section_start:$(date +%s):$name\015\033[0K" -} - -end_section() { - name="$1" - echo -e "section_end:$(date +%s):$name\015\033[0K" -} - -echo_color() { - local color="$1" - local msg="$2" - echo -e "\033[${color}m${msg}\033[0m" -} - -error() { echo_color "${RED}" "$1"; } -warn() { echo_color "${LT_BROWN}" "$1"; } -info() { echo_color "${LT_BLUE}" "$1"; } - -fail() { error "error: $1"; exit 1; } - -function run() { - info "Running $*..." - "$@" || ( error "$* failed"; return 1; ) -} diff --git a/.gitlab/ghcup.sh b/.gitlab/ghcup.sh deleted file mode 100644 index 98a8b433b79..00000000000 --- a/.gitlab/ghcup.sh +++ /dev/null @@ -1,38 +0,0 @@ -export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain" - -case "$(uname)" in - MSYS_*|MINGW*) - GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin" - ;; - *) - GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin" - ;; -esac - -mkdir -p "$GHCUP_BINDIR" -export PATH="$GHCUP_BINDIR:$PATH" - -export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 -export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION -export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_INSTALL_VERSION -export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes -# We don't use stack, and it isn't available on i386-deb9 -export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes - -# for some reason the subshell doesn't pick up the arm64 environment on darwin -# and starts installing x86_64 GHC -case "$(uname -s)" in - "Darwin"|"darwin") - case "$(/usr/bin/arch)" in - aarch64|arm64|armv8l) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash - ;; - *) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - ;; - esac - ;; - *) - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh - ;; -esac