Compare commits
No commits in common. "develop" and "CI" have entirely different histories.
28
.github/scripts/brew.sh
vendored
28
.github/scripts/brew.sh
vendored
@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. .github/scripts/env.sh
|
||||
|
||||
if [ -e "$HOME/.brew" ] ; then
|
||||
(
|
||||
cd "$HOME/.brew"
|
||||
git fetch --depth 1
|
||||
git reset --hard origin/master
|
||||
)
|
||||
else
|
||||
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
||||
fi
|
||||
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
||||
|
||||
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
|
||||
|
||||
#brew update
|
||||
brew install ${1+"$@"}
|
||||
|
66
.github/scripts/build.sh
vendored
66
.github/scripts/build.sh
vendored
@ -1,66 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. .github/scripts/env.sh
|
||||
# shellcheck disable=SC1091
|
||||
. .github/scripts/common.sh
|
||||
|
||||
uname -a
|
||||
uname -p
|
||||
uname
|
||||
pwd
|
||||
env
|
||||
|
||||
# ensure ghcup
|
||||
install_ghcup
|
||||
|
||||
# build
|
||||
ghcup install ghc "${GHC_VERSION}"
|
||||
ghcup set ghc "${GHC_VERSION}"
|
||||
sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project
|
||||
ecabal update
|
||||
ecabal user-config diff
|
||||
ecabal user-config init -f
|
||||
"ghc-${GHC_VERSION}" --info
|
||||
"ghc" --info
|
||||
|
||||
# https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
|
||||
if [ "$(getconf LONG_BIT)" == "32" ] || [ "${DISTRO}" == "CentOS" ] ; then
|
||||
echo 'constraints: lukko -ofd-locking' >> cabal.project.release.local
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2206
|
||||
args=(
|
||||
-w "ghc-$GHC_VERSION"
|
||||
--disable-profiling
|
||||
--enable-executable-stripping
|
||||
--project-file=cabal.project.release
|
||||
${ADD_CABAL_ARGS}
|
||||
)
|
||||
|
||||
run cabal v2-build "${args[@]}" cabal-install
|
||||
|
||||
mkdir -p "$CI_PROJECT_DIR/out"
|
||||
# shellcheck disable=SC2154
|
||||
cp "$(cabal list-bin "${args[@]}" cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$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}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
|
||||
;;
|
||||
tar.xz)
|
||||
tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
|
||||
;;
|
||||
*)
|
||||
fail "Unknown TARBALL_EXT: ${TARBALL_EXT}"
|
||||
;;
|
||||
esac
|
||||
|
||||
rm cabal plan.json
|
||||
|
110
.github/scripts/common.sh
vendored
110
.github/scripts/common.sh
vendored
@ -1,110 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. .github/scripts/env.sh
|
||||
|
||||
# Colors
|
||||
RED="0;31"
|
||||
LT_BROWN="1;33"
|
||||
LT_BLUE="1;34"
|
||||
|
||||
ecabal() {
|
||||
cabal "$@"
|
||||
}
|
||||
|
||||
nonfatal() {
|
||||
"$@" || "$* failed"
|
||||
}
|
||||
|
||||
sha_sum() {
|
||||
if [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
||||
sha256 "$@"
|
||||
else
|
||||
sha256sum "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
git_describe() {
|
||||
git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*"
|
||||
git describe --always
|
||||
}
|
||||
|
||||
install_ghcup() {
|
||||
# find "$GHCUP_INSTALL_BASE_PREFIX"
|
||||
mkdir -p "$GHCUP_BIN"
|
||||
mkdir -p "$GHCUP_BIN"/../cache
|
||||
|
||||
if [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
||||
curl -o ghcup https://downloads.haskell.org/ghcup/tmp/x86_64-portbld-freebsd-ghcup-0.1.18.1
|
||||
chmod +x ghcup
|
||||
mv ghcup "$HOME/.local/bin/ghcup"
|
||||
else
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
||||
source "$(dirname "${GHCUP_BIN}")/env"
|
||||
ghcup install cabal --set "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
strip_binary() {
|
||||
(
|
||||
set -e
|
||||
local binary=$1
|
||||
case "$(uname -s)" in
|
||||
"Darwin"|"darwin")
|
||||
;;
|
||||
MSYS_*|MINGW*)
|
||||
;;
|
||||
*)
|
||||
strip -s "${binary}"
|
||||
;;
|
||||
esac
|
||||
)
|
||||
}
|
||||
|
||||
# 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; }
|
||||
|
||||
run() {
|
||||
info "Running $*..."
|
||||
"$@" || ( error "$* failed"; return 1; )
|
||||
}
|
||||
|
||||
emake() {
|
||||
if command -v gmake >/dev/null 2>&1 ; then
|
||||
gmake "$@"
|
||||
else
|
||||
make "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
mktempdir() {
|
||||
case "$(uname -s)" in
|
||||
"Darwin"|"darwin")
|
||||
mktemp -d -t cabal_ci.XXXXXXX
|
||||
;;
|
||||
*)
|
||||
mktemp -d
|
||||
;;
|
||||
esac
|
||||
}
|
38
.github/scripts/env.sh
vendored
38
.github/scripts/env.sh
vendored
@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p "$HOME"/.local/bin
|
||||
|
||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
||||
ext=".exe"
|
||||
else
|
||||
# shellcheck disable=SC2034
|
||||
ext=''
|
||||
fi
|
||||
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
|
||||
export BOOTSTRAP_HASKELL_CABAL_VERSION="${CABAL_VER:-3.6.2.0-p2}"
|
||||
export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=no
|
||||
export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes
|
||||
export BOOTSTRAP_HASKELL_ADJUST_BASHRC=1
|
||||
|
||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
||||
# on windows use pwd to get unix style path
|
||||
CI_PROJECT_DIR="$(pwd)"
|
||||
export CI_PROJECT_DIR
|
||||
export GHCUP_INSTALL_BASE_PREFIX="/c"
|
||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
|
||||
export PATH="$GHCUP_BIN:$PATH"
|
||||
export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
|
||||
else
|
||||
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
|
||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
|
||||
export PATH="$GHCUP_BIN:$PATH"
|
||||
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
|
||||
export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache"
|
||||
fi
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export TZ=Asia/Singapore
|
242
.github/workflows/bindists.yaml
vendored
242
.github/workflows/bindists.yaml
vendored
@ -1,242 +0,0 @@
|
||||
name: Bindist installation
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tool:
|
||||
description: Tool
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
description: Version
|
||||
required: true
|
||||
type: string
|
||||
metadataFile:
|
||||
description: Metadata file
|
||||
required: true
|
||||
default: ghcup-0.0.8.yaml
|
||||
type: string
|
||||
channel:
|
||||
description: Distribution channel (main|prerelease|nightly)
|
||||
required: true
|
||||
default: Main
|
||||
type: string
|
||||
env:
|
||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
||||
BOOTSTRAP_HASKELL_MINIMAL: 1
|
||||
BOOTSTRAP_HASKELL_ADJUST_BASHRC: 1
|
||||
TOOL: ${{ github.event.inputs.tool }}
|
||||
VERSION: ${{ github.event.inputs.version }}
|
||||
METADATA_FILE: ${{ github.event.inputs.metadataFile }}
|
||||
CHANNEL: ${{ github.event.inputs.channel }}
|
||||
jobs:
|
||||
bindist-install:
|
||||
name: linux-${{ matrix.image }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- image: alpine:latest
|
||||
installCmd: apk update && apk add
|
||||
toolRequirements: binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz
|
||||
- image: debian:10
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev
|
||||
- image: debian:11
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev
|
||||
- image: debian:12
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev
|
||||
- image: debian:unstable
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 libnuma-dev
|
||||
- image: ubuntu:16.04
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: ubuntu:18.04
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: ubuntu:20.04
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: ubuntu:22.04
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: archlinux:latest
|
||||
installCmd: pacman -Syu --noconfirm
|
||||
toolRequirements: which gcc gmp libffi make ncurses perl tar xz
|
||||
- image: fedora:27
|
||||
installCmd: dnf install -y
|
||||
toolRequirements: which findutils gcc gcc-c++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
||||
- image: fedora:37
|
||||
installCmd: dnf install -y
|
||||
toolRequirements: which gcc g++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
||||
- image: rockylinux:8
|
||||
installCmd: dnf install -y
|
||||
toolRequirements: which findutils gcc gcc-c++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
||||
- image: rockylinux:9
|
||||
installCmd: dnf install -y --allowerasing
|
||||
toolRequirements: which findutils gcc gcc-c++ gmp gmp-devel make ncurses xz perl
|
||||
- image: linuxmintd/mint19.3-amd64
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: linuxmintd/mint20.3-amd64
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: linuxmintd/mint21.3-amd64
|
||||
installCmd: apt-get update && apt-get install -y
|
||||
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
||||
- image: ghcr.io/void-linux/void-glibc-full:latest
|
||||
installCmd: xbps-install -Suy && xbps-install -y
|
||||
toolRequirements: binutils curl gcc gmp-devel glibc-devel libffi-devel make ncurses-devel ncurses-libtinfo-libs perl tar xz
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Install requirements
|
||||
shell: sh
|
||||
run: |
|
||||
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }}
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install ghcup and bindist
|
||||
run: .github/workflows/install-bindist.sh
|
||||
|
||||
bindist-install-mac-win:
|
||||
name: Build non-linux
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: [self-hosted, macOS, ARM64]
|
||||
- os: macos-11
|
||||
- os: macos-12
|
||||
- os: windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
name: Install ghcup and bindist
|
||||
run: .github/workflows/install-bindist.sh
|
||||
|
||||
bindist-install-arm:
|
||||
name: Build ARM binary
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: [self-hosted, Linux, ARM64, maerwald]
|
||||
ARCH: ARM
|
||||
- os: [self-hosted, Linux, ARM64, maerwald]
|
||||
ARCH: ARM64
|
||||
steps:
|
||||
- uses: docker://arm64v8/ubuntu:focal
|
||||
name: Cleanup (aarch64 linux)
|
||||
with:
|
||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*"
|
||||
shell: bash
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- if: matrix.ARCH == 'ARM'
|
||||
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal
|
||||
name: Run build (armv7 linux)
|
||||
with:
|
||||
args: sh -c '.github/workflows/install-bindist.sh'
|
||||
|
||||
- if: matrix.ARCH == 'ARM64'
|
||||
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
|
||||
name: Run build (aarch64 linux)
|
||||
with:
|
||||
args: sh -c '.github/workflows/install-bindist.sh'
|
||||
|
||||
bindist-install-freebsd:
|
||||
name: Install FreeBSD binary
|
||||
runs-on: [self-hosted, FreeBSD, X64]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Run build
|
||||
run: .github/workflows/install-bindist.sh
|
||||
|
||||
validate:
|
||||
name: ghcup-gen check
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GHC: 9.2.8
|
||||
CABAL: 3.10.1.0
|
||||
steps:
|
||||
- name: create ~/.local/bin
|
||||
run: mkdir -p "$HOME/.local/bin"
|
||||
shell: bash
|
||||
|
||||
- name: Add ~/.local/bin to PATH
|
||||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
|
||||
- name: install yamllint
|
||||
run: pip install yamllint
|
||||
|
||||
- name: Update cabal cache
|
||||
run: cabal update
|
||||
shell: bash
|
||||
|
||||
- name: Install requirements
|
||||
shell: sh
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export TZ=Asia/Singapore
|
||||
sudo apt-get update && sudo apt-get install -y curl bash git gnupg libarchive-dev
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache Cabal
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-cabal
|
||||
with:
|
||||
path: |
|
||||
~/.cabal/store
|
||||
~/.cabal/packages
|
||||
key: v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-${{ hashFiles('cabal.project') }}
|
||||
restore-keys: |
|
||||
v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-${{ hashFiles('cabal.project') }}
|
||||
v2-${{ runner.os }}-${{ env.GHC }}-${{ env.CABAL }}-build-
|
||||
v2-${{ runner.os }}-${{ env.GHC }}
|
||||
|
||||
- name: Install ghcup-gen
|
||||
run: |
|
||||
ghcup run --cabal 3.10.1.0 --ghc 9.2.8 --install -- cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
|
||||
shell: bash
|
||||
|
||||
- name: Check yaml
|
||||
run: |
|
||||
ghcup-gen -- check -f ${{ env.METADATA_FILE }} --channel ${{ env.CHANNEL }}
|
||||
yamllint ${{ env.METADATA_FILE }}
|
||||
python3 -c "import yaml ; stream = open('${{ env.METADATA_FILE }}', 'r') ; yaml.safe_load(stream)"
|
||||
shell: bash
|
||||
|
||||
signature-test:
|
||||
name: Test signatures
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install requirements
|
||||
shell: sh
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y curl bash git gnupg
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Test signatures
|
||||
run: .github/workflows/test-sigs.sh
|
30
.github/workflows/common.sh
vendored
30
.github/workflows/common.sh
vendored
@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
||||
ext=".exe"
|
||||
else
|
||||
ext=''
|
||||
fi
|
||||
|
||||
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; }
|
||||
|
||||
mktempdir() {
|
||||
case "$(uname -s)" in
|
||||
"Darwin"|"darwin")
|
||||
mktemp -d -t hls_ci.XXXXXXX
|
||||
;;
|
||||
*)
|
||||
mktemp -d
|
||||
;;
|
||||
esac
|
||||
}
|
146
.github/workflows/install-bindist.sh
vendored
146
.github/workflows/install-bindist.sh
vendored
@ -1,146 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -x
|
||||
set -eo pipefail
|
||||
|
||||
. .github/workflows/common.sh
|
||||
|
||||
export GHCUP_INSTALL_BASE_PREFIX=$RUNNER_TEMP/foobarbaz
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/haskell/ghcup-hs/master/scripts/bootstrap/bootstrap-haskell | sh
|
||||
|
||||
source "$GHCUP_INSTALL_BASE_PREFIX"/.ghcup/env || source "$HOME/.bashrc"
|
||||
|
||||
ghcup --version
|
||||
which ghcup | grep foobarbaz
|
||||
|
||||
ghcup_fun() {
|
||||
case "$(uname -s)" in
|
||||
MSYS_*|MINGW*)
|
||||
ghcup -v --url-source="file:${GITHUB_WORKSPACE//\\//}/$METADATA_FILE" "$@"
|
||||
;;
|
||||
*)
|
||||
ghcup -v --url-source="file://${GITHUB_WORKSPACE}/$METADATA_FILE" "$@"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
case $TOOL in
|
||||
ghcup)
|
||||
ghcup_fun upgrade --force
|
||||
;;
|
||||
*) ghcup_fun install "$TOOL" --set "$VERSION"
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir -p /tmp/install-bindist-ci
|
||||
cd /tmp/install-bindist-ci
|
||||
|
||||
trap 'rm -rf -- /tmp/install-bindist-ci' EXIT
|
||||
|
||||
cat <<EOF > main.hs
|
||||
{- cabal:
|
||||
build-depends: base
|
||||
-}
|
||||
|
||||
main = print $ 1 + 1
|
||||
EOF
|
||||
|
||||
case $TOOL in
|
||||
ghcup)
|
||||
ghcup_fun list
|
||||
;;
|
||||
hls)
|
||||
ghcup_fun install cabal latest
|
||||
ghcup_fun install ghc --set recommended
|
||||
cabal update
|
||||
|
||||
test_package="bytestring-0.11.1.0"
|
||||
test_module="Data/ByteString.hs"
|
||||
|
||||
create_cradle() {
|
||||
echo "cradle:" > hie.yaml
|
||||
echo " cabal:" >> hie.yaml
|
||||
}
|
||||
|
||||
enter_test_package() {
|
||||
local tmp_dir
|
||||
tmp_dir=$(mktempdir)
|
||||
cd "$tmp_dir"
|
||||
cabal unpack "${test_package}"
|
||||
cd "${test_package}"
|
||||
}
|
||||
|
||||
# For all HLS GHC versions and the wrapper, run 'typecheck'
|
||||
# over the $test_module
|
||||
test_all_hls() {
|
||||
local bin
|
||||
local bin_noexe
|
||||
local bindir
|
||||
local hls
|
||||
bindir=$1
|
||||
|
||||
for hls in "${bindir}/"haskell-language-server-* ; do
|
||||
bin=${hls##*/}
|
||||
bin_noexe=${bin/.exe/}
|
||||
if ! [[ "${bin_noexe}" =~ "haskell-language-server-wrapper" ]] && ! [[ "${bin_noexe}" =~ "~" ]] && ! [[ "${bin_noexe}" =~ ".shim" ]] ; then
|
||||
if ghcup_fun install ghc --set "${bin_noexe/haskell-language-server-/}" ; then
|
||||
"${hls}" typecheck "${test_module}" || fail "failed to typecheck with HLS for GHC ${bin_noexe/haskell-language-server-/}"
|
||||
else
|
||||
fail "GHCup failed to install GHC ${bin_noexe/haskell-language-server-/}"
|
||||
fi
|
||||
ghcup_fun rm ghc "${bin_noexe/haskell-language-server-/}"
|
||||
fi
|
||||
done
|
||||
ghcup_fun install ghc --set recommended
|
||||
"$bindir/haskell-language-server-wrapper${ext}" typecheck "${test_module}" || fail "failed to typecheck with HLS wrapper"
|
||||
}
|
||||
|
||||
enter_test_package
|
||||
create_cradle
|
||||
case "$(uname -s)" in
|
||||
MSYS_*|MINGW*)
|
||||
test_all_hls "$(dirname "$(which ghcup)")"
|
||||
;;
|
||||
*)
|
||||
test_all_hls "$(ghcup whereis bindir)"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ghc)
|
||||
ghc --version
|
||||
ghc --info
|
||||
ghc -prof main.hs
|
||||
[[ $(./main +RTS -s) -eq 2 ]]
|
||||
ghcup install cabal recommended
|
||||
cabal --version
|
||||
cabal update
|
||||
case "${CHANNEL}" in
|
||||
Prerelease|prereleasee)
|
||||
cabal install --lib --package-env=. --allow-newer clock
|
||||
# https://github.com/haskell/ghcup-hs/issues/966
|
||||
cabal install --lib --package-env=. --allow-newer --constraint='filepath <1.5' hashable
|
||||
;;
|
||||
*)
|
||||
cabal install --lib --package-env=. clock
|
||||
# https://github.com/haskell/ghcup-hs/issues/966
|
||||
cabal install --lib --package-env=. hashable
|
||||
;;
|
||||
esac
|
||||
case "$(uname -s)" in
|
||||
MSYS_*|MINGW*)
|
||||
;;
|
||||
*)
|
||||
[[ -e "$(ghcup whereis --directory ghc "$VERSION")/../share/man/man1/ghc.1" ]]
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
cabal)
|
||||
ghcup_fun install ghc --set "$(ghcup_fun list -t ghc -r -c available | tail -1 | awk '{ print $2 }')"
|
||||
cabal --version
|
||||
cabal update
|
||||
[[ $(cabal --verbose=0 run --enable-profiling ./main.hs -- +RTS -s) -eq 2 ]]
|
||||
;;
|
||||
*)
|
||||
$TOOL --version
|
||||
;;
|
||||
esac
|
6
.github/workflows/sigs
vendored
6
.github/workflows/sigs
vendored
@ -1,6 +0,0 @@
|
||||
keys=(
|
||||
7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C # Julian Ospald <maerwald@hasufell.de>
|
||||
FFEB7CE81E16A36B3E2DED6F2DE04D4E97DB64AD # Ben Gamari <ben@well-typed.com>
|
||||
88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4 # Zubin Duggal <zubin@well-typed.com>
|
||||
EAF2A9A722C0C96F2B431CA511AAD8CEDEE0CAEF # Hécate <hecate@glitchbra.in>
|
||||
)
|
27
.github/workflows/test-sigs.sh
vendored
27
.github/workflows/test-sigs.sh
vendored
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -eo pipefail
|
||||
|
||||
. .github/workflows/common.sh
|
||||
|
||||
get_key() {
|
||||
local key=$1
|
||||
local server=$2
|
||||
gpg --batch --keyserver "${server}" --recv-keys "${key}"
|
||||
echo -e "${key}:6:" | gpg --import-ownertrust
|
||||
}
|
||||
|
||||
# verify signature
|
||||
. .github/workflows/sigs
|
||||
|
||||
for key in "${keys[@]}" ; do
|
||||
get_key "${key}" keys.openpgp.org || get_key "${key}" keyserver.ubuntu.com
|
||||
done
|
||||
unset key
|
||||
gpg --verify "${METADATA_FILE}.sig"
|
||||
|
||||
for f in ghcup-*.json ghcup-*.yaml hls-metadata-*.json ; do
|
||||
gpg --verify "${f}.sig"
|
||||
done
|
||||
|
46
.github/workflows/test.yaml
vendored
46
.github/workflows/test.yaml
vendored
@ -2,46 +2,28 @@ name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, develop ]
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master, develop ]
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test metadata
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
YAML_VER: 0.0.7
|
||||
YAML_VER: 0.0.6
|
||||
strategy:
|
||||
matrix:
|
||||
ghc:
|
||||
- '8.10.7'
|
||||
cabal:
|
||||
- '3.6.2.0'
|
||||
os:
|
||||
- ubuntu-22.04
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: haskell/actions/setup@v1.2
|
||||
with:
|
||||
ghc-version: ${{ matrix.ghc }}
|
||||
cabal-version: ${{ matrix.cabal }}
|
||||
|
||||
- name: Cache Cabal
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-cabal
|
||||
with:
|
||||
path: |
|
||||
~/.cabal/store
|
||||
~/.cabal/packages
|
||||
key: v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
|
||||
restore-keys: |
|
||||
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
|
||||
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-
|
||||
v2-${{ runner.os }}-${{ matrix.ghc }}
|
||||
ghc-version: 8.10.7
|
||||
cabal-version: 3.6.2.0
|
||||
|
||||
- name: create ~/.local/bin
|
||||
run: mkdir -p "$HOME/.local/bin"
|
||||
@ -51,30 +33,18 @@ jobs:
|
||||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
|
||||
- name: install yamllint
|
||||
run: pip install yamllint
|
||||
|
||||
- name: Update cabal cache
|
||||
run: cabal update
|
||||
shell: bash
|
||||
|
||||
- name: Install some deps
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export TZ=Asia/Singapore
|
||||
sudo apt install -y libarchive-dev
|
||||
shell: bash
|
||||
|
||||
- name: Install ghcup-gen
|
||||
run: |
|
||||
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
|
||||
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup
|
||||
shell: bash
|
||||
|
||||
- name: Check yaml
|
||||
- name: Check
|
||||
run: |
|
||||
ghcup-gen -- check -f ghcup-${{ env.YAML_VER }}.yaml
|
||||
yamllint ghcup-${{ env.YAML_VER }}.yaml
|
||||
python3 -c "import yaml ; stream = open('ghcup-${{ env.YAML_VER }}.yaml', 'r') ; yaml.safe_load(stream)"
|
||||
shell: bash
|
||||
|
||||
- name: Check tarballs
|
||||
|
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,17 +0,0 @@
|
||||
.ghci
|
||||
.vim
|
||||
codex.tags
|
||||
dist-newstyle/
|
||||
cabal.project.local
|
||||
.stack-work/
|
||||
bin/
|
||||
/*.prof
|
||||
/*.ps
|
||||
/*.hp
|
||||
tags
|
||||
TAGS
|
||||
/tmp/
|
||||
.entangled
|
||||
/release/
|
||||
/releases/
|
||||
site/
|
@ -1,5 +0,0 @@
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length: disable
|
||||
indentation: disable
|
57
README.md
57
README.md
@ -1,62 +1,13 @@
|
||||
# GHCup metadata
|
||||
|
||||
## For end users
|
||||
|
||||
### Metadata variants (distribution channels)
|
||||
|
||||
* `ghcup-A.B.C.yaml`: this is the main metadata and what ghcup uses by default
|
||||
* `ghcup-vanilla-A.B.C.yaml`: this is similar to `ghcup-A.B.C.yaml`, but only uses upstream bindists (no patches/fixes are applied, no missing platforms added)
|
||||
* `ghcup-prereleases-A.B.C.yaml`: this contains pre-releases of all tools
|
||||
* `ghcup-cross-A.B.C.yaml`: this contains experimental cross compilers. See https://www.haskell.org/ghcup/guide/#cross-support for details.
|
||||
|
||||
### Using the metadata
|
||||
|
||||
If you want access to both pre-releases and cross compilers, run:
|
||||
|
||||
```
|
||||
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
|
||||
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-cross-0.0.8.yaml
|
||||
```
|
||||
|
||||
If you want **only** vanilla upstream bindists and opt out of all unofficial stuff, you'd run:
|
||||
|
||||
```sh
|
||||
ghcup config set url-source https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml
|
||||
```
|
||||
|
||||
Also check the [config.yaml documentation](https://github.com/haskell/ghcup-hs/blob/master/data/config.yaml).
|
||||
|
||||
## For contributors
|
||||
|
||||
### Adding a new GHC version
|
||||
## Adding a new GHC version
|
||||
|
||||
1. open the latest `ghcup-<yaml-ver>.yaml`
|
||||
2. find the latest ghc version (in yaml tree e.g. `ghcupDownloads -> GHC -> 8.10.7`)
|
||||
3. copy-paste it
|
||||
4. adjust the version, tags, changelog, source url
|
||||
5. adjust the various bindist urls (make sure to also change the yaml anchors)
|
||||
6. run `cabal run ghcup-gen -- check -f ghcup-<yaml-ver>.yaml`
|
||||
7. run `cabal run ghcup-gen -- check-tarballs -f ghcup-<yaml-ver>.yaml -u 'ghc-8\.10\.8'`
|
||||
8. run `cabal run ghcup-gen -- generate-hls-ghcs -f ghcup-<yaml-ver>.yaml --format json -o hls-metadata-0.0.1.json`
|
||||
9. run `cabal run ghcup-gen -- generate-table -f ghcup-<yaml-ver>.yaml --stdout` and adjust [docs/install](https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/docs/install.md) tables
|
||||
|
||||
### During a pull request
|
||||
|
||||
* make sure to always add new versions to both `ghcup-A.B.C.yaml` and `ghcup-vanilla-A.B.C.yaml`
|
||||
* make sure to run the bindist action to check tool installation on all platforms: https://github.com/haskell/ghcup-metadata/actions/workflows/bindists.yaml
|
||||
- this is a manual pipeline
|
||||
- set the appropriate parameters
|
||||
* make sure to sign the yaml files you edited, e.g.: `gpg --detach-sign -u <your-email> ghcup-0.0.7.yaml` or ask a GHCup developer to sign
|
||||
- PGP pubkeys need to be cross-signed by the GHCup team
|
||||
- they need to be added to the CI: https://github.com/haskell/ghcup-metadata/blob/develop/.github/workflows/sigs
|
||||
- and need to be documented on the homepage
|
||||
* https://github.com/haskell/ghcup-hs/blob/master/docs/guide.md#gpg-verification
|
||||
* https://github.com/haskell/ghcup-hs/blob/master/docs/install.md#unix
|
||||
|
||||
### Understanding tags
|
||||
|
||||
Tags are documented [here](https://github.com/haskell/ghcup-hs/blob/master/lib/GHCup/Types.hs). Search for `data Tag`.
|
||||
Some tags are unique. Uniqueness is checked by `cabal run ghcup-gen -- check -f ghcup-<yaml-ver>.yaml`.
|
||||
|
||||
If you want to check prereleases, do: `cabal run ghcup-gen -- check -f ghcup-prereleases-<yaml-ver>.yaml --channel=prerelease`
|
||||
6. build the `ghcup-gen` binary from the [ghcup repo](https://gitlab.haskell.org/haskell/ghcup-hs)
|
||||
7. run `ghcup-gen -- check -f ghcup-<yaml-ver>.yaml`
|
||||
8. run `ghcup-gen -- check-tarballs -f ghcup-<yaml-ver>.yaml -u 'ghc-8\.10\.8'`
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
packages: ./ghcup-gen/ghcup-gen.cabal
|
||||
|
||||
package ghcup
|
||||
tests: False
|
||||
flags: +tui +no-exe
|
||||
|
||||
source-repository-package
|
||||
type: git
|
||||
location: https://github.com/haskell/ghcup-hs.git
|
||||
tag: 91ef2c7666d118bc6bd7d2fc2eeb7754081a9f3d
|
||||
|
||||
constraints: http-io-streams -brotli,
|
||||
any.aeson >= 2.0.1.0
|
||||
|
||||
package libarchive
|
||||
flags: +system-libarchive
|
||||
|
||||
package aeson-pretty
|
||||
flags: +lib-only
|
||||
|
||||
package cabal-plan
|
||||
flags: -exe
|
||||
|
||||
package aeson
|
||||
flags: +ordered-keymap
|
||||
|
||||
package streamly
|
||||
flags: +use-unliftio
|
@ -2132,39 +2132,43 @@
|
||||
}
|
||||
},
|
||||
"GHCup": {
|
||||
"0.1.19.0": {
|
||||
"0.1.16.2": {
|
||||
"viTags": [
|
||||
"Recommended",
|
||||
"Latest"
|
||||
],
|
||||
"viChangeLog": "https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md",
|
||||
"viChangeLog": "https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md",
|
||||
"viSourceDL": null,
|
||||
"viArch": {
|
||||
"A_64": {
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2",
|
||||
"dlSubdir": null,
|
||||
"dlHash": "d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893"
|
||||
}
|
||||
},
|
||||
"Darwin": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0",
|
||||
"dlHash": "416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2",
|
||||
"dlSubdir": null,
|
||||
"dlHash": "a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f"
|
||||
}
|
||||
},
|
||||
"FreeBSD": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0",
|
||||
"dlHash": "dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2",
|
||||
"dlSubdir": null,
|
||||
"dlHash": "92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9"
|
||||
}
|
||||
}
|
||||
},
|
||||
"A_32": {
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2",
|
||||
"dlSubdir": null,
|
||||
"dlHash": "01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -2674,51 +2674,51 @@
|
||||
}
|
||||
},
|
||||
"GHCup": {
|
||||
"0.1.19.0": {
|
||||
"0.1.16.2": {
|
||||
"viTags": [
|
||||
"Recommended",
|
||||
"Latest"
|
||||
],
|
||||
"viChangeLog": "https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md",
|
||||
"viChangeLog": "https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md",
|
||||
"viSourceDL": null,
|
||||
"viArch": {
|
||||
"A_64": {
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2",
|
||||
"dlHash": "d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893"
|
||||
}
|
||||
},
|
||||
"Darwin": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0",
|
||||
"dlHash": "416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2",
|
||||
"dlHash": "a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f"
|
||||
}
|
||||
},
|
||||
"FreeBSD": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0",
|
||||
"dlHash": "dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2",
|
||||
"dlHash": "92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9"
|
||||
}
|
||||
},
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2",
|
||||
"dlHash": "d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893"
|
||||
}
|
||||
}
|
||||
},
|
||||
"A_32": {
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2",
|
||||
"dlHash": "01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38"
|
||||
}
|
||||
},
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0",
|
||||
"dlHash": "0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2",
|
||||
"dlHash": "01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -1384,32 +1384,32 @@ ghcupDownloads:
|
||||
dlUri: https://oleg.fi/cabal-install-3.4.0.0-rc4/cabal-install-3.4.0.0-x86_64-freebsd-12.1-release.tar.xz
|
||||
dlHash: 9705e16d03497b46be4ad477e6c64d10890af853eafa8a9adf6dba89aa9e05f7
|
||||
GHCup:
|
||||
0.1.19.0:
|
||||
0.1.16.2:
|
||||
viTags:
|
||||
- Recommended
|
||||
- Latest
|
||||
viChangeLog: https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md
|
||||
viChangeLog: https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md
|
||||
viSourceDL:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-64
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0
|
||||
dlHash: 33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2
|
||||
dlHash: d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f
|
||||
FreeBSD:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0
|
||||
dlHash: dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2
|
||||
dlHash: 92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-64
|
||||
A_32:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-32
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0
|
||||
dlHash: 0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2
|
||||
dlHash: 01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-32
|
||||
|
Binary file not shown.
@ -1451,33 +1451,33 @@ ghcupDownloads:
|
||||
dlUri: https://oleg.fi/cabal-install-3.4.0.0-rc4/cabal-install-3.4.0.0-x86_64-freebsd-12.1-release.tar.xz
|
||||
dlHash: 9705e16d03497b46be4ad477e6c64d10890af853eafa8a9adf6dba89aa9e05f7
|
||||
GHCup:
|
||||
0.1.19.0:
|
||||
0.1.16.2:
|
||||
viTags:
|
||||
- Recommended
|
||||
- Latest
|
||||
viChangeLog: https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md
|
||||
viChangeLog: https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md
|
||||
viSourceDL:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-64
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0
|
||||
dlHash: 33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2
|
||||
dlHash: d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f
|
||||
FreeBSD:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0
|
||||
dlHash: dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2
|
||||
dlHash: 92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-64
|
||||
A_32:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-32
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0
|
||||
dlHash: 0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2
|
||||
dlHash: 01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-32
|
||||
HLS:
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1868,49 +1868,49 @@ ghcupDownloads:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
||||
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
||||
GHCup:
|
||||
0.1.19.0:
|
||||
0.1.16.2:
|
||||
viTags:
|
||||
- Recommended
|
||||
- Latest
|
||||
viChangeLog: https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md
|
||||
viChangeLog: https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md
|
||||
viSourceDL:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-64
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0
|
||||
dlHash: 33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2
|
||||
dlHash: d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f
|
||||
FreeBSD:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0
|
||||
dlHash: dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2
|
||||
dlHash: 92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-64
|
||||
A_32:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-32
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0
|
||||
dlHash: 0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2
|
||||
dlHash: 01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-32
|
||||
A_ARM64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/aarch64-linux-ghcup-0.1.19.0
|
||||
dlHash: a546dcd23a7e56f31bc4d6afad0276f88d3f0b850a3d3c36369721797dc3c3d5
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/aarch64-linux-ghcup-0.1.16.2
|
||||
dlHash: 0bdbfc724e0ddabb266156eea83c2c4e19c6ed79dd06db0c29b7d69df8d9fa8c
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/aarch64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 69bd8e37cd07606d928dca9215c066564a264e0def3c81171b76d5747dc6507c
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/aarch64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: 8854e991a2ba1350abda59dab96ce50ae7729d1ce99399d67929ef31e90f1da5
|
||||
A_ARM:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/armv7-linux-ghcup-0.1.19.0
|
||||
dlHash: 58a170c1fb0b4e701ebb40f90a23f6ababe9e61291726aad82e18d4649aed908
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/armv7-linux-ghcup-0.1.16.2
|
||||
dlHash: 983ebb5b584bfa600704216a63f94b40d36a02573834e90ef1042c8472d9ad57
|
||||
HLS:
|
||||
1.1.0:
|
||||
viTags:
|
||||
|
Binary file not shown.
@ -2025,53 +2025,53 @@ ghcupDownloads:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
||||
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
||||
GHCup:
|
||||
0.1.19.0:
|
||||
0.1.16.2:
|
||||
viTags:
|
||||
- Recommended
|
||||
- Latest
|
||||
viChangeLog: https://github.com/haskell/ghcup-hs/blob/master/CHANGELOG.md
|
||||
viChangeLog: https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md
|
||||
viSourceDL:
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-64
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-linux-ghcup-0.1.19.0
|
||||
dlHash: 33ee6a758ee06e3b520be176905e6192e31f5fa2e2acdc525b1bea77ca368a12
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2
|
||||
dlHash: d5e43b95ce1d42263376e414f7eb7c5dd440271c7c6cd9bad446fdeff3823893
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 416de8509092fd95f97ee19a5f3def91fbd6e6fa4fa630a5c5e7226f49a83af7
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: a334620ccce7705211b2142882dde544003e6030af4b91a44c890542a90f879f
|
||||
FreeBSD:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-portbld-freebsd-ghcup-0.1.19.0
|
||||
dlHash: dadf49f8ac045946ccea7369d0c80cf3a5221b2282d8f9943cc3dc86e8516a62
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-portbld-freebsd-ghcup-0.1.16.2
|
||||
dlHash: 92359592a5694375e53b22628920086bf4bbf0faff5be018a0ed3e745a6426a9
|
||||
Windows:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/x86_64-mingw64-ghcup-0.1.19.0.exe
|
||||
dlHash: c4e4a764b0844e351eb6939ff236452f33c34808aaca69f973ea82e18d3aa1ac
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/x86_64-mingw64-ghcup-0.1.16.2.exe
|
||||
dlHash: ec78872a84213968c490675127b9aad2285980b747c68207801ae824b98c7948
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-64
|
||||
A_32:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghcup-32
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/i386-linux-ghcup-0.1.19.0
|
||||
dlHash: 0308ebed4431241ef2886a9d374feb20a795d97ef3a24dd38b6bc7dd69e81e53
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/i386-linux-ghcup-0.1.16.2
|
||||
dlHash: 01968ca6decac7b6e8ba6e2c817870d3fa47289a6507e0c1ab563f7b6eec0e38
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghcup-32
|
||||
A_ARM64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/aarch64-linux-ghcup-0.1.19.0
|
||||
dlHash: a546dcd23a7e56f31bc4d6afad0276f88d3f0b850a3d3c36369721797dc3c3d5
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/aarch64-linux-ghcup-0.1.16.2
|
||||
dlHash: 0bdbfc724e0ddabb266156eea83c2c4e19c6ed79dd06db0c29b7d69df8d9fa8c
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/aarch64-apple-darwin-ghcup-0.1.19.0
|
||||
dlHash: 69bd8e37cd07606d928dca9215c066564a264e0def3c81171b76d5747dc6507c
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/aarch64-apple-darwin-ghcup-0.1.16.2
|
||||
dlHash: 8854e991a2ba1350abda59dab96ce50ae7729d1ce99399d67929ef31e90f1da5
|
||||
A_ARM:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.19.0/armv7-linux-ghcup-0.1.19.0
|
||||
dlHash: 58a170c1fb0b4e701ebb40f90a23f6ababe9e61291726aad82e18d4649aed908
|
||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.16.2/armv7-linux-ghcup-0.1.16.2
|
||||
dlHash: 983ebb5b584bfa600704216a63f94b40d36a02573834e90ef1042c8472d9ad57
|
||||
HLS:
|
||||
1.1.0:
|
||||
viTags: []
|
||||
|
Binary file not shown.
731
ghcup-0.0.6.yaml
731
ghcup-0.0.6.yaml
File diff suppressed because it is too large
Load Diff
Binary file not shown.
7407
ghcup-0.0.7.yaml
7407
ghcup-0.0.7.yaml
File diff suppressed because it is too large
Load Diff
Binary file not shown.
7486
ghcup-0.0.8.yaml
7486
ghcup-0.0.8.yaml
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,140 +0,0 @@
|
||||
---
|
||||
globalTools:
|
||||
ShimGen:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/shimgen/shim-2.exe
|
||||
dlHash: 7c55e201f71860c5babea886007c8fa44b861abf50d1c07e5677eb0bda387a70
|
||||
toolRequirements: {}
|
||||
ghcupDownloads:
|
||||
GHC:
|
||||
javascript-unknown-ghcjs-9.6.2:
|
||||
viTags:
|
||||
- base-4.18.0.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlHash: 4e12b602869206830eef1aa6a17a5a00fa887d6c98c3a552269c418ee7f736f8
|
||||
dlSubdir: ghc-9.6.2-javascript-unknown-ghcjs
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.6.2/ghc-javascript-unknown-ghcjs-9.6.2-x86_64-linux-unknown.tar.xz
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.6.2/ghc-javascript-unknown-ghcjs-9.6.2-x86_64-apple-darwin.tar.xz
|
||||
dlHash: dddb0ee68857a79e67a52c4ab9b7230023a8684a5e826e9afbb9c5820abf47e1
|
||||
dlSubdir: ghc-9.6.2-javascript-unknown-ghcjs
|
||||
A_ARM64:
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.6.2/ghc-javascript-unknown-ghcjs-9.6.2-aarch64-apple-darwin.tar.xz
|
||||
dlHash: 0d65bb3940a820d95b4b33ea0cd61bf39670d48c4d8f747153ded01a7ef34821
|
||||
dlSubdir: ghc-9.6.2-javascript-unknown-ghcjs
|
||||
javascript-unknown-ghcjs-9.10.0.20240413:
|
||||
viPreInstall: |
|
||||
To use this bindist, you have to use emscripten version 3.1.57
|
||||
Also see: https://www.haskell.org/ghcup/guide/#ghc-js-cross-bindists-experimental
|
||||
viTags:
|
||||
- base-4.20.0.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.10.0.20240413/ghc-javascript-unknown-ghcjs-9.10.0.20240413-x86_64-linux-rocky-8.9-2024-04-16-dc318739.tar.xz
|
||||
dlSubdir: ghc-9.10.0.20240413-javascript-unknown-ghcjs
|
||||
dlHash: dc318739b1ec4f1051dd4b38793b5fbc8eb4dea56b6177d1fe212edcf9e28b30
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.10.0.20240413/ghc-javascript-unknown-ghcjs-9.10.0.20240413-x86_64-darwin-2024-04-16-a819da18.tar.xz
|
||||
dlSubdir: ghc-9.10.0.20240413-javascript-unknown-ghcjs
|
||||
dlHash: a819da1875e9763da5732c37dc7f36eb6e9eb6d33ddc6ea11894df9cfa18a6ee
|
||||
A_ARM64:
|
||||
Darwin:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.10.0.20240413/ghc-javascript-unknown-ghcjs-9.10.0.20240413-aarch64-darwin-2024-04-16-c946719b.tar.xz
|
||||
dlSubdir: ghc-9.10.0.20240413-javascript-unknown-ghcjs
|
||||
dlHash: c946719b31f9249e899fdc15351b86a4297e66857ce4063743b1bcbd62cf9e0e
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning:
|
||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/javascript-unknown-ghcjs-9.10.0.20240413/ghc-javascript-unknown-ghcjs-9.10.0.20240413-aarch64-linux-debian-12-2024-04-16-5f63452c.tar.xz
|
||||
dlSubdir: ghc-9.10.0.20240413-javascript-unknown-ghcjs
|
||||
dlHash: 5f63452c8bee2fcc1282645158bcd20bae7ff93181f3e5d5dc8b2aa8d15f4696
|
||||
wasm32-wasi-9.6.3.20230927:
|
||||
viTags:
|
||||
- base-4.18.1.0
|
||||
viPreInstall: &old-wasm-pre-install |
|
||||
To use this bindist, you need to use the commit c0aa3bb7d88bb6ec809210e17658dd1ed64ba66c of ghc-wasm-meta repository.
|
||||
Also see: https://www.haskell.org/ghcup/guide/#ghc-wasm-cross-bindists-experimental
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-963-64-static
|
||||
dlHash: 2e1d363320c03e35fd9048a252a0cfed8f7b87da76c063c7fc52122c390f42c3
|
||||
dlSubdir: ghc-9.6.3.20230927-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20231001T201511/wasm32-wasi-ghc-9.6.tar.xz
|
||||
dlOutput: ghc-9.6.3.20230927-x86_64-linux-alpine3_12-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-963-64-static
|
||||
wasm32-wasi-9.6.4:
|
||||
viTags:
|
||||
- base-4.18.2.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-964-64-static
|
||||
dlHash: 9eebb42c40d880ec777f729e24b9b52e8aa51d76994f386bd79893d065f5239a
|
||||
dlSubdir: ghc-9.6.4-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20240218T031934/wasm32-wasi-ghc-9.6.tar.xz
|
||||
dlOutput: ghc-9.6.4-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-964-64-static
|
||||
wasm32-wasi-9.8.0.20230927:
|
||||
viTags:
|
||||
- base-4.19.0.0
|
||||
viPreInstall: *old-wasm-pre-install
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-980-64-static
|
||||
dlHash: bad3393b6eba103230c62f050ffd9d458916c6238e5d5fa031d3eee5d995305a
|
||||
dlSubdir: ghc-9.8.0.20230927-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20231001T201511/wasm32-wasi-ghc-9.8.tar.xz
|
||||
dlOutput: ghc-9.8.0.20230927-x86_64-linux-alpine3_12-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-980-64-static
|
||||
wasm32-wasi-9.8.1:
|
||||
viTags:
|
||||
- base-4.19.0.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-981-64-static
|
||||
dlHash: b1714d54468754e3a4353661bec883fef8b5d27398db53b5955753db7453da3e
|
||||
dlSubdir: ghc-9.8.1-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20240218T031934/wasm32-wasi-ghc-9.8.tar.xz
|
||||
dlOutput: ghc-9.8.1-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-981-64-static
|
||||
wasm32-wasi-9.10.0.20240313:
|
||||
viTags:
|
||||
- base-4.20.0.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-9101-64-static
|
||||
dlHash: e2ee5a0417f3617a93f8ca8df2b455c17e50dd5fb750b2fbe37e75982c3a4917
|
||||
dlSubdir: ghc-9.10.0.20240313-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20240318T183143/wasm32-wasi-ghc-9.10.tar.xz
|
||||
dlOutput: ghc-9.10.0.20240313-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-9101-64-static
|
||||
wasm32-wasi-9.10.0.20240412:
|
||||
viTags:
|
||||
- base-4.20.0.0
|
||||
viArch:
|
||||
A_64:
|
||||
Linux_UnknownLinux:
|
||||
unknown_versioning: &ghc-wasm32-wasi-9101-a3-64-static
|
||||
dlHash: e7648d84f7948d53dcd6935a0358967dc8d5d68ee3a60c0706f4b5a94a0fb628
|
||||
dlSubdir: ghc-9.10.0.20240412-wasm32-wasi
|
||||
dlUri: https://github.com/amesgen/ghc-wasm-bindists/releases/download/20240414T232345/wasm32-wasi-ghc-9.10.tar.xz
|
||||
dlOutput: ghc-9.10.0.20240412-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz
|
||||
Linux_Alpine:
|
||||
unknown_versioning: *ghc-wasm32-wasi-9101-a3-64-static
|
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
# Revision history for ghcup-gen
|
||||
|
||||
## 0.1.17.3 -- 2021-10-27
|
||||
|
||||
* First release (split from ghcup)
|
||||
|
@ -1,287 +0,0 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
|
||||
module Generate where
|
||||
|
||||
import GHCup
|
||||
import GHCup.Download
|
||||
import GHCup.Requirements
|
||||
import GHCup.Errors
|
||||
import GHCup.Types
|
||||
import GHCup.Types.Optics
|
||||
import GHCup.Utils
|
||||
|
||||
|
||||
import Codec.Archive
|
||||
import Control.DeepSeq
|
||||
import Control.Exception ( evaluate )
|
||||
import Control.Exception.Safe hiding ( handle )
|
||||
import Control.Monad
|
||||
import Control.Monad.IO.Class
|
||||
import Control.Monad.Reader.Class
|
||||
import Control.Monad.Trans.Resource ( runResourceT
|
||||
, MonadUnliftIO
|
||||
)
|
||||
import qualified Data.Aeson.Encode.Pretty as Aeson
|
||||
import Data.ByteString ( ByteString )
|
||||
import Data.Either
|
||||
import Data.Maybe
|
||||
import Data.List
|
||||
import Data.Map.Strict ( Map )
|
||||
import Data.Versions
|
||||
import Haskus.Utils.Variant.Excepts
|
||||
import System.Exit
|
||||
import System.FilePath
|
||||
import System.IO
|
||||
import Text.Regex.Posix
|
||||
import GHCup.Prelude.String.QQ
|
||||
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Yaml.Pretty as YAML
|
||||
import qualified Text.Megaparsec as MP
|
||||
|
||||
import Data.Bifoldable (bifoldMap)
|
||||
import Data.Foldable (traverse_)
|
||||
import Data.Text (Text)
|
||||
|
||||
import Text.PrettyPrint.HughesPJClass (pPrint)
|
||||
|
||||
data Format = FormatJSON
|
||||
| FormatYAML
|
||||
|
||||
data Output
|
||||
= FileOutput FilePath -- optsparse-applicative doesn't handle ByteString correctly anyway
|
||||
| StdOut
|
||||
|
||||
type HlsGhcVersions = Map Version (Map Architecture (Map Platform Version))
|
||||
|
||||
generateHLSGhc :: ( MonadFail m
|
||||
, MonadMask m
|
||||
, Monad m
|
||||
, MonadReader env m
|
||||
, HasSettings env
|
||||
, HasDirs env
|
||||
, HasLog env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, MonadUnliftIO m
|
||||
, HasGHCupInfo env
|
||||
)
|
||||
=> Format
|
||||
-> Output
|
||||
-> m ExitCode
|
||||
generateHLSGhc format output = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- getGHCupInfo
|
||||
let hlses = dls M.! HLS
|
||||
r <- forM hlses $ \(_viArch -> archs) ->
|
||||
forM archs $ \plats ->
|
||||
forM plats $ \(head . M.toList -> (_, dli)) -> do
|
||||
VRight r <- runResourceT . runE
|
||||
@'[DigestError
|
||||
, GPGError
|
||||
, DownloadFailed
|
||||
, UnknownArchive
|
||||
, ArchiveResult
|
||||
, ContentLengthError
|
||||
] $ do
|
||||
fp <- liftE $ downloadCached dli Nothing
|
||||
let subd = _dlSubdir dli
|
||||
filesL <- liftE $ getArchiveFiles fp
|
||||
files <- liftIO $ evaluate $ force filesL
|
||||
case subd of
|
||||
Just (RealDir d)
|
||||
| d </> "GNUmakefile" `elem` files
|
||||
-> do let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-([0-9]+\.)*([0-9]+)(\.in)$|] :: ByteString)
|
||||
pure (rights $ MP.parse version' ""
|
||||
. T.pack
|
||||
. fromJust
|
||||
. stripPrefix "haskell-language-server-"
|
||||
. stripIn
|
||||
<$> filter (match regex) (fromJust . stripPrefix (d <> "/") <$> files)
|
||||
)
|
||||
_ -> do let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-([0-9]+\.)*([0-9]+)(\.exe)?$|] :: ByteString)
|
||||
pure (rights $ MP.parse version' ""
|
||||
. T.pack
|
||||
. fromJust
|
||||
. stripPrefix "haskell-language-server-"
|
||||
. stripExe
|
||||
<$> filter (match regex) files
|
||||
)
|
||||
pure (sort r)
|
||||
let w = case format of
|
||||
FormatYAML -> BSL.fromStrict $ YAML.encodePretty YAML.defConfig r
|
||||
FormatJSON -> Aeson.encodePretty r
|
||||
case output of
|
||||
StdOut -> liftIO $ BSL.putStr w
|
||||
FileOutput f -> liftIO $ BSL.writeFile f w
|
||||
pure ExitSuccess
|
||||
where
|
||||
stripExe :: String -> String
|
||||
stripExe f = case reverse f of
|
||||
('e':'x':'e':'.':r) -> reverse r
|
||||
_ -> f
|
||||
stripIn :: String -> String
|
||||
stripIn f = case reverse f of
|
||||
('n':'i':'.':r) -> reverse r
|
||||
_ -> f
|
||||
|
||||
generateTable :: ( MonadFail m
|
||||
, MonadMask m
|
||||
, Monad m
|
||||
, MonadReader env m
|
||||
, HasSettings env
|
||||
, HasDirs env
|
||||
, HasLog env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, HasPlatformReq env
|
||||
, HasGHCupInfo env
|
||||
, MonadUnliftIO m
|
||||
)
|
||||
=> Output
|
||||
-> m ExitCode
|
||||
generateTable output = do
|
||||
handle <- case output of
|
||||
StdOut -> pure stdout
|
||||
FileOutput fp -> liftIO $ openFile fp WriteMode
|
||||
|
||||
forM_ [GHC,Cabal,HLS,Stack] $ \tool -> do
|
||||
case tool of
|
||||
GHC -> liftIO $ hPutStrLn handle $ "<details> <summary>Show all supported <a href='https://www.haskell.org/ghc/'>GHC</a> versions</summary>"
|
||||
Cabal -> liftIO $ hPutStrLn handle $ "<details> <summary>Show all supported <a href='https://cabal.readthedocs.io/en/stable/'>cabal-install</a> versions</summary>"
|
||||
HLS -> liftIO $ hPutStrLn handle $ "<details> <summary>Show all supported <a href='https://haskell-language-server.readthedocs.io/en/stable/'>HLS</a> versions</summary>"
|
||||
Stack -> liftIO $ hPutStrLn handle $ "<details> <summary>Show all supported <a href='https://docs.haskellstack.org/en/stable/README/'>Stack</a> versions</summary>"
|
||||
_ -> fail "no"
|
||||
liftIO $ hPutStrLn handle $ "<table>"
|
||||
liftIO $ hPutStrLn handle $ "<thead><tr><th>" <> show tool <> " Version</th><th>Tags</th></tr></thead>"
|
||||
liftIO $ hPutStrLn handle $ "<tbody>"
|
||||
vers <- reverse <$> listVersions (Just tool) [] False False (Nothing, Nothing)
|
||||
forM_ (filter (\ListResult{..} -> not lStray) vers) $ \ListResult{..} -> do
|
||||
liftIO $ hPutStrLn handle $
|
||||
"<tr><td>"
|
||||
<> T.unpack (prettyVer lVer)
|
||||
<> "</td><td>"
|
||||
<> intercalate ", " (filter (/= "") . fmap printTag $ sort lTag)
|
||||
<> "</td></tr>"
|
||||
pure ()
|
||||
liftIO $ hPutStrLn handle $ "</tbody>"
|
||||
liftIO $ hPutStrLn handle $ "</table>"
|
||||
liftIO $ hPutStrLn handle $ "</details>"
|
||||
liftIO $ hPutStrLn handle $ ""
|
||||
pure ExitSuccess
|
||||
where
|
||||
printTag Recommended = "<span style=\"color:green\">recommended</span>"
|
||||
printTag Latest = "<span style=\"color:blue\">latest</span>"
|
||||
printTag Prerelease = "<span style=\"color:red\">prerelease</span>"
|
||||
printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
|
||||
printTag (UnknownTag t ) = t
|
||||
printTag Old = ""
|
||||
|
||||
|
||||
generateSystemInfo :: ( MonadFail m
|
||||
, MonadMask m
|
||||
, Monad m
|
||||
, MonadReader env m
|
||||
, HasSettings env
|
||||
, HasDirs env
|
||||
, HasLog env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, HasPlatformReq env
|
||||
, HasGHCupInfo env
|
||||
, MonadUnliftIO m
|
||||
)
|
||||
=> Output
|
||||
-> m ExitCode
|
||||
generateSystemInfo output = do
|
||||
handle <- case output of
|
||||
StdOut -> pure stdout
|
||||
FileOutput fp -> liftIO $ openFile fp WriteMode
|
||||
|
||||
forM_ [ Linux Debian
|
||||
, Linux Ubuntu
|
||||
, Linux Fedora
|
||||
, Linux CentOS
|
||||
, Linux Alpine
|
||||
, Linux UnknownLinux
|
||||
, Darwin
|
||||
, FreeBSD
|
||||
, Windows
|
||||
] $ \plat -> do
|
||||
GHCupInfo { .. } <- getGHCupInfo
|
||||
(Just req) <- pure $ getCommonRequirements (PlatformResult plat Nothing) _toolRequirements
|
||||
liftIO $ hPutStrLn handle $ "### " <> (prettyPlat plat) <> "\n"
|
||||
liftIO $ hPutStrLn handle $ (T.unpack $ pretty' req) <> "\n"
|
||||
pure ExitSuccess
|
||||
where
|
||||
pretty' Requirements {..} =
|
||||
let d = if not . null $ _distroPKGs
|
||||
then "The following distro packages are required: " <> "`" <> T.intercalate " " _distroPKGs <> "`"
|
||||
else ""
|
||||
n = if not . T.null $ _notes then _notes else ""
|
||||
in if | T.null d -> n
|
||||
| T.null n -> d
|
||||
| otherwise -> d <> "\n" <> n
|
||||
|
||||
prettyPlat (Linux UnknownLinux) = "Linux (generic)"
|
||||
prettyPlat p = show p
|
||||
|
||||
|
||||
generateSystemInfoWithDistroVersion :: ( MonadFail m
|
||||
, MonadMask m
|
||||
, Monad m
|
||||
, MonadReader env m
|
||||
, HasSettings env
|
||||
, HasDirs env
|
||||
, HasLog env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, HasPlatformReq env
|
||||
, HasGHCupInfo env
|
||||
, MonadUnliftIO m
|
||||
)
|
||||
=> Output
|
||||
-> m ExitCode
|
||||
generateSystemInfoWithDistroVersion output = do
|
||||
handle <- case output of
|
||||
StdOut -> pure stdout
|
||||
FileOutput fp -> liftIO $ openFile fp WriteMode
|
||||
|
||||
GHCupInfo { _toolRequirements = tr } <- getGHCupInfo
|
||||
let ghcInfo = M.lookup Nothing <$> M.lookup GHC tr
|
||||
liftIO $ traverse_ (\(key, value) -> do
|
||||
liftIO $ hPutStrLn handle $ "### " <> prettyPlat key <> "\n"
|
||||
liftIO $ hPutStrLn handle $ T.unpack $ versionsAndRequirements value <> T.pack "\n")
|
||||
$ M.toList $ fromJust (fromJust ghcInfo)
|
||||
pure ExitSuccess
|
||||
|
||||
where
|
||||
pretty' Requirements {..} =
|
||||
let d = if not . null $ _distroPKGs
|
||||
then "The following distro packages are required: " <> "`" <> T.intercalate " " _distroPKGs <> "`" <> "\n"
|
||||
else ""
|
||||
n = if not . T.null $ _notes then _notes else ""
|
||||
in if | T.null d -> n
|
||||
| T.null n -> d
|
||||
| otherwise -> d <> "\n" <> n
|
||||
|
||||
versionsAndRequirements :: PlatformReqVersionSpec -> Text
|
||||
versionsAndRequirements =
|
||||
bifoldMap
|
||||
( \case
|
||||
Nothing -> T.pack $ "#### Generic" <> "\n"
|
||||
Just verz -> T.pack "#### Version " <> T.pack (show $ pPrint verz) <> "\n"
|
||||
)
|
||||
pretty'
|
||||
|
||||
prettyPlat (Linux UnknownLinux) = "Linux (generic)"
|
||||
prettyPlat p = show p
|
@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@ -1,232 +0,0 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE DuplicateRecordFields #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
|
||||
module Main where
|
||||
|
||||
import GHCup.Types
|
||||
import GHCup.Errors
|
||||
import GHCup.Platform
|
||||
import GHCup.Utils.Dirs
|
||||
import GHCup.Prelude.Logger
|
||||
import GHCup.Types.JSON ( )
|
||||
|
||||
import Control.Exception ( displayException )
|
||||
import Control.Monad.Trans.Reader ( runReaderT )
|
||||
import Control.Monad.IO.Class
|
||||
import Data.Char ( toLower )
|
||||
import Data.Maybe
|
||||
#if !MIN_VERSION_base(4,13,0)
|
||||
import Data.Semigroup ( (<>) )
|
||||
#endif
|
||||
import Options.Applicative hiding ( style )
|
||||
import Haskus.Utils.Variant.Excepts
|
||||
import System.Console.Pretty
|
||||
import System.Environment
|
||||
import System.Exit
|
||||
import System.IO ( stderr )
|
||||
import Text.Regex.Posix
|
||||
import Generate
|
||||
import Validate
|
||||
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
||||
|
||||
import qualified Data.Text.IO as T
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.Yaml.Aeson as Y
|
||||
|
||||
|
||||
data Options = Options
|
||||
{ optCommand :: Command
|
||||
}
|
||||
|
||||
|
||||
formatParser :: Parser Format
|
||||
formatParser =
|
||||
option
|
||||
(eitherReader formatP)
|
||||
(long "format" <> metavar "FORMAT" <> help
|
||||
"Which format to use (JSON | YAML). Yaml is default."
|
||||
<> value FormatJSON
|
||||
)
|
||||
where
|
||||
formatP :: String -> Either String Format
|
||||
formatP s' | t == T.pack "json" = Right FormatJSON
|
||||
| t == T.pack "yaml" = Right FormatYAML
|
||||
| t == T.pack "yml" = Right FormatYAML
|
||||
| otherwise = Left ("Unknown format value: " <> s')
|
||||
where t = T.toLower (T.pack s')
|
||||
|
||||
|
||||
data Command = ValidateYAML ValidateYAMLOpts
|
||||
| ValidateTarballs ValidateYAMLOpts TarballFilter
|
||||
| GenerateHlsGhc ValidateYAMLOpts Format Output
|
||||
| GenerateToolTable ValidateYAMLOpts Output
|
||||
| GenerateSystemDepsInfo ValidateYAMLOpts Output
|
||||
|
||||
|
||||
fileOutput :: Parser Output
|
||||
fileOutput =
|
||||
FileOutput
|
||||
<$> strOption
|
||||
(long "output-file" <> short 'o' <> metavar "FILENAME" <> help
|
||||
"Output file to write to"
|
||||
)
|
||||
|
||||
stdOutput :: Parser Output
|
||||
stdOutput = flag'
|
||||
StdOut
|
||||
(short 'o' <> long "stdout" <> help "Output to stdout (default)")
|
||||
|
||||
outputP :: Parser Output
|
||||
outputP = fileOutput <|> stdOutput
|
||||
|
||||
data Input
|
||||
= FileInput FilePath -- optsparse-applicative doesn't handle ByteString correctly anyway
|
||||
| StdInput
|
||||
|
||||
fileInput :: Parser Input
|
||||
fileInput =
|
||||
FileInput
|
||||
<$> strOption
|
||||
(long "file" <> short 'f' <> metavar "FILENAME" <> help
|
||||
"Input file to validate"
|
||||
)
|
||||
|
||||
stdInput :: Parser Input
|
||||
stdInput = flag'
|
||||
StdInput
|
||||
(short 'i' <> long "stdin" <> help "Validate from stdin (default)")
|
||||
|
||||
inputP :: Parser Input
|
||||
inputP = fileInput <|> stdInput
|
||||
|
||||
data ValidateYAMLOpts = ValidateYAMLOpts
|
||||
{ vChannel :: DistributionChannel
|
||||
, vInput :: Maybe Input
|
||||
}
|
||||
|
||||
validateYAMLOpts :: Parser ValidateYAMLOpts
|
||||
validateYAMLOpts = ValidateYAMLOpts <$> channelParser <*> optional inputP
|
||||
|
||||
channelParser :: Parser DistributionChannel
|
||||
channelParser =
|
||||
option
|
||||
(eitherReader chanP)
|
||||
(long "channel" <> metavar "CHANNEL" <> help
|
||||
"Signal which distribution channel the YAML denotes: (main | prerelease | nightly). Main is defaul."
|
||||
<> value MainChan
|
||||
)
|
||||
where
|
||||
chanP :: String -> Either String DistributionChannel
|
||||
chanP s' | t == T.pack "main" = Right MainChan
|
||||
| t == T.pack "prerelease" = Right PrereleaseChan
|
||||
| t == T.pack "prereleases" = Right PrereleaseChan
|
||||
| t == T.pack "nightly" = Right NightlyChan
|
||||
| t == T.pack "nightlies" = Right NightlyChan
|
||||
| otherwise = Left ("Unknown channel value: " <> s')
|
||||
where t = T.toLower (T.pack s')
|
||||
|
||||
tarballFilterP :: Parser TarballFilter
|
||||
tarballFilterP = option readm $
|
||||
long "tarball-filter" <> short 'u' <> metavar "<tool>-<version>" <> value def
|
||||
<> help "Only check certain tarballs (format: <tool>-<version>)"
|
||||
where
|
||||
def = TarballFilter Nothing (makeRegex ("" :: String))
|
||||
readm = do
|
||||
s <- str
|
||||
case span (/= '-') s of
|
||||
(_, []) -> fail "invalid format, missing '-' after the tool name"
|
||||
(t, v) | [tool] <- [ tool | tool <- [minBound..maxBound], low (show tool) == low t ] ->
|
||||
pure (TarballFilter $ Just tool) <*> makeRegexOptsM compIgnoreCase execBlank (drop 1 v)
|
||||
_ -> fail "invalid tool"
|
||||
low = fmap toLower
|
||||
|
||||
|
||||
opts :: Parser Options
|
||||
opts = Options <$> com
|
||||
|
||||
com :: Parser Command
|
||||
com = subparser
|
||||
( command
|
||||
"check"
|
||||
( ValidateYAML
|
||||
<$> info (validateYAMLOpts <**> helper)
|
||||
(progDesc "Validate the YAML")
|
||||
)
|
||||
<> command
|
||||
"check-tarballs"
|
||||
(info
|
||||
((ValidateTarballs <$> validateYAMLOpts <*> tarballFilterP) <**> helper)
|
||||
(progDesc "Validate all tarballs (download and checksum)")
|
||||
)
|
||||
<> command
|
||||
"generate-hls-ghcs"
|
||||
(info
|
||||
((GenerateHlsGhc <$> validateYAMLOpts <*> formatParser <*> outputP) <**> helper)
|
||||
(progDesc "Generate a list of HLS-GHC support")
|
||||
)
|
||||
<> command
|
||||
"generate-tool-table"
|
||||
(info
|
||||
((GenerateToolTable <$> validateYAMLOpts <*> outputP) <**> helper)
|
||||
(progDesc "Generate a markdown table of available tool versions")
|
||||
)
|
||||
<> command
|
||||
"generate-system-deps-info"
|
||||
(info
|
||||
((GenerateSystemDepsInfo <$> validateYAMLOpts <*> outputP) <**> helper)
|
||||
(progDesc "Generate a markdown info for system dependencies")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
no_color <- isJust <$> lookupEnv "NO_COLOR"
|
||||
let loggerConfig = LoggerConfig { lcPrintDebug = True
|
||||
, consoleOutter = T.hPutStr stderr
|
||||
, fileOutter = \_ -> pure ()
|
||||
, fancyColors = not no_color
|
||||
}
|
||||
dirs <- liftIO getAllDirs
|
||||
let leanAppstate = LeanAppState (Settings True 0 Lax False Never Curl True GHCupURL False GPGNone True Nothing (DM mempty)) dirs defaultKeyBindings loggerConfig
|
||||
|
||||
pfreq <- (
|
||||
flip runReaderT leanAppstate . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] $ platformRequest
|
||||
) >>= \case
|
||||
VRight r -> pure r
|
||||
VLeft e -> do
|
||||
flip runReaderT leanAppstate $ logError $ T.pack $ prettyShow e
|
||||
liftIO $ exitWith (ExitFailure 2)
|
||||
|
||||
let appstate = AppState (Settings True 0 Lax False Never Curl True GHCupURL False GPGNone True Nothing (DM mempty)) dirs defaultKeyBindings (GHCupInfo mempty mempty Nothing) pfreq loggerConfig
|
||||
|
||||
let withValidateYamlOpts vopts f = case vopts of
|
||||
ValidateYAMLOpts { vInput = Nothing } ->
|
||||
B.getContents >>= valAndExit f
|
||||
ValidateYAMLOpts { vInput = Just StdInput } ->
|
||||
B.getContents >>= valAndExit f
|
||||
ValidateYAMLOpts { vInput = Just (FileInput file) } ->
|
||||
B.readFile file >>= valAndExit f
|
||||
valAndExit f contents = do
|
||||
ginfo <- case Y.decodeEither' contents of
|
||||
Right r -> pure r
|
||||
Left e -> die (color Red $ displayException e)
|
||||
r <- flip runReaderT appstate { ghcupInfo = ginfo } f
|
||||
exitWith r
|
||||
|
||||
_ <- customExecParser (prefs showHelpOnError) (info (opts <**> helper) idm)
|
||||
>>= \Options {..} -> case optCommand of
|
||||
ValidateYAML vopts@ValidateYAMLOpts{ .. } -> withValidateYamlOpts vopts (validate vChannel)
|
||||
ValidateTarballs vopts tarballFilter -> withValidateYamlOpts vopts (validateTarballs tarballFilter)
|
||||
GenerateHlsGhc vopts format output -> withValidateYamlOpts vopts (generateHLSGhc format output)
|
||||
GenerateToolTable vopts output -> withValidateYamlOpts vopts (generateTable output)
|
||||
GenerateSystemDepsInfo vopts output -> withValidateYamlOpts vopts (generateSystemInfoWithDistroVersion output)
|
||||
pure ()
|
||||
|
||||
where
|
@ -1,308 +0,0 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Validate where
|
||||
|
||||
import GHCup
|
||||
import GHCup.Download
|
||||
import GHCup.Errors
|
||||
import GHCup.Types
|
||||
import GHCup.Types.Optics
|
||||
import GHCup.Utils
|
||||
import GHCup.Prelude.Logger
|
||||
import GHCup.Prelude.Version.QQ
|
||||
|
||||
import Codec.Archive
|
||||
import Control.Applicative
|
||||
import Control.Exception.Safe
|
||||
import Control.Monad
|
||||
import Control.Monad.IO.Class
|
||||
import Control.Monad.Reader.Class
|
||||
import Control.Monad.Trans.Class ( lift )
|
||||
import Control.Monad.Trans.Reader ( runReaderT )
|
||||
import Control.Monad.Trans.Resource ( runResourceT
|
||||
, MonadUnliftIO
|
||||
)
|
||||
import Data.Containers.ListUtils ( nubOrd )
|
||||
import Data.IORef
|
||||
import Data.List
|
||||
import Data.Versions
|
||||
import Haskus.Utils.Variant.Excepts
|
||||
import Optics
|
||||
import System.FilePath
|
||||
import System.Exit
|
||||
import Text.ParserCombinators.ReadP
|
||||
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
||||
import Text.Regex.Posix
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Version as V
|
||||
|
||||
|
||||
data ValidationError = InternalError String
|
||||
deriving Show
|
||||
|
||||
instance Exception ValidationError
|
||||
|
||||
data DistributionChannel = MainChan
|
||||
| PrereleaseChan
|
||||
| NightlyChan
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
||||
addError :: (MonadReader (IORef Int) m, MonadIO m, Monad m) => m ()
|
||||
addError = do
|
||||
ref <- ask
|
||||
liftIO $ modifyIORef ref (+ 1)
|
||||
|
||||
|
||||
validate :: ( Monad m
|
||||
, MonadReader env m
|
||||
, HasLog env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, MonadUnliftIO m
|
||||
, HasGHCupInfo env
|
||||
)
|
||||
=> DistributionChannel
|
||||
-> m ExitCode
|
||||
validate distroChannel = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- getGHCupInfo
|
||||
|
||||
ref <- liftIO $ newIORef 0
|
||||
|
||||
-- verify binary downloads --
|
||||
flip runReaderT ref $ do
|
||||
-- unique tags
|
||||
forM_ (M.toList dls) $ \(t, _) -> checkUniqueTags t
|
||||
|
||||
-- required platforms
|
||||
forM_ (M.toList dls) $ \(t, versions) ->
|
||||
forM_ (M.toList versions) $ \(v, vi) ->
|
||||
forM_ (M.toList $ _viArch vi) $ \(arch, pspecs) -> do
|
||||
checkHasRequiredPlatforms t (_tvVersion v) (_viTags vi) arch (M.keys pspecs)
|
||||
|
||||
checkGHCVerIsValid
|
||||
forM_ (M.toList dls) $ \(t, _) -> checkMandatoryTags t
|
||||
_ <- checkGHCHasBaseVersion
|
||||
|
||||
-- exit
|
||||
e <- liftIO $ readIORef ref
|
||||
if e > 0
|
||||
then pure $ ExitFailure e
|
||||
else do
|
||||
lift $ logInfo "All good"
|
||||
pure ExitSuccess
|
||||
where
|
||||
checkHasRequiredPlatforms t v tags arch pspecs
|
||||
-- relax requirements for prerelease and nightly channels
|
||||
| distroChannel `elem` [PrereleaseChan, NightlyChan] = pure ()
|
||||
| otherwise = do
|
||||
let v' = prettyVer v
|
||||
arch' = prettyShow arch
|
||||
when (Linux UnknownLinux `notElem` pspecs) $ do
|
||||
lift $ logError $
|
||||
"Linux UnknownLinux missing for for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack arch'
|
||||
addError
|
||||
when ((Darwin `notElem` pspecs) && arch == A_64) $ do
|
||||
lift $ logError $ "Darwin missing for for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack arch'
|
||||
addError
|
||||
when ((FreeBSD `notElem` pspecs) && arch == A_64) $ lift $ logWarn $
|
||||
"FreeBSD missing for for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack arch'
|
||||
when (Windows `notElem` pspecs && arch == A_64) $ do
|
||||
lift $ logError $ "Windows missing for for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack arch'
|
||||
addError
|
||||
|
||||
-- alpine needs to be set explicitly, because
|
||||
-- we cannot assume that "Linux UnknownLinux" runs on Alpine
|
||||
-- (although it could be static)
|
||||
when (Linux Alpine `notElem` pspecs) $
|
||||
case t of
|
||||
GHCup | arch `elem` [A_64, A_32] -> lift (logError $ "Linux Alpine missing for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack (prettyShow arch)) >> addError
|
||||
Cabal | v > [vver|2.4.1.0|]
|
||||
, arch `elem` [A_64, A_32] -> lift (logError $ "Linux Alpine missing for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack (prettyShow arch)) >> addError
|
||||
GHC | Latest `elem` tags || Recommended `elem` tags
|
||||
, arch `elem` [A_64, A_32] -> lift (logError $ "Linux Alpine missing for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack (prettyShow arch))
|
||||
_ -> lift $ logWarn $ "Linux Alpine missing for " <> T.pack (prettyShow t) <> " " <> v' <> " " <> T.pack (prettyShow arch)
|
||||
|
||||
checkUniqueTags tool = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
|
||||
let allTags = _viTags =<< M.elems (availableToolVersions dls tool)
|
||||
let nonUnique =
|
||||
fmap fst
|
||||
. filter (\(_, b) -> not b)
|
||||
<$> ( mapM
|
||||
(\case
|
||||
[] -> throwM $ InternalError "empty inner list"
|
||||
(t : ts) ->
|
||||
pure $ (t, ) (not (isUniqueTag t) || null ts)
|
||||
)
|
||||
. group
|
||||
. sort
|
||||
$ allTags
|
||||
)
|
||||
case join nonUnique of
|
||||
[] -> pure ()
|
||||
xs -> do
|
||||
lift $ logError $ "Tags not unique for " <> T.pack (prettyShow tool) <> ": " <> T.pack (prettyShow xs)
|
||||
addError
|
||||
where
|
||||
isUniqueTag Latest = True
|
||||
isUniqueTag Recommended = True
|
||||
isUniqueTag Old = False
|
||||
isUniqueTag Prerelease = False
|
||||
isUniqueTag LatestPrerelease = True
|
||||
isUniqueTag Nightly = False
|
||||
isUniqueTag LatestNightly = True
|
||||
isUniqueTag (Base _) = False
|
||||
isUniqueTag (UnknownTag _) = False
|
||||
|
||||
checkGHCVerIsValid = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
|
||||
let ghcVers = toListOf (ix GHC % to M.keys % to (map _tvVersion) % folded) dls
|
||||
forM_ ghcVers $ \v ->
|
||||
case [ x | (x,"") <- readP_to_S V.parseVersion (T.unpack . prettyVer $ v) ] of
|
||||
[_] -> pure ()
|
||||
_ -> do
|
||||
lift $ logError $ "GHC version " <> prettyVer v <> " is not valid"
|
||||
addError
|
||||
|
||||
-- a tool must have at least one of each mandatory tags
|
||||
checkMandatoryTags tool = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
|
||||
let allTags = _viTags =<< M.elems (availableToolVersions dls tool)
|
||||
forM_ (mandatoryTags tool) $ \t -> case t `elem` allTags of
|
||||
False -> do
|
||||
lift $ logError $ "Tag " <> T.pack (prettyShow t) <> " missing from " <> T.pack (prettyShow tool)
|
||||
addError
|
||||
True -> pure ()
|
||||
|
||||
mandatoryTags tool
|
||||
-- due to a quirk, even for ghcup prereleases we need the 'latest' tag
|
||||
-- https://github.com/haskell/ghcup-hs/issues/891
|
||||
| tool == GHCup = [Latest, Recommended]
|
||||
| otherwise = case distroChannel of
|
||||
MainChan -> [Latest, Recommended]
|
||||
PrereleaseChan -> [LatestPrerelease]
|
||||
NightlyChan -> [LatestNightly]
|
||||
|
||||
-- all GHC versions must have a base tag
|
||||
checkGHCHasBaseVersion = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
|
||||
let allTags = M.toList $ availableToolVersions dls GHC
|
||||
forM allTags $ \(ver, _viTags -> tags) -> case any isBase tags of
|
||||
False -> do
|
||||
lift $ logError $ "Base tag missing from GHC ver " <> prettyVer (_tvVersion ver)
|
||||
addError
|
||||
True -> pure ()
|
||||
|
||||
isBase (Base _) = True
|
||||
isBase _ = False
|
||||
|
||||
data TarballFilter = TarballFilter
|
||||
{ tfTool :: Maybe Tool
|
||||
, tfVersion :: Regex
|
||||
}
|
||||
|
||||
validateTarballs :: ( Monad m
|
||||
, MonadReader env m
|
||||
, HasLog env
|
||||
, HasDirs env
|
||||
, HasSettings env
|
||||
, MonadThrow m
|
||||
, MonadIO m
|
||||
, MonadUnliftIO m
|
||||
, MonadMask m
|
||||
, Alternative m
|
||||
, MonadFail m
|
||||
, HasGHCupInfo env
|
||||
)
|
||||
=> TarballFilter
|
||||
-> m ExitCode
|
||||
validateTarballs (TarballFilter mtool versionRegex) = do
|
||||
GHCupInfo { _ghcupDownloads = dls } <- getGHCupInfo
|
||||
ref <- liftIO $ newIORef 0
|
||||
|
||||
-- download/verify all tarballs
|
||||
let dlis = nubOrd $ dls ^.. each %& indices (maybe (const True) (==) mtool)
|
||||
%> each %& indices (matchTest versionRegex . T.unpack . prettyVer . _tvVersion)
|
||||
% (viTestDL % _Just `summing` viSourceDL % _Just `summing` viArch % each % each % each)
|
||||
when (null dlis) $ logError "no tarballs selected by filter" *> runReaderT addError ref
|
||||
forM_ dlis (downloadAll ref)
|
||||
|
||||
-- exit
|
||||
e <- liftIO $ readIORef ref
|
||||
if e > 0
|
||||
then pure $ ExitFailure e
|
||||
else do
|
||||
logInfo "All good"
|
||||
pure ExitSuccess
|
||||
|
||||
where
|
||||
downloadAll :: ( MonadUnliftIO m
|
||||
, MonadIO m
|
||||
, MonadReader env m
|
||||
, HasLog env
|
||||
, HasDirs env
|
||||
, HasSettings env
|
||||
, MonadCatch m
|
||||
, MonadMask m
|
||||
, MonadThrow m
|
||||
)
|
||||
=> IORef Int
|
||||
-> DownloadInfo
|
||||
-> m ()
|
||||
downloadAll ref dli = do
|
||||
r <- runResourceT
|
||||
. runE @'[DigestError
|
||||
, GPGError
|
||||
, DownloadFailed
|
||||
, UnknownArchive
|
||||
, ArchiveResult
|
||||
, ContentLengthError
|
||||
]
|
||||
$ do
|
||||
case mtool of
|
||||
(Just GHCup) -> do
|
||||
tmpUnpack <- lift mkGhcupTmpDir
|
||||
_ <- liftE $ download (_dlUri dli) Nothing (Just (_dlHash dli)) Nothing (fromGHCupPath tmpUnpack) Nothing False
|
||||
pure Nothing
|
||||
_ -> do
|
||||
p <- liftE $ downloadCached dli Nothing
|
||||
fmap Just $ liftE
|
||||
. getArchiveFiles
|
||||
$ p
|
||||
case r of
|
||||
VRight (Just entries) -> do
|
||||
case _dlSubdir dli of
|
||||
Just (RealDir prel) -> do
|
||||
logInfo
|
||||
$ " verifying subdir: " <> T.pack prel
|
||||
when (normalise prel `notElem` fmap (normalise . takeDirectory) entries) $ do
|
||||
logError $
|
||||
"Subdir doesn't match: expected " <> T.pack prel
|
||||
runReaderT addError ref
|
||||
Just (RegexDir regexString) -> do
|
||||
logInfo $
|
||||
"verifying subdir (regex): " <> T.pack regexString
|
||||
let regex = makeRegexOpts
|
||||
compIgnoreCase
|
||||
execBlank
|
||||
regexString
|
||||
unless (or $ fmap (match regex. normalise) entries) $ do
|
||||
logError $
|
||||
"Subdir doesn't match: expected regex " <> T.pack regexString
|
||||
runReaderT addError ref
|
||||
Nothing -> pure ()
|
||||
VRight Nothing -> pure ()
|
||||
VLeft e -> do
|
||||
logError $
|
||||
"Could not download (or verify hash) of " <> T.pack (show dli) <> ", Error was: " <> T.pack (prettyShow e)
|
||||
runReaderT addError ref
|
@ -1,69 +0,0 @@
|
||||
cabal-version: 3.0
|
||||
name: ghcup-gen
|
||||
version: 0.1.17.3
|
||||
license: LGPL-3.0-only
|
||||
license-file: LICENSE
|
||||
copyright: Julian Ospald 2020
|
||||
maintainer: hasufell@posteo.de
|
||||
author: Julian Ospald
|
||||
homepage: https://github.com/haskell/ghcup-metadata
|
||||
bug-reports: https://github.com/haskell/ghcup-metadata/issues
|
||||
synopsis: ghcup-gen dev tool
|
||||
description: Dev tool for handling ghcup metadata
|
||||
|
||||
category: System
|
||||
build-type: Simple
|
||||
extra-doc-files:
|
||||
CHANGELOG.md
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/haskell/ghcup-metadata.git
|
||||
|
||||
executable ghcup-gen
|
||||
main-is: Main.hs
|
||||
other-modules: Validate
|
||||
Generate
|
||||
default-language: Haskell2010
|
||||
default-extensions:
|
||||
DeriveGeneric
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
NamedFieldPuns
|
||||
PackageImports
|
||||
QuasiQuotes
|
||||
RecordWildCards
|
||||
ScopedTypeVariables
|
||||
StrictData
|
||||
TupleSections
|
||||
TypeApplications
|
||||
TypeFamilies
|
||||
ViewPatterns
|
||||
|
||||
ghc-options:
|
||||
-Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
|
||||
-fwarn-incomplete-record-updates -threaded
|
||||
|
||||
build-depends:
|
||||
, aeson-pretty ^>=0.8.9
|
||||
, base >=4.13 && <5
|
||||
, bytestring ^>=0.11
|
||||
, containers ^>=0.6
|
||||
, deepseq ^>=1.4
|
||||
, filepath ^>=1.4.2.1
|
||||
, ghcup ^>=0.1.19.0
|
||||
, haskus-utils-variant ^>=3.3
|
||||
, libarchive ^>=3.0.3.0
|
||||
, megaparsec >=8.0.0 && <9.3
|
||||
, mtl ^>=2.2
|
||||
, optics ^>=0.4
|
||||
, optparse-applicative >=0.15.1.0 && <0.17
|
||||
, pretty ^>=1.1.3.1
|
||||
, pretty-terminal ^>=0.1.0.0
|
||||
, regex-posix ^>=0.96
|
||||
, resourcet ^>=1.2.2
|
||||
, safe-exceptions ^>=0.1
|
||||
, text ^>=2.0
|
||||
, transformers ^>=0.5
|
||||
, versions >=6.0.0
|
||||
, yaml-streamly ^>=0.12.0
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
Reference in New Issue
Block a user