diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000000..624088f2a04 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,31 @@ +# release CI for FreeBSD +compute_engine_instance: + image_project: freebsd-org-cloud-dev + image: family/freebsd-13-2 + platform: freebsd + disk: 100 # Gb + +build_task: + timeout_in: 120m + only_if: $CIRRUS_TAG != '' + env: + ADD_CABAL_ARGS: "--enable-split-sections" + ARCH: 64 + ARTIFACT: "x86_64-portbld-freebsd" + CIRRUS_CLONE_SUBMODULES: true + DISTRO: na + GHC_VERSION: 9.2.8 + GITHUB_WORKSPACE: ${CIRRUS_WORKING_DIR} + RUNNER_OS: FreeBSD + TARBALL_EXT: tar.xz + TZ: Asia/Singapore + install_script: + - sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + - pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 patchelf tree gmp libiconv + script: + - tzsetup Etc/GMT + - adjkerntz -a + - bash .github/scripts/build.sh + binaries_artifacts: + path: "out/*" + diff --git a/.github/mergify.yml b/.github/mergify.yml index 7969fe95c25..94eb5d825c3 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -57,6 +57,23 @@ pull_request_rules: - label=merge me - base!=master - body~=backport + - label=merge delay passed + - '#approved-reviews-by>=1' + + # merge+squash strategy for backports: require 1 approver instead of 2 + - actions: + queue: + name: default + method: squash + # both update methods get absorbed by the squash, so we use the most + # reliable + update_method: merge + name: Put pull requests in the squash+merge queue + conditions: + - label=merge me + - base!=master + - body~=backport + - label=merge delay passed - '#approved-reviews-by>=1' # backports should be labeled as such diff --git a/.github/scripts/brew.sh b/.github/scripts/brew.sh new file mode 100644 index 00000000000..e05ffb7421c --- /dev/null +++ b/.github/scripts/brew.sh @@ -0,0 +1,28 @@ +#!/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+"$@"} + diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh new file mode 100644 index 00000000000..c0b2ad0ac20 --- /dev/null +++ b/.github/scripts/build.sh @@ -0,0 +1,66 @@ +#!/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 + diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh new file mode 100644 index 00000000000..cff91ea6bb5 --- /dev/null +++ b/.github/scripts/common.sh @@ -0,0 +1,110 @@ +#!/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 +} diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh new file mode 100644 index 00000000000..ec351f75f86 --- /dev/null +++ b/.github/scripts/env.sh @@ -0,0 +1,42 @@ +#!/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-p1}" +export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=no +export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes +export BOOTSTRAP_HASKELL_ADJUST_BASHRC=1 + +if [ "${RUNNER_OS}" = "freebsd" ] ; then + export RUNNER_OS=FreeBSD +fi + +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 diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 885b1916bc8..0aacfc1e14c 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -19,10 +19,10 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"] + ghc: ["8.10.7", "9.0.2", "9.2.8", "9.4.8"] include: - os: macos-latest - ghc: "9.2.3" + ghc: "9.2.8" name: Bootstrap ${{ matrix.os }} ghc-${{ matrix.ghc }} runs-on: ${{ matrix.os }} steps: @@ -35,9 +35,20 @@ jobs: restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115- - uses: actions/checkout@v3 + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi - name: bootstrap.py run: | GHC_VERSION=${{ matrix.ghc }} + ghcup --version ghcup config set cache true ghcup install ghc $GHC_VERSION diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 9c1e2ef70e8..425e5117188 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -29,10 +29,18 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-changelogs + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo mkdir -p /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi - name: ghcup run: | ghcup config set cache true diff --git a/.github/workflows/quick-jobs.yml b/.github/workflows/quick-jobs.yml index 2f9d42666fc..d309cc97c09 100644 --- a/.github/workflows/quick-jobs.yml +++ b/.github/workflows/quick-jobs.yml @@ -24,19 +24,30 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-meta + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi - name: ghcup run: | + ghcup --version ghcup config set cache true ghcup install ghc recommended ghcup set ghc recommended - name: Update Hackage index run: cabal v2-update - name: Install alex - run: cabal v2-install alex --constraint='alex ==3.2.6' + run: cabal v2-install alex --constraint='alex ==3.2.7.3' - uses: actions/checkout@v3 - name: Regenerate files run: | @@ -54,32 +65,30 @@ jobs: - name: Set PATH run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-env - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/phadej/cabal-extras/releases/download/preview-20191225/cabal-env-snapshot-20191225-x86_64-linux.xz > cabal-env.xz - echo "1b567d529c5f627fd8c956e57ae8f0d9f11ee66d6db34b7fb0cb1c370b4edf01 cabal-env.xz" | sha256sum -c - - xz -d < cabal-env.xz > $HOME/.cabal/bin/cabal-env - rm -f cabal-env.xz - chmod a+x $HOME/.cabal/bin/cabal-env - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-doctest + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi - name: ghcup run: | + ghcup --version ghcup config set cache true - ghcup install ghc 8.10.7 - ghcup set ghc 8.10.7 + ghcup install ghc --set recommended + ghcup install cabal --set latest - name: Update Hackage index run: cabal v2-update - - name: Install doctest - run: cabal v2-install doctest - - name: Install libraries - run: | - cabal-env --transitive QuickCheck - cabal-env array bytestring containers deepseq directory filepath pretty process time binary unix text parsec mtl - cat $HOME/.ghc/*/environments/default - uses: actions/checkout@v3 + - name: Install doctest + run: make doctest-install - name: Doctest run: make doctest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000000..35f43b2680e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,433 @@ +name: Build and release + +on: + push: + tags: + - 'cabal-install-*' + +jobs: + build-linux: + name: Build linux binaries + runs-on: ubuntu-latest + env: + TARBALL_EXT: tar.xz + ARCH: 64 + DEBIAN_FRONTEND: noninteractive + TZ: Asia/Singapore + GHC_VERSION: 9.2.8 + strategy: + fail-fast: false + matrix: + platform: [ { image: "debian:9" + , installCmd: "sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && sed -i 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list && sed -i /-updates/d /etc/apt/sources.list && apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb9" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "debian:10" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb10" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "debian:11" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb11" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:18.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu18.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:20.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu20.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:22.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu22.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "linuxmintd/mint20-amd64" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Mint" + , ARTIFACT: "x86_64-linux-mint20" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "linuxmintd/mint21-amd64" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf" + , DISTRO: "Mint" + , ARTIFACT: "x86_64-linux-mint21" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:27" + , installCmd: "dnf install -y" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora27" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:33" + , installCmd: "dnf install -y" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora33" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:37" + , installCmd: "dnf install -y" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora37" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "centos:7" + , installCmd: "yum -y install epel-release && yum install -y" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "CentOS" + , ARTIFACT: "x86_64-linux-centos7" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "rockylinux:8" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky8" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "rockylinux:9" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky9" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { 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 autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-unknown" + , ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + }, + { image: "alpine:3.12" + , 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 autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine312" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "alpine:3.19" + , 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 autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine319" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ghcr.io/void-linux/void-glibc:latest" + , installCmd: "xbps-install -Sy" + , toolRequirements: "ncurses-libtinfo-libs autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils findutils gcc gmp gmp-devel jq lbzip2 make ncurses ncurses-devel openssh patch perl python3 sqlite sudo wget which xz tar zlib-devel patchelf" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-void-glibc" + , ADD_CABAL_ARGS: "--enable-split-sections" + } + ] + container: + image: ${{ matrix.platform.image }} + steps: + - name: Install requirements + shell: sh + run: | + ${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} + + - uses: actions/checkout@v3 + + - name: Run build + run: | + bash .github/scripts/build.sh + + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-linux-32bit: + name: Build linux binaries (32bit) + runs-on: ubuntu-latest + env: + TARBALL_EXT: tar.xz + ARCH: 32 + TZ: Asia/Singapore + GHC_VERSION: 9.2.1 + DISTRO: "Unknown" + ARTIFACT: "i386-linux-unknown" + ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Run build (32 bit linux) + uses: docker://hasufell/i386-alpine-haskell:3.12 + with: + args: sh -c "apk update && apk add bash binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static && bash .github/scripts/build.sh" + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-arm: + name: Build ARM binary + runs-on: ${{ matrix.os }} + env: + TARBALL_EXT: tar.xz + ADD_CABAL_ARGS: "" + DEBIAN_FRONTEND: noninteractive + TZ: Asia/Singapore + ARCH: ARM64 + DISTRO: Debian + GHC_VERSION: 9.2.8 + strategy: + fail-fast: false + matrix: + include: + - os: [self-hosted, Linux, ARM64, maerwald] + ARCH: ARM + ARTIFACT: "armv7-linux-deb10" + - os: [self-hosted, Linux, ARM64, maerwald] + ARCH: ARM64 + ARTIFACT: "aarch64-linux-deb10" + steps: + - name: git config + run: | + git config --global --get-all safe.directory | grep '^\*$' || git config --global --add safe.directory "*" + shell: bash + + - name: Checkout code + uses: actions/checkout@v3 + + - if: matrix.ARCH == 'ARM' + uses: docker://hasufell/arm32v7-debian-haskell:10 + name: Run build (armv7 linux) + with: + args: bash .github/scripts/build.sh + env: + ARTIFACT: ${{ matrix.ARTIFACT }} + + - if: matrix.ARCH == 'ARM64' + uses: docker://hasufell/arm64v8-debian-haskell:10 + name: Run build (aarch64 linux) + with: + args: bash .github/scripts/build.sh + env: + ARTIFACT: ${{ matrix.ARTIFACT }} + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-mac-x86_64: + name: Build binary (Mac x86_64) + runs-on: macOS-11 + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-apple-darwin" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + GHC_VERSION: 9.2.8 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run build + run: | + brew install coreutils tree + bash .github/scripts/build.sh + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-mac-aarch64: + name: Build binary (Mac aarch64) + runs-on: [self-hosted, macOS, ARM64] + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + ADD_CABAL_ARGS: "" + ARTIFACT: "aarch64-apple-darwin" + ARCH: ARM64 + TARBALL_EXT: tar.xz + DISTRO: na + HOMEBREW_CHANGE_ARCH_TO_ARM: 1 + GHC_VERSION: 9.2.8 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run build + run: | + bash .github/scripts/brew.sh git coreutils autoconf automake tree + export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH" + export LD=ld + bash .github/scripts/build.sh + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-win: + name: Build binary (Win) + runs-on: windows-latest + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-mingw64" + ARCH: 64 + TARBALL_EXT: "zip" + DISTRO: na + GHC_VERSION: 9.2.8 + steps: + - name: install windows deps + shell: pwsh + run: | + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git" + taskkill /F /FI "MODULES eq msys-2.0.dll" + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run build (windows) + run: | + $env:CHERE_INVOKING = 1 + $env:MSYS2_PATH_TYPE = "inherit" + $ErrorActionPreference = "Stop" + C:\msys64\usr\bin\bash -lc "bash .github/scripts/build.sh" + shell: pwsh + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + build-freebsd-x86_64: + name: Build FreeBSD x86_64 + runs-on: [self-hosted, FreeBSD, X64] + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-portbld-freebsd" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + GHC_VERSION: 9.2.8 + RUNNER_OS: FreeBSD + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run build + run: | + sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14 libiconv + tzsetup Etc/GMT + adjkerntz -a + bash .github/scripts/build.sh + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + retention-days: 2 + name: artifacts + path: | + ./out/* + + release: + name: release + needs: ["build-linux", "build-linux-32bit", "build-arm", "build-mac-x86_64", "build-mac-aarch64", "build-win", "build-freebsd-x86_64"] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: artifacts + path: ./out + + - name: Install requirements + run: | + sudo apt-get update && sudo apt-get install -y tar xz-utils + shell: bash + + - name: build sdists + run: | + cabal sdist -o out all + shell: bash + + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + ./out/* + diff --git a/.github/workflows/users-guide.yml b/.github/workflows/users-guide.yml index 5b56c25266b..cd8137fbc38 100644 --- a/.github/workflows/users-guide.yml +++ b/.github/workflows/users-guide.yml @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: ['3.10'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 9c9ac2f4a3e..ef09f6f8997 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,11 +6,6 @@ defaults: run: shell: bash -# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - on: push: branches: @@ -19,14 +14,15 @@ on: release: types: - created + workflow_dispatch: env: # We choose a stable ghc version across all os's # which will be used to do the next release - GHC_FOR_RELEASE: '9.2.3' + GHC_FOR_RELEASE: '9.2.8' # Ideally we should use the version about to be released for hackage tests and benchmarks - GHC_FOR_SOLVER_BENCHMARKS: '9.2.3' - GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.2.3' + GHC_FOR_SOLVER_BENCHMARKS: '9.2.8' + GHC_FOR_COMPLETE_HACKAGE_TESTS: '9.2.8' COMMON_FLAGS: '-j 2 -v' jobs: @@ -38,34 +34,34 @@ jobs: strategy: matrix: os: ["ubuntu-20.04", "macos-latest", "windows-latest"] - ghc: ["9.4.2", "9.2.3", "9.0.2", "8.10.7", "8.8.4", "8.6.5", "8.4.4"] - exclude: - # corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356 - - os: "windows-latest" - ghc: "8.10.7" - # lot of segfaults caused by ghc bugs - - os: "windows-latest" - ghc: "8.8.4" - # it also throws segfaults randomly - - os: "windows-latest" - ghc: "8.4.4" - # it often randomly does "C:\Users\RUNNER~1\AppData\Local\Temp\ghcFEDE.c: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcFEDE.c": permission denied (Access is denied.)" - - os: "windows-latest" - ghc: "8.6.5" + ghc: ["9.2.8"] steps: - uses: actions/checkout@v3 - - uses: haskell/actions/setup@v2 + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi + - uses: haskell-actions/setup@v2 id: setup-haskell with: ghc-version: ${{ matrix.ghc }} - cabal-version: '3.8.1.0' + cabal-version: '3.10.1.0' # See the following link for a breakdown of the following step # https://github.com/haskell/actions/issues/7#issuecomment-745697160 - - uses: actions/cache@v2 + # + # See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded + - if: ${{ runner.os != 'Windows' }} + uses: actions/cache@v3 with: # validate.sh uses a special build dir path: | @@ -174,74 +170,136 @@ jobs: if: matrix.cli != 'false' run: sh validate.sh $FLAGS -s cli-suite - validate-old-ghcs: - name: Validate old ghcs ${{ matrix.extra-ghc }} - runs-on: ubuntu-20.04 - needs: validate - # This job needs an older ubuntu (16.04) cause - # the required old ghcs using the `-dyn` flavour - # are not installable from ppa/hvr in newer ones - # see https://github.com/haskell/cabal/issues/8011 - container: - image: phadej/ghc:8.8.4-xenial - + # The job below is a copy-paste of validate with the necessary tweaks + # to make all work with an upcoming GHC. Those tweaks include: + # - ghcup needs the prerelease channel activated + # - allow-newer for base libraries and Cabal* libraries + # - (sometimes) disabling some parts on Windows because it's hard to figure + # out why they fail + validate-prerelease: + # TODO: reenable when the next GHC prerelease appears + if: false + + name: Validate ${{ matrix.os }} ghc-prerelease + runs-on: ${{ matrix.os }} + outputs: + GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }} strategy: matrix: - # Newer ghc versions than 8.8.4 have to be installed with ghcup cause - # they are not available in ppa/hvr. The ghcup installation - # needs `sudo` which is not available in the xenial container - ghc: ["8.8.4"] - extra-ghc: ["7.10.3", "7.8.4", "7.6.3", "7.4.2", "7.2.2", "7.0.4"] + os: ["ubuntu-20.04", "macos-latest", "windows-latest"] steps: - # We can't use actions/checkout with the xenial docker container - # cause it does not work with the git version included in it, see: - # https://github.com/actions/checkout/issues/170 - # https://github.com/actions/checkout/issues/295 - # - uses: actions/checkout@v3 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) + - uses: actions/checkout@v3 - - name: Install extra compiler + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache run: | - apt-get update - apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi - - uses: haskell/actions/setup@v2 - id: setup-haskell - with: - ghc-version: ${{ matrix.ghc }} - cabal-version: '3.8.1.0' + - name: ghcup + run: | + ghcup --version + ghcup config set cache true + ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml + ghcup install ghc --set 9.6.0.20230210 + ghcup install cabal --set latest + ghc --version + cabal update - # As we are reusing the cached build dir from the previous step - # the generated artifacts are available here, - # including the cabal executable and the test suite - - uses: actions/cache@v2 + # See the following link for a breakdown of the following step + # https://github.com/haskell/actions/issues/7#issuecomment-745697160 + # + # See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded + - if: ${{ runner.os != 'Windows' }} + uses: actions/cache@v3 with: + # validate.sh uses a special build dir path: | ${{ steps.setup-haskell.outputs.cabal-store }} dist-* key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419- + - name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546) + run: | + git config --global protocol.file.allow always + + # The '+exe' constraint below is important, otherwise cabal-install + # might decide to build the library but not the executable which is + # what we need. - name: Install cabal-plan run: | cd $(mktemp -d) - cabal install cabal-plan --constraint='cabal-plan +exe' + cabal install cabal-plan --constraint='cabal-plan +exe' --allow-newer echo "$HOME/.cabal/bin" >> $GITHUB_PATH + # The tool is not essential to the rest of the test suite. If + # hackage-repo-tool is not present, any test that requires it will + # be skipped. + # We want to keep this in the loop but we don't want to fail if + # hackage-repo-tool breaks or fails to support a newer GHC version. + - name: Install hackage-repo-tool + continue-on-error: true + run: | + cd $(mktemp -d) + cabal install hackage-repo-tool + + # Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs + - name: Install Autotools + if: runner.os == 'macOS' + run: | + brew install automake + + - name: Allow newer boot libraries + run: | + echo "allow-newer: base, template-haskell, ghc-prim, Cabal-syntax, Cabal-described, Cabal, cabal-install-solver, cabal-install" >> cabal.project.validate + + - name: Set validate inputs + run: | + FLAGS="${{ env.COMMON_FLAGS }}" + if [[ "${{ matrix.cli }}" == "false" ]]; then + FLAGS="$FLAGS --lib-only" + fi + echo "FLAGS=$FLAGS" >> $GITHUB_ENV + + - name: Validate print-config + run: sh validate.sh $FLAGS -s print-config + + - name: Validate print-tool-versions + run: sh validate.sh $FLAGS -s print-tool-versions + - name: Validate build - run: sh validate.sh ${{ env.COMMON_FLAGS }} -s build + run: sh validate.sh $FLAGS -s build - - name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}" + - name: Validate lib-tests env: - EXTRA_GHC: "/opt/ghc/${{ matrix.extra-ghc }}/bin/ghc-${{ matrix.extra-ghc }}" - run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc ${{ env.EXTRA_GHC }} + # `rawSystemStdInOut reports text decoding errors` + # test does not find ghc without the full path in windows + GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }} + run: sh validate.sh $FLAGS -s lib-tests + + - name: Validate lib-suite + # see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848 + # for discussion about the trouble on Windows + if: ${{ runner.os != 'Windows' }} + run: sh validate.sh $FLAGS -s lib-suite + + - name: Validate cli-tests + if: matrix.cli != 'false' + run: sh validate.sh $FLAGS -s cli-tests + + - name: Validate cli-suite + # see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848 + # for discussion about the trouble on Windows + if: ( runner.os != 'Windows' ) && ( matrix.cli != 'false' ) + run: sh validate.sh $FLAGS -s cli-suite # The previous jobs use a released version of cabal to build cabal HEAD itself # This one uses the cabal HEAD generated executable in the previous step @@ -261,7 +319,17 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: haskell/actions/setup@v2 + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi + - uses: haskell-actions/setup@v2 id: setup-haskell with: ghc-version: ${{ matrix.ghc }} @@ -290,19 +358,3 @@ jobs: - name: Build using cabal HEAD run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s build - # We use this job as a summary of the workflow - # It will fail if any of the previous jobs does it - # This way we can use it exclusively in branch protection rules - # and abstract away the concrete jobs of the workflow, including their names - validate-post-job: - if: always() - name: Validate post job - runs-on: ubuntu-20.04 - # IMPORTANT! Any job added to the workflow should be added here too - needs: [validate, validate-old-ghcs, dogfooding] - - steps: - - run: | - echo "jobs info: ${{ toJSON(needs) }}" - - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') - run: exit 1 diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml index 0eddc2f7307..9c759ee3e35 100644 --- a/.github/workflows/whitespace.yml +++ b/.github/workflows/whitespace.yml @@ -31,6 +31,15 @@ jobs: path: "~/.local/bin" key: fix-whitespace-${{ env.fix-whitespace-ver }} + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo mkdir -p /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi + - uses: haskell/actions/setup@v2 if: ${{ !steps.cache.outputs.cache-hit }} with: @@ -40,7 +49,7 @@ jobs: - name: Install fix-whitespace if: ${{ !steps.cache.outputs.cache-hit }} run: | - cabal install --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }} + cabal install --constraint=aeson==2.1.2.1 --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }} strip $HOME/.local/bin/fix-whitespace - name: Check the whitespace issue diff --git a/.gitignore b/.gitignore index 8f1097ae8a1..e9ec3b6322f 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ register.sh # windows test artifacts cabal-testsuite/**/*.exe cabal-testsuite/**/*.bat +cabal-testsuite/**/haddocks # python artifacts from documentation builds *.pyc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 751ee16f019..4fdf3ed5204 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,9 @@ stages: - build -# Used for ci setup in the gitlab mirror of the project: -# https://gitlab.haskell.org/haskell/haskell-language-server/-/pipelines variables: # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: "9e4c540d9e4972a36291dfdf81f079f37d748890" + DOCKER_REV: "572353e0644044fe3a5465bba4342a9a0b0eb60e" GHC_VERSION: 9.2.3 CABAL_INSTALL_VERSION: 3.6.2.0 @@ -28,87 +26,59 @@ workflow: paths: - out/* -build-aarch64-linux-deb10: +build-linux: extends: .build + parallel: + matrix: + - ARCH: i386 + TAG: x86_64-linux + OS: + - deb9 + - ARCH: x86_64 + TAG: x86_64-linux + OS: + - centos7 + - deb9 + - fedora33 + - rocky8 + - ubuntu18_04 + - ubuntu20_04 + - deb10 + - deb11 + - ARCH: aarch64 + TAG: aarch64-linux + OS: + - deb10 + - deb11 tags: - - aarch64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV" + - $TAG + image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV" variables: - TARBALL_ARCHIVE_SUFFIX: aarch64-linux-deb10 - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "" - -build-armv7-linux-deb10: - extends: .build - tags: - - armv7-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV" - variables: - TARBALL_ARCHIVE_SUFFIX: armv7-linux-deb1 - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "" - # temp, because 3.6.2.0 is broken - CABAL_INSTALL_VERSION: 3.4.0.0 - retry: 2 - -build-x86_64-linux: - extends: .build - tags: - - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" - variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-linux-deb10 + PLATFORM: "${ARCH}-linux-${OS}" + TARBALL_ARCHIVE_SUFFIX: $PLATFORM TARBALL_EXT: tar.xz ADD_CABAL_ARGS: "--enable-split-sections" -build-x86_64-linux-deb11: - extends: .build - tags: - - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV" - variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-linux-deb11 - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "--enable-split-sections" - -build-x86_64-linux-alpine: +build-linux-alpine: extends: .build + parallel: + matrix: + - ARCH: i386 + OS: [alpine3_12] + GHC_VERSION: 9.0.2 + - ARCH: x86_64 + OS: [alpine3_12] tags: - x86_64-linux before_script: # for cabal build - sudo apk add --no-cache zlib zlib-dev zlib-static - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV" - variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-linux-alpine - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" - -build-i386-linux-alpine: - extends: .build - tags: - - x86_64-linux - image: "i386/alpine:3.12" - before_script: - # for GHC - - apk add --no-cache bash curl gcc g++ binutils binutils-gold bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl - # for cabal build - - apk add --no-cache zlib zlib-dev zlib-static + image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV" variables: - TARBALL_ARCHIVE_SUFFIX: i386-linux-alpine + PLATFORM: "${ARCH}-linux-${OS}" + TARBALL_ARCHIVE_SUFFIX: $PLATFORM TARBALL_EXT: tar.xz ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" - # temp, because 3.6.2.0 is broken - CABAL_INSTALL_VERSION: 3.4.0.0 - -build-x86_64-freebsd12: - extends: .build - tags: - - x86_64-freebsd12 - variables: - TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd12 - TARBALL_EXT: tar.xz - ADD_CABAL_ARGS: "--enable-split-sections" build-x86_64-darwin: extends: .build @@ -143,10 +113,15 @@ build-aarch64-darwin: TARBALL_ARCHIVE_SUFFIX: aarch64-darwin TARBALL_EXT: tar.xz ADD_CABAL_ARGS: "" + # Update periodically. + BREW_VERSION: 4.0.5 artifacts: expire_in: 2 week paths: - out/* + cache: + paths: + - .brew build-x86_64-windows: extends: .build diff --git a/.gitlab/brew.sh b/.gitlab/brew.sh index de769632e6f..a7bc6024124 100644 --- a/.gitlab/brew.sh +++ b/.gitlab/brew.sh @@ -1,10 +1,18 @@ #!/usr/bin/env bash -set -Eeuxo pipefail +set -Eeuo pipefail # Install brew locally in the project dir. Packages will also be installed here. -[ -e "$CI_PROJECT_DIR/.brew" ] || git clone --depth=1 https://github.com/Homebrew/brew $CI_PROJECT_DIR/.brew -export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" +# FIXME: Use brew in supported way. See +# https://docs.brew.sh/Installation#untar-anywhere-unsupported +brew_dir="${CI_PROJECT_DIR}/.brew" + +if [ ! -e "${brew_dir}" ]; then + mkdir -p "${brew_dir}" + curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}" +fi + +export PATH="${brew_dir}/bin:${brew_dir}/sbin:$PATH" # make sure to not pollute the machine with temp files etc mkdir -p $CI_PROJECT_DIR/.brew_cache diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 95d43664cb9..c856f9f2cb9 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -Eeuxo pipefail +set -Eeuo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" @@ -26,8 +26,9 @@ export PATH="$GHCUP_BINDIR:$PATH" export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_INSTALL_VERSION -export BOOTSTRAP_HASKELL_VERBOSE=1 export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes +# We don't use stack, and it isn't available on i386-deb9 +export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes # for some reason the subshell doesn't pick up the arm64 environment on darwin # and starts installing x86_64 GHC @@ -48,7 +49,11 @@ case "$(uname -s)" in esac # https://github.com/haskell/cabal/issues/7313#issuecomment-811851884 -if [ "$(getconf LONG_BIT)" == "32" ] ; then +# and +# https://github.com/haskellari/lukko/issues/17 +# +# $PLATFORM comes from CI. +if [ "$(getconf LONG_BIT)" = "32" -o "${PLATFORM:=xxx}" = "x86_64-linux-centos7" ] ; then echo 'constraints: lukko -ofd-locking' >> cabal.project.release.local fi @@ -60,6 +65,7 @@ args=( ${ADD_CABAL_ARGS} ) +run cabal update hackage.haskell.org,HEAD run cabal v2-build ${args[@]} cabal-install mkdir "$CI_PROJECT_DIR/out" diff --git a/.readthedocs.yml b/.readthedocs.yml index 347901d93bd..016f7e47a48 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,11 @@ version: 2 sphinx: configuration: doc/conf.py +build: + os: "ubuntu-22.04" + tools: + python: "3.8" + python: - version: 3.7 install: - requirements: doc/requirements.txt diff --git a/Cabal-QuickCheck/Cabal-QuickCheck.cabal b/Cabal-QuickCheck/Cabal-QuickCheck.cabal index 2240dca999c..29a9462354c 100644 --- a/Cabal-QuickCheck/Cabal-QuickCheck.cabal +++ b/Cabal-QuickCheck/Cabal-QuickCheck.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-QuickCheck -version: 3.9.0.0 +version: 3.10.1.0 synopsis: QuickCheck instances for types in Cabal category: Testing description: @@ -13,8 +13,8 @@ library build-depends: , base , bytestring - , Cabal ^>=3.9.0.0 - , Cabal-syntax ^>=3.9.0.0 + , Cabal ^>=3.10.0.0 + , Cabal-syntax ^>=3.10.0.0 , QuickCheck ^>=2.13.2 || ^>=2.14 exposed-modules: diff --git a/Cabal-described/Cabal-described.cabal b/Cabal-described/Cabal-described.cabal index 680272a8d2b..7458ee5f7f1 100644 --- a/Cabal-described/Cabal-described.cabal +++ b/Cabal-described/Cabal-described.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-described -version: 3.9.0.0 +version: 3.10.1.0 synopsis: Described functionality for types in Cabal category: Testing, Parsec description: Provides rere bindings @@ -11,8 +11,8 @@ library ghc-options: -Wall build-depends: , base - , Cabal ^>=3.9.0.0 - , Cabal-syntax ^>=3.9.0.0 + , Cabal ^>=3.10.0.0 + , Cabal-syntax ^>=3.10.0.0 , containers , pretty , QuickCheck diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index b0c72447648..ae63957eebd 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: Cabal-syntax -version: 3.9.0.0 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +version: 3.10.3.0 +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -15,7 +15,7 @@ description: category: Distribution build-type: Simple -extra-source-files: +extra-doc-files: README.md ChangeLog.md source-repository head @@ -29,17 +29,17 @@ library build-depends: array >= 0.4.0.1 && < 0.6, - base >= 4.6 && < 5, + base >= 4.9 && < 5, binary >= 0.7 && < 0.9, - bytestring >= 0.10.0.0 && < 0.12, - containers >= 0.5.0.0 && < 0.7, - deepseq >= 1.3.0.1 && < 1.5, + bytestring >= 0.10.0.0 && < 0.13, + containers >= 0.5.0.0 && < 0.8, + deepseq >= 1.3.0.1 && < 1.6, directory >= 1.2 && < 1.4, - filepath >= 1.3.0.1 && < 1.5, + filepath >= 1.3.0.1 && < 1.6, mtl >= 2.1 && < 2.4, parsec >= 3.1.13.0 && < 3.2, pretty >= 1.1.1 && < 1.2, - text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1), + text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2), time >= 1.4.0.1 && < 1.13, -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity -- See also https://github.com/ekmett/transformers-compat/issues/35 diff --git a/Cabal-syntax/ChangeLog.md b/Cabal-syntax/ChangeLog.md index 19933508cd9..7706be32368 100644 --- a/Cabal-syntax/ChangeLog.md +++ b/Cabal-syntax/ChangeLog.md @@ -1 +1 @@ -Please see https://hackage.haskell.org/package/Cabal/changelog +Please see See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.3.0.md diff --git a/Cabal-syntax/LICENSE b/Cabal-syntax/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/Cabal-syntax/LICENSE +++ b/Cabal-syntax/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/Cabal-syntax/src/Distribution/CabalSpecVersion.hs b/Cabal-syntax/src/Distribution/CabalSpecVersion.hs index 142ade373c4..a307bb4b0f3 100644 --- a/Cabal-syntax/src/Distribution/CabalSpecVersion.hs +++ b/Cabal-syntax/src/Distribution/CabalSpecVersion.hs @@ -30,6 +30,7 @@ data CabalSpecVersion | CabalSpecV3_4 | CabalSpecV3_6 | CabalSpecV3_8 + -- 3.10: no changes deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic) instance Binary CabalSpecVersion diff --git a/Cabal-syntax/src/Distribution/Compat/Prelude.hs b/Cabal-syntax/src/Distribution/Compat/Prelude.hs index 954714dc8ab..51a32f912b1 100644 --- a/Cabal-syntax/src/Distribution/Compat/Prelude.hs +++ b/Cabal-syntax/src/Distribution/Compat/Prelude.hs @@ -130,10 +130,9 @@ module Distribution.Compat.Prelude ( -- We also could hide few partial function import Prelude as BasePrelude hiding - ( mapM, mapM_, sequence, null, length, foldr, any, all, head, tail, last, init + ( mapM, mapM_, sequence, any, all, head, tail, last, init -- partial functions , read - , foldr1, foldl1 #if MINVER_base_411 -- As of base 4.11.0.0 Prelude exports part of Semigroup(..). -- Hide this so we instead rely on Distribution.Compat.Semigroup. @@ -142,8 +141,9 @@ import Prelude as BasePrelude hiding , Word -- We hide them, as we import only some members , Traversable, traverse, sequenceA - , Foldable, foldMap + , Foldable(..) ) +import Data.Foldable as BasePrelude (foldl, elem, sum, product, maximum, minimum) -- AMP import Data.Foldable @@ -186,7 +186,7 @@ import Data.Word (Word, Word16, Word32, Word64, Word8) import Distribution.Compat.Binary (Binary (..)) import Distribution.Compat.Semigroup (Semigroup (..), gmappend, gmempty) import Distribution.Compat.Typeable (TypeRep, Typeable, typeRep) -import GHC.Generics ((:*:) ((:*:)), (:+:) (L1, R1), Generic, K1 (unK1), M1 (unM1), Rep (..), U1 (U1), V1) +import GHC.Generics (Generic (..), K1 (unK1), M1 (unM1), U1 (U1), V1, (:*:) ((:*:)), (:+:) (L1, R1)) import System.Exit (ExitCode (..), exitFailure, exitSuccess, exitWith) import Text.Read (readMaybe) diff --git a/Cabal-syntax/src/Distribution/Fields/Lexer.hs b/Cabal-syntax/src/Distribution/Fields/Lexer.hs index 63388b36ad4..3d6e97763ec 100644 --- a/Cabal-syntax/src/Distribution/Fields/Lexer.hs +++ b/Cabal-syntax/src/Distribution/Fields/Lexer.hs @@ -1,7 +1,7 @@ {-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-missing-signatures #-} -{-# LANGUAGE CPP,MagicHash #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE MagicHash #-} {-# LINE 1 "templates/Lexer.x" #-} - ----------------------------------------------------------------------------- -- | -- Module : Distribution.Fields.Lexer @@ -52,7 +52,6 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.Encoding.Error as T #endif - #if __GLASGOW_HASKELL__ >= 603 #include "ghcconfig.h" #elif defined(__GLASGOW_HASKELL__) @@ -73,106 +72,107 @@ alex_tab_size :: Int alex_tab_size = 8 alex_base :: AlexAddr alex_base = AlexA# - "\x12\xff\xff\xff\xf9\xff\xff\xff\xfb\xff\xff\xff\x01\x00\x00\x00\x2f\x00\x00\x00\x50\x00\x00\x00\xd0\x00\x00\x00\x48\xff\xff\xff\xdc\xff\xff\xff\x51\xff\xff\xff\x6d\xff\xff\xff\x6f\xff\xff\xff\x50\x01\x00\x00\x74\x01\x00\x00\x70\xff\xff\xff\x68\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\xa3\x01\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x00\x00\x00\xd1\x01\x00\x00\xfb\x01\x00\x00\x7b\x02\x00\x00\xfb\x02\x00\x00\x00\x00\x00\x00\x7b\x03\x00\x00\x7d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x6d\x00\x00\x00\x6b\x00\x00\x00\xfc\x03\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x6f\x00\x00\x00\x1c\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00"# + "\x12\xff\xff\xff\xf9\xff\xff\xff\xfb\xff\xff\xff\x01\x00\x00\x00\x2f\x00\x00\x00\x50\x00\x00\x00\xd0\x00\x00\x00\x50\x01\x00\x00\xd0\x01\x00\x00\x50\x02\x00\x00\x81\x00\x00\x00\xfe\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x69\xff\xff\xff\x03\x00\x00\x00\x09\x00\x00\x00\xf8\x00\x00\x00\xe2\xff\xff\xff\xd0\x02\x00\x00\x71\xff\xff\xff\x0b\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x5f\xff\xff\xff\x5d\xff\xff\xff\x00\x00\x00\x00\xf0\x02\x00\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x03\x00\x00\x6a\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\x66\x03\x00\x00\x98\x00\x00\x00\x80\xff\xff\xff\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x03\x00\x00\x00\x00\x00\x00\xef\x03\x00\x00\x13\x04\x00\x00"# alex_table :: AlexAddr alex_table = AlexA# - "\x00\x00\x09\x00\x0f\x00\x11\x00\x02\x00\x11\x00\x12\x00\x00\x00\x12\x00\x13\x00\x03\x00\x11\x00\x07\x00\x10\x00\x12\x00\x25\x00\x14\x00\x11\x00\x10\x00\x11\x00\x14\x00\x11\x00\x12\x00\x23\x00\x12\x00\x0f\x00\x28\x00\x02\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x08\x00\x10\x00\x00\x00\x14\x00\x00\x00\x00\x00\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2a\x00\x2e\x00\xff\xff\xff\xff\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x26\x00\x28\x00\xff\xff\xff\xff\x29\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x26\x00\x0f\x00\x11\x00\x17\x00\x26\x00\x12\x00\x25\x00\x11\x00\x2a\x00\x00\x00\x12\x00\x00\x00\x15\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x17\x00\x26\x00\x00\x00\x25\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x00\x00\x2d\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x0e\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x23\x00\xff\xff\xff\xff\x24\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x1e\x00\x0d\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x1f\x00\x1f\x00\x1e\x00\x1e\x00\x1e\x00\x19\x00\x1a\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x1f\x00\x1e\x00\x1f\x00\x1e\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x21\x00\x1e\x00\x22\x00\x1e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x1d\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1e\x00\xff\xff\x1e\x00\x1e\x00\x1e\x00\x1e\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1e\x00\x1e\x00\x18\x00\x1a\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x1e\x00\xff\xff\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x1e\x00\xff\xff\x1e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1e\x00\xff\xff\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\xff\xff\xff\xff\x1e\x00\x1e\x00\x1e\x00\x1a\x00\x1a\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x1e\x00\xff\xff\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x1e\x00\xff\xff\x1e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x1c\x00\x1e\x00\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\xff\xff\x1e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# + "\x00\x00\x18\x00\x11\x00\x17\x00\x02\x00\x17\x00\x16\x00\x0b\x00\x16\x00\x0f\x00\x03\x00\x17\x00\x0f\x00\x17\x00\x16\x00\x13\x00\x16\x00\x15\x00\x10\x00\x17\x00\x15\x00\x17\x00\x16\x00\x17\x00\x16\x00\x11\x00\x19\x00\x02\x00\x1a\x00\x1c\x00\x0b\x00\x22\x00\x10\x00\x03\x00\x27\x00\x0f\x00\x00\x00\x00\x00\x12\x00\x00\x00\x12\x00\x10\x00\x00\x00\x15\x00\x00\x00\x00\x00\x12\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x21\x00\x1c\x00\xff\xff\xff\xff\x1d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x21\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x25\x00\x22\x00\xff\xff\xff\xff\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x25\x00\x00\x00\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x0c\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x21\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x1e\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x25\x00\x00\x00\x00\x00\x14\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\x00\x00\x00\x14\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x27\x00\xff\xff\xff\xff\x28\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x00\x2d\x00\x1b\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x2d\x00\x2d\x00\x08\x00\x09\x00\x2d\x00\xff\xff\x11\x00\x17\x00\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x00\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2d\x00\x29\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\xff\xff\xff\xff\x2d\x00\x2d\x00\x2d\x00\x0a\x00\x09\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x2d\x00\xff\xff\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x2d\x00\xff\xff\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\xff\xff\xff\xff\x2d\x00\x2d\x00\x2d\x00\x09\x00\x09\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x2d\x00\xff\xff\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x2d\x00\xff\xff\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xff\xff\x2d\x00\xff\xff\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x00\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x00\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x2e\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"# alex_check :: AlexAddr alex_check = AlexA# - "\xff\xff\xef\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x0d\x00\xbf\x00\x0d\x00\x2d\x00\x09\x00\x0a\x00\xbb\x00\xa0\x00\x0d\x00\xa0\x00\xa0\x00\x0a\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x0d\x00\x0a\x00\x0d\x00\x20\x00\x0a\x00\x20\x00\x0a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\x2d\x00\x20\x00\xff\xff\x20\x00\xff\xff\xff\xff\x2d\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x09\x00\x0a\x00\x09\x00\x09\x00\x0d\x00\x09\x00\x0a\x00\x09\x00\xff\xff\x0d\x00\xff\xff\x7b\x00\xff\xff\x7d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\x20\x00\x20\x00\xff\xff\x20\x00\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\xff\xff\x7d\x00\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xc2\x00\xff\xff\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x5c\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x5c\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x7f\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\xff\xff\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\x21\x00\xff\xff\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\xff\xff\xff\xff\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\x5c\x00\xff\xff\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7c\x00\x7f\x00\x7e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\xff\xff\x7d\x00\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# + "\xff\xff\xef\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x0d\x00\x09\x00\x0d\x00\xa0\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x0d\x00\x2d\x00\x0d\x00\xa0\x00\x09\x00\x0a\x00\x09\x00\x0a\x00\x0d\x00\x0a\x00\x0d\x00\x20\x00\xbb\x00\x20\x00\xbf\x00\x0a\x00\x20\x00\x0a\x00\xa0\x00\x20\x00\x0a\x00\x20\x00\xff\xff\xff\xff\x2d\x00\xff\xff\x2d\x00\x20\x00\xff\xff\x20\x00\xff\xff\xff\xff\x2d\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\xff\xff\x7d\x00\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x20\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\xff\xff\x7d\x00\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xc2\x00\xff\xff\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xc2\x00\xff\xff\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x7f\x00\x09\x00\x0a\x00\xff\xff\xff\xff\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\xff\xff\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc2\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x7f\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\xff\xff\x7d\x00\x21\x00\x7f\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\xff\xff\xff\xff\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\x5e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7c\x00\xff\xff\x7e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"# alex_deflt :: AlexAddr alex_deflt = AlexA# - "\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x27\x00\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\x18\x00\x1b\x00\x1b\x00\x1b\x00\xff\xff\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\xff\xff\xff\xff\xff\xff\x2b\x00\xff\xff\xff\xff\xff\xff\xff\xff"# + "\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\x24\x00\x07\x00\x07\x00\x07\x00\x07\x00\x0a\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x13\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\x24\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1b\x00"# -alex_accept = listArray (0 :: Int, 47) - [ AlexAcc 29 +alex_accept = listArray (0 :: Int, 48) + [ AlexAcc 30 + , AlexAcc 29 , AlexAcc 28 , AlexAcc 27 - , AlexAcc 26 - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone - , AlexAccNone , AlexAccNone , AlexAccNone , AlexAccNone + , AlexAcc 26 , AlexAcc 25 , AlexAcc 24 , AlexAccSkip + , AlexAccSkip , AlexAcc 23 , AlexAcc 22 + , AlexAccNone , AlexAcc 21 - , AlexAccSkip - , AlexAccSkip , AlexAcc 20 + , AlexAccNone + , AlexAccNone + , AlexAccSkip + , AlexAccNone + , AlexAccNone , AlexAcc 19 , AlexAcc 18 + , AlexAccNone + , AlexAccNone , AlexAcc 17 + , AlexAccNone , AlexAcc 16 , AlexAcc 15 , AlexAcc 14 , AlexAcc 13 , AlexAcc 12 + , AlexAccSkip , AlexAcc 11 , AlexAcc 10 , AlexAcc 9 - , AlexAcc 8 , AlexAccSkip + , AlexAccNone + , AlexAcc 8 , AlexAcc 7 , AlexAcc 6 , AlexAcc 5 - , AlexAccSkip , AlexAcc 4 , AlexAcc 3 , AlexAcc 2 , AlexAcc 1 , AlexAcc 0 + , AlexAccNone ] -alex_actions = array (0 :: Int, 30) - [ (29,alex_action_0) - , (28,alex_action_20) - , (27,alex_action_16) - , (26,alex_action_3) - , (25,alex_action_1) - , (24,alex_action_1) - , (23,alex_action_3) +alex_actions = array (0 :: Int, 31) + [ (30,alex_action_0) + , (29,alex_action_20) + , (28,alex_action_16) + , (27,alex_action_3) + , (26,alex_action_8) + , (25,alex_action_8) + , (24,alex_action_8) + , (23,alex_action_5) , (22,alex_action_4) - , (21,alex_action_5) - , (20,alex_action_8) - , (19,alex_action_8) - , (18,alex_action_8) - , (17,alex_action_9) - , (16,alex_action_9) - , (15,alex_action_10) - , (14,alex_action_11) - , (13,alex_action_12) - , (12,alex_action_13) - , (11,alex_action_14) - , (10,alex_action_15) - , (9,alex_action_15) - , (8,alex_action_16) - , (7,alex_action_18) - , (6,alex_action_19) - , (5,alex_action_19) - , (4,alex_action_22) - , (3,alex_action_23) - , (2,alex_action_24) - , (1,alex_action_25) - , (0,alex_action_25) + , (21,alex_action_3) + , (20,alex_action_16) + , (19,alex_action_1) + , (18,alex_action_1) + , (17,alex_action_0) + , (16,alex_action_25) + , (15,alex_action_25) + , (14,alex_action_24) + , (13,alex_action_23) + , (12,alex_action_22) + , (11,alex_action_19) + , (10,alex_action_19) + , (9,alex_action_18) + , (8,alex_action_15) + , (7,alex_action_15) + , (6,alex_action_14) + , (5,alex_action_13) + , (4,alex_action_12) + , (3,alex_action_11) + , (2,alex_action_10) + , (1,alex_action_9) + , (0,alex_action_9) ] {-# LINE 151 "templates/Lexer.x" #-} - -- | Tokens of outer cabal file structure. Field values are treated opaquely. data Token = TokSym !ByteString -- ^ Haskell-like identifier, number or operator | TokStr !ByteString -- ^ String in quotes @@ -195,17 +195,17 @@ toki t pos len input = return $! L pos (t (B.take len input)) tok :: Token -> Position -> Int -> ByteString -> Lex LToken tok t pos _len _input = return $! L pos t -checkLeadingWhitespace :: Int -> ByteString -> Lex Int -checkLeadingWhitespace len bs +checkLeadingWhitespace :: Position -> Int -> ByteString -> Lex Int +checkLeadingWhitespace pos len bs | B.any (== 9) (B.take len bs) = do - addWarning LexWarningTab - checkWhitespace len bs - | otherwise = checkWhitespace len bs + addWarningAt pos LexWarningTab + checkWhitespace pos len bs + | otherwise = checkWhitespace pos len bs -checkWhitespace :: Int -> ByteString -> Lex Int -checkWhitespace len bs +checkWhitespace :: Position -> Int -> ByteString -> Lex Int +checkWhitespace pos len bs | B.any (== 194) (B.take len bs) = do - addWarning LexWarningNBSP + addWarningAt pos LexWarningNBSP return $ len - B.count 194 (B.take len bs) | otherwise = return len @@ -313,40 +313,42 @@ bol_section = 3 in_field_braces = 4 in_field_layout = 5 in_section = 6 -alex_action_0 = \_ len _ -> do - when (len /= 0) $ addWarning LexWarningBOM +alex_action_0 = \pos len _ -> do + when (len /= 0) $ addWarningAt pos LexWarningBOM setStartCode bol_section lexToken - -alex_action_1 = \_pos len inp -> checkWhitespace len inp >> adjustPos retPos >> lexToken -alex_action_3 = \pos len inp -> checkLeadingWhitespace len inp >> +alex_action_1 = \pos len inp -> checkWhitespace pos len inp >> adjustPos retPos >> lexToken +alex_action_3 = \pos len inp -> checkLeadingWhitespace pos len inp >> if B.length inp == len then return (L pos EOF) else setStartCode in_section - >> return (L pos (Indent len)) -alex_action_4 = tok OpenBrace -alex_action_5 = tok CloseBrace -alex_action_8 = toki TokSym -alex_action_9 = \pos len inp -> return $! L pos (TokStr (B.take (len - 2) (B.tail inp))) -alex_action_10 = toki TokOther -alex_action_11 = toki TokOther -alex_action_12 = tok Colon -alex_action_13 = tok OpenBrace -alex_action_14 = tok CloseBrace -alex_action_15 = \_ _ _ -> adjustPos retPos >> setStartCode bol_section >> lexToken -alex_action_16 = \pos len inp -> checkLeadingWhitespace len inp >>= \len' -> + >> return (L pos (Indent len)) +alex_action_4 = tok OpenBrace +alex_action_5 = tok CloseBrace +alex_action_8 = toki TokSym +alex_action_9 = \pos len inp -> return $! L pos (TokStr (B.take (len - 2) (B.tail inp))) +alex_action_10 = toki TokOther +alex_action_11 = toki TokOther +alex_action_12 = tok Colon +alex_action_13 = tok OpenBrace +alex_action_14 = tok CloseBrace +alex_action_15 = \_ _ _ -> adjustPos retPos >> setStartCode bol_section >> lexToken +alex_action_16 = \pos len inp -> checkLeadingWhitespace pos len inp >>= \len' -> if B.length inp == len then return (L pos EOF) else setStartCode in_field_layout - >> return (L pos (Indent len')) -alex_action_18 = toki TokFieldLine -alex_action_19 = \_ _ _ -> adjustPos retPos >> setStartCode bol_field_layout >> lexToken -alex_action_20 = \_ _ _ -> setStartCode in_field_braces >> lexToken -alex_action_22 = toki TokFieldLine -alex_action_23 = tok OpenBrace -alex_action_24 = tok CloseBrace -alex_action_25 = \_ _ _ -> adjustPos retPos >> setStartCode bol_field_braces >> lexToken -{-# LINE 1 "templates/GenericTemplate.hs" #-} + >> return (L pos (Indent len')) +alex_action_18 = toki TokFieldLine +alex_action_19 = \_ _ _ -> adjustPos retPos >> setStartCode bol_field_layout >> lexToken +alex_action_20 = \_ _ _ -> setStartCode in_field_braces >> lexToken +alex_action_22 = toki TokFieldLine +alex_action_23 = tok OpenBrace +alex_action_24 = tok CloseBrace +alex_action_25 = \_ _ _ -> adjustPos retPos >> setStartCode bol_field_braces >> lexToken + +#define ALEX_GHC 1 +#define ALEX_LATIN1 1 +#define ALEX_NOPRED 1 -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE -- @@ -356,15 +358,37 @@ alex_action_25 = \_ _ _ -> adjustPos retPos >> setStartCode bol_field_braces >> -- ----------------------------------------------------------------------------- -- INTERNALS and main scanner engine +#ifdef ALEX_GHC +# define ILIT(n) n# +# define IBOX(n) (I# (n)) +# define FAST_INT Int# -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. -#if __GLASGOW_HASKELL__ > 706 -#define GTE(n,m) (tagToEnum# (n >=# m)) -#define EQ(n,m) (tagToEnum# (n ==# m)) +# if __GLASGOW_HASKELL__ > 706 +# define GTE(n,m) (tagToEnum# (n >=# m)) +# define EQ(n,m) (tagToEnum# (n ==# m)) +# else +# define GTE(n,m) (n >=# m) +# define EQ(n,m) (n ==# m) +# endif +# define PLUS(n,m) (n +# m) +# define MINUS(n,m) (n -# m) +# define TIMES(n,m) (n *# m) +# define NEGATE(n) (negateInt# (n)) +# define IF_GHC(x) (x) #else -#define GTE(n,m) (n >=# m) -#define EQ(n,m) (n ==# m) +# define ILIT(n) (n) +# define IBOX(n) (n) +# define FAST_INT Int +# define GTE(n,m) (n >= m) +# define EQ(n,m) (n == m) +# define PLUS(n,m) (n + m) +# define MINUS(n,m) (n - m) +# define TIMES(n,m) (n * m) +# define NEGATE(n) (negate (n)) +# define IF_GHC(x) #endif +#ifdef ALEX_GHC data AlexAddr = AlexA# Addr# -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ < 503 @@ -387,7 +411,11 @@ alexIndexInt16OffAddr (AlexA# arr) off = #endif (indexInt16OffAddr# arr off) #endif +#else +alexIndexInt16OffAddr arr off = arr ! off +#endif +#ifdef ALEX_GHC {-# INLINE alexIndexInt32OffAddr #-} alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int# alexIndexInt32OffAddr (AlexA# arr) off = @@ -408,6 +436,11 @@ alexIndexInt32OffAddr (AlexA# arr) off = #endif (indexInt32OffAddr# arr off) #endif +#else +alexIndexInt32OffAddr arr off = arr ! off +#endif + +#ifdef ALEX_GHC #if __GLASGOW_HASKELL__ < 503 quickIndex arr i = arr ! i @@ -415,6 +448,9 @@ quickIndex arr i = arr ! i -- GHC >= 503, unsafeAt is available from Data.Array.Base. quickIndex = unsafeAt #endif +#else +quickIndex arr i = arr ! i +#endif -- ----------------------------------------------------------------------------- -- Main lexing routines @@ -426,26 +462,34 @@ data AlexReturn a | AlexToken !AlexInput !Int a -- alexScan :: AlexInput -> StartCode -> AlexReturn a -alexScan input__ (I# (sc)) - = alexScanUser undefined input__ (I# (sc)) +alexScan input__ IBOX(sc) + = alexScanUser undefined input__ IBOX(sc) -alexScanUser user__ input__ (I# (sc)) - = case alex_scan_tkn user__ input__ 0# input__ sc AlexNone of +alexScanUser user__ input__ IBOX(sc) + = case alex_scan_tkn user__ input__ ILIT(0) input__ sc AlexNone of (AlexNone, input__') -> case alexGetByte input__ of Nothing -> - +#ifdef ALEX_DEBUG + trace ("End of input.") $ +#endif AlexEOF Just _ -> - +#ifdef ALEX_DEBUG + trace ("Error.") $ +#endif AlexError input__' (AlexLastSkip input__'' len, _) -> - +#ifdef ALEX_DEBUG + trace ("Skipping.") $ +#endif AlexSkip input__'' len (AlexLastAcc k input__''' len, _) -> - +#ifdef ALEX_DEBUG + trace ("Accept.") $ +#endif AlexToken input__''' len (alex_actions ! k) -- Push the input through the DFA, remembering the most recent accepting @@ -454,35 +498,56 @@ alexScanUser user__ input__ (I# (sc)) alex_scan_tkn user__ orig_input len input__ s last_acc = input__ `seq` -- strict in the input let - new_acc = (check_accs (alex_accept `quickIndex` (I# (s)))) + new_acc = (check_accs (alex_accept `quickIndex` IBOX(s))) in new_acc `seq` case alexGetByte input__ of Nothing -> (new_acc, input__) Just (c, new_input) -> - - case fromIntegral c of { (I# (ord_c)) -> +#ifdef ALEX_DEBUG + trace ("State: " ++ show IBOX(s) ++ ", char: " ++ show c) $ +#endif + case fromIntegral c of { IBOX(ord_c) -> let base = alexIndexInt32OffAddr alex_base s - offset = (base +# ord_c) - check = alexIndexInt16OffAddr alex_check offset + offset = PLUS(base,ord_c) - new_s = if GTE(offset,0#) && EQ(check,ord_c) + new_s = if GTE(offset,ILIT(0)) + && let check = alexIndexInt16OffAddr alex_check offset + in EQ(check,ord_c) then alexIndexInt16OffAddr alex_table offset else alexIndexInt16OffAddr alex_deflt s in case new_s of - -1# -> (new_acc, input__) + ILIT(-1) -> (new_acc, input__) -- on an error, we want to keep the input *before* the -- character that failed, not after. - _ -> alex_scan_tkn user__ orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len) - -- note that the length is increased ONLY if this is the 1st byte in a char encoding) - new_input new_s new_acc + _ -> alex_scan_tkn user__ orig_input +#ifdef ALEX_LATIN1 + PLUS(len,ILIT(1)) + -- issue 119: in the latin1 encoding, *each* byte is one character +#else + (if c < 0x80 || c >= 0xC0 then PLUS(len,ILIT(1)) else len) + -- note that the length is increased ONLY if this is the 1st byte in a char encoding) +#endif + new_input new_s new_acc } where check_accs (AlexAccNone) = last_acc - check_accs (AlexAcc a ) = AlexLastAcc a input__ (I# (len)) - check_accs (AlexAccSkip) = AlexLastSkip input__ (I# (len)) + check_accs (AlexAcc a ) = AlexLastAcc a input__ IBOX(len) + check_accs (AlexAccSkip) = AlexLastSkip input__ IBOX(len) +#ifndef ALEX_NOPRED + check_accs (AlexAccPred a predx rest) + | predx user__ orig_input IBOX(len) input__ + = AlexLastAcc a input__ IBOX(len) + | otherwise + = check_accs rest + check_accs (AlexAccSkipPred predx rest) + | predx user__ orig_input IBOX(len) input__ + = AlexLastSkip input__ IBOX(len) + | otherwise + = check_accs rest +#endif data AlexLastAcc = AlexNone @@ -493,4 +558,32 @@ data AlexAcc user = AlexAccNone | AlexAcc Int | AlexAccSkip +#ifndef ALEX_NOPRED + | AlexAccPred Int (AlexAccPred user) (AlexAcc user) + | AlexAccSkipPred (AlexAccPred user) (AlexAcc user) + +type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool +-- ----------------------------------------------------------------------------- +-- Predicates on a rule + +alexAndPred p1 p2 user__ in1 len in2 + = p1 user__ in1 len in2 && p2 user__ in1 len in2 + +--alexPrevCharIsPred :: Char -> AlexAccPred _ +alexPrevCharIs c _ input__ _ _ = c == alexInputPrevChar input__ + +alexPrevCharMatches f _ input__ _ _ = f (alexInputPrevChar input__) + +--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ +alexPrevCharIsOneOf arr _ input__ _ _ = arr ! alexInputPrevChar input__ + +--alexRightContext :: Int -> AlexAccPred _ +alexRightContext IBOX(sc) user__ _ _ input__ = + case alex_scan_tkn user__ input__ ILIT(0) input__ sc AlexNone of + (AlexNone, _) -> False + _ -> True + -- TODO: there's no need to find the longest + -- match when checking the right context, just + -- the first match will do. +#endif diff --git a/Cabal-syntax/src/Distribution/Fields/LexerMonad.hs b/Cabal-syntax/src/Distribution/Fields/LexerMonad.hs index 3c11fac92a4..ac414c18e31 100644 --- a/Cabal-syntax/src/Distribution/Fields/LexerMonad.hs +++ b/Cabal-syntax/src/Distribution/Fields/LexerMonad.hs @@ -27,6 +27,7 @@ module Distribution.Fields.LexerMonad ( LexWarning(..), LexWarningType(..), addWarning, + addWarningAt, toPWarnings, ) where @@ -153,3 +154,8 @@ setStartCode c = Lex $ \s -> LexResult s{ curCode = c } () addWarning :: LexWarningType -> Lex () addWarning wt = Lex $ \s@LexState{ curPos = pos, warnings = ws } -> LexResult s{ warnings = LexWarning wt pos : ws } () + +-- | Add warning at specific position +addWarningAt :: Position -> LexWarningType -> Lex () +addWarningAt pos wt = Lex $ \s@LexState{ warnings = ws } -> + LexResult s{ warnings = LexWarning wt pos : ws } () diff --git a/Cabal-syntax/src/Distribution/Fields/Parser.hs b/Cabal-syntax/src/Distribution/Fields/Parser.hs index 9061117b04e..a72ac35a9e1 100644 --- a/Cabal-syntax/src/Distribution/Fields/Parser.hs +++ b/Cabal-syntax/src/Distribution/Fields/Parser.hs @@ -47,6 +47,9 @@ import qualified Data.Text.Encoding as T import qualified Data.Text.Encoding.Error as T #endif +-- $setup +-- >>> import Data.Either (isLeft) + -- | The 'LexState'' (with a prime) is an instance of parsec's 'Stream' -- wrapped around lexer's 'LexState' (without a prime) data LexState' = LexState' !LexState (LToken, LexState') diff --git a/Cabal-syntax/src/Distribution/InstalledPackageInfo.hs b/Cabal-syntax/src/Distribution/InstalledPackageInfo.hs index 54a3fed6fc1..6e4bd785335 100644 --- a/Cabal-syntax/src/Distribution/InstalledPackageInfo.hs +++ b/Cabal-syntax/src/Distribution/InstalledPackageInfo.hs @@ -62,9 +62,6 @@ import qualified Text.PrettyPrint as Disp import Distribution.Types.InstalledPackageInfo import Distribution.Types.InstalledPackageInfo.FieldGrammar --- $setup --- >>> :set -XOverloadedStrings - installedComponentId :: InstalledPackageInfo -> ComponentId installedComponentId ipi = case unComponentId (installedComponentId_ ipi) of @@ -127,7 +124,7 @@ showFullInstalledPackageInfo = P.showFields (const NoComment) . prettyFieldGramm -- | -- --- >>> let ipi = emptyInstalledPackageInfo { maintainer = "Tester" } +-- >>> let ipi = emptyInstalledPackageInfo { maintainer = fromString "Tester" } -- >>> fmap ($ ipi) $ showInstalledPackageInfoField "maintainer" -- Just "maintainer: Tester" showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String) diff --git a/Cabal-syntax/src/Distribution/Types/Dependency.hs b/Cabal-syntax/src/Distribution/Types/Dependency.hs index bfdc78cd06d..74fde6398ae 100644 --- a/Cabal-syntax/src/Distribution/Types/Dependency.hs +++ b/Cabal-syntax/src/Distribution/Types/Dependency.hs @@ -77,16 +77,16 @@ instance NFData Dependency where rnf = genericRnf -- | -- --- >>> prettyShow $ Dependency "pkg" anyVersion mainLibSet +-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion mainLibSet -- "pkg" -- --- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib") mainLibSet +-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib") mainLibSet -- "pkg:{pkg, sublib}" -- --- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.singleton (LSubLibName "sublib") +-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib") -- "pkg:sublib" -- --- >>> prettyShow $ Dependency "pkg" anyVersion $ NES.insert (LSubLibName "sublib-b") $ NES.singleton (LSubLibName "sublib-a") +-- >>> prettyShow $ Dependency (mkPackageName "pkg") anyVersion $ NES.insert (LSubLibName $ mkUnqualComponentName "sublib-b") $ NES.singleton (LSubLibName $ mkUnqualComponentName "sublib-a") -- "pkg:{sublib-a, sublib-b}" -- instance Pretty Dependency where diff --git a/Cabal-syntax/src/Distribution/Types/GenericPackageDescription.hs b/Cabal-syntax/src/Distribution/Types/GenericPackageDescription.hs index 24b2c4d0f08..ee8f9d5284b 100644 --- a/Cabal-syntax/src/Distribution/Types/GenericPackageDescription.hs +++ b/Cabal-syntax/src/Distribution/Types/GenericPackageDescription.hs @@ -1,7 +1,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} module Distribution.Types.GenericPackageDescription ( @@ -86,7 +85,6 @@ instance L.HasBuildInfos GenericPackageDescription where <*> (traverse . L._2 . traverseCondTreeBuildInfo) f x4 <*> (traverse . L._2 . traverseCondTreeBuildInfo) f x5 <*> (traverse . L._2 . traverseCondTreeBuildInfo) f x6 - where -- We use this traversal to keep [Dependency] field in CondTree up to date. traverseCondTreeBuildInfo @@ -94,7 +92,7 @@ traverseCondTreeBuildInfo => LensLike' f (CondTree v [Dependency] comp) L.BuildInfo traverseCondTreeBuildInfo g = node where mkCondNode :: comp -> [CondBranch v [Dependency] comp] -> CondTree v [Dependency] comp - mkCondNode comp branches = CondNode comp (view L.targetBuildDepends comp) branches + mkCondNode comp = CondNode comp (view L.targetBuildDepends comp) node (CondNode comp _ branches) = mkCondNode <$> L.buildInfo g comp diff --git a/Cabal-syntax/src/Distribution/Utils/Structured.hs b/Cabal-syntax/src/Distribution/Utils/Structured.hs index 5327ed6a427..ca3147710c8 100644 --- a/Cabal-syntax/src/Distribution/Utils/Structured.hs +++ b/Cabal-syntax/src/Distribution/Utils/Structured.hs @@ -7,7 +7,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE TypeInType #-} -- | -- -- Copyright: (c) 2019 Oleg Grenrus diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index 1f6a9b6d814..b818b7e6cab 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: Cabal-tests version: 3 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -51,7 +51,7 @@ test-suite unit-tests build-depends: array , async >=2.2.2 && <2.3 - , base >=0 && <5 + , base >=4.9 && <5 , binary , bytestring , Cabal @@ -60,7 +60,7 @@ test-suite unit-tests , Cabal-QuickCheck , containers , deepseq - , Diff >=0.4 && <0.5 + , Diff >=0.4 && <0.6 , directory , filepath , integer-logarithms >=1.0.2 && <1.1 @@ -68,7 +68,7 @@ test-suite unit-tests , QuickCheck >=2.14 && <2.15 , rere >=0.1 && <0.3 , tagged - , tasty >=1.2.3 && <1.5 + , tasty >=1.2.3 && <1.6 , tasty-hunit , tasty-quickcheck , temporary @@ -84,18 +84,18 @@ test-suite parser-tests main-is: ParserTests.hs build-depends: base - , base-compat >=0.11.0 && <0.13 + , base-compat >=0.11.0 && <0.14 , bytestring , Cabal-syntax , Cabal-tree-diff - , Diff >=0.4 && <0.5 + , Diff >=0.4 && <0.6 , directory , filepath - , tasty >=1.2.3 && <1.5 + , tasty >=1.2.3 && <1.6 , tasty-golden >=2.3.1.1 && <2.4 , tasty-hunit , tasty-quickcheck - , tree-diff >=0.1 && <0.3 + , tree-diff >=0.1 && <0.4 ghc-options: -Wall default-language: Haskell2010 @@ -109,10 +109,10 @@ test-suite check-tests , bytestring , Cabal , Cabal-syntax - , Diff >=0.4 && <0.5 + , Diff >=0.4 && <0.6 , directory , filepath - , tasty >=1.2.3 && <1.5 + , tasty >=1.2.3 && <1.6 , tasty-expected-failure , tasty-golden >=2.3.1.1 && <2.4 @@ -155,13 +155,13 @@ test-suite hackage-tests , filepath build-depends: - base-compat >=0.11.0 && <0.13 - , base-orphans >=0.6 && <0.9 + base-compat >=0.11.0 && <0.14 + , base-orphans >=0.6 && <0.10 , clock >=0.8 && <0.9 - , optparse-applicative >=0.13.2.0 && <0.17 + , optparse-applicative >=0.13.2.0 && <0.19 , stm >=2.4.5.0 && <2.6 - , tar >=0.5.0.3 && <0.6 - , tree-diff >=0.1 && <0.3 + , tar >=0.5.0.3 && <0.7 + , tree-diff >=0.1 && <0.4 ghc-options: -Wall -rtsopts -threaded default-extensions: CPP @@ -178,7 +178,7 @@ test-suite rpmvercmp build-depends: QuickCheck - , tasty >=1.2.3 && <1.5 + , tasty >=1.2.3 && <1.6 , tasty-hunit , tasty-quickcheck @@ -197,10 +197,10 @@ test-suite no-thunks-test base , bytestring , Cabal-syntax - , tasty >=1.2.3 && <1.5 + , tasty >=1.2.3 && <1.6 , tasty-hunit -- this is test is buildable on old GHCs -- but it doesn't do anything. if impl(ghc >=8.6) - build-depends: nothunks >=0.1.1.0 && <0.2 + build-depends: nothunks >=0.1.1.0 && <0.3 diff --git a/Cabal-tests/LICENSE b/Cabal-tests/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/Cabal-tests/LICENSE +++ b/Cabal-tests/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.format b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.format index 432c3bba9a4..7d72803f0a5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.format +++ b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.format @@ -1,4 +1,4 @@ -Octree-0.5.cabal:39:3: Non breaking spaces at 39:3, 41:3, 43:3 +Octree-0.5.cabal:39:1: Non breaking spaces at 39:1, 41:1, 43:1 cabal-version: >=1.8 name: Octree version: 0.5 diff --git a/Cabal-tests/tests/ParserTests/regressions/monad-param.format b/Cabal-tests/tests/ParserTests/regressions/monad-param.format index 5c0ba1b819c..360a94bc825 100644 --- a/Cabal-tests/tests/ParserTests/regressions/monad-param.format +++ b/Cabal-tests/tests/ParserTests/regressions/monad-param.format @@ -1,4 +1,4 @@ -monad-param.cabal:19:3: Tabs used as indentation at 19:3, 20:3 +monad-param.cabal:19:1: Tabs used as indentation at 19:1, 20:1 name: monad-param version: 0.0.1 license: BSD3 diff --git a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.format b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.format index df2f77dd729..8fe7579952d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.format +++ b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.format @@ -1,4 +1,4 @@ -th-lift-instances.cabal:15:9: Tabs used as indentation at 15:9 +th-lift-instances.cabal:15:1: Tabs used as indentation at 15:1 cabal-version: >=1.10 name: th-lift-instances version: 0.1.4 diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs index 44efa858a01..c2180b630b7 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs @@ -5,8 +5,9 @@ #endif module UnitTests.Distribution.Utils.CharSet where +import Prelude hiding (Foldable(..)) import Data.Char (isAlpha, isAlphaNum) -import Data.List (foldl') +import Data.Foldable (foldl') import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase, (@?=)) diff --git a/Cabal-tree-diff/Cabal-tree-diff.cabal b/Cabal-tree-diff/Cabal-tree-diff.cabal index 4f27ba20cdd..d9e823426c7 100644 --- a/Cabal-tree-diff/Cabal-tree-diff.cabal +++ b/Cabal-tree-diff/Cabal-tree-diff.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-tree-diff -version: 3.9.0.0 +version: 3.10.1.0 synopsis: QuickCheck instances for types in Cabal category: Testing description: Provides tree-diff ToExpr instances for some types in Cabal @@ -11,9 +11,9 @@ library ghc-options: -Wall build-depends: , base - , Cabal-syntax ^>=3.9.0.0 - , Cabal ^>=3.9.0.0 - , tree-diff ^>=0.1 || ^>=0.2 + , Cabal-syntax ^>=3.10.0.0 + , Cabal ^>=3.10.0.0 + , tree-diff ^>=0.1 || ^>=0.2 || ^>=0.3 exposed-modules: Data.TreeDiff.Instances.Cabal other-modules: diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index c75d24df967..5acc930e475 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: Cabal -version: 3.9.0.0 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +version: 3.10.3.0 +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -21,7 +21,7 @@ build-type: Simple -- If we use a new Cabal feature, this needs to be changed to Custom so -- we can bootstrap. -extra-source-files: +extra-doc-files: README.md ChangeLog.md source-repository head @@ -34,20 +34,20 @@ library hs-source-dirs: src build-depends: - Cabal-syntax ^>= 3.9, + Cabal-syntax ^>= 3.10, array >= 0.4.0.1 && < 0.6, - base >= 4.6 && < 5, - bytestring >= 0.10.0.0 && < 0.12, - containers >= 0.5.0.0 && < 0.7, - deepseq >= 1.3.0.1 && < 1.5, + base >= 4.9 && < 5, + bytestring >= 0.10.0.0 && < 0.13, + containers >= 0.5.0.0 && < 0.8, + deepseq >= 1.3.0.1 && < 1.6, directory >= 1.2 && < 1.4, - filepath >= 1.3.0.1 && < 1.5, + filepath >= 1.3.0.1 && < 1.6, pretty >= 1.1.1 && < 1.2, process >= 1.2.1.0 && < 1.7, time >= 1.4.0.1 && < 1.13 if os(windows) - build-depends: Win32 >= 2.3.0.0 && < 2.14 + build-depends: Win32 >= 2.3.0.0 && < 2.15 else build-depends: unix >= 2.6.0.0 && < 2.9 @@ -302,7 +302,7 @@ library -- See also https://github.com/ekmett/transformers-compat/issues/35 transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7), mtl >= 2.1 && < 2.4, - text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1), + text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2), parsec >= 3.1.13.0 && < 3.2 other-modules: diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index 2797caf4872..08d6aa838dc 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -1,3 +1,15 @@ +# 3.10.3.0 [Hécate](mailto:hecate+github@glitchbra.in) January 2024 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.3.0.md + +# 3.10.2.1 [Hécate](mailto:hecate+github@glitchbra.in) October 2023 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.2.1.md + +# 3.10.2.0 [Hécate](mailto:hecate+github@glitchbra.in) August 2023 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.2.0.md + +# 3.10.1.0 [Mikolaj Konarski](mailto:mikolaj@well-typed.com) March 2023 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.10.1.0.md + # 3.8.1.0 [Mikolaj Konarski](mailto:mikolaj@well-typed.com) August 2022 * See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.8.1.0.md diff --git a/Cabal/LICENSE b/Cabal/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/Cabal/LICENSE +++ b/Cabal/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/Cabal/Makefile b/Cabal/Makefile index bf89ffd18d4..cb81a960208 100644 --- a/Cabal/Makefile +++ b/Cabal/Makefile @@ -1,4 +1,4 @@ -VERSION=3.9.0.0 +VERSION=3.10.3.0 #KIND=devel KIND=rc diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index f1c528752da..f07748f0db8 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -70,6 +70,7 @@ import System.FilePath import qualified Data.ByteString.Lazy as BS import qualified Data.Map as Map +import qualified Control.Monad as CM import qualified Distribution.Compat.DList as DList import qualified Distribution.SPDX as SPDX import qualified System.Directory as System @@ -223,6 +224,7 @@ data CheckExplanation = | CVExpliticDepsCustomSetup | CVAutogenPaths | CVAutogenPackageInfo + | CVAutogenPackageInfoGuard | GlobNoMatch String String | GlobExactMatch String String FilePath | GlobNoDir String String FilePath @@ -663,6 +665,11 @@ ppExplanation CVAutogenPackageInfo = ++ "the module does not come with the package and is generated on " ++ "setup. Modules built with a custom Setup.hs script also go here " ++ "to ensure that commands like sdist don't fail." +ppExplanation CVAutogenPackageInfoGuard = + "To use the autogenerated module PackageInfo_* you need to specify " + ++ "`cabal-version: 3.12` or higher. This is not possible in `cabal " + ++ "3.10`. To use this feature and be able to upload your package to " + ++ "Hackage, download `cabal 3.12`!" ppExplanation (GlobNoMatch field glob) = "In '" ++ field ++ "': the pattern '" ++ glob ++ "' does not" ++ " match any files." @@ -1192,9 +1199,10 @@ checkFields pkg = unknownCompilers = [ name | (OtherCompiler name, _) <- testedWith pkg ] unknownLanguages = [ name | bi <- allBuildInfo pkg , UnknownLanguage name <- allLanguages bi ] - unknownExtensions = [ name | bi <- allBuildInfo pkg - , UnknownExtension name <- allExtensions bi - , name `notElem` map prettyShow knownLanguages ] + unknownExtensions = filter (/= "TypeAbstractions") + [ name | bi <- allBuildInfo pkg + , UnknownExtension name <- allExtensions bi + , name `notElem` map prettyShow knownLanguages ] ourDeprecatedExtensions = nub $ catMaybes [ find ((==ext) . fst) deprecatedExtensions | bi <- allBuildInfo pkg @@ -1209,17 +1217,13 @@ checkFields pkg = | (compiler, vr) <- testedWith pkg , isNoVersion vr ] - internalLibraries = - map (maybe (packageName pkg) unqualComponentNameToPackageName . libraryNameString . libName) - (allLibraries pkg) - internalExecutables = map exeName $ executables pkg internalLibDeps = [ dep | bi <- allBuildInfo pkg , dep@(Dependency name _ _) <- targetBuildDepends bi - , name `elem` internalLibraries + , name == packageName pkg ] internalExeDeps = @@ -1385,7 +1389,7 @@ checkGhcOptions fieldName getOptions pkg = , checkFlags ["-prof"] $ PackageBuildWarning (OptProf fieldName) - , checkFlags ["-o"] $ + , unlessScript . checkFlags ["-o"] $ PackageBuildWarning (OptO fieldName) , checkFlags ["-hide-package"] $ @@ -1478,6 +1482,10 @@ checkGhcOptions fieldName getOptions pkg = checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck checkFlags flags = check (any (`elem` flags) all_ghc_options) + unlessScript :: Maybe PackageCheck -> Maybe PackageCheck + unlessScript pc | packageId pkg == fakePackageId = Nothing + | otherwise = pc + checkTestAndBenchmarkFlags :: [String] -> PackageCheck -> Maybe PackageCheck checkTestAndBenchmarkFlags flags = check (any (`elem` flags) test_and_benchmark_ghc_options) @@ -1812,6 +1820,9 @@ checkCabalVersion pkg = && not (elem (autogenPackageInfoModuleName pkg) allModuleNamesAutogen) ) $ PackageDistInexcusable CVAutogenPackageInfo + , check + (elem (autogenPackageInfoModuleName pkg) allModuleNames) + (PackageDistInexcusable CVAutogenPackageInfoGuard) ] where -- Perform a check on packages that use a version of the spec less than @@ -1895,7 +1906,7 @@ checkPackageVersions pkg = baseErrors where baseErrors = PackageDistInexcusable BaseNoUpperBounds <$ bases - deps = toDependencyVersionsMap allBuildDepends pkg + deps = toDependencyVersionsMap allNonInternalBuildDepends pkg -- base gets special treatment (it's more critical) (bases, others) = partition (("base" ==) . unPackageName) $ [ name @@ -1903,6 +1914,16 @@ checkPackageVersions pkg = , not (hasUpperBound vr) ] + -- Get the combined build-depends entries of all components. + allNonInternalBuildDepends :: PackageDescription -> [Dependency] + allNonInternalBuildDepends = targetBuildDepends CM.<=< allNonInternalBuildInfo + + allNonInternalBuildInfo :: PackageDescription -> [BuildInfo] + allNonInternalBuildInfo pkg_descr = + [bi | lib <- allLibraries pkg_descr, let bi = libBuildInfo lib] + ++ [bi | flib <- foreignLibs pkg_descr, let bi = foreignLibBuildInfo flib] + ++ [bi | exe <- executables pkg_descr, let bi = buildInfo exe] + checkConditionals :: GenericPackageDescription -> [PackageCheck] checkConditionals pkg = catMaybes [ @@ -1917,7 +1938,7 @@ checkConditionals pkg = PackageDistInexcusable (UnknownCompiler unknownImpls) ] where - unknownOSs = [ os | OS (OtherOS os) <- conditions ] + unknownOSs = [ os | OS (OtherOS os) <- conditions, os /= "haiku" ] unknownArches = [ arch | Arch (OtherArch arch) <- conditions ] unknownImpls = [ impl | Impl (OtherCompiler impl) _ <- conditions ] conditions = concatMap fvs (maybeToList (condLibrary pkg)) @@ -2545,12 +2566,13 @@ checkGlobFiles verbosity pkg root = do ) -- Predicate for desirable documentation file on Hackage server - isDesirableExtraDocFile :: [FilePath] -> FilePath -> Bool - isDesirableExtraDocFile paths path = map toLower basename `elem` paths + isDesirableExtraDocFile :: ([FilePath], [FilePath]) -> FilePath -> Bool + isDesirableExtraDocFile (basenames, extensions) path = + basename `elem` basenames && ext `elem` extensions where - (basename, _ext) = splitExtension path + (basename, ext) = splitExtension (map toLower path) - -- Changelog patterns + -- Changelog patterns (basenames & extensions) -- Source: hackage-server/src/Distribution/Server/Packages/ChangeLog.hs desirableChangeLog = [ "news" @@ -2558,6 +2580,7 @@ checkGlobFiles verbosity pkg root = do , "change_log" , "changes" ] + desirableChangeLogExtensions = ["", ".txt", ".md", ".markdown", ".rst"] -- [TODO] Check readme. Observations: -- • Readme is not necessary if package description is good. -- • Some readmes exists only for repository browsing. @@ -2567,7 +2590,7 @@ checkGlobFiles verbosity pkg root = do -- -- Readme patterns -- -- Source: hackage-server/src/Distribution/Server/Packages/Readme.hs -- desirableReadme = ["readme"] - desirableDocFiles = desirableChangeLog + desirableDocFiles = (desirableChangeLog, desirableChangeLogExtensions) -- If there's a missing directory in play, since our globs don't -- (currently) support disjunction, that will always mean there are no diff --git a/Cabal/src/Distribution/Simple.hs b/Cabal/src/Distribution/Simple.hs index 77ba089fa98..52b7c4c41ce 100644 --- a/Cabal/src/Distribution/Simple.hs +++ b/Cabal/src/Distribution/Simple.hs @@ -576,8 +576,7 @@ simpleUserHooks = -- -- * 'postConf' runs @.\/configure@, if present. -- --- * the pre-hooks 'preBuild', 'preClean', 'preCopy', 'preInst', --- 'preReg' and 'preUnreg' read additional build information from +-- * the pre-hooks, except for pre-conf, read additional build information from -- /package/@.buildinfo@, if present. -- -- Thus @configure@ can use local system information to generate @@ -588,14 +587,17 @@ autoconfUserHooks = simpleUserHooks { postConf = defaultPostConf, - preBuild = readHookWithArgs buildVerbosity buildDistPref, -- buildCabalFilePath, + preBuild = readHookWithArgs buildVerbosity buildDistPref, + preRepl = readHookWithArgs replVerbosity replDistPref, preCopy = readHookWithArgs copyVerbosity copyDistPref, preClean = readHook cleanVerbosity cleanDistPref, preInst = readHook installVerbosity installDistPref, preHscolour = readHook hscolourVerbosity hscolourDistPref, preHaddock = readHookWithArgs haddockVerbosity haddockDistPref, preReg = readHook regVerbosity regDistPref, - preUnreg = readHook regVerbosity regDistPref + preUnreg = readHook regVerbosity regDistPref, + preTest = readHookWithArgs testVerbosity testDistPref, + preBench = readHookWithArgs benchmarkVerbosity benchmarkDistPref } where defaultPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () diff --git a/Cabal/src/Distribution/Simple/Configure.hs b/Cabal/src/Distribution/Simple/Configure.hs index ac7bd852f0d..bc8e5f5d289 100644 --- a/Cabal/src/Distribution/Simple/Configure.hs +++ b/Cabal/src/Distribution/Simple/Configure.hs @@ -76,12 +76,13 @@ import Distribution.Simple.Program import Distribution.Simple.Setup as Setup import Distribution.Simple.BuildTarget import Distribution.Simple.LocalBuildInfo +import Distribution.Simple.Program.Db (appendProgramSearchPath, modifyProgramSearchPath, lookupProgramByName) +import Distribution.Simple.Utils +import Distribution.System import Distribution.Types.PackageVersionConstraint import Distribution.Types.LocalBuildInfo import Distribution.Types.ComponentRequestedSpec import Distribution.Types.GivenComponent -import Distribution.Simple.Utils -import Distribution.System import Distribution.Version import Distribution.Verbosity import qualified Distribution.Compat.Graph as Graph @@ -101,7 +102,8 @@ import qualified Distribution.Simple.HaskellSuite as HaskellSuite import Control.Exception ( try ) import Distribution.Utils.Structured ( structuredDecodeOrFailIO, structuredEncode ) -import Distribution.Compat.Directory ( listDirectory ) +import Distribution.Compat.Directory + ( listDirectory, doesPathExist ) import Data.ByteString.Lazy ( ByteString ) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy.Char8 as BLC8 @@ -114,8 +116,6 @@ import System.Directory , getTemporaryDirectory, removeFile) import System.FilePath ( (), isAbsolute, takeDirectory ) -import Distribution.Compat.Directory - ( doesPathExist ) import qualified System.Info ( compilerName, compilerVersion ) import System.IO @@ -367,18 +367,19 @@ configure (pkg_descr0, pbi) cfg = do (fromFlag (configUserInstall cfg)) (configPackageDBs cfg) + programDbPre <- mkProgramDb cfg (configPrograms cfg) -- comp: the compiler we're building with -- compPlatform: the platform we're building for -- programDb: location and args of all programs we're -- building with - (comp :: Compiler, + (comp :: Compiler, compPlatform :: Platform, - programDb :: ProgramDb) + programDb :: ProgramDb) <- configCompilerEx (flagToMaybe (configHcFlavor cfg)) (flagToMaybe (configHcPath cfg)) (flagToMaybe (configHcPkg cfg)) - (mkProgramDb cfg (configPrograms cfg)) + programDbPre (lessVerbose verbosity) -- The InstalledPackageIndex of all installed packages @@ -637,21 +638,16 @@ configure (pkg_descr0, pbi) cfg = do "--enable-split-objs; ignoring") return False - let compilerSupportsGhciLibs :: Bool - compilerSupportsGhciLibs = - case compilerId comp of - CompilerId GHC version - | version > mkVersion [9,3] && windows -> - False - CompilerId GHC _ -> - True - CompilerId GHCJS _ -> - True - _ -> False - where - windows = case compPlatform of - Platform _ Windows -> True - Platform _ _ -> False + -- Basically yes/no/unknown. + let linkerSupportsRelocations :: Maybe Bool + linkerSupportsRelocations = + case lookupProgramByName "ld" programDb'' of + Nothing -> Nothing + Just ld -> + case Map.lookup "Supports relocatable output" $ programProperties ld of + Just "YES" -> Just True + Just "NO" -> Just False + _other -> Nothing let ghciLibByDefault = case compilerId comp of @@ -671,10 +667,12 @@ configure (pkg_descr0, pbi) cfg = do withGHCiLib_ <- case fromFlagOrDefault ghciLibByDefault (configGHCiLib cfg) of - True | not compilerSupportsGhciLibs -> do + -- NOTE: If linkerSupportsRelocations is Nothing this may still fail if the + -- linker does not support -r. + True | not (fromMaybe True linkerSupportsRelocations) -> do warn verbosity $ - "--enable-library-for-ghci is no longer supported on Windows with" - ++ " GHC 9.4 and later; ignoring..." + "--enable-library-for-ghci is not supported with the current" + ++ " linker; ignoring..." return False v -> return v @@ -843,16 +841,27 @@ configure (pkg_descr0, pbi) cfg = do where verbosity = fromFlag (configVerbosity cfg) -mkProgramDb :: ConfigFlags -> ProgramDb -> ProgramDb -mkProgramDb cfg initialProgramDb = programDb +-- | Adds the extra program paths from the flags provided to @configure@ as +-- well as specified locations for certain known programs and their default +-- arguments. +mkProgramDb :: ConfigFlags -> ProgramDb -> IO ProgramDb +mkProgramDb cfg initialProgramDb = do + programDb <- + modifyProgramSearchPath (getProgramSearchPath initialProgramDb ++) + <$> appendProgramSearchPath (fromFlagOrDefault normal (configVerbosity cfg)) searchpath initialProgramDb + pure + . userSpecifyArgss (configProgramArgs cfg) + . userSpecifyPaths (configProgramPaths cfg) + $ programDb where - programDb = userSpecifyArgss (configProgramArgs cfg) - . userSpecifyPaths (configProgramPaths cfg) - . setProgramSearchPath searchpath - $ initialProgramDb - searchpath = map ProgramSearchPathDir - (fromNubList $ configProgramPathExtra cfg) - ++ getProgramSearchPath initialProgramDb + searchpath = fromNubList $ configProgramPathExtra cfg + +-- Note. We try as much as possible to _prepend_ rather than postpend the extra-prog-path +-- so that we can override the system path. However, in a v2-build, at this point, the "system" path +-- has already been extended by both the built-tools-depends paths, as well as the program-path-extra +-- so for v2 builds adding it again is entirely unnecessary. However, it needs to get added again _anyway_ +-- so as to take effect for v1 builds or standalone calls to Setup.hs +-- In this instance, the lesser evil is to not allow it to override the system path. -- ----------------------------------------------------------------------------- -- Helper functions for configure @@ -938,11 +947,11 @@ dependencySatisfiable then internalDepSatisfiable else -- Backward compatibility for the old sublibrary syntax - (sublibs == mainLibSet + sublibs == mainLibSet && Map.member (pn, CLibName $ LSubLibName $ packageNameToUnqualComponentName depName) - requiredDepsMap) + requiredDepsMap || all visible sublibs @@ -969,7 +978,7 @@ dependencySatisfiable internalDepSatisfiable = Set.isSubsetOf (NES.toSet sublibs) packageLibraries internalDepSatisfiableExternally = - all (\ln -> not $ null $ PackageIndex.lookupInternalDependency installedPackageSet pn vr ln) sublibs + all (not . null . PackageIndex.lookupInternalDependency installedPackageSet pn vr) sublibs -- Check whether a library exists and is visible. -- We don't disambiguate between dependency on non-existent or private @@ -1438,8 +1447,7 @@ getInstalledPackagesMonitorFiles verbosity comp packageDBs progdb platform = -- flag into a single package db stack. -- interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStack -interpretPackageDbFlags userInstall specificDBs = - extra initialStack specificDBs +interpretPackageDbFlags userInstall = extra initialStack where initialStack | userInstall = [GlobalPackageDB, UserPackageDB] | otherwise = [GlobalPackageDB] @@ -1685,8 +1693,8 @@ ccLdOptionsBuildInfo cflags ldflags ldflags_static = let (includeDirs', cflags') = partition ("-I" `isPrefixOf`) cflags (extraLibs', ldflags') = partition ("-l" `isPrefixOf`) ldflags (extraLibDirs', ldflags'') = partition ("-L" `isPrefixOf`) ldflags' - (extraLibsStatic') = filter ("-l" `isPrefixOf`) ldflags_static - (extraLibDirsStatic') = filter ("-L" `isPrefixOf`) ldflags_static + extraLibsStatic' = filter ("-l" `isPrefixOf`) ldflags_static + extraLibDirsStatic' = filter ("-L" `isPrefixOf`) ldflags_static in mempty { includeDirs = map (drop 2) includeDirs', extraLibs = map (drop 2) extraLibs', @@ -1702,13 +1710,13 @@ ccLdOptionsBuildInfo cflags ldflags ldflags_static = configCompilerAuxEx :: ConfigFlags -> IO (Compiler, Platform, ProgramDb) -configCompilerAuxEx cfg = configCompilerEx (flagToMaybe $ configHcFlavor cfg) +configCompilerAuxEx cfg = do + programDb <- mkProgramDb cfg defaultProgramDb + configCompilerEx (flagToMaybe $ configHcFlavor cfg) (flagToMaybe $ configHcPath cfg) (flagToMaybe $ configHcPkg cfg) programDb (fromFlag (configVerbosity cfg)) - where - programDb = mkProgramDb cfg defaultProgramDb configCompilerEx :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> Verbosity diff --git a/Cabal/src/Distribution/Simple/ConfigureScript.hs b/Cabal/src/Distribution/Simple/ConfigureScript.hs index 9c3e5c8874b..9d5e363585d 100644 --- a/Cabal/src/Distribution/Simple/ConfigureScript.hs +++ b/Cabal/src/Distribution/Simple/ConfigureScript.hs @@ -137,10 +137,9 @@ runConfigureScript verbosity flags lbi = do maybeHostFlag = if hp == buildPlatform then [] else ["--host=" ++ show (pretty hp)] args' = configureFile':args ++ ["CC=" ++ ccProgShort] ++ maybeHostFlag shProg = simpleProgram "sh" - progDb = modifyProgramSearchPath - (\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb + progDb <- appendProgramSearchPath verbosity extraPath emptyProgramDb shConfiguredProg <- lookupProgram shProg - `fmap` configureProgram verbosity shProg progDb + `fmap` configureProgram verbosity shProg progDb case shConfiguredProg of Just sh -> runProgramInvocation verbosity $ (programInvocation (sh {programOverrideEnv = overEnv}) args') diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index d5d9241a8ed..a9c5141401c 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -140,12 +140,12 @@ configure verbosity hcPath hcPkgPath conf0 = do (userMaybeSpecifyPath "ghc" hcPath conf0) let implInfo = ghcVersionImplInfo ghcVersion - -- Cabal currently supports ghc >= 7.0.1 && < 9.8 + -- Cabal currently supports ghc >= 7.0.1 && < 9.10 -- ... and the following odd development version - unless (ghcVersion < mkVersion [9,8]) $ + unless (ghcVersion < mkVersion [9,10]) $ warn verbosity $ "Unknown/unsupported 'ghc' version detected " - ++ "(Cabal " ++ prettyShow cabalVersion ++ " supports 'ghc' version < 9.8): " + ++ "(Cabal " ++ prettyShow cabalVersion ++ " supports 'ghc' version < 9.10): " ++ programPath ghcProg ++ " is version " ++ prettyShow ghcVersion -- This is slightly tricky, we have to configure ghc first, then we use the @@ -185,10 +185,13 @@ configure verbosity hcPath hcPkgPath conf0 = do ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg let ghcInfoMap = Map.fromList ghcInfo - extensions = -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214 - filterExt JavaScriptFFI $ - -- see 'filterExtTH' comment below - filterExtTH $ extensions0 + filterJS = if ghcVersion < mkVersion [9, 8] then filterExt JavaScriptFFI else id + extensions = + -- workaround https://gitlab.haskell.org/ghc/ghc/-/issues/11214 + filterJS $ + -- see 'filterExtTH' comment below + filterExtTH $ + extensions0 -- starting with GHC 8.0, `TemplateHaskell` will be omitted from -- `--supported-extensions` when it's not available. @@ -523,7 +526,8 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do comp = compiler lbi ghcVersion = compilerVersion comp implInfo = getImplInfo comp - platform@(Platform _hostArch hostOS) = hostPlatform lbi + platform@(Platform hostArch hostOS) = hostPlatform lbi + hasJsSupport = hostArch == JavaScript has_code = not (componentIsIndefinite clbi) relLibTargetDir <- makeRelativeToCurrentDirectory libTargetDir @@ -567,11 +571,13 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do , toNubListR (cxxSources libBi) , toNubListR (cmmSources libBi) , toNubListR (asmSources libBi) - , toNubListR (jsSources libBi) + , if hasJsSupport -- JS files are C-like with GHC's JS backend: they are -- "compiled" into `.o` files (renamed with a header). -- This is a difference from GHCJS, for which we only -- pass the JS files at link time. + then toNubListR (jsSources libBi) + else mempty ] cLikeObjs = map (`replaceExtension` objExtension) cLikeSources baseOpts = componentGhcOptions verbosity lbi libBi clbi libTargetDir @@ -699,38 +705,41 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do | filename <- cxxSources libBi] -- build any C sources - unless (not has_code || null (cSources libBi)) $ do + let libraryName = case libName lib of + LMainLibName -> "the main library" + LSubLibName name -> "library " <> prettyShow name + cSrcs' <- checkCSources verbosity libraryName (cSources libBi) + unless (not has_code || null cSrcs') $ do info verbosity "Building C Sources..." - sequence_ - [ do let baseCcOpts = Internal.componentCcGhcOptions verbosity implInfo - lbi libBi clbi relLibTargetDir filename - vanillaCcOpts = if isGhcDynamic - -- Dynamic GHC requires C sources to be built - -- with -fPIC for REPL to work. See #2207. - then baseCcOpts { ghcOptFPic = toFlag True } - else baseCcOpts - profCcOpts = vanillaCcOpts `mappend` mempty { - ghcOptProfilingMode = toFlag True, - ghcOptObjSuffix = toFlag "p_o" - } - sharedCcOpts = vanillaCcOpts `mappend` mempty { - ghcOptFPic = toFlag True, - ghcOptDynLinkMode = toFlag GhcDynamicOnly, - ghcOptObjSuffix = toFlag "dyn_o" - } - odir = fromFlag (ghcOptObjDir vanillaCcOpts) - createDirectoryIfMissingVerbose verbosity True odir - let runGhcProgIfNeeded ccOpts = do - needsRecomp <- checkNeedsRecompilation filename ccOpts - when needsRecomp $ runGhcProg ccOpts - runGhcProgIfNeeded vanillaCcOpts - unless forRepl $ - whenSharedLib forceSharedLib (runGhcProgIfNeeded sharedCcOpts) - unless forRepl $ whenProfLib (runGhcProgIfNeeded profCcOpts) - | filename <- cSources libBi] + forM_ cSrcs' $ \filename -> do + let baseCcOpts = Internal.componentCcGhcOptions verbosity implInfo + lbi libBi clbi relLibTargetDir filename + vanillaCcOpts = if isGhcDynamic + -- Dynamic GHC requires C sources to be built + -- with -fPIC for REPL to work. See #2207. + then baseCcOpts { ghcOptFPic = toFlag True } + else baseCcOpts + profCcOpts = vanillaCcOpts `mappend` mempty { + ghcOptProfilingMode = toFlag True, + ghcOptObjSuffix = toFlag "p_o" + } + sharedCcOpts = vanillaCcOpts `mappend` mempty { + ghcOptFPic = toFlag True, + ghcOptDynLinkMode = toFlag GhcDynamicOnly, + ghcOptObjSuffix = toFlag "dyn_o" + } + odir = fromFlag (ghcOptObjDir vanillaCcOpts) + createDirectoryIfMissingVerbose verbosity True odir + let runGhcProgIfNeeded ccOpts = do + needsRecomp <- checkNeedsRecompilation filename ccOpts + when needsRecomp $ runGhcProg ccOpts + runGhcProgIfNeeded vanillaCcOpts + unless forRepl $ + whenSharedLib forceSharedLib (runGhcProgIfNeeded sharedCcOpts) + unless forRepl $ whenProfLib (runGhcProgIfNeeded profCcOpts) -- build any JS sources - unless (not has_code || null (jsSources libBi)) $ do + unless (not has_code || not hasJsSupport || null (jsSources libBi)) $ do info verbosity "Building JS Sources..." sequence_ [ do let vanillaJsOpts = Internal.componentJsGhcOptions verbosity implInfo @@ -926,7 +935,7 @@ buildOrReplLib mReplFlags verbosity numJobs pkg_descr lbi lib clbi = do ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi, ghcOptLinkFrameworkDirs = toNubListR $ PD.extraFrameworkDirs libBi, - ghcOptRPaths = rpaths + ghcOptRPaths = rpaths <> toNubListR (extraLibDirs libBi) } ghcStaticLinkArgs = mempty { @@ -1427,7 +1436,7 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do [tmpDir x | x <- cLikeObjs ++ cxxObjs] } dynLinkerOpts = mempty { - ghcOptRPaths = rpaths, + ghcOptRPaths = rpaths <> toNubListR (extraLibDirs bnfo), ghcOptInputFiles = toNubListR [tmpDir x | x <- cLikeObjs ++ cxxObjs] } @@ -1521,32 +1530,32 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do | filename <- cxxSrcs ] -- build any C sources - unless (null cSrcs) $ do - info verbosity "Building C Sources..." - sequence_ - [ do let baseCcOpts = Internal.componentCcGhcOptions verbosity implInfo + cSrcs' <- checkCSources verbosity (gbuildName bm) cSrcs + unless (null cSrcs') $ do + info verbosity "Building C Sources..." + forM_ cSrcs' $ \filename -> do + let baseCcOpts = Internal.componentCcGhcOptions verbosity implInfo lbi bnfo clbi tmpDir filename - vanillaCcOpts = if isGhcDynamic - -- Dynamic GHC requires C sources to be built - -- with -fPIC for REPL to work. See #2207. - then baseCcOpts { ghcOptFPic = toFlag True } - else baseCcOpts - profCcOpts = vanillaCcOpts `mappend` mempty { - ghcOptProfilingMode = toFlag True - } - sharedCcOpts = vanillaCcOpts `mappend` mempty { - ghcOptFPic = toFlag True, - ghcOptDynLinkMode = toFlag GhcDynamicOnly - } - opts | needProfiling = profCcOpts - | needDynamic = sharedCcOpts - | otherwise = vanillaCcOpts - odir = fromFlag (ghcOptObjDir opts) - createDirectoryIfMissingVerbose verbosity True odir - needsRecomp <- checkNeedsRecompilation filename opts - when needsRecomp $ - runGhcProg opts - | filename <- cSrcs ] + let vanillaCcOpts = if isGhcDynamic + -- Dynamic GHC requires C sources to be built + -- with -fPIC for REPL to work. See #2207. + then baseCcOpts { ghcOptFPic = toFlag True } + else baseCcOpts + let profCcOpts = vanillaCcOpts `mappend` mempty { + ghcOptProfilingMode = toFlag True + } + let sharedCcOpts = vanillaCcOpts `mappend` mempty { + ghcOptFPic = toFlag True, + ghcOptDynLinkMode = toFlag GhcDynamicOnly + } + let opts | needProfiling = profCcOpts + | needDynamic = sharedCcOpts + | otherwise = vanillaCcOpts + let odir = fromFlag (ghcOptObjDir opts) + createDirectoryIfMissingVerbose verbosity True odir + needsRecomp <- checkNeedsRecompilation filename opts + when needsRecomp $ + runGhcProg opts -- TODO: problem here is we need the .c files built first, so we can load them -- with ghci, but .c files can depend on .h files generated by ghc by ffi @@ -1852,18 +1861,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi - vanillaArgs0 = + vanillaArgs = (componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi)) `mappend` mempty { ghcOptMode = toFlag GhcModeAbiHash, ghcOptInputModules = toNubListR $ exposedModules lib } - vanillaArgs = - -- Package DBs unnecessary, and break ghc-cabal. See #3633 - -- BUT, put at least the global database so that 7.4 doesn't - -- break. - vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB] - , ghcOptPackages = mempty } sharedArgs = vanillaArgs `mappend` mempty { ghcOptDynLinkMode = toFlag GhcDynamicOnly, ghcOptFPic = toFlag True, @@ -1887,7 +1890,7 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do (ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi) hash <- getProgramInvocationOutput verbosity - (ghcInvocation ghcProg comp platform ghcArgs) + =<< ghcInvocation verbosity ghcProg comp platform ghcArgs return (takeWhile (not . isSpace) hash) componentGhcOptions :: Verbosity -> LocalBuildInfo @@ -2087,7 +2090,10 @@ installLib verbosity lbi targetDir dynlibTargetDir _builtDir pkg lib clbi = do && null (cxxSources (libBuildInfo lib)) && null (cmmSources (libBuildInfo lib)) && null (asmSources (libBuildInfo lib)) - && null (jsSources (libBuildInfo lib)) + && (null (jsSources (libBuildInfo lib)) || not hasJsSupport) + hasJsSupport = case hostPlatform lbi of + Platform JavaScript _ -> True + _ -> False has_code = not (componentIsIndefinite clbi) whenHasCode = when has_code whenVanilla = when (hasLib && withVanillaLib lbi) @@ -2157,3 +2163,23 @@ supportsDynamicToo = Internal.ghcLookupProperty "Support dynamic-too" withExt :: FilePath -> String -> FilePath withExt fp ext = fp <.> if takeExtension fp /= ('.':ext) then ext else "" + +checkCSources :: Verbosity -> String -> [String] -> IO [String] +checkCSources verbosity name cSrcs = do + let (headers, cSrcs') = partition (\filepath -> ".h" `isSuffixOf` filepath) cSrcs + others = filter (\filepath -> not (".c" `isSuffixOf` filepath)) cSrcs' + unless (null headers) $ do + let files = intercalate ", " headers + warn verbosity $ unlines + [ "The following header files listed in " <> name <> "'s c-sources will not be used: " <> files <> "." + , "Header files should be in the 'include' or 'install-include' stanza." + , "See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes" + ] + unless (null others) $ do + let files = intercalate ", " others + warn verbosity $ unlines + [ "The following files listed in " <> name <> "'s c-sources do not have the expected '.c' extension " <> files <> "." + , "C++ files should be in the 'cxx-sources' stanza." + , "See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-cxx-sources" + ] + return cSrcs' diff --git a/Cabal/src/Distribution/Simple/GHC/Internal.hs b/Cabal/src/Distribution/Simple/GHC/Internal.hs index 507831f3cab..6b595b75f3a 100644 --- a/Cabal/src/Distribution/Simple/GHC/Internal.hs +++ b/Cabal/src/Distribution/Simple/GHC/Internal.hs @@ -101,7 +101,9 @@ configureToolchain _implInfo ghcProg ghcInfo = } . addKnownProgram ldProgram { programFindLocation = findProg ldProgramName extraLdPath, - programPostConf = configureLd + programPostConf = \v cp -> + -- Call any existing configuration first and then add any new configuration + configureLd v =<< programPostConf ldProgram v cp } . addKnownProgram arProgram { programFindLocation = findProg arProgramName extraArPath diff --git a/Cabal/src/Distribution/Simple/GHCJS.hs b/Cabal/src/Distribution/Simple/GHCJS.hs index c8721746a6a..3cc6c544434 100644 --- a/Cabal/src/Distribution/Simple/GHCJS.hs +++ b/Cabal/src/Distribution/Simple/GHCJS.hs @@ -1573,18 +1573,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi - vanillaArgs0 = + vanillaArgs = (componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi)) `mappend` mempty { ghcOptMode = toFlag GhcModeAbiHash, ghcOptInputModules = toNubListR $ exposedModules lib } - vanillaArgs = - -- Package DBs unnecessary, and break ghc-cabal. See #3633 - -- BUT, put at least the global database so that 7.4 doesn't - -- break. - vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB] - , ghcOptPackages = mempty } sharedArgs = vanillaArgs `mappend` mempty { ghcOptDynLinkMode = toFlag GhcDynamicOnly, ghcOptFPic = toFlag True, @@ -1608,7 +1602,7 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do (ghcjsProg, _) <- requireProgram verbosity ghcjsProgram (withPrograms lbi) hash <- getProgramInvocationOutput verbosity - (ghcInvocation ghcjsProg comp platform ghcArgs) + =<< ghcInvocation verbose ghcjsProg comp platform ghcArgs return (takeWhile (not . isSpace) hash) componentGhcOptions :: Verbosity -> LocalBuildInfo diff --git a/Cabal/src/Distribution/Simple/Haddock.hs b/Cabal/src/Distribution/Simple/Haddock.hs index aa616ec0249..09194c34cd4 100644 --- a/Cabal/src/Distribution/Simple/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Haddock.hs @@ -360,7 +360,7 @@ createHaddockIndex :: Verbosity createHaddockIndex verbosity programDb comp platform flags = do let args = fromHaddockProjectFlags flags (haddockProg, _version) <- - getHaddockProg verbosity programDb comp args (haddockProjectQuickJump flags) + getHaddockProg verbosity programDb comp args (Flag True) runHaddock verbosity defaultTempFileOptions comp platform haddockProg False args -- ------------------------------------------------------------------------------ @@ -405,12 +405,12 @@ fromHaddockProjectFlags :: HaddockProjectFlags -> HaddockArgs fromHaddockProjectFlags flags = mempty { argOutputDir = Dir (fromFlag $ haddockProjectDir flags) - , argQuickJump = haddockProjectQuickJump flags - , argGenContents = haddockProjectGenContents flags - , argGenIndex = haddockProjectGenIndex flags + , argQuickJump = Flag True + , argGenContents = Flag True + , argGenIndex = Flag True , argPrologueFile = haddockProjectPrologue flags , argInterfaces = fromFlagOrDefault [] (haddockProjectInterfaces flags) - , argLinkedSource = haddockProjectLinkedSource flags + , argLinkedSource = Flag True , argLib = haddockProjectLib flags } @@ -684,7 +684,12 @@ renderArgs verbosity tmpFileOpts version comp platform args k = do result = intercalate ", " . map (\o -> outputDir case o of - Html -> "index.html" + Html + | fromFlagOrDefault False (argGenIndex args) -> + "index.html" + Html + | otherwise -> + mempty Hoogle -> pkgstr <.> "txt") . fromFlagOrDefault [Html] . argOutput @@ -709,7 +714,7 @@ renderPureArgs version comp platform args = concat , [ "--since-qual=external" | isVersion 2 20 ] , [ "--quickjump" | isVersion 2 19 - , _ <- flagToList . argQuickJump $ args ] + , True <- flagToList . argQuickJump $ args ] , [ "--hyperlinked-source" | isVersion 2 17 , True <- flagToList . argLinkedSource $ args ] diff --git a/Cabal/src/Distribution/Simple/Program/Builtin.hs b/Cabal/src/Distribution/Simple/Program/Builtin.hs index 5c615fd5f51..81aee4b93d6 100644 --- a/Cabal/src/Distribution/Simple/Program/Builtin.hs +++ b/Cabal/src/Distribution/Simple/Program/Builtin.hs @@ -256,8 +256,7 @@ arProgram = simpleProgram "ar" stripProgram :: Program stripProgram = (simpleProgram "strip") { - programFindVersion = \verbosity -> - findProgramVersion "--version" stripExtractVersion (lessVerbose verbosity) + programFindVersion = findProgramVersion "--version" stripExtractVersion . lessVerbose } hsc2hsProgram :: Program @@ -322,7 +321,44 @@ greencardProgram :: Program greencardProgram = simpleProgram "greencard" ldProgram :: Program -ldProgram = simpleProgram "ld" +ldProgram = (simpleProgram "ld") + { programPostConf = \verbosity ldProg -> do + -- The `lld` linker cannot create merge (relocatable) objects so we + -- want to detect this. + -- If the linker does support relocatable objects, we want to use that + -- to create partially pre-linked objects for GHCi, so we get much + -- faster loading as we do not have to do the separate loading and + -- in-memory linking the static linker in GHC does, but can offload + -- parts of this process to a pre-linking step. + -- However this requires the linker to support this features. Not all + -- linkers do, and notably as of this writing `lld` which is a popular + -- choice for windows linking does not support this feature. However + -- if using binutils ld or another linker that supports --relocatable, + -- we should still be good to generate pre-linked objects. + ldHelpOutput <- + getProgramInvocationOutput + verbosity + (programInvocation ldProg ["--help"]) + -- In case the linker does not support '--help'. Eg the LLVM linker, + -- `lld` only accepts `-help`. + `catchIO` (\_ -> return "") + let k = "Supports relocatable output" + -- Standard GNU `ld` uses `--relocatable` while `ld.gold` uses + -- `-relocatable` (single `-`). + v + | "-relocatable" `isInfixOf` ldHelpOutput = "YES" + -- ld64 on macOS has this lovely response for "--help" + -- + -- ld64: For information on command line options please use 'man ld'. + -- + -- it does however support -r, if you read the manpage + -- (e.g. https://www.manpagez.com/man/1/ld64/) + | "ld64:" `isPrefixOf` ldHelpOutput = "YES" + | otherwise = "NO" + + m = Map.insert k v (programProperties ldProg) + return $ ldProg{programProperties = m} + } tarProgram :: Program tarProgram = (simpleProgram "tar") { @@ -334,7 +370,7 @@ tarProgram = (simpleProgram "tar") { -- Some versions of tar don't support '--help'. `catchIO` (\_ -> return "") let k = "Supports --format" - v = if ("--format" `isInfixOf` tarHelpOutput) then "YES" else "NO" + v = if "--format" `isInfixOf` tarHelpOutput then "YES" else "NO" m = Map.insert k v (programProperties tarProg) return $ tarProg { programProperties = m } } @@ -343,6 +379,14 @@ cppProgram :: Program cppProgram = simpleProgram "cpp" pkgConfigProgram :: Program -pkgConfigProgram = (simpleProgram "pkg-config") { - programFindVersion = findProgramVersion "--version" id - } +pkgConfigProgram = + (simpleProgram "pkg-config") + { programFindVersion = findProgramVersion "--version" id + , programPostConf = \_ pkgConfProg -> + let programOverrideEnv' = + programOverrideEnv pkgConfProg + ++ [ ("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS", Just "1") + , ("PKG_CONFIG_ALLOW_SYSTEM_LIBS", Just "1") + ] + in pure $ pkgConfProg{programOverrideEnv = programOverrideEnv'} + } diff --git a/Cabal/src/Distribution/Simple/Program/Db.hs b/Cabal/src/Distribution/Simple/Program/Db.hs index 4657e19b059..b1edb84499f 100644 --- a/Cabal/src/Distribution/Simple/Program/Db.hs +++ b/Cabal/src/Distribution/Simple/Program/Db.hs @@ -34,6 +34,7 @@ module Distribution.Simple.Program.Db ( -- ** Query and manipulate the program db addKnownProgram, addKnownPrograms, + appendProgramSearchPath, lookupKnownProgram, knownPrograms, getProgramSearchPath, @@ -46,6 +47,7 @@ module Distribution.Simple.Program.Db ( userSpecifyArgss, userSpecifiedArgs, lookupProgram, + lookupProgramByName, updateProgram, configuredPrograms, @@ -222,6 +224,21 @@ modifyProgramSearchPath :: (ProgramSearchPath -> ProgramSearchPath) modifyProgramSearchPath f db = setProgramSearchPath (f $ getProgramSearchPath db) db +-- | Modify the current 'ProgramSearchPath' used by the 'ProgramDb' +-- by appending the provided extra paths. Also logs the added paths +-- in info verbosity. +appendProgramSearchPath + :: Verbosity + -> [FilePath] + -> ProgramDb + -> IO ProgramDb +appendProgramSearchPath verbosity extraPaths db = + if not $ null extraPaths + then do + logExtraProgramSearchPath verbosity extraPaths + pure $ modifyProgramSearchPath (map ProgramSearchPathDir extraPaths ++) db + else pure db + -- |User-specify this path. Basically override any path information -- for this program in the configuration. If it's not a known -- program ignore it. @@ -293,8 +310,11 @@ userSpecifiedArgs prog = -- | Try to find a configured program lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram -lookupProgram prog = Map.lookup (programName prog) . configuredProgs +lookupProgram = lookupProgramByName . programName +-- | Try to find a configured program +lookupProgramByName :: String -> ProgramDb -> Maybe ConfiguredProgram +lookupProgramByName name = Map.lookup name . configuredProgs -- | Update a configured program in the database. updateProgram :: ConfiguredProgram -> ProgramDb diff --git a/Cabal/src/Distribution/Simple/Program/Find.hs b/Cabal/src/Distribution/Simple/Program/Find.hs index 1e8497e1e1a..b53de5cab65 100644 --- a/Cabal/src/Distribution/Simple/Program/Find.hs +++ b/Cabal/src/Distribution/Simple/Program/Find.hs @@ -32,13 +32,17 @@ module Distribution.Simple.Program.Find ( defaultProgramSearchPath, findProgramOnSearchPath, programSearchPathAsPATHVar, + logExtraProgramSearchPath, getSystemSearchPath, + getExtraPathEnv, + simpleProgram ) where import Prelude () import Distribution.Compat.Prelude import Distribution.Verbosity +import Distribution.Simple.Program.Types import Distribution.Simple.Utils import Distribution.System import Distribution.Compat.Environment @@ -52,30 +56,18 @@ import System.FilePath as FilePath import qualified System.Win32 as Win32 #endif --- | A search path to use when locating executables. This is analogous --- to the unix @$PATH@ or win32 @%PATH%@ but with the ability to use --- the system default method for finding executables ('findExecutable' which --- on unix is simply looking on the @$PATH@ but on win32 is a bit more --- complicated). --- --- The default to use is @[ProgSearchPathDefault]@ but you can add extra dirs --- either before, after or instead of the default, e.g. here we add an extra --- dir to search after the usual ones. --- --- > ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir] --- -type ProgramSearchPath = [ProgramSearchPathEntry] -data ProgramSearchPathEntry = - ProgramSearchPathDir FilePath -- ^ A specific dir - | ProgramSearchPathDefault -- ^ The system default - deriving (Eq, Generic, Typeable) - -instance Binary ProgramSearchPathEntry -instance Structured ProgramSearchPathEntry - defaultProgramSearchPath :: ProgramSearchPath defaultProgramSearchPath = [ProgramSearchPathDefault] +logExtraProgramSearchPath + :: Verbosity + -> [FilePath] + -> IO () +logExtraProgramSearchPath verbosity extraPaths = + info verbosity . unlines $ + "Including the following directories in PATH:" + : map ("- " ++) extraPaths + findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath])) findProgramOnSearchPath verbosity searchpath prog = do @@ -141,6 +133,25 @@ findProgramOnSearchPath verbosity searchpath prog = do Just _ -> return a Nothing -> firstJustM mas +-- | Adds some paths to the "PATH" entry in the key-value environment provided +-- or if there is none, looks up @$PATH@ in the real environment. +getExtraPathEnv + :: Verbosity + -> [(String, Maybe String)] + -> [FilePath] + -> IO [(String, Maybe String)] +getExtraPathEnv _ _ [] = return [] +getExtraPathEnv verbosity env extras = do + mb_path <- case lookup "PATH" env of + Just x -> return x + Nothing -> lookupEnv "PATH" + logExtraProgramSearchPath verbosity extras + let extra = intercalate [searchPathSeparator] extras + path' = case mb_path of + Nothing -> extra + Just path -> extra ++ searchPathSeparator : path + return [("PATH", Just path')] + -- | Interpret a 'ProgramSearchPath' to construct a new @$PATH@ env var. -- Note that this is close but not perfect because on Windows the search -- algorithm looks at more than just the @%PATH%@. @@ -196,3 +207,19 @@ findExecutable prog = do _ -> return mExe #endif + +-- | Make a simple named program. +-- +-- By default we'll just search for it in the path and not try to find the +-- version name. You can override these behaviours if necessary, eg: +-- +-- > (simpleProgram "foo") { programFindLocation = ... , programFindVersion ... } +-- +simpleProgram :: String -> Program +simpleProgram name = Program { + programName = name, + programFindLocation = \v p -> findProgramOnSearchPath v p name, + programFindVersion = \_ _ -> return Nothing, + programPostConf = \_ p -> return p, + programNormaliseArgs = \_ _ -> id + } diff --git a/Cabal/src/Distribution/Simple/Program/GHC.hs b/Cabal/src/Distribution/Simple/Program/GHC.hs index 902422c253f..3025eee7372 100644 --- a/Cabal/src/Distribution/Simple/Program/GHC.hs +++ b/Cabal/src/Distribution/Simple/Program/GHC.hs @@ -31,8 +31,9 @@ import Distribution.PackageDescription import Distribution.ModuleName import Distribution.Simple.Compiler import Distribution.Simple.Flag -import Distribution.Simple.Program.Types +import Distribution.Simple.Program.Find (getExtraPathEnv) import Distribution.Simple.Program.Run +import Distribution.Simple.Program.Types import Distribution.System import Distribution.Pretty import Distribution.Types.ComponentId @@ -569,15 +570,19 @@ data GhcProfAuto = GhcProfAutoAll -- ^ @-fprof-auto@ runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> IO () runGHC verbosity ghcProg comp platform opts = do - runProgramInvocation verbosity (ghcInvocation ghcProg comp platform opts) - - -ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions - -> ProgramInvocation -ghcInvocation prog comp platform opts = - (programInvocation prog (renderGhcOptions comp platform opts)) { - progInvokePathEnv = fromNubListR (ghcOptExtraPath opts) - } + runProgramInvocation verbosity =<< ghcInvocation verbosity ghcProg comp platform opts + +ghcInvocation :: Verbosity -> ConfiguredProgram -> Compiler -> Platform -> GhcOptions + -> IO ProgramInvocation +ghcInvocation verbosity ghcProg comp platform opts = do + -- NOTE: GHC is the only program whose path we modify with more values than + -- the standard @extra-prog-path@, namely the folders of the executables in + -- the components, see @componentGhcOptions@. + let envOverrides = programOverrideEnv ghcProg + extraPath <- getExtraPathEnv verbosity envOverrides (fromNubListR (ghcOptExtraPath opts)) + let ghcProg' = ghcProg{programOverrideEnv = envOverrides ++ extraPath} + + pure $ programInvocation ghcProg' (renderGhcOptions comp platform opts) renderGhcOptions :: Compiler -> Platform -> GhcOptions -> [String] renderGhcOptions comp _platform@(Platform _arch os) opts diff --git a/Cabal/src/Distribution/Simple/Program/Run.hs b/Cabal/src/Distribution/Simple/Program/Run.hs index 66ab3ac82a7..c5858350b7a 100644 --- a/Cabal/src/Distribution/Simple/Program/Run.hs +++ b/Cabal/src/Distribution/Simple/Program/Run.hs @@ -13,20 +13,19 @@ -- This module provides a data type for program invocations and functions to -- run them. -module Distribution.Simple.Program.Run ( - ProgramInvocation(..), - IOEncoding(..), - emptyProgramInvocation, - simpleProgramInvocation, - programInvocation, - multiStageProgramInvocation, - - runProgramInvocation, - getProgramInvocationOutput, - getProgramInvocationLBS, - getProgramInvocationOutputAndErrors, - - getEffectiveEnvironment, +module Distribution.Simple.Program.Run + ( ProgramInvocation (..) + , IOEncoding (..) + , emptyProgramInvocation + , simpleProgramInvocation + , programInvocation + , multiStageProgramInvocation + , runProgramInvocation + , getProgramInvocationOutput + , getProgramInvocationLBS + , getProgramInvocationOutputAndErrors + , getProgramInvocationLBSAndErrors + , getEffectiveEnvironment ) where import Distribution.Compat.Prelude @@ -38,8 +37,6 @@ import Distribution.Simple.Utils import Distribution.Utils.Generic import Distribution.Verbosity -import System.FilePath (searchPathSeparator) - import qualified Data.ByteString.Lazy as LBS import qualified Data.Map as Map @@ -54,8 +51,6 @@ data ProgramInvocation = ProgramInvocation { progInvokePath :: FilePath, progInvokeArgs :: [String], progInvokeEnv :: [(String, Maybe String)], - -- Extra paths to add to PATH - progInvokePathEnv :: [FilePath], progInvokeCwd :: Maybe FilePath, progInvokeInput :: Maybe IOData, progInvokeInputEncoding :: IOEncoding, -- ^ TODO: remove this, make user decide when constructing 'progInvokeInput'. @@ -76,7 +71,6 @@ emptyProgramInvocation = progInvokePath = "", progInvokeArgs = [], progInvokeEnv = [], - progInvokePathEnv = [], progInvokeCwd = Nothing, progInvokeInput = Nothing, progInvokeInputEncoding = IOEncodingText, @@ -107,7 +101,6 @@ runProgramInvocation verbosity progInvokePath = path, progInvokeArgs = args, progInvokeEnv = [], - progInvokePathEnv = [], progInvokeCwd = Nothing, progInvokeInput = Nothing } = @@ -118,12 +111,10 @@ runProgramInvocation verbosity progInvokePath = path, progInvokeArgs = args, progInvokeEnv = envOverrides, - progInvokePathEnv = extraPath, progInvokeCwd = mcwd, progInvokeInput = Nothing } = do - pathOverride <- getExtraPathEnv envOverrides extraPath - menv <- getEffectiveEnvironment (envOverrides ++ pathOverride) + menv <- getEffectiveEnvironment envOverrides maybeExit $ rawSystemIOWithEnv verbosity path args mcwd menv @@ -134,13 +125,11 @@ runProgramInvocation verbosity progInvokePath = path, progInvokeArgs = args, progInvokeEnv = envOverrides, - progInvokePathEnv = extraPath, progInvokeCwd = mcwd, progInvokeInput = Just inputStr, progInvokeInputEncoding = encoding } = do - pathOverride <- getExtraPathEnv envOverrides extraPath - menv <- getEffectiveEnvironment (envOverrides ++ pathOverride) + menv <- getEffectiveEnvironment envOverrides (_, errors, exitCode) <- rawSystemStdInOut verbosity path args mcwd menv @@ -174,6 +163,13 @@ getProgramInvocationOutputAndErrors verbosity inv = case progInvokeOutputEncodin (output', errors, exitCode) <- getProgramInvocationIODataAndErrors verbosity inv IODataModeBinary return (normaliseLineEndings (fromUTF8LBS output'), errors, exitCode) +getProgramInvocationLBSAndErrors + :: Verbosity + -> ProgramInvocation + -> IO (LBS.ByteString, String, ExitCode) +getProgramInvocationLBSAndErrors verbosity inv = + getProgramInvocationIODataAndErrors verbosity inv IODataModeBinary + getProgramInvocationIODataAndErrors :: KnownIODataMode mode => Verbosity -> ProgramInvocation -> IODataMode mode -> IO (mode, String, ExitCode) @@ -183,30 +179,16 @@ getProgramInvocationIODataAndErrors { progInvokePath = path , progInvokeArgs = args , progInvokeEnv = envOverrides - , progInvokePathEnv = extraPath , progInvokeCwd = mcwd , progInvokeInput = minputStr , progInvokeInputEncoding = encoding } mode = do - pathOverride <- getExtraPathEnv envOverrides extraPath - menv <- getEffectiveEnvironment (envOverrides ++ pathOverride) + menv <- getEffectiveEnvironment envOverrides rawSystemStdInOut verbosity path args mcwd menv input mode where input = encodeToIOData encoding <$> minputStr -getExtraPathEnv :: [(String, Maybe String)] -> [FilePath] -> IO [(String, Maybe String)] -getExtraPathEnv _ [] = return [] -getExtraPathEnv env extras = do - mb_path <- case lookup "PATH" env of - Just x -> return x - Nothing -> lookupEnv "PATH" - let extra = intercalate [searchPathSeparator] extras - path' = case mb_path of - Nothing -> extra - Just path -> extra ++ searchPathSeparator : path - return [("PATH", Just path')] - -- | Return the current environment extended with the given overrides. -- If an entry is specified twice in @overrides@, the second entry takes -- precedence. diff --git a/Cabal/src/Distribution/Simple/Program/Types.hs b/Cabal/src/Distribution/Simple/Program/Types.hs index 4078f050185..e90290d77ee 100644 --- a/Cabal/src/Distribution/Simple/Program/Types.hs +++ b/Cabal/src/Distribution/Simple/Program/Types.hs @@ -25,7 +25,6 @@ module Distribution.Simple.Program.Types ( Program(..), ProgramSearchPath, ProgramSearchPathEntry(..), - simpleProgram, -- * Configured program and related functions ConfiguredProgram(..), @@ -40,7 +39,6 @@ import Prelude () import Distribution.Compat.Prelude import Distribution.PackageDescription -import Distribution.Simple.Program.Find import Distribution.Version import Distribution.Verbosity @@ -87,6 +85,36 @@ instance Show Program where type ProgArg = String +-- | A search path to use when locating executables. This is analogous +-- to the unix @$PATH@ or win32 @%PATH%@ but with the ability to use +-- the system default method for finding executables ('findExecutable' which +-- on unix is simply looking on the @$PATH@ but on win32 is a bit more +-- complicated). +-- +-- The default to use is @[ProgSearchPathDefault]@ but you can add extra dirs +-- either before, after or instead of the default, e.g. here we add an extra +-- dir to search after the usual ones. +-- +-- > ['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir] +-- +-- We also use this path to set the environment when running child processes. +-- +-- The @ProgramDb@ is created with a @ProgramSearchPath@ to which we +-- @appendProgramSearchPath@ to add the ones that come from cli flags and from +-- configurations. Then each of the programs that are configured in the db +-- inherits the same path as part of @configureProgram@. +type ProgramSearchPath = [ProgramSearchPathEntry] + +data ProgramSearchPathEntry + = -- | A specific dir + ProgramSearchPathDir FilePath + | -- | The system default + ProgramSearchPathDefault + deriving (Eq, Generic, Typeable) + +instance Binary ProgramSearchPathEntry +instance Structured ProgramSearchPathEntry + -- | Represents a program which has been configured and is thus ready to be run. -- -- These are usually made by configuring a 'Program', but if you have to @@ -157,22 +185,6 @@ programPath = locationPath . programLocation suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram suppressOverrideArgs prog = prog { programOverrideArgs = [] } --- | Make a simple named program. --- --- By default we'll just search for it in the path and not try to find the --- version name. You can override these behaviours if necessary, eg: --- --- > (simpleProgram "foo") { programFindLocation = ... , programFindVersion ... } --- -simpleProgram :: String -> Program -simpleProgram name = Program { - programName = name, - programFindLocation = \v p -> findProgramOnSearchPath v p name, - programFindVersion = \_ _ -> return Nothing, - programPostConf = \_ p -> return p, - programNormaliseArgs = \_ _ -> id - } - -- | Make a simple 'ConfiguredProgram'. -- -- > simpleConfiguredProgram "foo" (FoundOnSystem path) diff --git a/Cabal/src/Distribution/Simple/Register.hs b/Cabal/src/Distribution/Simple/Register.hs index 29b839e261f..c4dc22c7b7a 100644 --- a/Cabal/src/Distribution/Simple/Register.hs +++ b/Cabal/src/Distribution/Simple/Register.hs @@ -466,8 +466,11 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi || not (null (asmSources bi)) || not (null (cmmSources bi)) || not (null (cxxSources bi)) - || not (null (jsSources bi))) + || (not (null (jsSources bi)) && hasJsSupport)) && not (componentIsIndefinite clbi) + hasJsSupport = case hostPlatform lbi of + Platform JavaScript _ -> True + _ -> False libdirsStatic | hasLibrary = libdir installDirs : extraLibDirsStaticOrFallback | otherwise = extraLibDirsStaticOrFallback diff --git a/Cabal/src/Distribution/Simple/Setup/Haddock.hs b/Cabal/src/Distribution/Simple/Setup/Haddock.hs new file mode 100644 index 00000000000..3efc6640bd2 --- /dev/null +++ b/Cabal/src/Distribution/Simple/Setup/Haddock.hs @@ -0,0 +1,603 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE RankNTypes #-} + +----------------------------------------------------------------------------- + +-- | +-- Module : Distribution.Simple.Setup.Haddock +-- Copyright : Isaac Jones 2003-2004 +-- Duncan Coutts 2007 +-- License : BSD3 +-- +-- Maintainer : cabal-devel@haskell.org +-- Portability : portable +-- +-- Definition of the haddock command-line options. +-- See: @Distribution.Simple.Setup@ +module Distribution.Simple.Setup.Haddock + ( HaddockTarget (..) + , HaddockFlags (..) + , emptyHaddockFlags + , defaultHaddockFlags + , haddockCommand + , Visibility (..) + , HaddockProjectFlags (..) + , emptyHaddockProjectFlags + , defaultHaddockProjectFlags + , haddockProjectCommand + , haddockOptions + , haddockProjectOptions + ) where + +import Distribution.Compat.Prelude hiding (get) +import Prelude () + +import qualified Distribution.Compat.CharParsing as P +import Distribution.Parsec +import Distribution.Pretty +import Distribution.Simple.Command hiding (boolOpt, boolOpt') +import Distribution.Simple.Flag +import Distribution.Simple.InstallDirs +import Distribution.Simple.Program +import Distribution.Verbosity +import qualified Text.PrettyPrint as Disp + +import Distribution.Simple.Setup.Common + +-- ------------------------------------------------------------ + +-- * Haddock flags + +-- ------------------------------------------------------------ + +-- | When we build haddock documentation, there are two cases: +-- +-- 1. We build haddocks only for the current development version, +-- intended for local use and not for distribution. In this case, +-- we store the generated documentation in @/doc/html/@. +-- +-- 2. We build haddocks for intended for uploading them to hackage. +-- In this case, we need to follow the layout that hackage expects +-- from documentation tarballs, and we might also want to use different +-- flags than for development builds, so in this case we store the generated +-- documentation in @/doc/html/-docs@. +data HaddockTarget = ForHackage | ForDevelopment deriving (Eq, Show, Generic, Typeable) + +instance Binary HaddockTarget +instance Structured HaddockTarget + +instance Pretty HaddockTarget where + pretty ForHackage = Disp.text "for-hackage" + pretty ForDevelopment = Disp.text "for-development" + +instance Parsec HaddockTarget where + parsec = + P.choice + [ P.try $ P.string "for-hackage" >> return ForHackage + , P.string "for-development" >> return ForDevelopment + ] + +data HaddockFlags = HaddockFlags + { haddockProgramPaths :: [(String, FilePath)] + , haddockProgramArgs :: [(String, [String])] + , haddockHoogle :: Flag Bool + , haddockHtml :: Flag Bool + , haddockHtmlLocation :: Flag String + , haddockForHackage :: Flag HaddockTarget + , haddockExecutables :: Flag Bool + , haddockTestSuites :: Flag Bool + , haddockBenchmarks :: Flag Bool + , haddockForeignLibs :: Flag Bool + , haddockInternal :: Flag Bool + , haddockCss :: Flag FilePath + , haddockLinkedSource :: Flag Bool + , haddockQuickJump :: Flag Bool + , haddockHscolourCss :: Flag FilePath + , haddockContents :: Flag PathTemplate + , haddockIndex :: Flag PathTemplate + , haddockDistPref :: Flag FilePath + , haddockKeepTempFiles :: Flag Bool + , haddockVerbosity :: Flag Verbosity + , haddockCabalFilePath :: Flag FilePath + , haddockBaseUrl :: Flag String + , haddockLib :: Flag String + , haddockOutputDir :: Flag FilePath + , haddockArgs :: [String] + } + deriving (Show, Generic, Typeable) + +defaultHaddockFlags :: HaddockFlags +defaultHaddockFlags = + HaddockFlags + { haddockProgramPaths = mempty + , haddockProgramArgs = [] + , haddockHoogle = Flag False + , haddockHtml = Flag False + , haddockHtmlLocation = NoFlag + , haddockForHackage = NoFlag + , haddockExecutables = Flag False + , haddockTestSuites = Flag False + , haddockBenchmarks = Flag False + , haddockForeignLibs = Flag False + , haddockInternal = Flag False + , haddockCss = NoFlag + , haddockLinkedSource = Flag False + , haddockQuickJump = Flag False + , haddockHscolourCss = NoFlag + , haddockContents = NoFlag + , haddockDistPref = NoFlag + , haddockKeepTempFiles = Flag False + , haddockVerbosity = Flag normal + , haddockCabalFilePath = mempty + , haddockIndex = NoFlag + , haddockBaseUrl = NoFlag + , haddockLib = NoFlag + , haddockOutputDir = NoFlag + , haddockArgs = mempty + } + +haddockCommand :: CommandUI HaddockFlags +haddockCommand = + CommandUI + { commandName = "haddock" + , commandSynopsis = "Generate Haddock HTML documentation." + , commandDescription = Just $ \_ -> + "Requires the program haddock, version 2.x.\n" + , commandNotes = Nothing + , commandUsage = + usageAlternatives "haddock" $ + [ "[FLAGS]" + , "COMPONENTS [FLAGS]" + ] + , commandDefaultFlags = defaultHaddockFlags + , commandOptions = \showOrParseArgs -> + haddockOptions showOrParseArgs + ++ programDbPaths + progDb + ParseArgs + haddockProgramPaths + (\v flags -> flags{haddockProgramPaths = v}) + ++ programDbOption + progDb + showOrParseArgs + haddockProgramArgs + (\v fs -> fs{haddockProgramArgs = v}) + ++ programDbOptions + progDb + ParseArgs + haddockProgramArgs + (\v flags -> flags{haddockProgramArgs = v}) + } + where + progDb = + addKnownProgram haddockProgram $ + addKnownProgram ghcProgram $ + emptyProgramDb + +haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags] +haddockOptions showOrParseArgs = + [ optionVerbosity + haddockVerbosity + (\v flags -> flags{haddockVerbosity = v}) + , optionDistPref + haddockDistPref + (\d flags -> flags{haddockDistPref = d}) + showOrParseArgs + , option + "" + ["keep-temp-files"] + "Keep temporary files" + haddockKeepTempFiles + (\b flags -> flags{haddockKeepTempFiles = b}) + trueArg + , option + "" + ["hoogle"] + "Generate a hoogle database" + haddockHoogle + (\v flags -> flags{haddockHoogle = v}) + trueArg + , option + "" + ["html"] + "Generate HTML documentation (the default)" + haddockHtml + (\v flags -> flags{haddockHtml = v}) + trueArg + , option + "" + ["html-location"] + "Location of HTML documentation for pre-requisite packages" + haddockHtmlLocation + (\v flags -> flags{haddockHtmlLocation = v}) + (reqArgFlag "URL") + , option + "" + ["for-hackage"] + "Collection of flags to generate documentation suitable for upload to hackage" + haddockForHackage + (\v flags -> flags{haddockForHackage = v}) + (noArg (Flag ForHackage)) + , option + "" + ["executables"] + "Run haddock for Executables targets" + haddockExecutables + (\v flags -> flags{haddockExecutables = v}) + trueArg + , option + "" + ["tests"] + "Run haddock for Test Suite targets" + haddockTestSuites + (\v flags -> flags{haddockTestSuites = v}) + trueArg + , option + "" + ["benchmarks"] + "Run haddock for Benchmark targets" + haddockBenchmarks + (\v flags -> flags{haddockBenchmarks = v}) + trueArg + , option + "" + ["foreign-libraries"] + "Run haddock for Foreign Library targets" + haddockForeignLibs + (\v flags -> flags{haddockForeignLibs = v}) + trueArg + , option + "" + ["all"] + "Run haddock for all targets" + ( \f -> + allFlags + [ haddockExecutables f + , haddockTestSuites f + , haddockBenchmarks f + , haddockForeignLibs f + ] + ) + ( \v flags -> + flags + { haddockExecutables = v + , haddockTestSuites = v + , haddockBenchmarks = v + , haddockForeignLibs = v + } + ) + trueArg + , option + "" + ["internal"] + "Run haddock for internal modules and include all symbols" + haddockInternal + (\v flags -> flags{haddockInternal = v}) + trueArg + , option + "" + ["css"] + "Use PATH as the haddock stylesheet" + haddockCss + (\v flags -> flags{haddockCss = v}) + (reqArgFlag "PATH") + , option + "" + ["hyperlink-source", "hyperlink-sources", "hyperlinked-source"] + "Hyperlink the documentation to the source code" + haddockLinkedSource + (\v flags -> flags{haddockLinkedSource = v}) + trueArg + , option + "" + ["quickjump"] + "Generate an index for interactive documentation navigation" + haddockQuickJump + (\v flags -> flags{haddockQuickJump = v}) + trueArg + , option + "" + ["hscolour-css"] + "Use PATH as the HsColour stylesheet" + haddockHscolourCss + (\v flags -> flags{haddockHscolourCss = v}) + (reqArgFlag "PATH") + , option + "" + ["contents-location"] + "Bake URL in as the location for the contents page" + haddockContents + (\v flags -> flags{haddockContents = v}) + ( reqArg' + "URL" + (toFlag . toPathTemplate) + (flagToList . fmap fromPathTemplate) + ) + , option + "" + ["index-location"] + "Use a separately-generated HTML index" + haddockIndex + (\v flags -> flags{haddockIndex = v}) + ( reqArg' + "URL" + (toFlag . toPathTemplate) + (flagToList . fmap fromPathTemplate) + ) + , option + "" + ["base-url"] + "Base URL for static files." + haddockBaseUrl + (\v flags -> flags{haddockBaseUrl = v}) + (reqArgFlag "URL") + , option + "" + ["lib"] + "location of Haddocks static / auxiliary files" + haddockLib + (\v flags -> flags{haddockLib = v}) + (reqArgFlag "DIR") + , option + "" + ["output-dir"] + "Generate haddock documentation into this directory. This flag is provided as a technology preview and is subject to change in the next releases." + haddockOutputDir + (\v flags -> flags{haddockOutputDir = v}) + (reqArgFlag "DIR") + ] + +emptyHaddockFlags :: HaddockFlags +emptyHaddockFlags = mempty + +instance Monoid HaddockFlags where + mempty = gmempty + mappend = (<>) + +instance Semigroup HaddockFlags where + (<>) = gmappend + +-- ------------------------------------------------------------ + +-- * HaddocksFlags flags + +-- ------------------------------------------------------------ + +-- | Governs whether modules from a given interface should be visible or +-- hidden in the Haddock generated content page. We don't expose this +-- functionality to the user, but simply use 'Visible' for only local packages. +-- Visibility of modules is available since @haddock-2.26.1@. +data Visibility = Visible | Hidden + deriving (Eq, Show) + +data HaddockProjectFlags = HaddockProjectFlags + { haddockProjectHackage :: Flag Bool + -- ^ a shortcut option which builds documentation linked to hackage. It implies: + -- * `--html-location='https://hackage.haskell.org/package/$prg-$version/docs' + -- * `--quickjump` + -- * `--gen-index` + -- * `--gen-contents` + -- * `--hyperlinked-source` + , -- options passed to @haddock@ via 'createHaddockIndex' + haddockProjectDir :: Flag String + -- ^ output directory of combined haddocks, the default is './haddocks' + , haddockProjectPrologue :: Flag String + , haddockProjectInterfaces :: Flag [(FilePath, Maybe FilePath, Maybe FilePath, Visibility)] + -- ^ 'haddocksInterfaces' is inferred by the 'haddocksAction'; currently not + -- exposed to the user. + , -- options passed to @haddock@ via 'HaddockFlags' when building + -- documentation + + haddockProjectProgramPaths :: [(String, FilePath)] + , haddockProjectProgramArgs :: [(String, [String])] + , haddockProjectHoogle :: Flag Bool + , -- haddockHtml is not supported + haddockProjectHtmlLocation :: Flag String + , -- haddockForHackage is not supported + haddockProjectExecutables :: Flag Bool + , haddockProjectTestSuites :: Flag Bool + , haddockProjectBenchmarks :: Flag Bool + , haddockProjectForeignLibs :: Flag Bool + , haddockProjectInternal :: Flag Bool + , haddockProjectCss :: Flag FilePath + , haddockProjectHscolourCss :: Flag FilePath + , -- haddockContent is not supported, a fixed value is provided + -- haddockIndex is not supported, a fixed value is provided + -- haddockDistPerf is not supported, note: it changes location of the haddocks + haddockProjectKeepTempFiles :: Flag Bool + , haddockProjectVerbosity :: Flag Verbosity + , -- haddockBaseUrl is not supported, a fixed value is provided + haddockProjectLib :: Flag String + , haddockProjectOutputDir :: Flag FilePath + } + deriving (Show, Generic, Typeable) + +defaultHaddockProjectFlags :: HaddockProjectFlags +defaultHaddockProjectFlags = + HaddockProjectFlags + { haddockProjectHackage = Flag False + , haddockProjectDir = Flag "./haddocks" + , haddockProjectPrologue = NoFlag + , haddockProjectTestSuites = Flag False + , haddockProjectProgramPaths = mempty + , haddockProjectProgramArgs = mempty + , haddockProjectHoogle = Flag False + , haddockProjectHtmlLocation = NoFlag + , haddockProjectExecutables = Flag False + , haddockProjectBenchmarks = Flag False + , haddockProjectForeignLibs = Flag False + , haddockProjectInternal = Flag False + , haddockProjectCss = NoFlag + , haddockProjectHscolourCss = NoFlag + , haddockProjectKeepTempFiles = Flag False + , haddockProjectVerbosity = Flag normal + , haddockProjectLib = NoFlag + , haddockProjectOutputDir = NoFlag + , haddockProjectInterfaces = NoFlag + } + +haddockProjectCommand :: CommandUI HaddockProjectFlags +haddockProjectCommand = + CommandUI + { commandName = "v2-haddock-project" + , commandSynopsis = "Generate Haddocks HTML documentation for the cabal project." + , commandDescription = Just $ \_ -> + "Require the programm haddock, version 2.26.\n" + , commandNotes = Nothing + , commandUsage = + usageAlternatives "haddocks" $ + [ "[FLAGS]" + , "COMPONENTS [FLAGS]" + ] + , commandDefaultFlags = defaultHaddockProjectFlags + , commandOptions = \showOrParseArgs -> + haddockProjectOptions showOrParseArgs + ++ programDbPaths + progDb + ParseArgs + haddockProjectProgramPaths + (\v flags -> flags{haddockProjectProgramPaths = v}) + ++ programDbOption + progDb + showOrParseArgs + haddockProjectProgramArgs + (\v fs -> fs{haddockProjectProgramArgs = v}) + ++ programDbOptions + progDb + ParseArgs + haddockProjectProgramArgs + (\v flags -> flags{haddockProjectProgramArgs = v}) + } + where + progDb = + addKnownProgram haddockProgram $ + addKnownProgram ghcProgram $ + emptyProgramDb + +haddockProjectOptions :: ShowOrParseArgs -> [OptionField HaddockProjectFlags] +haddockProjectOptions _showOrParseArgs = + [ option + "" + ["hackage"] + ( concat + [ "A short-cut option to build documentation linked to hackage." + ] + ) + haddockProjectHackage + (\v flags -> flags{haddockProjectHackage = v}) + trueArg + , option + "" + ["output"] + "Output directory" + haddockProjectDir + (\v flags -> flags{haddockProjectDir = v}) + (optArg' "DIRECTORY" maybeToFlag (fmap Just . flagToList)) + , option + "" + ["prologue"] + "File path to a prologue file in haddock format" + haddockProjectPrologue + (\v flags -> flags{haddockProjectPrologue = v}) + (optArg' "PATH" maybeToFlag (fmap Just . flagToList)) + , option + "" + ["hoogle"] + "Generate a hoogle database" + haddockProjectHoogle + (\v flags -> flags{haddockProjectHoogle = v}) + trueArg + , option + "" + ["html-location"] + "Location of HTML documentation for pre-requisite packages" + haddockProjectHtmlLocation + (\v flags -> flags{haddockProjectHtmlLocation = v}) + (reqArgFlag "URL") + , option + "" + ["executables"] + "Run haddock for Executables targets" + haddockProjectExecutables + (\v flags -> flags{haddockProjectExecutables = v}) + trueArg + , option + "" + ["tests"] + "Run haddock for Test Suite targets" + haddockProjectTestSuites + (\v flags -> flags{haddockProjectTestSuites = v}) + trueArg + , option + "" + ["benchmarks"] + "Run haddock for Benchmark targets" + haddockProjectBenchmarks + (\v flags -> flags{haddockProjectBenchmarks = v}) + trueArg + , option + "" + ["foreign-libraries"] + "Run haddock for Foreign Library targets" + haddockProjectForeignLibs + (\v flags -> flags{haddockProjectForeignLibs = v}) + trueArg + , option + "" + ["internal"] + "Run haddock for internal modules and include all symbols" + haddockProjectInternal + (\v flags -> flags{haddockProjectInternal = v}) + trueArg + , option + "" + ["css"] + "Use PATH as the haddock stylesheet" + haddockProjectCss + (\v flags -> flags{haddockProjectCss = v}) + (reqArgFlag "PATH") + , option + "" + ["hscolour-css"] + "Use PATH as the HsColour stylesheet" + haddockProjectHscolourCss + (\v flags -> flags{haddockProjectHscolourCss = v}) + (reqArgFlag "PATH") + , option + "" + ["keep-temp-files"] + "Keep temporary files" + haddockProjectKeepTempFiles + (\b flags -> flags{haddockProjectKeepTempFiles = b}) + trueArg + , optionVerbosity + haddockProjectVerbosity + (\v flags -> flags{haddockProjectVerbosity = v}) + , option + "" + ["lib"] + "location of Haddocks static / auxiliary files" + haddockProjectLib + (\v flags -> flags{haddockProjectLib = v}) + (reqArgFlag "DIR") + , option + "" + ["output-dir"] + "Generate haddock documentation into this directory. This flag is provided as a technology preview and is subject to change in the next releases." + haddockProjectOutputDir + (\v flags -> flags{haddockProjectOutputDir = v}) + (reqArgFlag "DIR") + ] + +emptyHaddockProjectFlags :: HaddockProjectFlags +emptyHaddockProjectFlags = mempty + +instance Monoid HaddockProjectFlags where + mempty = gmempty + mappend = (<>) + +instance Semigroup HaddockProjectFlags where + (<>) = gmappend diff --git a/LICENSE b/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/Makefile b/Makefile index 63654e83167..6dc6b6c26cc 100644 --- a/Makefile +++ b/Makefile @@ -71,15 +71,27 @@ ghcid-lib : ghcid-cli : ghcid -c 'cabal v2-repl cabal-install' -# doctests (relies on .ghc.environment files) - +# Artem, 2023-02-03, https://github.com/haskell/cabal/issues/8504 +# The new and prefered way to call the doctest tool (as of now) is based on cabal repl --with-ghc=doctest. +# The call below reflects the current documentation of the doctest tool except one caveat, +# which is https://github.com/haskell/cabal/issues/6859, i.e. we have to hide allow-newer in our project +# file from cabal/doctest. This is easy: we just select a project file with no allow-newer (e.g. cabal.project.libonly). +# +# TODO: Cabal-described should be added here but its doctests currently broken, see: +# https://github.com/haskell/cabal/issues/8734 +# Just as well, cabal-install(-solver) doctests (the target below) bitrotted and need some care. doctest : - doctest --fast Cabal-syntax/src Cabal/src + cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal-syntax + cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal + # This is not run as part of validate.sh (we need hackage-security, which is tricky to get). doctest-cli : doctest -D__DOCTEST__ --fast cabal-install/src cabal-install-solver/src cabal-install-solver/src-assertion +doctest-install: + cabal install doctest --overwrite-policy=always --ignore-project + # tests check-tests : @@ -177,13 +189,13 @@ tags : ############################################################################## bootstrap-json-%: phony - cabal v2-build --project=cabal.project.release --with-compiler=ghc-$* --dry-run cabal-install:exe:cabal + cabal v2-build --project-file=cabal.project.release --with-compiler=ghc-$* --dry-run cabal-install:exe:cabal cp dist-newstyle/cache/plan.json bootstrap/linux-$*.plan.json @# -v0 to avoid build output on stdout cd bootstrap && cabal v2-run -v0 cabal-bootstrap-gen -- linux-$*.plan.json \ | python3 -m json.tool > linux-$*.json -BOOTSTRAP_GHC_VERSIONS := 8.6.5 8.8.4 8.10.7 9.0.2 9.2.3 +BOOTSTRAP_GHC_VERSIONS := 8.10.7 9.0.2 9.2.8 9.4.8 bootstrap-jsons: $(BOOTSTRAP_GHC_VERSIONS:%=bootstrap-json-%) diff --git a/bootstrap/cabal-bootstrap-gen.cabal b/bootstrap/cabal-bootstrap-gen.cabal index a8e0ad0ad88..f185356e047 100644 --- a/bootstrap/cabal-bootstrap-gen.cabal +++ b/bootstrap/cabal-bootstrap-gen.cabal @@ -8,18 +8,14 @@ executable cabal-bootstrap-gen ghc-options: -Wall main-is: Main.hs build-depends: - , aeson ^>=1.5.2.0 || ^>=2.0.3.0 - -- Not yet picked up: (*) || ^>=2.1.0.0 - , base ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 + , aeson ^>=1.5.2.0 || ^>=2.0.3.0 || ^>=2.1.0.0 + , base ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 , bytestring ^>=0.10.8.2 || ^>=0.11.0.0 - , Cabal ^>=3.2.0.0 || ^>=3.4.1.0 || ^>=3.6.3.0 - -- Not yet picked up: (*) || ^>=3.8.1.0 - , cabal-install-parsers ^>=0.3.0.1 || ^>=0.4.5 + , Cabal ^>=3.8.1.0 || ^>=3.10.3 + , Cabal-syntax ^>=3.8.1.0 || ^>=3.10.2.0 + , cabal-install-parsers ^>=0.3.0.1 || ^>=0.4.5 || ^>=0.6 , cabal-plan ^>=0.7.0.0 , containers ^>=0.6.0.1 - , text ^>=1.2.3.0 - -- Not yet picked up: (*) || ^>=2.0.1 + , text ^>=1.2.3.0 || ^>=2.0.1 , topograph ^>=1.0.0.1 - , transformers ^>=0.5.6.2 - -- Not yet picked up: (*) || ^>=0.6.0.4 - -- (*) as of 2022-08-19 + , transformers ^>=0.5.6.2 || ^>=0.6.0.4 diff --git a/bootstrap/linux-8.10.7.json b/bootstrap/linux-8.10.7.json index a27028a1e3b..74a3fb3f5bf 100644 --- a/bootstrap/linux-8.10.7.json +++ b/bootstrap/linux-8.10.7.json @@ -1,74 +1,158 @@ { + "builtin": [ + { + "package": "rts", + "version": "1.0.1" + }, + { + "package": "ghc-prim", + "version": "0.6.1" + }, + { + "package": "integer-gmp", + "version": "1.0.3.0" + }, + { + "package": "base", + "version": "4.14.3.0" + }, + { + "package": "array", + "version": "0.5.4.0" + }, + { + "package": "deepseq", + "version": "1.4.4.0" + }, + { + "package": "bytestring", + "version": "0.10.12.0" + }, + { + "package": "containers", + "version": "0.6.5.1" + }, + { + "package": "binary", + "version": "0.8.8.0" + }, + { + "package": "filepath", + "version": "1.4.2.1" + }, + { + "package": "time", + "version": "1.9.3" + }, + { + "package": "unix", + "version": "2.7.2.2" + }, + { + "package": "transformers", + "version": "0.5.6.2" + }, + { + "package": "mtl", + "version": "2.2.2" + }, + { + "package": "ghc-boot-th", + "version": "8.10.7" + }, + { + "package": "pretty", + "version": "1.1.3.6" + }, + { + "package": "template-haskell", + "version": "2.16.0.0" + }, + { + "package": "text", + "version": "1.2.4.1" + }, + { + "package": "parsec", + "version": "3.1.14.0" + }, + { + "package": "stm", + "version": "2.5.0.1" + }, + { + "package": "exceptions", + "version": "0.10.4" + } + ], "dependencies": [ { - "cabal_sha256": "1125a0a4be3aafc8da208940f219d4e4df8a0db87d892cc42bb369071855c590", - "revision": 0, - "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", + "cabal_sha256": "7d16bf127fb303bd69d9c433bb146c5815f9690933af1d5a6ee45dea2e536dc5", "flags": [], "package": "directory", + "revision": 1, "source": "hackage", + "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", "version": "1.3.7.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal-syntax", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf", - "revision": 0, - "src_sha256": "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab", + "cabal_sha256": "8b4bce2749e4f61a440049e6088487003e8023c720e2019345e399d50888594f", "flags": [], "package": "process", + "revision": 2, "source": "hackage", - "version": "1.6.15.0" + "src_sha256": "aa5f4c4fe4974f89f5ab998c7509daa4bda3926cfb06daacd5eba892aad8a37e", + "version": "1.6.18.0" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568", - "revision": 0, - "src_sha256": "7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85", + "cabal_sha256": "e152cdb03243afb52bbc740cfbe96905ca298a6f6342f0c47b3f2e227ff19def", "flags": [ "-devel" ], "package": "network", + "revision": 1, "source": "hackage", - "version": "3.1.2.7" + "src_sha256": "b452a2afac95d9207357eb3820c719c7c7d27871ef4b6ed7bfcd03a036b9158e", + "version": "3.1.4.0" }, { - "cabal_sha256": "f65819f74c6ced42b24d9e5053165508c4b6a18271c8e3229dc93b1dc8f7a5ab", - "revision": 1, - "src_sha256": "6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6", + "cabal_sha256": "f5f2c679ecc1c1b83d2d68db6cc564e5c78d53425e69e1b9e36784820e122d37", "flags": [], "package": "th-compat", + "revision": 4, "source": "hackage", - "version": "0.1.3" + "src_sha256": "d8f97ac14ab47b6b8a7b0fdb4ff95426322ec56badd01652ac15da4a44d4bab8", + "version": "0.1.4" }, { - "cabal_sha256": "a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d", - "revision": 0, - "src_sha256": "57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584", + "cabal_sha256": "6fffb57373962b5651a2db8b0af732098b3bf029a7ced76a9855615de2026588", "flags": [], "package": "network-uri", + "revision": 1, "source": "hackage", - "version": "2.6.4.1" + "src_sha256": "9c188973126e893250b881f20e8811dca06c223c23402b06f7a1f2e995797228", + "version": "2.6.4.2" }, { - "cabal_sha256": "16ee1212245c6e7cf0905b039689b55dbe8386a2b450094055e536d30c89ba76", - "revision": 0, - "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", + "cabal_sha256": "0e37572590743e49d7a610f472e1618a594dc861410846f64d9f2347923c4f5b", "flags": [ "-conduit10", "+network-uri", @@ -76,105 +160,137 @@ "-warp-tests" ], "package": "HTTP", + "revision": 3, "source": "hackage", + "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", "version": "4000.4.1" }, { - "cabal_sha256": "eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37", - "revision": 0, - "src_sha256": "20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb", + "cabal_sha256": "c4733d09f798fc4304e936924a1a7d9fc2425aefad6c46ad4592035254b46051", "flags": [], "package": "base-orphans", + "revision": 0, "source": "hackage", - "version": "0.8.6" + "src_sha256": "5bbf2da382c5b212d6a8be2f8c49edee0eba30f272a15fd32c13e6e4091ef172", + "version": "0.9.1" }, { - "cabal_sha256": "64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a", - "revision": 0, - "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", + "cabal_sha256": "ad89e28b2b046175698fbf542af2ce43e5d2af50aae9f48d12566b1bb3de1d3c", + "flags": [], + "package": "data-array-byte", + "revision": 2, + "source": "hackage", + "src_sha256": "1bb6eca0b3e02d057fe7f4e14c81ef395216f421ab30fdaa1b18017c9c025600", + "version": "0.1.0.1" + }, + { + "cabal_sha256": "f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194", + "flags": [ + "+integer-gmp", + "-random-initial-seed" + ], + "package": "hashable", + "revision": 1, + "source": "hackage", + "src_sha256": "32efb16c2891786209b7cbe5c39df9b3a9ae51e836f1a54f646bc4602b7ab0f5", + "version": "1.4.3.0" + }, + { + "cabal_sha256": "9b8ceefce014e490f9e1335fa5f511161309926c55d01cec795016f4363b5d2d", + "flags": [ + "-bench" + ], + "package": "async", + "revision": 4, + "source": "hackage", + "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", + "version": "2.2.4" + }, + { + "cabal_sha256": "a694e88f9ec9fc79f0b03f233d3fea592b68f70a34aac2ddb5bcaecb6562e2fd", "flags": [], "package": "base16-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", "version": "1.0.2.0" }, { - "cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8", - "revision": 0, - "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", + "cabal_sha256": "45305ccf8914c66d385b518721472c7b8c858f1986945377f74f85c1e0d49803", "flags": [], "package": "base64-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", "version": "1.2.1.0" }, { - "cabal_sha256": "714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1", - "revision": 0, - "src_sha256": "6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa", + "cabal_sha256": "bac0ae8d46a04e410666b0c8081cff63f060f29157983b569ca86ddb6e6e0dc6", "flags": [ "-optimised-mixer" ], "package": "splitmix", + "revision": 0, "source": "hackage", - "version": "0.1.0.4" + "src_sha256": "9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002", + "version": "0.1.0.5" }, { - "cabal_sha256": "dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9", - "revision": 0, - "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", + "cabal_sha256": "e7c1f881159d5cc788619c9ee8b8f340ba2ff0db571cdf3d1a1968ebc5108789", "flags": [], "package": "random", + "revision": 1, "source": "hackage", + "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", "version": "1.2.1.1" }, { "cabal_sha256": "4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee", - "revision": 1, - "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "flags": [], "package": "edit-distance", + "revision": 1, "source": "hackage", + "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "version": "0.2.2.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "-debug-conflict-sets", "-debug-expensive-assertions", "-debug-tracetree" ], "package": "cabal-install-solver", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", - "revision": 0, - "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "cabal_sha256": "03db065161987f614a3a2bbcd16264f78e47efe231fb5bd161be2043eaf20488", "flags": [ - "-example" + "-exe", + "+use-cbits" ], - "package": "echo", + "package": "cryptohash-sha256", + "revision": 3, "source": "hackage", - "version": "0.1.4" + "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "version": "0.11.102.1" }, { - "cabal_sha256": "188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332", - "revision": 0, - "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", "flags": [ - "-exe", - "+use-cbits" + "-example" ], - "package": "cryptohash-sha256", + "package": "echo", + "revision": 0, "source": "hackage", - "version": "0.11.102.1" + "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "version": "0.1.4" }, { - "cabal_sha256": "24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2", - "revision": 5, - "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", + "cabal_sha256": "48383789821af5cc624498f3ee1d0939a070cda9468c0bfe63c951736be81c75", "flags": [ "+no-donna", "+test-doctests", @@ -182,49 +298,49 @@ "+test-properties" ], "package": "ed25519", + "revision": 8, "source": "hackage", + "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", "version": "0.0.5.0" }, { - "cabal_sha256": "c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0", - "revision": 2, - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", + "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", "flags": [ "+ofd-locking" ], "package": "lukko", + "revision": 5, "source": "hackage", + "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", "version": "0.1.1.3" }, { - "cabal_sha256": "bc14969ea4adfec6eee20264decf4a07c4002b38b2aa802d58d86b1a2cf7b895", - "revision": 5, - "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", + "cabal_sha256": "aaf5dd3ef327aaf203b1cb199760efd463fac2256453dd0e05d5cd707cdbd6e1", "flags": [ "-old-bytestring", "-old-time" ], "package": "tar", + "revision": 10, "source": "hackage", + "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", "version": "0.5.1.1" }, { - "cabal_sha256": "8214a9d37580f17f8b675109578a5dbe6853559eef156e34dc2233f1123ace33", - "revision": 0, - "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", + "cabal_sha256": "19eb7759af71957811d5ec10ddb1e2f4c98700ddb9c0da6860c0441d811f0e6d", "flags": [ "-bundled-c-zlib", "-non-blocking-ffi", "-pkg-config" ], "package": "zlib", + "revision": 4, "source": "hackage", + "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", "version": "0.6.3.0" }, { - "cabal_sha256": "1d4b292bd90970f7ef52c72f2ae365f88bd2c6a75627dc34a31d24bc8f53f2e4", - "revision": 2, - "src_sha256": "bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8", + "cabal_sha256": "2b2e560ac449e49f86a10d79957b2409da5be4b77edabd7425696780334cf3bf", "flags": [ "+base48", "+cabal-syntax", @@ -234,168 +350,60 @@ "+use-network-uri" ], "package": "hackage-security", + "revision": 8, "source": "hackage", - "version": "0.6.2.1" + "src_sha256": "52ee0576971955571d846b8e6c09638f89f4f7881f4a95173e44ccc0d856a066", + "version": "0.6.2.3" }, { - "cabal_sha256": "0cddd0229d1aac305ea0404409c0bbfab81f075817bd74b8b2929eff58333e55", - "revision": 0, - "src_sha256": "83606edd356d914c075ecd44f6d5fe91a3b186aa0683c8dd8c9a7e8e22a47600", - "flags": [ - "+containers", - "+integer-gmp", - "-random-initial-seed" - ], - "package": "hashable", - "source": "hackage", - "version": "1.4.0.2" - }, - { - "cabal_sha256": "4ff4425c710cddf440dfbac6cd52310bb6b23e17902390ff71c9fc7eaafc4fcc", - "revision": 1, - "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", + "cabal_sha256": "0322b2fcd1358f3355e0c8608efa60d27b14d1c9d476451dbcb9181363bd8b27", "flags": [], "package": "regex-base", + "revision": 4, "source": "hackage", + "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", "version": "0.94.0.2" }, { - "cabal_sha256": "9dbba4b65a3bb6975d9740814be5593c6b2d2d6a0b3febc8ec940edb9a9bbdf4", - "revision": 1, - "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", + "cabal_sha256": "816d6acc560cb86672f347a7bef8129578dde26ed760f9e79b4976ed9bd7b9fd", "flags": [ "-_regex-posix-clib" ], "package": "regex-posix", + "revision": 3, "source": "hackage", + "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", "version": "0.96.0.1" }, { - "cabal_sha256": "2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4", - "revision": 4, - "src_sha256": "81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671", + "cabal_sha256": "4868265ab5760d2fdeb96625b138c8df25d41b9ee2651fa299ed019a69403045", "flags": [], "package": "resolv", + "revision": 3, "source": "hackage", - "version": "0.1.2.0" + "src_sha256": "880d283df9132a7375fa28670f71e86480a4f49972256dc2a204c648274ae74b", + "version": "0.2.0.2" }, { - "cabal_sha256": "6e9b1b233af80cc0aa17ea858d2641ba146fb11cbcc5970a52649e89d77282e2", - "revision": 0, - "src_sha256": "91ce28d8f8a6efd31788d4827ed5cdcb9a546ad4053a86c56f7947c66a30b5bf", + "cabal_sha256": "8bb7261bd54bd58acfcb154be6a161fb6d0d31a1852aadc8e927d2ad2d7651d1", "flags": [], "package": "safe-exceptions", - "source": "hackage", - "version": "0.1.7.3" - }, - { - "cabal_sha256": "b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0", "revision": 1, - "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", - "flags": [ - "-bench" - ], - "package": "async", "source": "hackage", - "version": "2.2.4" + "src_sha256": "3c51d8d50c9b60ff8bf94f942fd92e3bea9e62c5afa778dfc9f707b79da41ef6", + "version": "0.1.7.4" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "+lukko", "+native-dns" ], "package": "cabal-install", + "revision": null, "source": "local", - "version": "3.9.0.0" - } - ], - "builtin": [ - { - "package": "rts", - "version": "1.0.1" - }, - { - "package": "ghc-prim", - "version": "0.6.1" - }, - { - "package": "integer-gmp", - "version": "1.0.3.0" - }, - { - "package": "base", - "version": "4.14.3.0" - }, - { - "package": "array", - "version": "0.5.4.0" - }, - { - "package": "deepseq", - "version": "1.4.4.0" - }, - { - "package": "bytestring", - "version": "0.10.12.0" - }, - { - "package": "containers", - "version": "0.6.5.1" - }, - { - "package": "binary", - "version": "0.8.8.0" - }, - { - "package": "filepath", - "version": "1.4.2.1" - }, - { - "package": "time", - "version": "1.9.3" - }, - { - "package": "unix", - "version": "2.7.2.2" - }, - { - "package": "transformers", - "version": "0.5.6.2" - }, - { - "package": "mtl", - "version": "2.2.2" - }, - { - "package": "ghc-boot-th", - "version": "8.10.7" - }, - { - "package": "pretty", - "version": "1.1.3.6" - }, - { - "package": "template-haskell", - "version": "2.16.0.0" - }, - { - "package": "text", - "version": "1.2.4.1" - }, - { - "package": "parsec", - "version": "3.1.14.0" - }, - { - "package": "stm", - "version": "2.5.0.1" - }, - { - "package": "exceptions", - "version": "0.10.4" + "src_sha256": null, + "version": "3.10.3.0" } ] } diff --git a/bootstrap/linux-8.6.5.json b/bootstrap/linux-8.6.5.json deleted file mode 100644 index 4b6d7d16c6f..00000000000 --- a/bootstrap/linux-8.6.5.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "dependencies": [ - { - "cabal_sha256": "1125a0a4be3aafc8da208940f219d4e4df8a0db87d892cc42bb369071855c590", - "revision": 0, - "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", - "flags": [], - "package": "directory", - "source": "hackage", - "version": "1.3.7.1" - }, - { - "cabal_sha256": null, - "revision": null, - "src_sha256": null, - "flags": [], - "package": "Cabal-syntax", - "source": "local", - "version": "3.9.0.0" - }, - { - "cabal_sha256": "04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf", - "revision": 0, - "src_sha256": "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab", - "flags": [], - "package": "process", - "source": "hackage", - "version": "1.6.15.0" - }, - { - "cabal_sha256": null, - "revision": null, - "src_sha256": null, - "flags": [], - "package": "Cabal", - "source": "local", - "version": "3.9.0.0" - }, - { - "cabal_sha256": "e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568", - "revision": 0, - "src_sha256": "7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85", - "flags": [ - "-devel" - ], - "package": "network", - "source": "hackage", - "version": "3.1.2.7" - }, - { - "cabal_sha256": "f65819f74c6ced42b24d9e5053165508c4b6a18271c8e3229dc93b1dc8f7a5ab", - "revision": 1, - "src_sha256": "6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6", - "flags": [], - "package": "th-compat", - "source": "hackage", - "version": "0.1.3" - }, - { - "cabal_sha256": "a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d", - "revision": 0, - "src_sha256": "57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584", - "flags": [], - "package": "network-uri", - "source": "hackage", - "version": "2.6.4.1" - }, - { - "cabal_sha256": "16ee1212245c6e7cf0905b039689b55dbe8386a2b450094055e536d30c89ba76", - "revision": 0, - "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", - "flags": [ - "-conduit10", - "+network-uri", - "-warn-as-error", - "-warp-tests" - ], - "package": "HTTP", - "source": "hackage", - "version": "4000.4.1" - }, - { - "cabal_sha256": "eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37", - "revision": 0, - "src_sha256": "20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb", - "flags": [], - "package": "base-orphans", - "source": "hackage", - "version": "0.8.6" - }, - { - "cabal_sha256": "64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a", - "revision": 0, - "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", - "flags": [], - "package": "base16-bytestring", - "source": "hackage", - "version": "1.0.2.0" - }, - { - "cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8", - "revision": 0, - "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", - "flags": [], - "package": "base64-bytestring", - "source": "hackage", - "version": "1.2.1.0" - }, - { - "cabal_sha256": "714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1", - "revision": 0, - "src_sha256": "6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa", - "flags": [ - "-optimised-mixer" - ], - "package": "splitmix", - "source": "hackage", - "version": "0.1.0.4" - }, - { - "cabal_sha256": "dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9", - "revision": 0, - "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", - "flags": [], - "package": "random", - "source": "hackage", - "version": "1.2.1.1" - }, - { - "cabal_sha256": "4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee", - "revision": 1, - "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", - "flags": [], - "package": "edit-distance", - "source": "hackage", - "version": "0.2.2.1" - }, - { - "cabal_sha256": null, - "revision": null, - "src_sha256": null, - "flags": [ - "-debug-conflict-sets", - "-debug-expensive-assertions", - "-debug-tracetree" - ], - "package": "cabal-install-solver", - "source": "local", - "version": "3.9.0.0" - }, - { - "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", - "revision": 0, - "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", - "flags": [ - "-example" - ], - "package": "echo", - "source": "hackage", - "version": "0.1.4" - }, - { - "cabal_sha256": "188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332", - "revision": 0, - "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", - "flags": [ - "-exe", - "+use-cbits" - ], - "package": "cryptohash-sha256", - "source": "hackage", - "version": "0.11.102.1" - }, - { - "cabal_sha256": "24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2", - "revision": 5, - "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", - "flags": [ - "+no-donna", - "+test-doctests", - "+test-hlint", - "+test-properties" - ], - "package": "ed25519", - "source": "hackage", - "version": "0.0.5.0" - }, - { - "cabal_sha256": "c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0", - "revision": 2, - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", - "flags": [ - "+ofd-locking" - ], - "package": "lukko", - "source": "hackage", - "version": "0.1.1.3" - }, - { - "cabal_sha256": "bc14969ea4adfec6eee20264decf4a07c4002b38b2aa802d58d86b1a2cf7b895", - "revision": 5, - "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", - "flags": [ - "-old-bytestring", - "-old-time" - ], - "package": "tar", - "source": "hackage", - "version": "0.5.1.1" - }, - { - "cabal_sha256": "8214a9d37580f17f8b675109578a5dbe6853559eef156e34dc2233f1123ace33", - "revision": 0, - "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", - "flags": [ - "-bundled-c-zlib", - "-non-blocking-ffi", - "-pkg-config" - ], - "package": "zlib", - "source": "hackage", - "version": "0.6.3.0" - }, - { - "cabal_sha256": "1d4b292bd90970f7ef52c72f2ae365f88bd2c6a75627dc34a31d24bc8f53f2e4", - "revision": 2, - "src_sha256": "bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8", - "flags": [ - "+base48", - "+cabal-syntax", - "+lukko", - "-mtl21", - "-old-directory", - "+use-network-uri" - ], - "package": "hackage-security", - "source": "hackage", - "version": "0.6.2.1" - }, - { - "cabal_sha256": "0cddd0229d1aac305ea0404409c0bbfab81f075817bd74b8b2929eff58333e55", - "revision": 0, - "src_sha256": "83606edd356d914c075ecd44f6d5fe91a3b186aa0683c8dd8c9a7e8e22a47600", - "flags": [ - "+containers", - "+integer-gmp", - "-random-initial-seed" - ], - "package": "hashable", - "source": "hackage", - "version": "1.4.0.2" - }, - { - "cabal_sha256": "4ff4425c710cddf440dfbac6cd52310bb6b23e17902390ff71c9fc7eaafc4fcc", - "revision": 1, - "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", - "flags": [], - "package": "regex-base", - "source": "hackage", - "version": "0.94.0.2" - }, - { - "cabal_sha256": "9dbba4b65a3bb6975d9740814be5593c6b2d2d6a0b3febc8ec940edb9a9bbdf4", - "revision": 1, - "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", - "flags": [ - "-_regex-posix-clib" - ], - "package": "regex-posix", - "source": "hackage", - "version": "0.96.0.1" - }, - { - "cabal_sha256": "2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4", - "revision": 4, - "src_sha256": "81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671", - "flags": [], - "package": "resolv", - "source": "hackage", - "version": "0.1.2.0" - }, - { - "cabal_sha256": "b2c634a95ba2a68e0df3ae67d006f0dabb02edbe4dc77b321133551e308ca047", - "revision": 1, - "src_sha256": "66e3c0b4e2d32287621a3faab6b99c7e03b285a07711f335332aec6b4217bf8b", - "flags": [ - "+transformers-0-4" - ], - "package": "exceptions", - "source": "hackage", - "version": "0.10.5" - }, - { - "cabal_sha256": "6e9b1b233af80cc0aa17ea858d2641ba146fb11cbcc5970a52649e89d77282e2", - "revision": 0, - "src_sha256": "91ce28d8f8a6efd31788d4827ed5cdcb9a546ad4053a86c56f7947c66a30b5bf", - "flags": [], - "package": "safe-exceptions", - "source": "hackage", - "version": "0.1.7.3" - }, - { - "cabal_sha256": "b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0", - "revision": 1, - "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", - "flags": [ - "-bench" - ], - "package": "async", - "source": "hackage", - "version": "2.2.4" - }, - { - "cabal_sha256": null, - "revision": null, - "src_sha256": null, - "flags": [ - "+lukko", - "+native-dns" - ], - "package": "cabal-install", - "source": "local", - "version": "3.9.0.0" - } - ], - "builtin": [ - { - "package": "rts", - "version": "1.0" - }, - { - "package": "ghc-prim", - "version": "0.5.3" - }, - { - "package": "integer-gmp", - "version": "1.0.2.0" - }, - { - "package": "base", - "version": "4.12.0.0" - }, - { - "package": "array", - "version": "0.5.3.0" - }, - { - "package": "deepseq", - "version": "1.4.4.0" - }, - { - "package": "bytestring", - "version": "0.10.8.2" - }, - { - "package": "containers", - "version": "0.6.0.1" - }, - { - "package": "binary", - "version": "0.8.6.0" - }, - { - "package": "filepath", - "version": "1.4.2.1" - }, - { - "package": "time", - "version": "1.8.0.2" - }, - { - "package": "unix", - "version": "2.7.2.2" - }, - { - "package": "transformers", - "version": "0.5.6.2" - }, - { - "package": "mtl", - "version": "2.2.2" - }, - { - "package": "text", - "version": "1.2.3.1" - }, - { - "package": "parsec", - "version": "3.1.13.0" - }, - { - "package": "pretty", - "version": "1.1.3.6" - }, - { - "package": "ghc-boot-th", - "version": "8.6.5" - }, - { - "package": "template-haskell", - "version": "2.14.0.0" - }, - { - "package": "stm", - "version": "2.5.0.0" - } - ] -} diff --git a/bootstrap/linux-9.0.2.json b/bootstrap/linux-9.0.2.json index 753984e7016..83075a0541b 100644 --- a/bootstrap/linux-9.0.2.json +++ b/bootstrap/linux-9.0.2.json @@ -1,74 +1,158 @@ { + "builtin": [ + { + "package": "rts", + "version": "1.0.2" + }, + { + "package": "ghc-prim", + "version": "0.7.0" + }, + { + "package": "ghc-bignum", + "version": "1.1" + }, + { + "package": "base", + "version": "4.15.1.0" + }, + { + "package": "array", + "version": "0.5.4.0" + }, + { + "package": "deepseq", + "version": "1.4.5.0" + }, + { + "package": "bytestring", + "version": "0.10.12.1" + }, + { + "package": "containers", + "version": "0.6.4.1" + }, + { + "package": "binary", + "version": "0.8.8.0" + }, + { + "package": "filepath", + "version": "1.4.2.1" + }, + { + "package": "time", + "version": "1.9.3" + }, + { + "package": "unix", + "version": "2.7.2.2" + }, + { + "package": "transformers", + "version": "0.5.6.2" + }, + { + "package": "mtl", + "version": "2.2.2" + }, + { + "package": "ghc-boot-th", + "version": "9.0.2" + }, + { + "package": "pretty", + "version": "1.1.3.6" + }, + { + "package": "template-haskell", + "version": "2.17.0.0" + }, + { + "package": "text", + "version": "1.2.5.0" + }, + { + "package": "parsec", + "version": "3.1.14.0" + }, + { + "package": "stm", + "version": "2.5.0.0" + }, + { + "package": "exceptions", + "version": "0.10.4" + } + ], "dependencies": [ { - "cabal_sha256": "1125a0a4be3aafc8da208940f219d4e4df8a0db87d892cc42bb369071855c590", - "revision": 0, - "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", + "cabal_sha256": "7d16bf127fb303bd69d9c433bb146c5815f9690933af1d5a6ee45dea2e536dc5", "flags": [], "package": "directory", + "revision": 1, "source": "hackage", + "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", "version": "1.3.7.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal-syntax", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf", - "revision": 0, - "src_sha256": "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab", + "cabal_sha256": "8b4bce2749e4f61a440049e6088487003e8023c720e2019345e399d50888594f", "flags": [], "package": "process", + "revision": 2, "source": "hackage", - "version": "1.6.15.0" + "src_sha256": "aa5f4c4fe4974f89f5ab998c7509daa4bda3926cfb06daacd5eba892aad8a37e", + "version": "1.6.18.0" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568", - "revision": 0, - "src_sha256": "7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85", + "cabal_sha256": "e152cdb03243afb52bbc740cfbe96905ca298a6f6342f0c47b3f2e227ff19def", "flags": [ "-devel" ], "package": "network", + "revision": 1, "source": "hackage", - "version": "3.1.2.7" + "src_sha256": "b452a2afac95d9207357eb3820c719c7c7d27871ef4b6ed7bfcd03a036b9158e", + "version": "3.1.4.0" }, { - "cabal_sha256": "f65819f74c6ced42b24d9e5053165508c4b6a18271c8e3229dc93b1dc8f7a5ab", - "revision": 1, - "src_sha256": "6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6", + "cabal_sha256": "f5f2c679ecc1c1b83d2d68db6cc564e5c78d53425e69e1b9e36784820e122d37", "flags": [], "package": "th-compat", + "revision": 4, "source": "hackage", - "version": "0.1.3" + "src_sha256": "d8f97ac14ab47b6b8a7b0fdb4ff95426322ec56badd01652ac15da4a44d4bab8", + "version": "0.1.4" }, { - "cabal_sha256": "a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d", - "revision": 0, - "src_sha256": "57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584", + "cabal_sha256": "6fffb57373962b5651a2db8b0af732098b3bf029a7ced76a9855615de2026588", "flags": [], "package": "network-uri", + "revision": 1, "source": "hackage", - "version": "2.6.4.1" + "src_sha256": "9c188973126e893250b881f20e8811dca06c223c23402b06f7a1f2e995797228", + "version": "2.6.4.2" }, { - "cabal_sha256": "16ee1212245c6e7cf0905b039689b55dbe8386a2b450094055e536d30c89ba76", - "revision": 0, - "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", + "cabal_sha256": "0e37572590743e49d7a610f472e1618a594dc861410846f64d9f2347923c4f5b", "flags": [ "-conduit10", "+network-uri", @@ -76,105 +160,137 @@ "-warp-tests" ], "package": "HTTP", + "revision": 3, "source": "hackage", + "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", "version": "4000.4.1" }, { - "cabal_sha256": "eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37", - "revision": 0, - "src_sha256": "20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb", + "cabal_sha256": "c4733d09f798fc4304e936924a1a7d9fc2425aefad6c46ad4592035254b46051", "flags": [], "package": "base-orphans", + "revision": 0, "source": "hackage", - "version": "0.8.6" + "src_sha256": "5bbf2da382c5b212d6a8be2f8c49edee0eba30f272a15fd32c13e6e4091ef172", + "version": "0.9.1" }, { - "cabal_sha256": "64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a", - "revision": 0, - "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", + "cabal_sha256": "ad89e28b2b046175698fbf542af2ce43e5d2af50aae9f48d12566b1bb3de1d3c", + "flags": [], + "package": "data-array-byte", + "revision": 2, + "source": "hackage", + "src_sha256": "1bb6eca0b3e02d057fe7f4e14c81ef395216f421ab30fdaa1b18017c9c025600", + "version": "0.1.0.1" + }, + { + "cabal_sha256": "f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194", + "flags": [ + "+integer-gmp", + "-random-initial-seed" + ], + "package": "hashable", + "revision": 1, + "source": "hackage", + "src_sha256": "32efb16c2891786209b7cbe5c39df9b3a9ae51e836f1a54f646bc4602b7ab0f5", + "version": "1.4.3.0" + }, + { + "cabal_sha256": "9b8ceefce014e490f9e1335fa5f511161309926c55d01cec795016f4363b5d2d", + "flags": [ + "-bench" + ], + "package": "async", + "revision": 4, + "source": "hackage", + "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", + "version": "2.2.4" + }, + { + "cabal_sha256": "a694e88f9ec9fc79f0b03f233d3fea592b68f70a34aac2ddb5bcaecb6562e2fd", "flags": [], "package": "base16-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", "version": "1.0.2.0" }, { - "cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8", - "revision": 0, - "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", + "cabal_sha256": "45305ccf8914c66d385b518721472c7b8c858f1986945377f74f85c1e0d49803", "flags": [], "package": "base64-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", "version": "1.2.1.0" }, { - "cabal_sha256": "714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1", - "revision": 0, - "src_sha256": "6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa", + "cabal_sha256": "bac0ae8d46a04e410666b0c8081cff63f060f29157983b569ca86ddb6e6e0dc6", "flags": [ "-optimised-mixer" ], "package": "splitmix", + "revision": 0, "source": "hackage", - "version": "0.1.0.4" + "src_sha256": "9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002", + "version": "0.1.0.5" }, { - "cabal_sha256": "dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9", - "revision": 0, - "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", + "cabal_sha256": "e7c1f881159d5cc788619c9ee8b8f340ba2ff0db571cdf3d1a1968ebc5108789", "flags": [], "package": "random", + "revision": 1, "source": "hackage", + "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", "version": "1.2.1.1" }, { "cabal_sha256": "4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee", - "revision": 1, - "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "flags": [], "package": "edit-distance", + "revision": 1, "source": "hackage", + "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "version": "0.2.2.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "-debug-conflict-sets", "-debug-expensive-assertions", "-debug-tracetree" ], "package": "cabal-install-solver", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", - "revision": 0, - "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "cabal_sha256": "03db065161987f614a3a2bbcd16264f78e47efe231fb5bd161be2043eaf20488", "flags": [ - "-example" + "-exe", + "+use-cbits" ], - "package": "echo", + "package": "cryptohash-sha256", + "revision": 3, "source": "hackage", - "version": "0.1.4" + "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "version": "0.11.102.1" }, { - "cabal_sha256": "188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332", - "revision": 0, - "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", "flags": [ - "-exe", - "+use-cbits" + "-example" ], - "package": "cryptohash-sha256", + "package": "echo", + "revision": 0, "source": "hackage", - "version": "0.11.102.1" + "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "version": "0.1.4" }, { - "cabal_sha256": "24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2", - "revision": 5, - "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", + "cabal_sha256": "48383789821af5cc624498f3ee1d0939a070cda9468c0bfe63c951736be81c75", "flags": [ "+no-donna", "+test-doctests", @@ -182,49 +298,49 @@ "+test-properties" ], "package": "ed25519", + "revision": 8, "source": "hackage", + "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", "version": "0.0.5.0" }, { - "cabal_sha256": "c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0", - "revision": 2, - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", + "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", "flags": [ "+ofd-locking" ], "package": "lukko", + "revision": 5, "source": "hackage", + "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", "version": "0.1.1.3" }, { - "cabal_sha256": "bc14969ea4adfec6eee20264decf4a07c4002b38b2aa802d58d86b1a2cf7b895", - "revision": 5, - "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", + "cabal_sha256": "aaf5dd3ef327aaf203b1cb199760efd463fac2256453dd0e05d5cd707cdbd6e1", "flags": [ "-old-bytestring", "-old-time" ], "package": "tar", + "revision": 10, "source": "hackage", + "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", "version": "0.5.1.1" }, { - "cabal_sha256": "8214a9d37580f17f8b675109578a5dbe6853559eef156e34dc2233f1123ace33", - "revision": 0, - "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", + "cabal_sha256": "19eb7759af71957811d5ec10ddb1e2f4c98700ddb9c0da6860c0441d811f0e6d", "flags": [ "-bundled-c-zlib", "-non-blocking-ffi", "-pkg-config" ], "package": "zlib", + "revision": 4, "source": "hackage", + "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", "version": "0.6.3.0" }, { - "cabal_sha256": "1d4b292bd90970f7ef52c72f2ae365f88bd2c6a75627dc34a31d24bc8f53f2e4", - "revision": 2, - "src_sha256": "bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8", + "cabal_sha256": "2b2e560ac449e49f86a10d79957b2409da5be4b77edabd7425696780334cf3bf", "flags": [ "+base48", "+cabal-syntax", @@ -234,168 +350,60 @@ "+use-network-uri" ], "package": "hackage-security", + "revision": 8, "source": "hackage", - "version": "0.6.2.1" + "src_sha256": "52ee0576971955571d846b8e6c09638f89f4f7881f4a95173e44ccc0d856a066", + "version": "0.6.2.3" }, { - "cabal_sha256": "0cddd0229d1aac305ea0404409c0bbfab81f075817bd74b8b2929eff58333e55", - "revision": 0, - "src_sha256": "83606edd356d914c075ecd44f6d5fe91a3b186aa0683c8dd8c9a7e8e22a47600", - "flags": [ - "+containers", - "+integer-gmp", - "-random-initial-seed" - ], - "package": "hashable", - "source": "hackage", - "version": "1.4.0.2" - }, - { - "cabal_sha256": "4ff4425c710cddf440dfbac6cd52310bb6b23e17902390ff71c9fc7eaafc4fcc", - "revision": 1, - "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", + "cabal_sha256": "0322b2fcd1358f3355e0c8608efa60d27b14d1c9d476451dbcb9181363bd8b27", "flags": [], "package": "regex-base", + "revision": 4, "source": "hackage", + "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", "version": "0.94.0.2" }, { - "cabal_sha256": "9dbba4b65a3bb6975d9740814be5593c6b2d2d6a0b3febc8ec940edb9a9bbdf4", - "revision": 1, - "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", + "cabal_sha256": "816d6acc560cb86672f347a7bef8129578dde26ed760f9e79b4976ed9bd7b9fd", "flags": [ "-_regex-posix-clib" ], "package": "regex-posix", + "revision": 3, "source": "hackage", + "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", "version": "0.96.0.1" }, { - "cabal_sha256": "2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4", - "revision": 4, - "src_sha256": "81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671", + "cabal_sha256": "4868265ab5760d2fdeb96625b138c8df25d41b9ee2651fa299ed019a69403045", "flags": [], "package": "resolv", + "revision": 3, "source": "hackage", - "version": "0.1.2.0" + "src_sha256": "880d283df9132a7375fa28670f71e86480a4f49972256dc2a204c648274ae74b", + "version": "0.2.0.2" }, { - "cabal_sha256": "6e9b1b233af80cc0aa17ea858d2641ba146fb11cbcc5970a52649e89d77282e2", - "revision": 0, - "src_sha256": "91ce28d8f8a6efd31788d4827ed5cdcb9a546ad4053a86c56f7947c66a30b5bf", + "cabal_sha256": "8bb7261bd54bd58acfcb154be6a161fb6d0d31a1852aadc8e927d2ad2d7651d1", "flags": [], "package": "safe-exceptions", - "source": "hackage", - "version": "0.1.7.3" - }, - { - "cabal_sha256": "b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0", "revision": 1, - "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", - "flags": [ - "-bench" - ], - "package": "async", "source": "hackage", - "version": "2.2.4" + "src_sha256": "3c51d8d50c9b60ff8bf94f942fd92e3bea9e62c5afa778dfc9f707b79da41ef6", + "version": "0.1.7.4" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "+lukko", "+native-dns" ], "package": "cabal-install", + "revision": null, "source": "local", - "version": "3.9.0.0" - } - ], - "builtin": [ - { - "package": "rts", - "version": "1.0.2" - }, - { - "package": "ghc-prim", - "version": "0.7.0" - }, - { - "package": "ghc-bignum", - "version": "1.1" - }, - { - "package": "base", - "version": "4.15.1.0" - }, - { - "package": "array", - "version": "0.5.4.0" - }, - { - "package": "deepseq", - "version": "1.4.5.0" - }, - { - "package": "bytestring", - "version": "0.10.12.1" - }, - { - "package": "containers", - "version": "0.6.4.1" - }, - { - "package": "binary", - "version": "0.8.8.0" - }, - { - "package": "filepath", - "version": "1.4.2.1" - }, - { - "package": "time", - "version": "1.9.3" - }, - { - "package": "unix", - "version": "2.7.2.2" - }, - { - "package": "transformers", - "version": "0.5.6.2" - }, - { - "package": "mtl", - "version": "2.2.2" - }, - { - "package": "ghc-boot-th", - "version": "9.0.2" - }, - { - "package": "pretty", - "version": "1.1.3.6" - }, - { - "package": "template-haskell", - "version": "2.17.0.0" - }, - { - "package": "text", - "version": "1.2.5.0" - }, - { - "package": "parsec", - "version": "3.1.14.0" - }, - { - "package": "stm", - "version": "2.5.0.0" - }, - { - "package": "exceptions", - "version": "0.10.4" + "src_sha256": null, + "version": "3.10.3.0" } ] } diff --git a/bootstrap/linux-9.2.3.json b/bootstrap/linux-9.2.8.json similarity index 68% rename from bootstrap/linux-9.2.3.json rename to bootstrap/linux-9.2.8.json index 98d7d689c1f..5fa41795110 100644 --- a/bootstrap/linux-9.2.3.json +++ b/bootstrap/linux-9.2.8.json @@ -1,74 +1,158 @@ { + "builtin": [ + { + "package": "rts", + "version": "1.0.2" + }, + { + "package": "ghc-prim", + "version": "0.8.0" + }, + { + "package": "ghc-bignum", + "version": "1.2" + }, + { + "package": "base", + "version": "4.16.4.0" + }, + { + "package": "array", + "version": "0.5.4.0" + }, + { + "package": "deepseq", + "version": "1.4.6.1" + }, + { + "package": "ghc-boot-th", + "version": "9.2.8" + }, + { + "package": "pretty", + "version": "1.1.3.6" + }, + { + "package": "template-haskell", + "version": "2.18.0.0" + }, + { + "package": "bytestring", + "version": "0.11.4.0" + }, + { + "package": "containers", + "version": "0.6.5.1" + }, + { + "package": "binary", + "version": "0.8.9.0" + }, + { + "package": "filepath", + "version": "1.4.2.2" + }, + { + "package": "time", + "version": "1.11.1.1" + }, + { + "package": "unix", + "version": "2.7.2.2" + }, + { + "package": "transformers", + "version": "0.5.6.2" + }, + { + "package": "mtl", + "version": "2.2.2" + }, + { + "package": "text", + "version": "1.2.5.0" + }, + { + "package": "parsec", + "version": "3.1.15.0" + }, + { + "package": "stm", + "version": "2.5.0.2" + }, + { + "package": "exceptions", + "version": "0.10.4" + } + ], "dependencies": [ { - "cabal_sha256": "1125a0a4be3aafc8da208940f219d4e4df8a0db87d892cc42bb369071855c590", - "revision": 0, - "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", + "cabal_sha256": "7d16bf127fb303bd69d9c433bb146c5815f9690933af1d5a6ee45dea2e536dc5", "flags": [], "package": "directory", + "revision": 1, "source": "hackage", + "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", "version": "1.3.7.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal-syntax", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf", - "revision": 0, - "src_sha256": "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab", + "cabal_sha256": "8b4bce2749e4f61a440049e6088487003e8023c720e2019345e399d50888594f", "flags": [], "package": "process", + "revision": 2, "source": "hackage", - "version": "1.6.15.0" + "src_sha256": "aa5f4c4fe4974f89f5ab998c7509daa4bda3926cfb06daacd5eba892aad8a37e", + "version": "1.6.18.0" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [], "package": "Cabal", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568", - "revision": 0, - "src_sha256": "7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85", + "cabal_sha256": "e152cdb03243afb52bbc740cfbe96905ca298a6f6342f0c47b3f2e227ff19def", "flags": [ "-devel" ], "package": "network", + "revision": 1, "source": "hackage", - "version": "3.1.2.7" + "src_sha256": "b452a2afac95d9207357eb3820c719c7c7d27871ef4b6ed7bfcd03a036b9158e", + "version": "3.1.4.0" }, { - "cabal_sha256": "f65819f74c6ced42b24d9e5053165508c4b6a18271c8e3229dc93b1dc8f7a5ab", - "revision": 1, - "src_sha256": "6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6", + "cabal_sha256": "f5f2c679ecc1c1b83d2d68db6cc564e5c78d53425e69e1b9e36784820e122d37", "flags": [], "package": "th-compat", + "revision": 4, "source": "hackage", - "version": "0.1.3" + "src_sha256": "d8f97ac14ab47b6b8a7b0fdb4ff95426322ec56badd01652ac15da4a44d4bab8", + "version": "0.1.4" }, { - "cabal_sha256": "a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d", - "revision": 0, - "src_sha256": "57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584", + "cabal_sha256": "6fffb57373962b5651a2db8b0af732098b3bf029a7ced76a9855615de2026588", "flags": [], "package": "network-uri", + "revision": 1, "source": "hackage", - "version": "2.6.4.1" + "src_sha256": "9c188973126e893250b881f20e8811dca06c223c23402b06f7a1f2e995797228", + "version": "2.6.4.2" }, { - "cabal_sha256": "16ee1212245c6e7cf0905b039689b55dbe8386a2b450094055e536d30c89ba76", - "revision": 0, - "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", + "cabal_sha256": "0e37572590743e49d7a610f472e1618a594dc861410846f64d9f2347923c4f5b", "flags": [ "-conduit10", "+network-uri", @@ -76,96 +160,128 @@ "-warp-tests" ], "package": "HTTP", + "revision": 3, "source": "hackage", + "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", "version": "4000.4.1" }, { - "cabal_sha256": "64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a", - "revision": 0, - "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", + "cabal_sha256": "ad89e28b2b046175698fbf542af2ce43e5d2af50aae9f48d12566b1bb3de1d3c", + "flags": [], + "package": "data-array-byte", + "revision": 2, + "source": "hackage", + "src_sha256": "1bb6eca0b3e02d057fe7f4e14c81ef395216f421ab30fdaa1b18017c9c025600", + "version": "0.1.0.1" + }, + { + "cabal_sha256": "f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194", + "flags": [ + "+integer-gmp", + "-random-initial-seed" + ], + "package": "hashable", + "revision": 1, + "source": "hackage", + "src_sha256": "32efb16c2891786209b7cbe5c39df9b3a9ae51e836f1a54f646bc4602b7ab0f5", + "version": "1.4.3.0" + }, + { + "cabal_sha256": "9b8ceefce014e490f9e1335fa5f511161309926c55d01cec795016f4363b5d2d", + "flags": [ + "-bench" + ], + "package": "async", + "revision": 4, + "source": "hackage", + "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", + "version": "2.2.4" + }, + { + "cabal_sha256": "a694e88f9ec9fc79f0b03f233d3fea592b68f70a34aac2ddb5bcaecb6562e2fd", "flags": [], "package": "base16-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", "version": "1.0.2.0" }, { - "cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8", - "revision": 0, - "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", + "cabal_sha256": "45305ccf8914c66d385b518721472c7b8c858f1986945377f74f85c1e0d49803", "flags": [], "package": "base64-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", "version": "1.2.1.0" }, { - "cabal_sha256": "714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1", - "revision": 0, - "src_sha256": "6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa", + "cabal_sha256": "bac0ae8d46a04e410666b0c8081cff63f060f29157983b569ca86ddb6e6e0dc6", "flags": [ "-optimised-mixer" ], "package": "splitmix", + "revision": 0, "source": "hackage", - "version": "0.1.0.4" + "src_sha256": "9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002", + "version": "0.1.0.5" }, { - "cabal_sha256": "dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9", - "revision": 0, - "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", + "cabal_sha256": "e7c1f881159d5cc788619c9ee8b8f340ba2ff0db571cdf3d1a1968ebc5108789", "flags": [], "package": "random", + "revision": 1, "source": "hackage", + "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", "version": "1.2.1.1" }, { "cabal_sha256": "4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee", - "revision": 1, - "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "flags": [], "package": "edit-distance", + "revision": 1, "source": "hackage", + "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "version": "0.2.2.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "-debug-conflict-sets", "-debug-expensive-assertions", "-debug-tracetree" ], "package": "cabal-install-solver", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", - "revision": 0, - "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "cabal_sha256": "03db065161987f614a3a2bbcd16264f78e47efe231fb5bd161be2043eaf20488", "flags": [ - "-example" + "-exe", + "+use-cbits" ], - "package": "echo", + "package": "cryptohash-sha256", + "revision": 3, "source": "hackage", - "version": "0.1.4" + "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "version": "0.11.102.1" }, { - "cabal_sha256": "188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332", - "revision": 0, - "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", "flags": [ - "-exe", - "+use-cbits" + "-example" ], - "package": "cryptohash-sha256", + "package": "echo", + "revision": 0, "source": "hackage", - "version": "0.11.102.1" + "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "version": "0.1.4" }, { - "cabal_sha256": "24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2", - "revision": 5, - "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", + "cabal_sha256": "48383789821af5cc624498f3ee1d0939a070cda9468c0bfe63c951736be81c75", "flags": [ "+no-donna", "+test-doctests", @@ -173,49 +289,49 @@ "+test-properties" ], "package": "ed25519", + "revision": 8, "source": "hackage", + "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", "version": "0.0.5.0" }, { - "cabal_sha256": "c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0", - "revision": 2, - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", + "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", "flags": [ "+ofd-locking" ], "package": "lukko", + "revision": 5, "source": "hackage", + "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", "version": "0.1.1.3" }, { - "cabal_sha256": "bc14969ea4adfec6eee20264decf4a07c4002b38b2aa802d58d86b1a2cf7b895", - "revision": 5, - "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", + "cabal_sha256": "aaf5dd3ef327aaf203b1cb199760efd463fac2256453dd0e05d5cd707cdbd6e1", "flags": [ "-old-bytestring", "-old-time" ], "package": "tar", + "revision": 10, "source": "hackage", + "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", "version": "0.5.1.1" }, { - "cabal_sha256": "8214a9d37580f17f8b675109578a5dbe6853559eef156e34dc2233f1123ace33", - "revision": 0, - "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", + "cabal_sha256": "19eb7759af71957811d5ec10ddb1e2f4c98700ddb9c0da6860c0441d811f0e6d", "flags": [ "-bundled-c-zlib", "-non-blocking-ffi", "-pkg-config" ], "package": "zlib", + "revision": 4, "source": "hackage", + "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", "version": "0.6.3.0" }, { - "cabal_sha256": "1d4b292bd90970f7ef52c72f2ae365f88bd2c6a75627dc34a31d24bc8f53f2e4", - "revision": 2, - "src_sha256": "bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8", + "cabal_sha256": "2b2e560ac449e49f86a10d79957b2409da5be4b77edabd7425696780334cf3bf", "flags": [ "+base48", "+cabal-syntax", @@ -225,168 +341,60 @@ "+use-network-uri" ], "package": "hackage-security", + "revision": 8, "source": "hackage", - "version": "0.6.2.1" + "src_sha256": "52ee0576971955571d846b8e6c09638f89f4f7881f4a95173e44ccc0d856a066", + "version": "0.6.2.3" }, { - "cabal_sha256": "0cddd0229d1aac305ea0404409c0bbfab81f075817bd74b8b2929eff58333e55", - "revision": 0, - "src_sha256": "83606edd356d914c075ecd44f6d5fe91a3b186aa0683c8dd8c9a7e8e22a47600", - "flags": [ - "+containers", - "+integer-gmp", - "-random-initial-seed" - ], - "package": "hashable", - "source": "hackage", - "version": "1.4.0.2" - }, - { - "cabal_sha256": "4ff4425c710cddf440dfbac6cd52310bb6b23e17902390ff71c9fc7eaafc4fcc", - "revision": 1, - "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", + "cabal_sha256": "0322b2fcd1358f3355e0c8608efa60d27b14d1c9d476451dbcb9181363bd8b27", "flags": [], "package": "regex-base", + "revision": 4, "source": "hackage", + "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", "version": "0.94.0.2" }, { - "cabal_sha256": "9dbba4b65a3bb6975d9740814be5593c6b2d2d6a0b3febc8ec940edb9a9bbdf4", - "revision": 1, - "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", + "cabal_sha256": "816d6acc560cb86672f347a7bef8129578dde26ed760f9e79b4976ed9bd7b9fd", "flags": [ "-_regex-posix-clib" ], "package": "regex-posix", + "revision": 3, "source": "hackage", + "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", "version": "0.96.0.1" }, { - "cabal_sha256": "2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4", - "revision": 4, - "src_sha256": "81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671", + "cabal_sha256": "4868265ab5760d2fdeb96625b138c8df25d41b9ee2651fa299ed019a69403045", "flags": [], "package": "resolv", + "revision": 3, "source": "hackage", - "version": "0.1.2.0" + "src_sha256": "880d283df9132a7375fa28670f71e86480a4f49972256dc2a204c648274ae74b", + "version": "0.2.0.2" }, { - "cabal_sha256": "6e9b1b233af80cc0aa17ea858d2641ba146fb11cbcc5970a52649e89d77282e2", - "revision": 0, - "src_sha256": "91ce28d8f8a6efd31788d4827ed5cdcb9a546ad4053a86c56f7947c66a30b5bf", + "cabal_sha256": "8bb7261bd54bd58acfcb154be6a161fb6d0d31a1852aadc8e927d2ad2d7651d1", "flags": [], "package": "safe-exceptions", - "source": "hackage", - "version": "0.1.7.3" - }, - { - "cabal_sha256": "b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0", "revision": 1, - "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", - "flags": [ - "-bench" - ], - "package": "async", "source": "hackage", - "version": "2.2.4" + "src_sha256": "3c51d8d50c9b60ff8bf94f942fd92e3bea9e62c5afa778dfc9f707b79da41ef6", + "version": "0.1.7.4" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "+lukko", "+native-dns" ], "package": "cabal-install", + "revision": null, "source": "local", - "version": "3.9.0.0" - } - ], - "builtin": [ - { - "package": "rts", - "version": "1.0.2" - }, - { - "package": "ghc-prim", - "version": "0.8.0" - }, - { - "package": "ghc-bignum", - "version": "1.2" - }, - { - "package": "base", - "version": "4.16.2.0" - }, - { - "package": "array", - "version": "0.5.4.0" - }, - { - "package": "deepseq", - "version": "1.4.6.1" - }, - { - "package": "ghc-boot-th", - "version": "9.2.3" - }, - { - "package": "pretty", - "version": "1.1.3.6" - }, - { - "package": "template-haskell", - "version": "2.18.0.0" - }, - { - "package": "bytestring", - "version": "0.11.3.1" - }, - { - "package": "containers", - "version": "0.6.5.1" - }, - { - "package": "binary", - "version": "0.8.9.0" - }, - { - "package": "filepath", - "version": "1.4.2.2" - }, - { - "package": "time", - "version": "1.11.1.1" - }, - { - "package": "unix", - "version": "2.7.2.2" - }, - { - "package": "transformers", - "version": "0.5.6.2" - }, - { - "package": "mtl", - "version": "2.2.2" - }, - { - "package": "text", - "version": "1.2.5.0" - }, - { - "package": "parsec", - "version": "3.1.15.0" - }, - { - "package": "stm", - "version": "2.5.0.2" - }, - { - "package": "exceptions", - "version": "0.10.4" + "src_sha256": null, + "version": "3.10.3.0" } ] } diff --git a/bootstrap/linux-8.8.4.json b/bootstrap/linux-9.4.8.json similarity index 61% rename from bootstrap/linux-8.8.4.json rename to bootstrap/linux-9.4.8.json index c9a6c9c5ea1..914b2ee43c4 100644 --- a/bootstrap/linux-8.8.4.json +++ b/bootstrap/linux-9.4.8.json @@ -1,74 +1,148 @@ { - "dependencies": [ + "builtin": [ + { + "package": "rts", + "version": "1.0.2" + }, + { + "package": "ghc-prim", + "version": "0.9.1" + }, + { + "package": "ghc-bignum", + "version": "1.3" + }, + { + "package": "base", + "version": "4.17.2.1" + }, + { + "package": "array", + "version": "0.5.4.0" + }, + { + "package": "deepseq", + "version": "1.4.8.0" + }, + { + "package": "ghc-boot-th", + "version": "9.4.8" + }, + { + "package": "pretty", + "version": "1.1.3.6" + }, + { + "package": "template-haskell", + "version": "2.19.0.0" + }, + { + "package": "bytestring", + "version": "0.11.5.3" + }, + { + "package": "containers", + "version": "0.6.7" + }, + { + "package": "binary", + "version": "0.8.9.1" + }, + { + "package": "filepath", + "version": "1.4.2.2" + }, + { + "package": "time", + "version": "1.12.2" + }, + { + "package": "unix", + "version": "2.7.3" + }, { - "cabal_sha256": "1125a0a4be3aafc8da208940f219d4e4df8a0db87d892cc42bb369071855c590", - "revision": 0, - "src_sha256": "dc2785d6548cec2e80700fab007d3e9467f65d3c58ab3efa21b34d9017cf0efd", - "flags": [], "package": "directory", - "source": "hackage", "version": "1.3.7.1" }, { - "cabal_sha256": null, - "revision": null, - "src_sha256": null, - "flags": [], - "package": "Cabal-syntax", - "source": "local", - "version": "3.9.0.0" + "package": "transformers", + "version": "0.5.6.2" + }, + { + "package": "mtl", + "version": "2.2.2" + }, + { + "package": "text", + "version": "2.0.2" + }, + { + "package": "parsec", + "version": "3.1.16.1" }, { - "cabal_sha256": "04df32d9497add5f0b90a27a3eceffa4bad5c2f41d038bd12ed6efc454db3faf", - "revision": 0, - "src_sha256": "44b31b6cd3129893ac1a007573dedb69dde667fa06ee108526d58f08b1a1f7ab", - "flags": [], "package": "process", - "source": "hackage", - "version": "1.6.15.0" + "version": "1.6.18.0" + }, + { + "package": "stm", + "version": "2.5.1.0" }, + { + "package": "exceptions", + "version": "0.10.5" + } + ], + "dependencies": [ { "cabal_sha256": null, + "flags": [], + "package": "Cabal-syntax", "revision": null, + "source": "local", "src_sha256": null, + "version": "3.10.3.0" + }, + { + "cabal_sha256": null, "flags": [], "package": "Cabal", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "e3d78b13db9512aeb106e44a334ab42b7aa48d26c097299084084cb8be5c5568", - "revision": 0, - "src_sha256": "7f7620fef1a1af3d3d6747f510e73223a5c600e7d7fd9ace073d1222bdc63d85", + "cabal_sha256": "e152cdb03243afb52bbc740cfbe96905ca298a6f6342f0c47b3f2e227ff19def", "flags": [ "-devel" ], "package": "network", + "revision": 1, "source": "hackage", - "version": "3.1.2.7" + "src_sha256": "b452a2afac95d9207357eb3820c719c7c7d27871ef4b6ed7bfcd03a036b9158e", + "version": "3.1.4.0" }, { - "cabal_sha256": "f65819f74c6ced42b24d9e5053165508c4b6a18271c8e3229dc93b1dc8f7a5ab", - "revision": 1, - "src_sha256": "6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6", + "cabal_sha256": "f5f2c679ecc1c1b83d2d68db6cc564e5c78d53425e69e1b9e36784820e122d37", "flags": [], "package": "th-compat", + "revision": 4, "source": "hackage", - "version": "0.1.3" + "src_sha256": "d8f97ac14ab47b6b8a7b0fdb4ff95426322ec56badd01652ac15da4a44d4bab8", + "version": "0.1.4" }, { - "cabal_sha256": "a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d", - "revision": 0, - "src_sha256": "57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584", + "cabal_sha256": "6fffb57373962b5651a2db8b0af732098b3bf029a7ced76a9855615de2026588", "flags": [], "package": "network-uri", + "revision": 1, "source": "hackage", - "version": "2.6.4.1" + "src_sha256": "9c188973126e893250b881f20e8811dca06c223c23402b06f7a1f2e995797228", + "version": "2.6.4.2" }, { - "cabal_sha256": "16ee1212245c6e7cf0905b039689b55dbe8386a2b450094055e536d30c89ba76", - "revision": 0, - "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", + "cabal_sha256": "0e37572590743e49d7a610f472e1618a594dc861410846f64d9f2347923c4f5b", "flags": [ "-conduit10", "+network-uri", @@ -76,105 +150,119 @@ "-warp-tests" ], "package": "HTTP", + "revision": 3, "source": "hackage", + "src_sha256": "df31d8efec775124dab856d7177ddcba31be9f9e0836ebdab03d94392f2dd453", "version": "4000.4.1" }, { - "cabal_sha256": "eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37", - "revision": 0, - "src_sha256": "20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb", - "flags": [], - "package": "base-orphans", + "cabal_sha256": "f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194", + "flags": [ + "+integer-gmp", + "-random-initial-seed" + ], + "package": "hashable", + "revision": 1, "source": "hackage", - "version": "0.8.6" + "src_sha256": "32efb16c2891786209b7cbe5c39df9b3a9ae51e836f1a54f646bc4602b7ab0f5", + "version": "1.4.3.0" }, { - "cabal_sha256": "64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a", - "revision": 0, - "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", + "cabal_sha256": "9b8ceefce014e490f9e1335fa5f511161309926c55d01cec795016f4363b5d2d", + "flags": [ + "-bench" + ], + "package": "async", + "revision": 4, + "source": "hackage", + "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", + "version": "2.2.4" + }, + { + "cabal_sha256": "a694e88f9ec9fc79f0b03f233d3fea592b68f70a34aac2ddb5bcaecb6562e2fd", "flags": [], "package": "base16-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784", "version": "1.0.2.0" }, { - "cabal_sha256": "50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8", - "revision": 0, - "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", + "cabal_sha256": "45305ccf8914c66d385b518721472c7b8c858f1986945377f74f85c1e0d49803", "flags": [], "package": "base64-bytestring", + "revision": 1, "source": "hackage", + "src_sha256": "fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9", "version": "1.2.1.0" }, { - "cabal_sha256": "714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1", - "revision": 0, - "src_sha256": "6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa", + "cabal_sha256": "bac0ae8d46a04e410666b0c8081cff63f060f29157983b569ca86ddb6e6e0dc6", "flags": [ "-optimised-mixer" ], "package": "splitmix", + "revision": 0, "source": "hackage", - "version": "0.1.0.4" + "src_sha256": "9df07a9611ef45f1b1258a0b412f4d02c920248f69d2e2ce8ccda328f7e13002", + "version": "0.1.0.5" }, { - "cabal_sha256": "dea1f11e5569332dc6c8efaad1cb301016a5587b6754943a49f9de08ae0e56d9", - "revision": 0, - "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", + "cabal_sha256": "e7c1f881159d5cc788619c9ee8b8f340ba2ff0db571cdf3d1a1968ebc5108789", "flags": [], "package": "random", + "revision": 1, "source": "hackage", + "src_sha256": "3e1272f7ed6a4d7bd1712b90143ec326fee9b225789222379fea20a9c90c9b76", "version": "1.2.1.1" }, { "cabal_sha256": "4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee", - "revision": 1, - "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "flags": [], "package": "edit-distance", + "revision": 1, "source": "hackage", + "src_sha256": "3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a", "version": "0.2.2.1" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "-debug-conflict-sets", "-debug-expensive-assertions", "-debug-tracetree" ], "package": "cabal-install-solver", + "revision": null, "source": "local", - "version": "3.9.0.0" + "src_sha256": null, + "version": "3.10.3.0" }, { - "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", - "revision": 0, - "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "cabal_sha256": "03db065161987f614a3a2bbcd16264f78e47efe231fb5bd161be2043eaf20488", "flags": [ - "-example" + "-exe", + "+use-cbits" ], - "package": "echo", + "package": "cryptohash-sha256", + "revision": 3, "source": "hackage", - "version": "0.1.4" + "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "version": "0.11.102.1" }, { - "cabal_sha256": "188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332", - "revision": 0, - "src_sha256": "73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6", + "cabal_sha256": "ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42", "flags": [ - "-exe", - "+use-cbits" + "-example" ], - "package": "cryptohash-sha256", + "package": "echo", + "revision": 0, "source": "hackage", - "version": "0.11.102.1" + "src_sha256": "c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43", + "version": "0.1.4" }, { - "cabal_sha256": "24ac7b5f3d9fa3c2f70262b329f2a75f24e7fd829f88c189b388efa1bcd67eb2", - "revision": 5, - "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", + "cabal_sha256": "48383789821af5cc624498f3ee1d0939a070cda9468c0bfe63c951736be81c75", "flags": [ "+no-donna", "+test-doctests", @@ -182,49 +270,49 @@ "+test-properties" ], "package": "ed25519", + "revision": 8, "source": "hackage", + "src_sha256": "d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d", "version": "0.0.5.0" }, { - "cabal_sha256": "c084c043a40632d3cafcac50fb5eeff84d91edb070a54baa94945f1c976f97c0", - "revision": 2, - "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", + "cabal_sha256": "17786545dce60c4d5783ba6125c0a6499a1abddd3d7417b15500ccd767c35f07", "flags": [ "+ofd-locking" ], "package": "lukko", + "revision": 5, "source": "hackage", + "src_sha256": "a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f", "version": "0.1.1.3" }, { - "cabal_sha256": "bc14969ea4adfec6eee20264decf4a07c4002b38b2aa802d58d86b1a2cf7b895", - "revision": 5, - "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", + "cabal_sha256": "aaf5dd3ef327aaf203b1cb199760efd463fac2256453dd0e05d5cd707cdbd6e1", "flags": [ "-old-bytestring", "-old-time" ], "package": "tar", + "revision": 10, "source": "hackage", + "src_sha256": "b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de", "version": "0.5.1.1" }, { - "cabal_sha256": "8214a9d37580f17f8b675109578a5dbe6853559eef156e34dc2233f1123ace33", - "revision": 0, - "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", + "cabal_sha256": "19eb7759af71957811d5ec10ddb1e2f4c98700ddb9c0da6860c0441d811f0e6d", "flags": [ "-bundled-c-zlib", "-non-blocking-ffi", "-pkg-config" ], "package": "zlib", + "revision": 4, "source": "hackage", + "src_sha256": "9eaa989ad4534438b5beb51c1d3a4c8f6a088fdff0b259a5394fbf39aaee04da", "version": "0.6.3.0" }, { - "cabal_sha256": "1d4b292bd90970f7ef52c72f2ae365f88bd2c6a75627dc34a31d24bc8f53f2e4", - "revision": 2, - "src_sha256": "bf22cd16dde7d6b7130463f4d7324b64a2964d9ef3f523df97d7cb98544d64a8", + "cabal_sha256": "2b2e560ac449e49f86a10d79957b2409da5be4b77edabd7425696780334cf3bf", "flags": [ "+base48", "+cabal-syntax", @@ -234,175 +322,60 @@ "+use-network-uri" ], "package": "hackage-security", + "revision": 8, "source": "hackage", - "version": "0.6.2.1" + "src_sha256": "52ee0576971955571d846b8e6c09638f89f4f7881f4a95173e44ccc0d856a066", + "version": "0.6.2.3" }, { - "cabal_sha256": "0cddd0229d1aac305ea0404409c0bbfab81f075817bd74b8b2929eff58333e55", - "revision": 0, - "src_sha256": "83606edd356d914c075ecd44f6d5fe91a3b186aa0683c8dd8c9a7e8e22a47600", - "flags": [ - "+containers", - "+integer-gmp", - "-random-initial-seed" - ], - "package": "hashable", - "source": "hackage", - "version": "1.4.0.2" - }, - { - "cabal_sha256": "4ff4425c710cddf440dfbac6cd52310bb6b23e17902390ff71c9fc7eaafc4fcc", - "revision": 1, - "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", + "cabal_sha256": "0322b2fcd1358f3355e0c8608efa60d27b14d1c9d476451dbcb9181363bd8b27", "flags": [], "package": "regex-base", + "revision": 4, "source": "hackage", + "src_sha256": "7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1", "version": "0.94.0.2" }, { - "cabal_sha256": "9dbba4b65a3bb6975d9740814be5593c6b2d2d6a0b3febc8ec940edb9a9bbdf4", - "revision": 1, - "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", + "cabal_sha256": "816d6acc560cb86672f347a7bef8129578dde26ed760f9e79b4976ed9bd7b9fd", "flags": [ "-_regex-posix-clib" ], "package": "regex-posix", + "revision": 3, "source": "hackage", + "src_sha256": "c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c", "version": "0.96.0.1" }, { - "cabal_sha256": "2088eb9368b920f80bbe4e3b03c3b8484090208f5c3b31645bd67a9ef7d26db4", - "revision": 4, - "src_sha256": "81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671", + "cabal_sha256": "4868265ab5760d2fdeb96625b138c8df25d41b9ee2651fa299ed019a69403045", "flags": [], "package": "resolv", + "revision": 3, "source": "hackage", - "version": "0.1.2.0" + "src_sha256": "880d283df9132a7375fa28670f71e86480a4f49972256dc2a204c648274ae74b", + "version": "0.2.0.2" }, { - "cabal_sha256": "b2c634a95ba2a68e0df3ae67d006f0dabb02edbe4dc77b321133551e308ca047", - "revision": 1, - "src_sha256": "66e3c0b4e2d32287621a3faab6b99c7e03b285a07711f335332aec6b4217bf8b", - "flags": [ - "+transformers-0-4" - ], - "package": "exceptions", - "source": "hackage", - "version": "0.10.5" - }, - { - "cabal_sha256": "6e9b1b233af80cc0aa17ea858d2641ba146fb11cbcc5970a52649e89d77282e2", - "revision": 0, - "src_sha256": "91ce28d8f8a6efd31788d4827ed5cdcb9a546ad4053a86c56f7947c66a30b5bf", + "cabal_sha256": "8bb7261bd54bd58acfcb154be6a161fb6d0d31a1852aadc8e927d2ad2d7651d1", "flags": [], "package": "safe-exceptions", - "source": "hackage", - "version": "0.1.7.3" - }, - { - "cabal_sha256": "b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0", "revision": 1, - "src_sha256": "484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725", - "flags": [ - "-bench" - ], - "package": "async", "source": "hackage", - "version": "2.2.4" + "src_sha256": "3c51d8d50c9b60ff8bf94f942fd92e3bea9e62c5afa778dfc9f707b79da41ef6", + "version": "0.1.7.4" }, { "cabal_sha256": null, - "revision": null, - "src_sha256": null, "flags": [ "+lukko", "+native-dns" ], "package": "cabal-install", + "revision": null, "source": "local", - "version": "3.9.0.0" - } - ], - "builtin": [ - { - "package": "rts", - "version": "1.0" - }, - { - "package": "ghc-prim", - "version": "0.5.3" - }, - { - "package": "integer-gmp", - "version": "1.0.2.0" - }, - { - "package": "base", - "version": "4.13.0.0" - }, - { - "package": "array", - "version": "0.5.4.0" - }, - { - "package": "deepseq", - "version": "1.4.4.0" - }, - { - "package": "bytestring", - "version": "0.10.10.1" - }, - { - "package": "containers", - "version": "0.6.2.1" - }, - { - "package": "binary", - "version": "0.8.7.0" - }, - { - "package": "filepath", - "version": "1.4.2.1" - }, - { - "package": "time", - "version": "1.9.3" - }, - { - "package": "unix", - "version": "2.7.2.2" - }, - { - "package": "transformers", - "version": "0.5.6.2" - }, - { - "package": "mtl", - "version": "2.2.2" - }, - { - "package": "ghc-boot-th", - "version": "8.8.4" - }, - { - "package": "pretty", - "version": "1.1.3.6" - }, - { - "package": "template-haskell", - "version": "2.15.0.0" - }, - { - "package": "text", - "version": "1.2.4.0" - }, - { - "package": "parsec", - "version": "3.1.14.0" - }, - { - "package": "stm", - "version": "2.5.0.0" + "src_sha256": null, + "version": "3.10.3.0" } ] } diff --git a/bootstrap/src/Main.hs b/bootstrap/src/Main.hs index c2898516719..0ca636ea020 100644 --- a/bootstrap/src/Main.hs +++ b/bootstrap/src/Main.hs @@ -93,7 +93,7 @@ main2 meta plan = do return ( Hackage , Just $ fromIntegral (I.riRevision relInfo) - , P.sha256FromByteString $ I.getSHA256 $ I.riCabal relInfo + , P.sha256FromByteString $ I.getSHA256 $ getHash relInfo ) Nothing -> case P.uType unit of @@ -117,6 +117,12 @@ main2 meta plan = do { resBuiltin = builtin , resDependencies = deps } + where +#if MIN_VERSION_cabal_install_parsers(0,6,0) + getHash = I.riCabalHash +#else + getHash = I.riCabal +#endif bfs :: P.PlanJson -> P.Unit -> IO [P.Unit] bfs plan unit0 = do diff --git a/cabal-benchmarks/LICENSE b/cabal-benchmarks/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/cabal-benchmarks/LICENSE +++ b/cabal-benchmarks/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/cabal-benchmarks/cabal-benchmarks.cabal b/cabal-benchmarks/cabal-benchmarks.cabal index 86d2a2e1456..d2e9cb328b2 100644 --- a/cabal-benchmarks/cabal-benchmarks.cabal +++ b/cabal-benchmarks/cabal-benchmarks.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: cabal-benchmarks version: 3 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -31,4 +31,4 @@ test-suite cabal-benchmarks base , bytestring , Cabal-syntax - , criterion >=1.5.6.2 && <1.6 + , criterion >=1.5.6.2 && <1.7 diff --git a/cabal-dev-scripts/LICENSE b/cabal-dev-scripts/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/cabal-dev-scripts/LICENSE +++ b/cabal-dev-scripts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/cabal-dev-scripts/cabal-dev-scripts.cabal b/cabal-dev-scripts/cabal-dev-scripts.cabal index dcf40f84371..24e160eaa92 100644 --- a/cabal-dev-scripts/cabal-dev-scripts.cabal +++ b/cabal-dev-scripts/cabal-dev-scripts.cabal @@ -18,7 +18,7 @@ executable gen-spdx ghc-options: -Wall build-depends: , aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0 - , base >=4.10 && <4.17 + , base >=4.10 && <4.19 , bytestring , containers , Diff ^>=0.4 @@ -35,7 +35,7 @@ executable gen-spdx-exc ghc-options: -Wall build-depends: , aeson ^>=1.4.1.0 || ^>=1.5.2.0 || ^>=2.1.1.0 - , base >=4.10 && <4.17 + , base >=4.10 && <4.19 , bytestring , containers , Diff ^>=0.4 diff --git a/cabal-install-solver/ChangeLog.md b/cabal-install-solver/ChangeLog.md index 3c9ef2350ec..3bfdd653afe 100644 --- a/cabal-install-solver/ChangeLog.md +++ b/cabal-install-solver/ChangeLog.md @@ -1 +1 @@ -Please see https://hackage.haskell.org/package/cabal-install/changelog +Please see https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.3.0.md diff --git a/cabal-install-solver/LICENSE b/cabal-install-solver/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/cabal-install-solver/LICENSE +++ b/cabal-install-solver/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 1b03d228a68..6e5d72ca478 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: cabal-install-solver -version: 3.9.0.0 +version: 3.10.3.0 synopsis: The command-line interface for Cabal and Hackage. description: The solver component used in cabal-install command-line program @@ -11,10 +11,10 @@ license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team (see AUTHORS file) maintainer: Cabal Development Team -copyright: 2003-2022, Cabal Development Team +copyright: 2003-2023, Cabal Development Team category: Distribution build-type: Simple -Extra-Source-Files: +extra-doc-files: ChangeLog.md source-repository head @@ -105,23 +105,24 @@ library build-depends: , array >=0.4 && <0.6 - , base >=4.10 && <4.18 - , bytestring >=0.10.6.0 && <0.12 - , Cabal ^>=3.9 - , Cabal-syntax ^>=3.9 - , containers >=0.5.6.2 && <0.7 + , base >=4.10 && <4.20 + , bytestring >=0.10.6.0 && <0.13 + , Cabal ^>=3.10 + , Cabal-syntax ^>=3.10 + , containers >=0.5.6.2 && <0.8 , edit-distance ^>= 0.2.2 - , filepath ^>=1.4.0.0 + , filepath >= 1.3.0.1 && < 1.6 , mtl >=2.0 && <2.4 , pretty ^>=1.1 , transformers >=0.4.2.0 && <0.7 + , text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2) if flag(debug-expensive-assertions) cpp-options: -DDEBUG_EXPENSIVE_ASSERTIONS if flag(debug-conflict-sets) cpp-options: -DDEBUG_CONFLICT_SETS - build-depends: base >=4.8 + build-depends: base >=4.9 if flag(debug-tracetree) cpp-options: -DDEBUG_TRACETREE @@ -138,10 +139,10 @@ Test-Suite unit-tests UnitTests.Distribution.Solver.Modular.MessageUtils build-depends: - , base >= 4.10 && <4.18 + , base >= 4.10 && <4.20 , Cabal , Cabal-syntax , cabal-install-solver - , tasty >= 1.2.3 && <1.5 + , tasty >= 1.2.3 && <1.6 , tasty-quickcheck , tasty-hunit >= 0.10 diff --git a/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs b/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs index 11e6da847f0..2cf6ddbe51b 100644 --- a/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs +++ b/cabal-install-solver/src/Distribution/Solver/Types/PkgConfigDb.hs @@ -1,5 +1,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE LambdaCase #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Solver.Types.PkgConfigDb @@ -23,17 +24,23 @@ module Distribution.Solver.Types.PkgConfigDb import Distribution.Solver.Compat.Prelude import Prelude () -import Control.Exception (handle) -import Control.Monad (mapM) -import qualified Data.Map as M -import System.FilePath (splitSearchPath) +import Control.Exception (handle) +import Control.Monad (mapM) +import Data.ByteString (ByteString) +import qualified Data.ByteString.Lazy as LBS +import qualified Data.Map as M +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import qualified Data.Text.Encoding.Error as T +import System.FilePath (splitSearchPath) import Distribution.Compat.Environment (lookupEnv) import Distribution.Package (PkgconfigName, mkPkgconfigName) import Distribution.Parsec import Distribution.Simple.Program (ProgramDb, getProgramOutput, pkgConfigProgram, needProgram, ConfiguredProgram) -import Distribution.Simple.Program.Run (getProgramInvocationOutputAndErrors, programInvocation) +import Distribution.Simple.Program.Run + (getProgramInvocationOutputAndErrors, programInvocation, getProgramInvocationLBSAndErrors) import Distribution.Simple.Utils (info) import Distribution.Types.PkgconfigVersion import Distribution.Types.PkgconfigVersionRange @@ -63,19 +70,53 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do case mpkgConfig of Nothing -> noPkgConfig "Cannot find pkg-config program" Just (pkgConfig, _) -> do - pkgList <- lines <$> getProgramOutput verbosity pkgConfig ["--list-all"] - -- The output of @pkg-config --list-all@ also includes a description - -- for each package, which we do not need. - let pkgNames = map (takeWhile (not . isSpace)) pkgList - (pkgVersions, _errs, exitCode) <- + -- To prevent malformed Unicode in the descriptions from crashing cabal, + -- read without interpreting any encoding first. (#9608) + (listAllOutput, listAllErrs, listAllExitcode) <- + getProgramInvocationLBSAndErrors verbosity (programInvocation pkgConfig ["--list-all"]) + when (listAllExitcode /= ExitSuccess) $ + ioError (userError ("pkg-config --list-all failed: " ++ listAllErrs)) + let pkgList = LBS.split (fromIntegral (ord '\n')) listAllOutput + -- Now decode the package *names* to a String. The ones where decoding + -- failed end up in 'failedPkgNames'. + let (failedPkgNames, pkgNames) = + partitionEithers + -- Drop empty package names. This will handle empty lines + -- in pkg-config's output, including the spurious one + -- after the last newline (because of LBS.split). + . filter (either (const True) (not . null)) + -- Try decoding strictly; if it fails, put the lenient + -- decoding in a Left for later reporting. + . map (\bsname -> + let sbsname = LBS.toStrict bsname + in case T.decodeUtf8' sbsname of + Left _ -> Left (T.unpack (decodeUtf8LenientCompat sbsname)) + Right name -> Right (T.unpack name)) + -- The output of @pkg-config --list-all@ also includes a + -- description for each package, which we do not need. + -- We don't use Data.Char.isSpace because that would also + -- include 0xA0, the non-breaking space, which can occur + -- in multi-byte UTF-8 sequences. + . map (LBS.takeWhile (not . isAsciiSpace)) + $ pkgList + when (not (null failedPkgNames)) $ + info verbosity ("Some pkg-config packages have names containing invalid unicode: " ++ intercalate ", " failedPkgNames) + (outs, _errs, exitCode) <- getProgramInvocationOutputAndErrors verbosity (programInvocation pkgConfig ("--modversion" : pkgNames)) - case exitCode of - ExitSuccess -> (return . pkgConfigDbFromList . zip pkgNames) (lines pkgVersions) - -- if there's a single broken pc file the above fails, so we fall back into calling it individually - _ -> do - info verbosity ("call to pkg-config --modversion on all packages failed. Falling back to querying pkg-config individually on each package") - pkgConfigDbFromList . catMaybes <$> mapM (getIndividualVersion pkgConfig) pkgNames + let pkgVersions = lines outs + if exitCode == ExitSuccess && length pkgVersions == length pkgNames + then (return . pkgConfigDbFromList . zip pkgNames) pkgVersions + else + -- if there's a single broken pc file the above fails, so we fall back + -- into calling it individually + -- + -- Also some implementations of @pkg-config@ do not provide more than + -- one package version, so if the returned list is shorter than the + -- requested one, we fall back to querying one by one. + do + info verbosity ("call to pkg-config --modversion on all packages failed. Falling back to querying pkg-config individually on each package") + pkgConfigDbFromList . catMaybes <$> mapM (getIndividualVersion pkgConfig) pkgNames where -- For when pkg-config invocation fails (possibly because of a -- too long command line). @@ -97,6 +138,15 @@ readPkgConfigDb verbosity progdb = handle ioErrorHandler $ do ExitSuccess -> Just (pkg, pkgVersion) _ -> Nothing + isAsciiSpace :: Word8 -> Bool + isAsciiSpace c = c `elem` map (fromIntegral . ord) " \t" + + -- The decodeUtf8Lenient function is defined starting with text-2.0.1; this + -- function simply reimplements it. When the minimum supported GHC version + -- is >= 9.4, switch to decodeUtf8Lenient. + decodeUtf8LenientCompat :: ByteString -> T.Text + decodeUtf8LenientCompat = T.decodeUtf8With T.lenientDecode + -- | Create a `PkgConfigDb` from a list of @(packageName, version)@ pairs. pkgConfigDbFromList :: [(String, String)] -> PkgConfigDb pkgConfigDbFromList pairs = (PkgConfigDb . M.fromList . map convert) pairs diff --git a/cabal-install/LICENSE b/cabal-install/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/cabal-install/LICENSE +++ b/cabal-install/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 747d353276b..5110e6a3c20 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -1,7 +1,7 @@ Cabal-Version: 2.2 Name: cabal-install -Version: 3.9.0.0 +Version: 3.10.3.0 Synopsis: The command-line interface for Cabal and Hackage. Description: The \'cabal\' command-line program simplifies the process of managing @@ -13,12 +13,13 @@ License: BSD-3-Clause License-File: LICENSE Author: Cabal Development Team (see AUTHORS file) Maintainer: Cabal Development Team -Copyright: 2003-2022, Cabal Development Team +Copyright: 2003-2023, Cabal Development Team Category: Distribution Build-type: Simple Extra-Source-Files: - README.md bash-completion/cabal +extra-doc-files: + README.md changelog source-repository head @@ -42,20 +43,22 @@ common warnings ghc-options: -Wall -Wcompat -Wnoncanonical-monad-instances -Wincomplete-uni-patterns -Wincomplete-record-updates if impl(ghc < 8.8) ghc-options: -Wnoncanonical-monadfail-instances - if impl(ghc >=8.10) + if impl(ghc >=9.0) + -- Warning: even though introduced with GHC 8.10, -Wunused-packages + -- gives false positives with GHC 8.10. ghc-options: -Wunused-packages common base-dep - build-depends: base >=4.10 && <4.18 + build-depends: base >=4.10 && <4.20 common cabal-dep - build-depends: Cabal ^>=3.9 + build-depends: Cabal ^>=3.10 common cabal-syntax-dep - build-depends: Cabal-syntax ^>=3.9 + build-depends: Cabal-syntax ^>=3.10 common cabal-install-solver-dep - build-depends: cabal-install-solver ^>=3.9 + build-depends: cabal-install-solver ^>=3.10 library import: warnings, base-dep, cabal-dep, cabal-syntax-dep, cabal-install-solver-dep @@ -63,6 +66,10 @@ library default-extensions: TypeOperators hs-source-dirs: src + autogen-modules: + Paths_cabal_install + other-modules: + Paths_cabal_install exposed-modules: -- this modules are moved from Cabal -- they are needed for as long until cabal-install moves to parsec parser @@ -101,6 +108,7 @@ library Distribution.Client.Compat.Orphans Distribution.Client.Compat.Prelude Distribution.Client.Compat.Semaphore + Distribution.Client.Compat.Tar Distribution.Client.Config Distribution.Client.Configure Distribution.Client.Dependency @@ -140,6 +148,7 @@ library Distribution.Client.InstallSymlink Distribution.Client.JobControl Distribution.Client.List + Distribution.Client.Main Distribution.Client.Manpage Distribution.Client.ManpageFlags Distribution.Client.Nix @@ -205,14 +214,14 @@ library array >= 0.4 && < 0.6, base16-bytestring >= 0.1.1 && < 1.1.0.0, binary >= 0.7.3 && < 0.9, - bytestring >= 0.10.6.0 && < 0.12, - containers >= 0.5.6.2 && < 0.7, + bytestring >= 0.10.6.0 && < 0.13, + containers >= 0.5.6.2 && < 0.8, cryptohash-sha256 >= 0.11 && < 0.12, directory >= 1.3.7.0 && < 1.4, echo >= 0.1.3 && < 0.2, edit-distance >= 0.2.2 && < 0.3, exceptions >= 0.10.4 && < 0.11, - filepath >= 1.4.0.0 && < 1.5, + filepath >= 1.4.0.0 && < 1.6, hashable >= 1.0 && < 1.5, HTTP >= 4000.1.5 && < 4000.5, mtl >= 2.0 && < 2.4, @@ -221,11 +230,11 @@ library process >= 1.2.3.0 && < 1.7, random >= 1.2 && < 1.3, stm >= 2.0 && < 2.6, - tar >= 0.5.0.3 && < 0.6, + tar >= 0.5.0.3 && < 0.7, time >= 1.5.0.1 && < 1.13, - zlib >= 0.5.3 && < 0.7, + zlib >= 0.5.3 && < 0.8, hackage-security >= 0.6.2.0 && < 0.7, - text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.1, + text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.2, parsec >= 3.1.13.0 && < 3.2, regex-base >= 0.94.0.0 && <0.95, regex-posix >= 0.96.0.0 && <0.97, @@ -235,7 +244,7 @@ library if os(windows) build-depends: windns >= 0.1.0 && < 0.2 else - build-depends: resolv >= 0.1.1 && < 0.2 + build-depends: resolv >= 0.1.1 && < 0.3 if os(windows) -- newer directory for symlinks @@ -252,7 +261,7 @@ library executable cabal - import: warnings, base-dep, cabal-dep, cabal-syntax-dep + import: warnings, base-dep main-is: Main.hs hs-source-dirs: main default-language: Haskell2010 @@ -264,9 +273,7 @@ executable cabal extra-libraries: bsd build-depends: - cabal-install, - directory, - filepath + cabal-install -- Small, fast running tests. -- @@ -330,12 +337,12 @@ test-suite unit-tests tar, time, zlib, - tasty >= 1.2.3 && <1.5, + tasty >= 1.2.3 && <1.6, tasty-golden >=2.3.1.1 && <2.4, tasty-quickcheck, tasty-hunit >= 0.10, tree-diff, - QuickCheck >= 2.14 && <2.15 + QuickCheck >= 2.14.3 && <2.15 -- Tests to run with a limited stack and heap size @@ -360,7 +367,7 @@ test-suite mem-use-tests build-depends: cabal-install, containers, - tasty >= 1.2.3 && <1.5, + tasty >= 1.2.3 && <1.6, tasty-hunit >= 0.10 @@ -380,7 +387,7 @@ test-suite integration-tests2 containers, directory, filepath, - tasty >= 1.2.3 && <1.5, + tasty >= 1.2.3 && <1.6, tasty-hunit >= 0.10, tagged @@ -416,7 +423,7 @@ test-suite long-tests network-uri >= 2.6.2.0 && <2.7, random, tagged, - tasty >= 1.2.3 && <1.5, + tasty >= 1.2.3 && <1.6, tasty-expected-failure, tasty-hunit >= 0.10, tasty-quickcheck, diff --git a/cabal-install/changelog b/cabal-install/changelog index dc75160a186..2d742052eeb 100644 --- a/cabal-install/changelog +++ b/cabal-install/changelog @@ -1,5 +1,17 @@ -*-change-log-*- +3.10.3.0 Hécate January 2024 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.3.0.md + +3.10.2.1 Hécate November 2023 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.2.1.md + +3.10.2.0 Hécate November 2023 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.2.0.md + +3.10.1.0 Mikolaj Konarski March 2023 + * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.1.0.md + 3.8.1.0 Mikolaj Konarski August 2022 * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.8.1.0.md diff --git a/cabal-install/main/Main.hs b/cabal-install/main/Main.hs index 324fd88d8ad..56898bd8be2 100644 --- a/cabal-install/main/Main.hs +++ b/cabal-install/main/Main.hs @@ -1,1010 +1,11 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE ScopedTypeVariables #-} - ------------------------------------------------------------------------------ --- | --- Module : Main --- Copyright : (c) David Himmelstrup 2005 --- License : BSD-like --- --- Maintainer : lemmih@gmail.com --- Stability : provisional --- Portability : portable --- --- Entry point to the default cabal-install front-end. ------------------------------------------------------------------------------ - module Main (main) where -import Distribution.Client.Setup - ( GlobalFlags(..), globalCommand, withRepoContext - , ConfigFlags(..) - , ConfigExFlags(..), defaultConfigExFlags, configureExCommand - , reconfigureCommand - , configCompilerAux', configPackageDB' - , BuildFlags(..) - , buildCommand, replCommand, testCommand, benchmarkCommand - , InstallFlags(..), defaultInstallFlags - , installCommand - , FetchFlags(..), fetchCommand - , FreezeFlags(..), freezeCommand - , genBoundsCommand - , GetFlags(..), getCommand, unpackCommand - , checkCommand - , formatCommand - , ListFlags(..), listCommand, listNeedsCompiler - , InfoFlags(..), infoCommand - , UploadFlags(..), uploadCommand - , ReportFlags(..), reportCommand - , runCommand - , InitFlags(initVerbosity, initHcPath), initCommand - , ActAsSetupFlags(..), actAsSetupCommand - , UserConfigFlags(..), userConfigCommand - , reportCommand - , manpageCommand - , haddockCommand - , cleanCommand - , copyCommand - , registerCommand - ) -import Distribution.Simple.Setup - ( HaddockTarget(..) - , HaddockFlags(..), defaultHaddockFlags - , HscolourFlags(..), hscolourCommand - , ReplFlags(..) - , CopyFlags(..) - , RegisterFlags(..) - , CleanFlags(..) - , TestFlags(..), BenchmarkFlags(..) - , Flag(..), fromFlag, fromFlagOrDefault, flagToMaybe, toFlag - , configAbsolutePaths - ) - import Prelude () -import Distribution.Client.Compat.Prelude hiding (get) - -import Distribution.Client.SetupWrapper - ( setupWrapper, SetupScriptOptions(..), defaultSetupScriptOptions ) -import Distribution.Client.Config - ( SavedConfig(..), loadConfig, defaultConfigFile, userConfigDiff - , userConfigUpdate, createDefaultConfigFile, getConfigFilePath ) -import Distribution.Client.Targets - ( readUserTargets ) -import qualified Distribution.Client.List as List - ( list, info ) - -import qualified Distribution.Client.CmdConfigure as CmdConfigure -import qualified Distribution.Client.CmdUpdate as CmdUpdate -import qualified Distribution.Client.CmdBuild as CmdBuild -import qualified Distribution.Client.CmdRepl as CmdRepl -import qualified Distribution.Client.CmdFreeze as CmdFreeze -import qualified Distribution.Client.CmdHaddock as CmdHaddock -import qualified Distribution.Client.CmdHaddockProject as CmdHaddockProject -import qualified Distribution.Client.CmdInstall as CmdInstall -import qualified Distribution.Client.CmdRun as CmdRun -import qualified Distribution.Client.CmdTest as CmdTest -import qualified Distribution.Client.CmdBench as CmdBench -import qualified Distribution.Client.CmdExec as CmdExec -import qualified Distribution.Client.CmdClean as CmdClean -import qualified Distribution.Client.CmdSdist as CmdSdist -import qualified Distribution.Client.CmdListBin as CmdListBin -import qualified Distribution.Client.CmdOutdated as CmdOutdated -import Distribution.Client.CmdLegacy - -import Distribution.Client.Install (install) -import Distribution.Client.Configure (configure, writeConfigFlags) -import Distribution.Client.Fetch (fetch) -import Distribution.Client.Freeze (freeze) -import Distribution.Client.GenBounds (genBounds) -import Distribution.Client.Check as Check (check) ---import Distribution.Client.Clean (clean) -import qualified Distribution.Client.Upload as Upload -import Distribution.Client.Run (run, splitRunArgs) -import Distribution.Client.Get (get) -import Distribution.Client.Reconfigure (Check(..), reconfigure) -import Distribution.Client.Nix (nixInstantiate - ,nixShell - ) -import Distribution.Client.Sandbox (loadConfigOrSandboxConfig - ,findSavedDistPref - ,updateInstallDirs) -import Distribution.Client.Tar (createTarGzFile) -import Distribution.Client.Types.Credentials (Password (..)) -import Distribution.Client.Init (initCmd) -import Distribution.Client.Manpage (manpageCmd) -import Distribution.Client.ManpageFlags (ManpageFlags (..)) -import Distribution.Client.Utils - ( determineNumJobs, relaxEncodingErrors ) -import Distribution.Client.Signal - ( installTerminationHandler ) -import Distribution.Client.Version - ( cabalInstallVersion ) +import Distribution.Client.Compat.Prelude -import Distribution.Package (packageId) -import Distribution.PackageDescription - ( BuildType(..), Executable(..), buildable ) +import System.Environment (getArgs) -import Distribution.PackageDescription.PrettyPrint - ( writeGenericPackageDescription ) -import qualified Distribution.Simple as Simple -import qualified Distribution.Make as Make -import qualified Distribution.Types.UnqualComponentName as Make -import Distribution.Simple.Build - ( startInterpreter ) -import Distribution.Simple.Command - ( CommandParse(..), CommandUI(..), Command, CommandSpec(..) - , CommandType(..), commandsRun, commandAddAction, hiddenCommand - , commandFromSpec, commandShowOptions ) -import Distribution.Simple.Compiler (PackageDBStack) -import Distribution.Simple.Configure - ( configCompilerAuxEx, ConfigStateFileError(..) - , getPersistBuildConfig, interpretPackageDbFlags - , tryGetPersistBuildConfig ) -import qualified Distribution.Simple.LocalBuildInfo as LBI -import Distribution.Simple.PackageDescription ( readGenericPackageDescription ) -import Distribution.Simple.Program (defaultProgramDb - ,configureAllKnownPrograms - ,simpleProgramInvocation - ,getProgramInvocationOutput) -import Distribution.Simple.Program.Db (reconfigurePrograms) -import qualified Distribution.Simple.Setup as Cabal -import Distribution.Simple.Utils - ( cabalVersion, die', dieNoVerbosity, info, notice, topHandler - , findPackageDesc, tryFindPackageDesc, createDirectoryIfMissingVerbose ) -import Distribution.Text - ( display ) -import Distribution.Verbosity as Verbosity - ( normal ) -import Distribution.Version - ( Version, mkVersion, orLaterVersion ) +import qualified Distribution.Client.Main as Client -import Distribution.Compat.ResponseFile -import System.Environment (getArgs, getProgName) -import System.FilePath ( dropExtension, splitExtension - , takeExtension, (), (<.>) ) -import System.IO ( BufferMode(LineBuffering), hSetBuffering - , hPutStrLn, stderr, stdout ) -import System.Directory ( doesFileExist, getCurrentDirectory - , withCurrentDirectory) -import Data.Monoid (Any(..)) -import Control.Exception (AssertionFailed, assert, try) - - --- | Entry point --- main :: IO () -main = do - installTerminationHandler - -- Enable line buffering so that we can get fast feedback even when piped. - -- This is especially important for CI and build systems. - hSetBuffering stdout LineBuffering - - -- If the locale encoding for CLI doesn't support all Unicode characters, - -- printing to it may fail unless we relax the handling of encoding errors - -- when writing to stderr and stdout. - relaxEncodingErrors stdout - relaxEncodingErrors stderr - (args0, args1) <- break (== "--") <$> getArgs - mainWorker =<< (++ args1) <$> expandResponse args0 - --- | Check whether assertions are enabled and print a warning in that case. -warnIfAssertionsAreEnabled :: IO () -warnIfAssertionsAreEnabled = - assert False (return ()) `catch` - (\(_e :: AssertionFailed) -> hPutStrLn stderr assertionsEnabledMsg) - -- Andreas, 2022-12-30, issue #8654: - -- The verbosity machinery is not in place at this point (option -v not parsed), - -- so instead of using function @warn@, we print straight to stderr. - where - assertionsEnabledMsg = - "Warning: this is a debug build of cabal-install with assertions enabled." - -mainWorker :: [String] -> IO () -mainWorker args = do - topHandler $ - case commandsRun (globalCommand commands) commands args of - CommandHelp help -> printGlobalHelp help - CommandList opts -> printOptionsList opts - CommandErrors errs -> printErrors errs - CommandReadyToGo (globalFlags, commandParse) -> - case commandParse of - _ | fromFlagOrDefault False (globalVersion globalFlags) - -> printVersion - | fromFlagOrDefault False (globalNumericVersion globalFlags) - -> printNumericVersion - CommandHelp help -> printCommandHelp help - CommandList opts -> printOptionsList opts - - CommandErrors errs -> do - -- Check whether cabal is called from a script, like #!/path/to/cabal. - case args of - [] -> printErrors errs - script : scriptArgs -> CmdRun.validScript script >>= \case - False -> printErrors errs - True -> do - -- In main operation (not help, version etc.) print warning if assertions are on. - warnIfAssertionsAreEnabled - CmdRun.handleShebang script scriptArgs - - CommandReadyToGo action -> do - -- In main operation (not help, version etc.) print warning if assertions are on. - warnIfAssertionsAreEnabled - action globalFlags - - where - printCommandHelp help = do - pname <- getProgName - putStr (help pname) - printGlobalHelp help = do - pname <- getProgName - configFile <- defaultConfigFile - putStr (help pname) - putStr $ "\nYou can edit the cabal configuration file to set defaults:\n" - ++ " " ++ configFile ++ "\n" - exists <- doesFileExist configFile - unless exists $ - putStrLn $ "This file will be generated with sensible " - ++ "defaults if you run 'cabal update'." - printOptionsList = putStr . unlines - printErrors errs = dieNoVerbosity $ intercalate "\n" errs - printNumericVersion = putStrLn $ display cabalInstallVersion - printVersion = putStrLn $ "cabal-install version " - ++ display cabalInstallVersion - ++ "\ncompiled using version " - ++ display cabalVersion - ++ " of the Cabal library " - - commands = map commandFromSpec commandSpecs - commandSpecs = - [ regularCmd listCommand listAction - , regularCmd infoCommand infoAction - , regularCmd fetchCommand fetchAction - , regularCmd getCommand getAction - , regularCmd unpackCommand unpackAction - , regularCmd checkCommand checkAction - , regularCmd uploadCommand uploadAction - , regularCmd reportCommand reportAction - , regularCmd initCommand initAction - , regularCmd userConfigCommand userConfigAction - , regularCmd genBoundsCommand genBoundsAction - , regularCmd CmdOutdated.outdatedCommand CmdOutdated.outdatedAction - , wrapperCmd hscolourCommand hscolourVerbosity hscolourDistPref - , hiddenCmd formatCommand formatAction - , hiddenCmd actAsSetupCommand actAsSetupAction - , hiddenCmd manpageCommand (manpageAction commandSpecs) - , regularCmd CmdListBin.listbinCommand CmdListBin.listbinAction - - ] ++ concat - [ newCmd CmdConfigure.configureCommand CmdConfigure.configureAction - , newCmd CmdUpdate.updateCommand CmdUpdate.updateAction - , newCmd CmdBuild.buildCommand CmdBuild.buildAction - , newCmd CmdRepl.replCommand CmdRepl.replAction - , newCmd CmdFreeze.freezeCommand CmdFreeze.freezeAction - , newCmd CmdHaddock.haddockCommand CmdHaddock.haddockAction - , newCmd CmdHaddockProject.haddockProjectCommand - CmdHaddockProject.haddockProjectAction - , newCmd CmdInstall.installCommand CmdInstall.installAction - , newCmd CmdRun.runCommand CmdRun.runAction - , newCmd CmdTest.testCommand CmdTest.testAction - , newCmd CmdBench.benchCommand CmdBench.benchAction - , newCmd CmdExec.execCommand CmdExec.execAction - , newCmd CmdClean.cleanCommand CmdClean.cleanAction - , newCmd CmdSdist.sdistCommand CmdSdist.sdistAction - - , legacyCmd configureExCommand configureAction - , legacyCmd buildCommand buildAction - , legacyCmd replCommand replAction - , legacyCmd freezeCommand freezeAction - , legacyCmd haddockCommand haddockAction - , legacyCmd installCommand installAction - , legacyCmd runCommand runAction - , legacyCmd testCommand testAction - , legacyCmd benchmarkCommand benchmarkAction - , legacyCmd cleanCommand cleanAction - , legacyWrapperCmd copyCommand copyVerbosity copyDistPref - , legacyWrapperCmd registerCommand regVerbosity regDistPref - , legacyCmd reconfigureCommand reconfigureAction - ] - -type Action = GlobalFlags -> IO () - --- Duplicated in Distribution.Client.CmdLegacy. Any changes must be --- reflected there, as well. -regularCmd :: CommandUI flags -> (flags -> [String] -> action) - -> CommandSpec action -regularCmd ui action = - CommandSpec ui ((flip commandAddAction) action) NormalCommand - -hiddenCmd :: CommandUI flags -> (flags -> [String] -> action) - -> CommandSpec action -hiddenCmd ui action = - CommandSpec ui (\ui' -> hiddenCommand (commandAddAction ui' action)) - HiddenCommand - -wrapperCmd :: Monoid flags => CommandUI flags -> (flags -> Flag Verbosity) - -> (flags -> Flag String) -> CommandSpec Action -wrapperCmd ui verbosity distPref = - CommandSpec ui (\ui' -> wrapperAction ui' verbosity distPref) NormalCommand - -wrapperAction :: Monoid flags - => CommandUI flags - -> (flags -> Flag Verbosity) - -> (flags -> Flag String) - -> Command Action -wrapperAction command verbosityFlag distPrefFlag = - commandAddAction command - { commandDefaultFlags = mempty } $ \flags extraArgs globalFlags -> do - let verbosity = fromFlagOrDefault normal (verbosityFlag flags) - load <- try (loadConfigOrSandboxConfig verbosity globalFlags) - let config = either (\(SomeException _) -> mempty) id load - distPref <- findSavedDistPref config (distPrefFlag flags) - let setupScriptOptions = defaultSetupScriptOptions { useDistPref = distPref } - setupWrapper verbosity setupScriptOptions Nothing - command (const flags) (const extraArgs) - -configureAction :: (ConfigFlags, ConfigExFlags) - -> [String] -> Action -configureAction (configFlags, configExFlags) extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) - config <- updateInstallDirs (configUserInstall configFlags) - <$> loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (configDistPref configFlags) - nixInstantiate verbosity distPref True globalFlags config - nixShell verbosity distPref globalFlags config $ do - let configFlags' = savedConfigureFlags config `mappend` configFlags - configExFlags' = savedConfigureExFlags config `mappend` configExFlags - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, platform, progdb) <- configCompilerAuxEx configFlags' - - writeConfigFlags verbosity distPref (configFlags', configExFlags') - - -- What package database(s) to use - let packageDBs :: PackageDBStack - packageDBs - = interpretPackageDbFlags - (fromFlag (configUserInstall configFlags')) - (configPackageDBs configFlags') - - withRepoContext verbosity globalFlags' $ \repoContext -> - configure verbosity packageDBs repoContext - comp platform progdb configFlags' configExFlags' extraArgs - -reconfigureAction :: (ConfigFlags, ConfigExFlags) - -> [String] -> Action -reconfigureAction flags@(configFlags, _) _ globalFlags = do - let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) - config <- updateInstallDirs (configUserInstall configFlags) - <$> loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (configDistPref configFlags) - let checkFlags = Check $ \_ saved -> do - let flags' = saved <> flags - unless (saved == flags') $ info verbosity message - pure (Any True, flags') - where - -- This message is correct, but not very specific: it will list all - -- of the new flags, even if some have not actually changed. The - -- *minimal* set of changes is more difficult to determine. - message = - "flags changed: " - ++ unwords (commandShowOptions configureExCommand flags) - nixInstantiate verbosity distPref True globalFlags config - _ <- - reconfigure configureAction - verbosity distPref NoFlag - checkFlags [] globalFlags config - pure () - -buildAction :: BuildFlags -> [String] -> Action -buildAction buildFlags extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (buildDistPref buildFlags) - -- Calls 'configureAction' to do the real work, so nothing special has to be - -- done to support sandboxes. - config' <- - reconfigure configureAction - verbosity distPref (buildNumJobs buildFlags) - mempty [] globalFlags config - nixShell verbosity distPref globalFlags config $ do - build verbosity config' distPref buildFlags extraArgs - - --- | Actually do the work of building the package. This is separate from --- 'buildAction' so that 'testAction' and 'benchmarkAction' do not invoke --- 'reconfigure' twice. -build :: Verbosity -> SavedConfig -> FilePath -> BuildFlags -> [String] -> IO () -build verbosity config distPref buildFlags extraArgs = - setupWrapper verbosity setupOptions Nothing - (Cabal.buildCommand progDb) mkBuildFlags (const extraArgs) - where - progDb = defaultProgramDb - setupOptions = defaultSetupScriptOptions { useDistPref = distPref } - - mkBuildFlags version = filterBuildFlags version config buildFlags' - buildFlags' = buildFlags - { buildVerbosity = toFlag verbosity - , buildDistPref = toFlag distPref - } - --- | Make sure that we don't pass new flags to setup scripts compiled against --- old versions of Cabal. -filterBuildFlags :: Version -> SavedConfig -> BuildFlags -> BuildFlags -filterBuildFlags version config buildFlags - | version >= mkVersion [1,19,1] = buildFlags_latest - -- Cabal < 1.19.1 doesn't support 'build -j'. - | otherwise = buildFlags_pre_1_19_1 - where - buildFlags_pre_1_19_1 = buildFlags { - buildNumJobs = NoFlag - } - buildFlags_latest = buildFlags { - -- Take the 'jobs' setting config file into account. - buildNumJobs = Flag . Just . determineNumJobs $ - (numJobsConfigFlag `mappend` numJobsCmdLineFlag) - } - numJobsConfigFlag = installNumJobs . savedInstallFlags $ config - numJobsCmdLineFlag = buildNumJobs buildFlags - - -replAction :: ReplFlags -> [String] -> Action -replAction replFlags extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal (replVerbosity replFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (replDistPref replFlags) - cwd <- getCurrentDirectory - pkgDesc <- findPackageDesc cwd - let - -- There is a .cabal file in the current directory: start a REPL and load - -- the project's modules. - onPkgDesc = do - -- Calls 'configureAction' to do the real work, so nothing special has to - -- be done to support sandboxes. - _ <- - reconfigure configureAction - verbosity distPref NoFlag - mempty [] globalFlags config - let progDb = defaultProgramDb - setupOptions = defaultSetupScriptOptions - { useCabalVersion = orLaterVersion $ mkVersion [1,18,0] - , useDistPref = distPref - } - replFlags' = replFlags - { replVerbosity = toFlag verbosity - , replDistPref = toFlag distPref - } - - nixShell verbosity distPref globalFlags config $ - setupWrapper verbosity setupOptions Nothing (Cabal.replCommand progDb) (const replFlags') (const extraArgs) - - -- No .cabal file in the current directory: just start the REPL (possibly - -- using the sandbox package DB). - onNoPkgDesc = do - let configFlags = savedConfigureFlags config - (comp, platform, programDb) <- configCompilerAux' configFlags - programDb' <- reconfigurePrograms verbosity - (replProgramPaths replFlags) - (replProgramArgs replFlags) - programDb - nixShell verbosity distPref globalFlags config $ do - startInterpreter verbosity programDb' comp platform - (configPackageDB' configFlags) - - either (const onNoPkgDesc) (const onPkgDesc) pkgDesc - -installAction :: ( ConfigFlags, ConfigExFlags, InstallFlags - , HaddockFlags, TestFlags, BenchmarkFlags ) - -> [String] -> Action -installAction (configFlags, _, installFlags, _, _, _) _ globalFlags - | fromFlagOrDefault False (installOnly installFlags) = do - let verb = fromFlagOrDefault normal (configVerbosity configFlags) - config <- loadConfigOrSandboxConfig verb globalFlags - dist <- findSavedDistPref config (configDistPref configFlags) - let setupOpts = defaultSetupScriptOptions { useDistPref = dist } - setupWrapper - verb setupOpts Nothing - installCommand (const (mempty, mempty, mempty, mempty, mempty, mempty)) - (const []) - -installAction - ( configFlags, configExFlags, installFlags - , haddockFlags, testFlags, benchmarkFlags ) - extraArgs globalFlags = do - let verb = fromFlagOrDefault normal (configVerbosity configFlags) - config <- updateInstallDirs (configUserInstall configFlags) - <$> loadConfigOrSandboxConfig verb globalFlags - - dist <- findSavedDistPref config (configDistPref configFlags) - - do - targets <- readUserTargets verb extraArgs - - let configFlags' = maybeForceTests installFlags' $ - savedConfigureFlags config `mappend` - configFlags { configDistPref = toFlag dist } - configExFlags' = defaultConfigExFlags `mappend` - savedConfigureExFlags config `mappend` configExFlags - installFlags' = defaultInstallFlags `mappend` - savedInstallFlags config `mappend` installFlags - haddockFlags' = defaultHaddockFlags `mappend` - savedHaddockFlags config `mappend` - haddockFlags { haddockDistPref = toFlag dist } - testFlags' = Cabal.defaultTestFlags `mappend` - savedTestFlags config `mappend` - testFlags { testDistPref = toFlag dist } - benchmarkFlags' = Cabal.defaultBenchmarkFlags `mappend` - savedBenchmarkFlags config `mappend` - benchmarkFlags { benchmarkDistPref = toFlag dist } - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, platform, progdb) <- configCompilerAux' configFlags' - - -- TODO: Redesign ProgramDB API to prevent such problems as #2241 in the - -- future. - progdb' <- configureAllKnownPrograms verb progdb - - configFlags'' <- configAbsolutePaths configFlags' - - withRepoContext verb globalFlags' $ \repoContext -> - install verb - (configPackageDB' configFlags'') - repoContext - comp platform progdb' - globalFlags' configFlags'' configExFlags' - installFlags' haddockFlags' testFlags' benchmarkFlags' - targets - - where - -- '--run-tests' implies '--enable-tests'. - maybeForceTests installFlags' configFlags' = - if fromFlagOrDefault False (installRunTests installFlags') - then configFlags' { configTests = toFlag True } - else configFlags' - -testAction :: (BuildFlags, TestFlags) -> [String] -> GlobalFlags - -> IO () -testAction (buildFlags, testFlags) extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (testDistPref testFlags) - let buildFlags' = buildFlags - { buildVerbosity = testVerbosity testFlags } - checkFlags = Check $ \_ flags@(configFlags, configExFlags) -> - if fromFlagOrDefault False (configTests configFlags) - then pure (mempty, flags) - else do - info verbosity "reconfiguring to enable tests" - let flags' = ( configFlags { configTests = toFlag True } - , configExFlags - ) - pure (Any True, flags') - - _ <- - reconfigure configureAction - verbosity distPref (buildNumJobs buildFlags') - checkFlags [] globalFlags config - nixShell verbosity distPref globalFlags config $ do - let setupOptions = defaultSetupScriptOptions { useDistPref = distPref } - testFlags' = testFlags { testDistPref = toFlag distPref } - - -- The package was just configured, so the LBI must be available. - names <- componentNamesFromLBI verbosity distPref "test suites" - (\c -> case c of { LBI.CTest{} -> True; _ -> False }) - let extraArgs' - | null extraArgs = case names of - ComponentNamesUnknown -> [] - ComponentNames names' -> [ Make.unUnqualComponentName name - | LBI.CTestName name <- names' ] - | otherwise = extraArgs - - build verbosity config distPref buildFlags' extraArgs' - setupWrapper verbosity setupOptions Nothing Cabal.testCommand (const testFlags') (const extraArgs') - -data ComponentNames = ComponentNamesUnknown - | ComponentNames [LBI.ComponentName] - --- | Return the names of all buildable components matching a given predicate. -componentNamesFromLBI :: Verbosity -> FilePath -> String - -> (LBI.Component -> Bool) - -> IO ComponentNames -componentNamesFromLBI verbosity distPref targetsDescr compPred = do - eLBI <- tryGetPersistBuildConfig distPref - case eLBI of - Left err -> case err of - -- Note: the build config could have been generated by a custom setup - -- script built against a different Cabal version, so it's crucial that - -- we ignore the bad version error here. - ConfigStateFileBadVersion _ _ _ -> return ComponentNamesUnknown - _ -> die' verbosity (show err) - Right lbi -> do - let pkgDescr = LBI.localPkgDescr lbi - names = map LBI.componentName - . filter (buildable . LBI.componentBuildInfo) - . filter compPred $ - LBI.pkgComponents pkgDescr - if null names - then do notice verbosity $ "Package has no buildable " - ++ targetsDescr ++ "." - exitSuccess -- See #3215. - - else return $! (ComponentNames names) - -benchmarkAction :: (BuildFlags, BenchmarkFlags) - -> [String] -> GlobalFlags - -> IO () -benchmarkAction - (buildFlags, benchmarkFlags) - extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal - (buildVerbosity buildFlags) - - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (benchmarkDistPref benchmarkFlags) - let buildFlags' = buildFlags - { buildVerbosity = benchmarkVerbosity benchmarkFlags } - - let checkFlags = Check $ \_ flags@(configFlags, configExFlags) -> - if fromFlagOrDefault False (configBenchmarks configFlags) - then pure (mempty, flags) - else do - info verbosity "reconfiguring to enable benchmarks" - let flags' = ( configFlags { configBenchmarks = toFlag True } - , configExFlags - ) - pure (Any True, flags') - - config' <- - reconfigure configureAction - verbosity distPref (buildNumJobs buildFlags') - checkFlags [] globalFlags config - nixShell verbosity distPref globalFlags config $ do - let setupOptions = defaultSetupScriptOptions { useDistPref = distPref } - benchmarkFlags'= benchmarkFlags { benchmarkDistPref = toFlag distPref } - - -- The package was just configured, so the LBI must be available. - names <- componentNamesFromLBI verbosity distPref "benchmarks" - (\c -> case c of { LBI.CBench{} -> True; _ -> False; }) - let extraArgs' - | null extraArgs = case names of - ComponentNamesUnknown -> [] - ComponentNames names' -> [ Make.unUnqualComponentName name - | LBI.CBenchName name <- names'] - | otherwise = extraArgs - - build verbosity config' distPref buildFlags' extraArgs' - setupWrapper verbosity setupOptions Nothing Cabal.benchmarkCommand (const benchmarkFlags') (const extraArgs') - -haddockAction :: HaddockFlags -> [String] -> Action -haddockAction haddockFlags extraArgs globalFlags = do - let verbosity = fromFlag (haddockVerbosity haddockFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (haddockDistPref haddockFlags) - config' <- - reconfigure configureAction - verbosity distPref NoFlag - mempty [] globalFlags config - nixShell verbosity distPref globalFlags config $ do - let haddockFlags' = defaultHaddockFlags `mappend` - savedHaddockFlags config' `mappend` - haddockFlags { haddockDistPref = toFlag distPref } - setupScriptOptions = defaultSetupScriptOptions - { useDistPref = distPref } - setupWrapper verbosity setupScriptOptions Nothing - haddockCommand (const haddockFlags') (const extraArgs) - when (haddockForHackage haddockFlags == Flag ForHackage) $ do - pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref) - let dest = distPref name <.> "tar.gz" - name = display (packageId pkg) ++ "-docs" - docDir = distPref "doc" "html" - createTarGzFile dest docDir name - notice verbosity $ "Documentation tarball created: " ++ dest - -cleanAction :: CleanFlags -> [String] -> Action -cleanAction cleanFlags extraArgs globalFlags = do - load <- try (loadConfigOrSandboxConfig verbosity globalFlags) - let config = either (\(SomeException _) -> mempty) id load - distPref <- findSavedDistPref config (cleanDistPref cleanFlags) - let setupScriptOptions = defaultSetupScriptOptions - { useDistPref = distPref - , useWin32CleanHack = True - } - cleanFlags' = cleanFlags { cleanDistPref = toFlag distPref } - setupWrapper verbosity setupScriptOptions Nothing - cleanCommand (const cleanFlags') (const extraArgs) - where - verbosity = fromFlagOrDefault normal (cleanVerbosity cleanFlags) - -listAction :: ListFlags -> [String] -> Action -listAction listFlags extraArgs globalFlags = do - let verbosity = fromFlag (listVerbosity listFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - let configFlags' = savedConfigureFlags config - configFlags = configFlags' - { configPackageDBs = configPackageDBs configFlags' - `mappend` listPackageDBs listFlags - , configHcPath = listHcPath listFlags - } - globalFlags' = savedGlobalFlags config `mappend` globalFlags - compProgdb <- if listNeedsCompiler listFlags - then do - (comp, _, progdb) <- configCompilerAux' configFlags - return (Just (comp, progdb)) - else return Nothing - withRepoContext verbosity globalFlags' $ \repoContext -> - List.list verbosity - (configPackageDB' configFlags) - repoContext - compProgdb - listFlags - extraArgs - -infoAction :: InfoFlags -> [String] -> Action -infoAction infoFlags extraArgs globalFlags = do - let verbosity = fromFlag (infoVerbosity infoFlags) - targets <- readUserTargets verbosity extraArgs - config <- loadConfigOrSandboxConfig verbosity globalFlags - let configFlags' = savedConfigureFlags config - configFlags = configFlags' { - configPackageDBs = configPackageDBs configFlags' - `mappend` infoPackageDBs infoFlags - } - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, _, progdb) <- configCompilerAuxEx configFlags - withRepoContext verbosity globalFlags' $ \repoContext -> - List.info verbosity - (configPackageDB' configFlags) - repoContext - comp - progdb - globalFlags' - infoFlags - targets - -fetchAction :: FetchFlags -> [String] -> Action -fetchAction fetchFlags extraArgs globalFlags = do - let verbosity = fromFlag (fetchVerbosity fetchFlags) - targets <- readUserTargets verbosity extraArgs - config <- loadConfig verbosity (globalConfigFile globalFlags) - let configFlags = savedConfigureFlags config - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, platform, progdb) <- configCompilerAux' configFlags - withRepoContext verbosity globalFlags' $ \repoContext -> - fetch verbosity - (configPackageDB' configFlags) - repoContext - comp platform progdb globalFlags' fetchFlags - targets - -freezeAction :: FreezeFlags -> [String] -> Action -freezeAction freezeFlags _extraArgs globalFlags = do - let verbosity = fromFlag (freezeVerbosity freezeFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config NoFlag - nixShell verbosity distPref globalFlags config $ do - let configFlags = savedConfigureFlags config - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, platform, progdb) <- configCompilerAux' configFlags - - withRepoContext verbosity globalFlags' $ \repoContext -> - freeze verbosity - (configPackageDB' configFlags) - repoContext - comp platform progdb - globalFlags' freezeFlags - -genBoundsAction :: FreezeFlags -> [String] -> GlobalFlags -> IO () -genBoundsAction freezeFlags _extraArgs globalFlags = do - let verbosity = fromFlag (freezeVerbosity freezeFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config NoFlag - nixShell verbosity distPref globalFlags config $ do - let configFlags = savedConfigureFlags config - globalFlags' = savedGlobalFlags config `mappend` globalFlags - (comp, platform, progdb) <- configCompilerAux' configFlags - - withRepoContext verbosity globalFlags' $ \repoContext -> - genBounds verbosity - (configPackageDB' configFlags) - repoContext - comp platform progdb - globalFlags' freezeFlags - -uploadAction :: UploadFlags -> [String] -> Action -uploadAction uploadFlags extraArgs globalFlags = do - config <- loadConfig verbosity (globalConfigFile globalFlags) - let uploadFlags' = savedUploadFlags config `mappend` uploadFlags - globalFlags' = savedGlobalFlags config `mappend` globalFlags - tarfiles = extraArgs - when (null tarfiles && not (fromFlag (uploadDoc uploadFlags'))) $ - die' verbosity "the 'upload' command expects at least one .tar.gz archive." - checkTarFiles extraArgs - maybe_password <- - case uploadPasswordCmd uploadFlags' - of Flag (xs:xss) -> Just . Password <$> - getProgramInvocationOutput verbosity - (simpleProgramInvocation xs xss) - _ -> pure $ flagToMaybe $ uploadPassword uploadFlags' - withRepoContext verbosity globalFlags' $ \repoContext -> do - if fromFlag (uploadDoc uploadFlags') - then do - when (length tarfiles > 1) $ - die' verbosity $ "the 'upload' command can only upload documentation " - ++ "for one package at a time." - tarfile <- maybe (generateDocTarball config) return $ listToMaybe tarfiles - Upload.uploadDoc verbosity - repoContext - (flagToMaybe $ uploadUsername uploadFlags') - maybe_password - (fromFlag (uploadCandidate uploadFlags')) - tarfile - else do - Upload.upload verbosity - repoContext - (flagToMaybe $ uploadUsername uploadFlags') - maybe_password - (fromFlag (uploadCandidate uploadFlags')) - tarfiles - where - verbosity = fromFlag (uploadVerbosity uploadFlags) - checkTarFiles tarfiles - | not (null otherFiles) - = die' verbosity $ "the 'upload' command expects only .tar.gz archives: " - ++ intercalate ", " otherFiles - | otherwise = sequence_ - [ do exists <- doesFileExist tarfile - unless exists $ die' verbosity $ "file not found: " ++ tarfile - | tarfile <- tarfiles ] - - where otherFiles = filter (not . isTarGzFile) tarfiles - isTarGzFile file = case splitExtension file of - (file', ".gz") -> takeExtension file' == ".tar" - _ -> False - generateDocTarball config = do - notice verbosity $ - "No documentation tarball specified. " - ++ "Building a documentation tarball with default settings...\n" - ++ "If you need to customise Haddock options, " - ++ "run 'haddock --for-hackage' first " - ++ "to generate a documentation tarball." - haddockAction (defaultHaddockFlags { haddockForHackage = Flag ForHackage }) - [] globalFlags - distPref <- findSavedDistPref config NoFlag - pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref) - return $ distPref display (packageId pkg) ++ "-docs" <.> "tar.gz" - -checkAction :: Flag Verbosity -> [String] -> Action -checkAction verbosityFlag extraArgs _globalFlags = do - let verbosity = fromFlag verbosityFlag - unless (null extraArgs) $ - die' verbosity $ "'check' doesn't take any extra arguments: " ++ unwords extraArgs - allOk <- Check.check (fromFlag verbosityFlag) - unless allOk exitFailure - -formatAction :: Flag Verbosity -> [String] -> Action -formatAction verbosityFlag extraArgs _globalFlags = do - let verbosity = fromFlag verbosityFlag - path <- case extraArgs of - [] -> do cwd <- getCurrentDirectory - tryFindPackageDesc verbosity cwd - (p:_) -> return p - pkgDesc <- readGenericPackageDescription verbosity path - -- Uses 'writeFileAtomic' under the hood. - writeGenericPackageDescription path pkgDesc - -reportAction :: ReportFlags -> [String] -> Action -reportAction reportFlags extraArgs globalFlags = do - let verbosity = fromFlag (reportVerbosity reportFlags) - unless (null extraArgs) $ - die' verbosity $ "'report' doesn't take any extra arguments: " ++ unwords extraArgs - config <- loadConfig verbosity (globalConfigFile globalFlags) - let globalFlags' = savedGlobalFlags config `mappend` globalFlags - reportFlags' = savedReportFlags config `mappend` reportFlags - - withRepoContext verbosity globalFlags' $ \repoContext -> - Upload.report verbosity repoContext - (flagToMaybe $ reportUsername reportFlags') - (flagToMaybe $ reportPassword reportFlags') - -runAction :: BuildFlags -> [String] -> Action -runAction buildFlags extraArgs globalFlags = do - let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) - config <- loadConfigOrSandboxConfig verbosity globalFlags - distPref <- findSavedDistPref config (buildDistPref buildFlags) - config' <- - reconfigure configureAction - verbosity distPref (buildNumJobs buildFlags) - mempty [] globalFlags config - nixShell verbosity distPref globalFlags config $ do - lbi <- getPersistBuildConfig distPref - (exe, exeArgs) <- splitRunArgs verbosity lbi extraArgs - - build verbosity config' distPref buildFlags ["exe:" ++ display (exeName exe)] - run verbosity lbi exe exeArgs - -getAction :: GetFlags -> [String] -> Action -getAction getFlags extraArgs globalFlags = do - let verbosity = fromFlag (getVerbosity getFlags) - targets <- readUserTargets verbosity extraArgs - config <- loadConfigOrSandboxConfig verbosity globalFlags - let globalFlags' = savedGlobalFlags config `mappend` globalFlags - withRepoContext verbosity (savedGlobalFlags config) $ \repoContext -> - get verbosity - repoContext - globalFlags' - getFlags - targets - -unpackAction :: GetFlags -> [String] -> Action -unpackAction getFlags extraArgs globalFlags = do - getAction getFlags extraArgs globalFlags - -initAction :: InitFlags -> [String] -> Action -initAction initFlags extraArgs globalFlags = do - -- it takes the first value within extraArgs (if there's one) - -- and uses it as the root directory for the new project - case extraArgs of - [] -> initAction' - [projectDir] -> do - createDirectoryIfMissingVerbose verbosity True projectDir - withCurrentDirectory projectDir initAction' - _ -> die' verbosity $ - "'init' only takes a single, optional, extra " ++ - "argument for the project root directory" - where - initAction' = do - confFlags <- loadConfigOrSandboxConfig verbosity globalFlags - -- override with `--with-compiler` from CLI if available - let confFlags' = savedConfigureFlags confFlags `mappend` compFlags - initFlags' = savedInitFlags confFlags `mappend` initFlags - globalFlags' = savedGlobalFlags confFlags `mappend` globalFlags - - (comp, _, progdb) <- configCompilerAux' confFlags' - - withRepoContext verbosity globalFlags' $ \repoContext -> - initCmd verbosity (configPackageDB' confFlags') - repoContext comp progdb initFlags' - - verbosity = fromFlag (initVerbosity initFlags) - compFlags = mempty { configHcPath = initHcPath initFlags } - -userConfigAction :: UserConfigFlags -> [String] -> Action -userConfigAction ucflags extraArgs globalFlags = do - let verbosity = fromFlag (userConfigVerbosity ucflags) - frc = fromFlag (userConfigForce ucflags) - extraLines = fromFlag (userConfigAppendLines ucflags) - case extraArgs of - ("init":_) -> do - path <- configFile - fileExists <- doesFileExist path - if (not fileExists || (fileExists && frc)) - then void $ createDefaultConfigFile verbosity extraLines path - else die' verbosity $ path ++ " already exists." - ("diff":_) -> traverse_ putStrLn =<< userConfigDiff verbosity globalFlags extraLines - ("update":_) -> userConfigUpdate verbosity globalFlags extraLines - -- Error handling. - [] -> die' verbosity $ "Please specify a subcommand (see 'help user-config')" - _ -> die' verbosity $ "Unknown 'user-config' subcommand: " ++ unwords extraArgs - where configFile = getConfigFilePath (globalConfigFile globalFlags) - --- | Used as an entry point when cabal-install needs to invoke itself --- as a setup script. This can happen e.g. when doing parallel builds. --- -actAsSetupAction :: ActAsSetupFlags -> [String] -> Action -actAsSetupAction actAsSetupFlags args _globalFlags = - let bt = fromFlag (actAsSetupBuildType actAsSetupFlags) - in case bt of - Simple -> Simple.defaultMainArgs args - Configure -> Simple.defaultMainWithHooksArgs - Simple.autoconfUserHooks args - Make -> Make.defaultMainArgs args - Custom -> error "actAsSetupAction Custom" - -manpageAction :: [CommandSpec action] -> ManpageFlags -> [String] -> Action -manpageAction commands flags extraArgs _ = do - let verbosity = fromFlag (manpageVerbosity flags) - unless (null extraArgs) $ - die' verbosity $ "'man' doesn't take any extra arguments: " ++ unwords extraArgs - pname <- getProgName - let cabalCmd = if takeExtension pname == ".exe" - then dropExtension pname - else pname - manpageCmd cabalCmd commands flags +main = getArgs >>= Client.main diff --git a/cabal-install/src/Distribution/Client/CmdExec.hs b/cabal-install/src/Distribution/Client/CmdExec.hs index 80220592498..4c0ea639ded 100644 --- a/cabal-install/src/Distribution/Client/CmdExec.hs +++ b/cabal-install/src/Distribution/Client/CmdExec.hs @@ -27,6 +27,10 @@ import Distribution.Client.Setup ( ConfigFlags(configVerbosity) , GlobalFlags ) +import Distribution.Client.ProjectConfig.Types + ( ProjectConfig (projectConfigShared) + , ProjectConfigShared (projectConfigProgPathExtra) + ) import Distribution.Client.ProjectFlags ( removeIgnoreProjectOption ) @@ -54,13 +58,13 @@ import Distribution.Client.ProjectPlanning import Distribution.Simple.Command ( CommandUI(..) ) import Distribution.Simple.Program.Db - ( modifyProgramSearchPath + ( appendProgramSearchPath + , configuredPrograms , requireProgram , configuredPrograms ) import Distribution.Simple.Program.Find - ( ProgramSearchPathEntry(..) - ) + ( simpleProgram ) import Distribution.Simple.Program.Run ( programInvocation , runProgramInvocation @@ -69,7 +73,6 @@ import Distribution.Simple.Program.Types ( programOverrideEnv , programDefaultArgs , programPath - , simpleProgram , ConfiguredProgram ) import Distribution.Simple.GHC @@ -80,12 +83,14 @@ import Distribution.Simple.Flag ) import Distribution.Simple.Utils ( die' - , info , createDirectoryIfMissingVerbose , withTempDirectory , wrapText , notice ) +import Distribution.Utils.NubList + ( fromNubList + ) import Distribution.Verbosity ( normal ) @@ -147,12 +152,15 @@ execAction flags@NixStyleFlags {..} extraArgs globalFlags = do mempty -- Some dependencies may have executables. Let's put those on the PATH. - extraPaths <- pathAdditions verbosity baseCtx buildCtx - let programDb = modifyProgramSearchPath - (map ProgramSearchPathDir extraPaths ++) - . pkgConfigCompilerProgs - . elaboratedShared - $ buildCtx + let extraPaths = pathAdditions baseCtx buildCtx + + programDb <- + appendProgramSearchPath + verbosity + extraPaths + . pkgConfigCompilerProgs + . elaboratedShared + $ buildCtx -- Now that we have the packages, set up the environment. We accomplish this -- by creating an environment file that selects the databases and packages we @@ -235,15 +243,21 @@ withTempEnvFile verbosity baseCtx buildCtx buildStatus action = do buildStatus action envOverrides) -pathAdditions :: Verbosity -> ProjectBaseContext -> ProjectBuildContext -> IO [FilePath] -pathAdditions verbosity ProjectBaseContext{..}ProjectBuildContext{..} = do - info verbosity . unlines $ "Including the following directories in PATH:" - : paths - return paths +-- | Get paths to all dependency executables to be included in PATH. +pathAdditions :: ProjectBaseContext -> ProjectBuildContext -> [FilePath] +pathAdditions ProjectBaseContext{..} ProjectBuildContext{..} = + paths ++ cabalConfigPaths where - paths = S.toList - $ binDirectories distDirLayout elaboratedShared elaboratedPlanToExecute + cabalConfigPaths = + fromNubList + . projectConfigProgPathExtra + . projectConfigShared + $ projectConfig + paths = + S.toList $ + binDirectories distDirLayout elaboratedShared elaboratedPlanToExecute +-- | Get paths to all dependency executables to be included in PATH. binDirectories :: DistDirLayout -> ElaboratedSharedConfig diff --git a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs index c9e160ca52e..8f79c5060d5 100644 --- a/cabal-install/src/Distribution/Client/CmdHaddockProject.hs +++ b/cabal-install/src/Distribution/Client/CmdHaddockProject.hs @@ -4,7 +4,6 @@ module Distribution.Client.CmdHaddockProject ) where import Prelude () -import Data.Bool (bool) import Distribution.Client.Compat.Prelude hiding (get) import qualified Distribution.Client.CmdBuild as CmdBuild @@ -44,6 +43,7 @@ import Distribution.Client.TargetProblem (TargetProblem(..)) import Distribution.Types.PackageId (pkgName) import Distribution.Types.PackageName (unPackageName) +import Distribution.Types.UnitId (unUnitId) import Distribution.Types.Version (mkVersion) import Distribution.Types.VersionRange (orLaterVersion) import Distribution.Types.InstalledPackageInfo (InstalledPackageInfo (..)) @@ -53,8 +53,6 @@ import Distribution.Simple.Compiler ( Compiler (..) ) import Distribution.Simple.Flag ( Flag(..) - , flagElim - , flagToList , fromFlag , fromFlagOrDefault ) @@ -86,13 +84,6 @@ haddockProjectAction flags _extraArgs globalFlags = do let outputDir = normalise $ fromFlag (haddockProjectDir flags) createDirectoryIfMissingVerbose verbosity True outputDir - when ((2::Int) <= - ( flagElim 0 (bool 0 1) (haddockProjectHackage flags) - + flagElim 0 (bool 0 1) (haddockProjectLocal flags) - + flagElim 0 (const 1) (haddockProjectHtmlLocation flags) - )) $ - die' verbosity "Options `--local`, `--hackage` and `--html-location` are mutually exclusive`" - warn verbosity "haddock-project command is experimental, it might break in the future" -- build all packages with appropriate haddock flags @@ -115,12 +106,8 @@ haddockProjectAction flags _extraArgs globalFlags = do , haddockForeignLibs = haddockProjectForeignLibs flags , haddockInternal = haddockProjectInternal flags , haddockCss = haddockProjectCss flags - , haddockLinkedSource = if localOrHackage - then Flag True - else haddockProjectLinkedSource flags - , haddockQuickJump = if localOrHackage - then Flag True - else haddockProjectQuickJump flags + , haddockLinkedSource = Flag True + , haddockQuickJump = Flag True , haddockHscolourCss = haddockProjectHscolourCss flags , haddockContents = if localStyle then Flag (toPathTemplate "../index.html") else NoFlag @@ -142,7 +129,7 @@ haddockProjectAction flags _extraArgs globalFlags = do -- we need. -- - withContextAndSelectors RejectNoTargets Nothing nixFlags ["all"] globalFlags HaddockCommand $ \targetCtx ctx targetSelectors -> do + withContextAndSelectors RejectNoTargets Nothing (commandDefaultFlags CmdBuild.buildCommand) ["all"] globalFlags HaddockCommand $ \targetCtx ctx targetSelectors -> do baseCtx <- case targetCtx of ProjectContext -> return ctx GlobalContext -> return ctx @@ -193,6 +180,16 @@ haddockProjectAction flags _extraArgs globalFlags = do (orLaterVersion (mkVersion [2,26,1])) progs -- + -- Build project; we need to build dependencies. + -- Issue #8958. + -- + + when localStyle $ + CmdBuild.buildAction + (commandDefaultFlags CmdBuild.buildCommand) + ["all"] + globalFlags + -- -- Build haddocks of each components -- @@ -210,6 +207,8 @@ haddockProjectAction flags _extraArgs globalFlags = do Left _ | not localStyle -> return [] Left package -> do + -- TODO: this might not work for public packages with sublibraries. + -- Issue #9026. let packageName = unPackageName (pkgName $ sourcePackageId package) destDir = outputDir packageName fmap catMaybes $ for (haddockInterfaces package) $ \interfacePath -> do @@ -227,12 +226,13 @@ haddockProjectAction flags _extraArgs globalFlags = do case elabLocalToProject package of True -> do let distDirParams = elabDistDirParams sharedConfig' package + unitId = unUnitId (elabUnitId package) buildDir = distBuildDirectory distLayout distDirParams packageName = unPackageName (pkgName $ elabPkgSourceId package) let docDir = buildDir "doc" "html" packageName - destDir = outputDir packageName + destDir = outputDir unitId interfacePath = destDir packageName <.> "haddock" a <- doesDirectoryExist docDir @@ -242,11 +242,17 @@ haddockProjectAction flags _extraArgs globalFlags = do , interfacePath , Visible )] - False -> return [] + False -> do + warn verbosity + ("haddocks of " + ++ show unitId + ++ " not found in the store") + return [] False | not localStyle -> return [] False -> do let packageName = unPackageName (pkgName $ elabPkgSourceId package) + unitId = unUnitId (elabUnitId package) packageDir = storePackageDirectory (cabalStoreDirLayout cabalLayout) (compilerId (pkgConfigCompiler sharedConfig')) (elabUnitId package) @@ -259,11 +265,16 @@ haddockProjectAction flags _extraArgs globalFlags = do True -> copyDirectoryRecursive verbosity docDir destDir -- non local packages will be hidden in haddock's -- generated contents page - >> return [( packageName + >> return [( unitId , interfacePath , Hidden )] - False -> return [] + False -> do + warn verbosity + ("haddocks of " + ++ show unitId + ++ " not found in the store") + return [] -- -- generate index, content, etc. @@ -271,23 +282,13 @@ haddockProjectAction flags _extraArgs globalFlags = do let flags' = flags { haddockProjectDir = Flag outputDir - , haddockProjectGenIndex = if localOrHackage - then Flag True - else haddockProjectGenIndex flags - , haddockProjectGenContents = if localOrHackage - then Flag True - else haddockProjectGenContents flags - , haddockProjectQuickJump = if localOrHackage - then Flag True - else haddockProjectQuickJump flags - , haddockProjectLinkedSource = haddockLinkedSource haddockFlags , haddockProjectInterfaces = Flag [ ( interfacePath - , Just packageName - , Just packageName + , Just name + , Just name , visibility ) - | (packageName, interfacePath, visibility) <- packageInfos + | (name, interfacePath, visibility) <- packageInfos ] } createHaddockIndex verbosity @@ -302,17 +303,9 @@ haddockProjectAction flags _extraArgs globalFlags = do -- transitive dependencies; or depend on `--haddocks-html-location` to -- provide location of the documentation of dependencies. localStyle = - let local = fromFlagOrDefault False (haddockProjectLocal flags) - hackage = fromFlagOrDefault False (haddockProjectHackage flags) + let hackage = fromFlagOrDefault False (haddockProjectHackage flags) location = fromFlagOrDefault False (const True <$> haddockProjectHtmlLocation flags) - in local && not hackage && not location - -- or if none of the flags is given set `localStyle` to `True` - || not local && not hackage && not location - - - localOrHackage = - any id $ flagToList (haddockProjectLocal flags) - ++ flagToList (haddockProjectHackage flags) + in not hackage && not location reportTargetProblems :: Show x => [x] -> IO a reportTargetProblems = diff --git a/cabal-install/src/Distribution/Client/CmdInstall.hs b/cabal-install/src/Distribution/Client/CmdInstall.hs index cd1254b5fe1..203b90c6b60 100644 --- a/cabal-install/src/Distribution/Client/CmdInstall.hs +++ b/cabal-install/src/Distribution/Client/CmdInstall.hs @@ -39,7 +39,7 @@ import Distribution.Client.Types , SourcePackageDb(..) ) import qualified Distribution.Client.InstallPlan as InstallPlan import Distribution.Package - ( Package(..), PackageName, unPackageName ) + ( Package(..), PackageName, mkPackageName, unPackageName ) import Distribution.Types.PackageId ( PackageIdentifier(..) ) import Distribution.Client.ProjectConfig @@ -53,16 +53,15 @@ import Distribution.Client.ProjectFlags (ProjectFlags (..)) import Distribution.Client.ProjectConfig.Types ( ProjectConfig(..), ProjectConfigShared(..) , ProjectConfigBuildOnly(..), PackageConfig(..) + , MapMappend(..) , getMapLast, getMapMappend, projectConfigLogsDir , projectConfigStoreDir, projectConfigBuildOnly , projectConfigConfigFile ) import Distribution.Simple.Program.Db ( userSpecifyPaths, userSpecifyArgss, defaultProgramDb - , modifyProgramSearchPath ) + , appendProgramSearchPath ) import Distribution.Simple.BuildPaths ( exeExtension ) -import Distribution.Simple.Program.Find - ( ProgramSearchPathEntry(..) ) import Distribution.Client.Config ( defaultInstallPath, loadConfig, SavedConfig(..) ) import qualified Distribution.Simple.PackageIndex as PI @@ -105,7 +104,7 @@ import Distribution.Simple.Configure ( configCompilerEx ) import Distribution.Simple.Compiler ( Compiler(..), CompilerId(..), CompilerFlavor(..) - , PackageDBStack ) + , PackageDBStack, PackageDB(..) ) import Distribution.Simple.GHC ( ghcPlatformAndVersionString, getGhcAppDir , GhcImplInfo(..), getImplInfo @@ -122,11 +121,13 @@ import Distribution.Verbosity import Distribution.Simple.Utils ( wrapText, die', notice, warn , withTempDirectory, createDirectoryIfMissingVerbose - , ordNub ) + , ordNub, safeHead ) import Distribution.Utils.Generic ( writeFileAtomic ) import qualified Data.ByteString.Lazy.Char8 as BS +import Data.Ord + ( Down(..) ) import qualified Data.Map as Map import qualified Data.Set as S import qualified Data.List.NonEmpty as NE @@ -321,7 +322,8 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg, - projectConfigStoreDir + projectConfigStoreDir, + projectConfigProgPathExtra }, projectConfigLocalPackages = PackageConfig { packageConfigProgramPaths, @@ -334,14 +336,13 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe hcPath = flagToMaybe projectConfigHcPath hcPkg = flagToMaybe projectConfigHcPkg + configProgDb <- appendProgramSearchPath verbosity ((fromNubList packageConfigProgramPathExtra) ++ (fromNubList projectConfigProgPathExtra)) defaultProgramDb + let -- ProgramDb with directly user specified paths preProgDb = - userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) - . userSpecifyArgss (Map.toList (getMapMappend packageConfigProgramArgs)) - . modifyProgramSearchPath - (++ [ ProgramSearchPathDir dir - | dir <- fromNubList packageConfigProgramPathExtra ]) - $ defaultProgramDb + userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) + . userSpecifyArgss (Map.toList (getMapMappend packageConfigProgramArgs)) + $ configProgDb -- progDb is a program database with compiler tools configured properly (compiler@Compiler { compilerId = @@ -423,19 +424,31 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe unless dryRun $ if installLibs then installLibraries verbosity - buildCtx compiler packageDbs envFile nonGlobalEnvEntries' + buildCtx installedIndex compiler packageDbs envFile nonGlobalEnvEntries' else installExes verbosity baseCtx buildCtx platform compiler configFlags clientInstallFlags where configFlags' = disableTestsBenchsByDefault configFlags verbosity = fromFlagOrDefault normal (configVerbosity configFlags') ignoreProject = flagIgnoreProject projectFlags - cliConfig = commandLineFlagsToProjectConfig - globalFlags - flags { configFlags = configFlags' } - clientInstallFlags' + baseCliConfig = commandLineFlagsToProjectConfig + globalFlags + flags { configFlags = configFlags' } + clientInstallFlags' + cliConfig = addLocalConfigToTargets baseCliConfig targetStrings globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig) +-- | Treat all direct targets of install command as local packages: #8637 +addLocalConfigToTargets :: ProjectConfig -> [String] -> ProjectConfig +addLocalConfigToTargets config targetStrings + = config { + projectConfigSpecificPackage = projectConfigSpecificPackage config + <> MapMappend (Map.fromList targetPackageConfigs) + } + where + localConfig = projectConfigLocalPackages config + targetPackageConfigs = map (\x -> (mkPackageName x, localConfig)) targetStrings + -- | Verify that invalid config options were not passed to the install command. -- -- If an invalid configuration is found the command will @die'@. @@ -674,20 +687,31 @@ installExes verbosity baseCtx buildCtx platform compiler installLibraries :: Verbosity -> ProjectBuildContext + -> PI.PackageIndex InstalledPackageInfo -> Compiler -> PackageDBStack -> FilePath -- ^ Environment file -> [GhcEnvironmentFileEntry] -> IO () -installLibraries verbosity buildCtx compiler - packageDbs envFile envEntries = do +installLibraries verbosity buildCtx installedIndex compiler + packageDbs' envFile envEntries = do if supportsPkgEnvFiles $ getImplInfo compiler then do + let validDb (SpecificPackageDB fp) = doesPathExist fp + validDb _ = pure True + -- if a user "installs" a global package and no existing cabal db exists, none will be created. + -- this ensures we don't add the "phantom" path to the file. + packageDbs <- filterM validDb packageDbs' let + getLatest = (=<<) (maybeToList . safeHead . snd) . take 1 . sortBy (comparing (Down . fst)) + . PI.lookupPackageName installedIndex + globalLatest = concat (getLatest <$> globalPackages) + globalEntries = GhcEnvFilePackageId . installedUnitId <$> globalLatest baseEntries = GhcEnvFileClearPackageDbStack : fmap GhcEnvFilePackageDb packageDbs pkgEntries = ordNub $ - envEntries + globalEntries + ++ envEntries ++ entriesForLibraryComponents (targetsMap buildCtx) contents' = renderGhcEnvironmentFile (baseEntries ++ pkgEntries) createDirectoryIfMissing True (takeDirectory envFile) @@ -698,6 +722,12 @@ installLibraries verbosity buildCtx compiler ++ "so only executables will be available. (Library installation is " ++ "supported on GHC 8.0+ only)" +-- See ticket #8894. This is safe to include any nonreinstallable boot pkg, +-- but the particular package users will always expect to be in scope without specific installation +-- is base, so that they can access prelude, regardles of if they specifically asked for it. +globalPackages :: [PackageName] +globalPackages = mkPackageName <$> [ "base" ] + warnIfNoExes :: Verbosity -> ProjectBuildContext -> IO () warnIfNoExes verbosity buildCtx = when noExes $ diff --git a/cabal-install/src/Distribution/Client/CmdListBin.hs b/cabal-install/src/Distribution/Client/CmdListBin.hs index 27674300849..8993e18e2de 100644 --- a/cabal-install/src/Distribution/Client/CmdListBin.hs +++ b/cabal-install/src/Distribution/Client/CmdListBin.hs @@ -28,7 +28,9 @@ import Distribution.Client.NixStyleOptions import Distribution.Client.ProjectOrchestration import Distribution.Client.ProjectPlanning.Types import Distribution.Client.ScriptUtils - (AcceptNoTargets(..), TargetContext(..), updateContextAndWriteProjectFile, withContextAndSelectors) + ( AcceptNoTargets(..), TargetContext(..) + , updateContextAndWriteProjectFile, withContextAndSelectors + , movedExePath ) import Distribution.Client.Setup (GlobalFlags (..)) import Distribution.Client.TargetProblem (TargetProblem (..)) import Distribution.Simple.BuildPaths (dllExtension, exeExtension) @@ -170,7 +172,7 @@ listbinAction flags@NixStyleFlags{..} args globalFlags = do bin_file c = case c of CD.ComponentExe s - | s == selectedComponent -> [bin_file' s] + | s == selectedComponent -> [moved_bin_file s] CD.ComponentTest s | s == selectedComponent -> [bin_file' s] CD.ComponentBench s @@ -194,6 +196,8 @@ listbinAction flags@NixStyleFlags{..} args globalFlags = do then dist_dir "build" prettyShow s ("lib" ++ prettyShow s) <.> dllExtension plat else InstallDirs.bindir (elabInstallDirs elab) ("lib" ++ prettyShow s) <.> dllExtension plat + moved_bin_file s = fromMaybe (bin_file' s) (movedExePath selectedComponent distDirLayout elaboratedSharedConfig elab) + ------------------------------------------------------------------------------- -- Target Problem: the very similar to CmdRun ------------------------------------------------------------------------------- diff --git a/cabal-install/src/Distribution/Client/CmdRepl.hs b/cabal-install/src/Distribution/Client/CmdRepl.hs index be129b042f4..dcf659f036a 100644 --- a/cabal-install/src/Distribution/Client/CmdRepl.hs +++ b/cabal-install/src/Distribution/Client/CmdRepl.hs @@ -75,7 +75,7 @@ import Distribution.Types.BuildInfo import Distribution.Types.ComponentName ( componentNameString ) import Distribution.Types.CondTree - ( CondTree(..), traverseCondTreeC ) + ( CondTree(..) ) import Distribution.Types.Dependency ( Dependency(..), mainLibSet ) import Distribution.Types.Library @@ -338,7 +338,12 @@ addDepsToProjectTarget deps pkgId ctx = | packageId pkg /= pkgId = SpecificSourcePackage pkg | SourcePackage{..} <- pkg = SpecificSourcePackage $ pkg { srcpkgDescription = - srcpkgDescription & (\f -> L.allCondTrees $ traverseCondTreeC f) + -- New dependencies are added to the original ones found in the + -- `targetBuildDepends` field. + -- `traverseBuildInfos` is used in order to update _all_ the + -- occurrences of the field `targetBuildDepends`. It ensures that + -- fields depending on the latter are also consistently updated. + srcpkgDescription & (L.traverseBuildInfos . L.targetBuildDepends) %~ (deps ++) } addDeps spec = spec diff --git a/cabal-install/src/Distribution/Client/CmdRun.hs b/cabal-install/src/Distribution/Client/CmdRun.hs index 64241fd8bbc..e416e7e2948 100644 --- a/cabal-install/src/Distribution/Client/CmdRun.hs +++ b/cabal-install/src/Distribution/Client/CmdRun.hs @@ -22,51 +22,62 @@ module Distribution.Client.CmdRun ( import Prelude () import Distribution.Client.Compat.Prelude hiding (toList) -import Distribution.Client.ProjectOrchestration import Distribution.Client.CmdErrorMessages ( renderTargetSelector, showTargetSelector, renderTargetProblem, renderTargetProblemNoTargets, plural, targetSelectorPluralPkgs, targetSelectorFilter, renderListCommaAnd, renderListPretty ) -import Distribution.Client.TargetProblem - ( TargetProblem (..) ) - +import Distribution.Client.GlobalFlags + ( defaultGlobalFlags ) +import Distribution.Client.InstallPlan + ( toList, foldPlanPackage ) import Distribution.Client.NixStyleOptions ( NixStyleFlags (..), nixStyleOptions, defaultNixStyleFlags ) +import Distribution.Client.ProjectConfig.Types +import Distribution.Client.ProjectOrchestration +import Distribution.Client.ProjectPlanning + ( ElaboratedConfiguredPackage(..) + , ElaboratedInstallPlan, binDirectoryFor + ) +import Distribution.Client.ProjectPlanning.Types + ( dataDirsEnvironmentForPlan, elabExeDependencyPaths ) +import Distribution.Client.ScriptUtils + ( AcceptNoTargets(..), TargetContext(..) + , updateContextAndWriteProjectFile, withContextAndSelectors + , movedExePath ) import Distribution.Client.Setup ( GlobalFlags(..), ConfigFlags(..) ) -import Distribution.Client.GlobalFlags - ( defaultGlobalFlags ) -import Distribution.Simple.Flag - ( fromFlagOrDefault ) +import Distribution.Client.TargetProblem + ( TargetProblem (..) ) import Distribution.Simple.Command ( CommandUI(..), usageAlternatives ) -import Distribution.Types.ComponentName - ( componentNameRaw ) -import Distribution.Verbosity - ( normal, silent ) -import Distribution.Simple.Utils - ( wrapText, die', info, notice, safeHead ) -import Distribution.Client.ProjectPlanning - ( ElaboratedConfiguredPackage(..) - , ElaboratedInstallPlan, binDirectoryFor ) -import Distribution.Client.ProjectPlanning.Types - ( dataDirsEnvironmentForPlan ) -import Distribution.Client.InstallPlan - ( toList, foldPlanPackage ) -import Distribution.Types.UnqualComponentName - ( UnqualComponentName, unUnqualComponentName ) +import Distribution.Simple.Flag + ( fromFlagOrDefault ) +import Distribution.Simple.Program.Find + ( ProgramSearchPathEntry(..), defaultProgramSearchPath, + programSearchPathAsPATHVar, logExtraProgramSearchPath + ) import Distribution.Simple.Program.Run ( runProgramInvocation, ProgramInvocation(..), emptyProgramInvocation ) +import Distribution.Simple.Utils + ( wrapText, die', info, notice, safeHead ) +import Distribution.Types.ComponentName + ( componentNameRaw ) import Distribution.Types.UnitId ( UnitId ) -import Distribution.Client.ScriptUtils - ( AcceptNoTargets(..), withContextAndSelectors, updateContextAndWriteProjectFile, TargetContext(..) ) +import Distribution.Utils.NubList + ( fromNubList ) + +import Distribution.Types.UnqualComponentName + ( UnqualComponentName, unUnqualComponentName ) +import Distribution.Verbosity + ( normal, silent ) import Data.List (group) import qualified Data.Set as Set + import System.Directory ( doesFileExist ) import System.FilePath @@ -216,14 +227,31 @@ runAction flags@NixStyleFlags {..} targetAndArgs globalFlags ++ exeName ++ ":\n" ++ unlines (fmap (\p -> " - in package " ++ prettyShow (elabUnitId p)) elabPkgs) - let exePath = binDirectoryFor (distDirLayout baseCtx) - (elaboratedShared buildCtx) - pkg - exeName - exeName + + let defaultExePath = binDirectoryFor + (distDirLayout baseCtx) + (elaboratedShared buildCtx) + pkg + exeName + exeName + exePath = fromMaybe defaultExePath (movedExePath selectedComponent (distDirLayout baseCtx) (elaboratedShared buildCtx) pkg) + let dryRun = buildSettingDryRun (buildSettings baseCtx) || buildSettingOnlyDownload (buildSettings baseCtx) + let extraPath = + elabExeDependencyPaths pkg + ++ ( fromNubList + . projectConfigProgPathExtra + . projectConfigShared + . projectConfig + $ baseCtx + ) + + logExtraProgramSearchPath verbosity extraPath + + progPath <- programSearchPathAsPATHVar (map ProgramSearchPathDir extraPath ++ defaultProgramSearchPath) + if dryRun then notice verbosity "Running of executable suppressed by flag(s)" else @@ -232,7 +260,8 @@ runAction flags@NixStyleFlags {..} targetAndArgs globalFlags emptyProgramInvocation { progInvokePath = exePath, progInvokeArgs = args, - progInvokeEnv = dataDirsEnvironmentForPlan + progInvokeEnv = ("PATH", Just $ progPath) + : dataDirsEnvironmentForPlan (distDirLayout baseCtx) elaboratedPlan } diff --git a/cabal-install/src/Distribution/Client/CmdUpdate.hs b/cabal-install/src/Distribution/Client/CmdUpdate.hs index f066788ec63..55efee8459c 100644 --- a/cabal-install/src/Distribution/Client/CmdUpdate.hs +++ b/cabal-install/src/Distribution/Client/CmdUpdate.hs @@ -199,10 +199,12 @@ updateRepo verbosity _updateFlags repoCtxt (repo, indexState) = do -- NB: always update the timestamp, even if we didn't actually -- download anything writeIndexTimestamp index indexState - ce <- if repoContextIgnoreExpiry repoCtxt - then Just `fmap` getCurrentTime - else return Nothing - updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure ce + -- typically we get the current time to check expiry against + -- but if the flag is set, we don't. + now' <- case repoContextIgnoreExpiry repoCtxt of + False -> Just <$> getCurrentTime + True -> pure Nothing + updated <- Sec.uncheckClientErrors $ Sec.checkForUpdates repoSecure now' -- this resolves indexState (which could be HEAD) into a timestamp new_ts <- currentIndexTimestamp (lessVerbose verbosity) repoCtxt repo let rname = remoteRepoName (repoRemote repo) diff --git a/cabal-install/src/Distribution/Client/Compat/Tar.hs b/cabal-install/src/Distribution/Client/Compat/Tar.hs new file mode 100644 index 00000000000..8597c61fede --- /dev/null +++ b/cabal-install/src/Distribution/Client/Compat/Tar.hs @@ -0,0 +1,68 @@ +{-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +{- FOURMOLU_DISABLE -} +module Distribution.Client.Compat.Tar + ( extractTarGzFile +#if MIN_VERSION_tar(0,6,0) + , Tar.Entry + , Tar.Entries + , Tar.GenEntries (..) + , Tar.GenEntryContent (..) + , Tar.entryContent +#else + , Tar.Entries (..) + , Tar.Entry (..) + , Tar.EntryContent (..) +#endif + ) where +{- FOURMOLU_ENABLE -} + +import Distribution.Client.Compat.Prelude +import Prelude () + +import qualified Codec.Archive.Tar as Tar +import qualified Codec.Archive.Tar.Check as Tar +#if MIN_VERSION_tar(0,6,0) +#else +import qualified Codec.Archive.Tar.Entry as Tar +#endif +import qualified Data.ByteString.Lazy as BS +import qualified Distribution.Client.GZipUtils as GZipUtils + +instance (Exception a, Exception b) => Exception (Either a b) where + toException (Left e) = toException e + toException (Right e) = toException e + + fromException e = + case fromException e of + Just e' -> Just (Left e') + Nothing -> case fromException e of + Just e' -> Just (Right e') + Nothing -> Nothing + +{- FOURMOLU_DISABLE -} +extractTarGzFile + :: FilePath + -- ^ Destination directory + -> FilePath + -- ^ Expected subdir (to check for tarbombs) + -> FilePath + -- ^ Tarball + -> IO () +extractTarGzFile dir expected tar = +#if MIN_VERSION_tar(0,6,0) + Tar.unpackAndCheck + ( \x -> + SomeException <$> Tar.checkEntryTarbomb expected x + <|> SomeException <$> Tar.checkEntrySecurity x + ) + dir +#else + Tar.unpack dir + . Tar.checkTarbomb expected +#endif + . Tar.read + . GZipUtils.maybeDecompress + =<< BS.readFile tar +{- FOURMOLU_ENABLE -} diff --git a/cabal-install/src/Distribution/Client/Config.hs b/cabal-install/src/Distribution/Client/Config.hs index 023d6a6fdbc..0dc3079f5e4 100644 --- a/cabal-install/src/Distribution/Client/Config.hs +++ b/cabal-install/src/Distribution/Client/Config.hs @@ -133,7 +133,7 @@ import Text.PrettyPrint import Text.PrettyPrint.HughesPJ ( text, Doc ) import System.Directory - ( createDirectoryIfMissing, getHomeDirectory, getXdgDirectory, XdgDirectory(XdgCache, XdgConfig, XdgState), renameFile, getAppUserDataDirectory, doesDirectoryExist ) + ( createDirectoryIfMissing, getHomeDirectory, getXdgDirectory, XdgDirectory(XdgCache, XdgConfig, XdgState), renameFile, getAppUserDataDirectory, doesDirectoryExist, doesFileExist ) import Network.URI ( URI(..), URIAuth(..), parseURI ) import System.FilePath @@ -568,34 +568,54 @@ baseSavedConfig = do -- initialSavedConfig :: IO SavedConfig initialSavedConfig = do - cacheDir <- defaultCacheDir - logsDir <- defaultLogsDir - extraPath <- defaultExtraPath + cacheDir <- defaultCacheDir + logsDir <- defaultLogsDir installPath <- defaultInstallPath - return mempty { - savedGlobalFlags = mempty { - globalCacheDir = toFlag cacheDir, - globalRemoteRepos = toNubList [defaultRemoteRepo] - }, - savedConfigureFlags = mempty { - configProgramPathExtra = toNubList extraPath - }, - savedInstallFlags = mempty { - installSummaryFile = toNubList [toPathTemplate (logsDir "build.log")], - installBuildReports= toFlag NoReports, - installNumJobs = toFlag Nothing - }, - savedClientInstallFlags = mempty { - cinstInstalldir = toFlag installPath - } - } + return + mempty + { savedGlobalFlags = + mempty + { globalCacheDir = toFlag cacheDir + , globalRemoteRepos = toNubList [defaultRemoteRepo] + } + , savedInstallFlags = + mempty + { installSummaryFile = toNubList [toPathTemplate (logsDir "build.log")] + , installBuildReports = toFlag NoReports + , installNumJobs = toFlag Nothing + } + , savedClientInstallFlags = + mempty + { cinstInstalldir = toFlag installPath + } + } --- | If @CABAL\_DIR@ is set or @~/.cabal@ exists, return that --- directory. Otherwise returns Nothing. If this function returns --- Nothing, then it implies that we are not using a single directory --- for everything, but instead use XDG paths. Fundamentally, this --- function is used to implement transparent backwards compatibility --- with pre-XDG versions of cabal-install. +-- | Issue a warning if both @$XDG_CONFIG_HOME/cabal/config@ and +-- @~/.cabal@ exists. +warnOnTwoConfigs :: Verbosity -> IO () +warnOnTwoConfigs verbosity = do + defaultDir <- getAppUserDataDirectory "cabal" + xdgCfgDir <- getXdgDirectory XdgConfig "cabal" + when (defaultDir /= xdgCfgDir) $ do + dotCabalExists <- doesDirectoryExist defaultDir + let xdgCfg = xdgCfgDir "config" + xdgCfgExists <- doesFileExist xdgCfg + when (dotCabalExists && xdgCfgExists) $ + warn verbosity $ + "Both " + <> defaultDir + <> " and " + <> xdgCfg + <> " exist - ignoring the former.\n" + <> "It is advisable to remove one of them. In that case, we will use the remaining one by default (unless '$CABAL_DIR' is explicitly set)." + +-- | If @CABAL\_DIR@ is set, return @Just@ its value. Otherwise, if +-- @~/.cabal@ exists and @$XDG_CONFIG_HOME/cabal/config@ does not +-- exist, return @Just "~/.cabal"@. Otherwise, return @Nothing@. If +-- this function returns Nothing, then it implies that we are not +-- using a single directory for everything, but instead use XDG paths. +-- Fundamentally, this function is used to implement transparent +-- backwards compatibility with pre-XDG versions of cabal-install. maybeGetCabalDir :: IO (Maybe FilePath) maybeGetCabalDir = do mDir <- lookupEnv "CABAL_DIR" @@ -604,9 +624,11 @@ maybeGetCabalDir = do Nothing -> do defaultDir <- getAppUserDataDirectory "cabal" dotCabalExists <- doesDirectoryExist defaultDir - return $ if dotCabalExists - then Just defaultDir - else Nothing + xdgCfg <- getXdgDirectory XdgConfig ("cabal" "config") + xdgCfgExists <- doesFileExist xdgCfg + if dotCabalExists && not xdgCfgExists + then return $ Just defaultDir + else return Nothing -- | The default behaviour of cabal-install is to use the XDG -- directory standard. However, if @CABAL_DIR@ is set, we instead use @@ -656,16 +678,6 @@ defaultReportsDir :: IO FilePath defaultReportsDir = getDefaultDir XdgCache "reports" -defaultExtraPath :: IO [FilePath] -defaultExtraPath = do - mDir <- maybeGetCabalDir - case mDir of - Just dir -> - return [dir "bin"] - Nothing -> do - dir <- getHomeDirectory - return [dir ".local" "bin"] - defaultInstallPath :: IO FilePath defaultInstallPath = do mDir <- maybeGetCabalDir @@ -737,12 +749,29 @@ addInfoForKnownRepos other = other -- defaultHackageRemoteRepoKeys :: [String] defaultHackageRemoteRepoKeys = - [ "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0", - "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42", - "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3", - "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d", - "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921" - ] + -- Key owners and public keys are provided as a convenience to readers. + -- The canonical source for this mapping data is the hackage-root-keys + -- repository and Hackage's root.json file. + -- + -- Links: + -- * https://github.com/haskell-infra/hackage-root-keys + -- * https://hackage.haskell.org/root.json + -- Please consult root.json on Hackage to map key IDs to public keys, + -- and the hackage-root-keys repository to map public keys to their + -- owners. + [ -- Adam Gundry (uRPdSiL3/MNsk50z6NB55ABo0OrrNDXigtCul4vtzmw=) + "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0" + , -- Gershom Bazerman (bYoUXXQ9TtX10UriaMiQtTccuXPGnmldP68djzZ7cLo=) + "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42" + , -- John Wiegley (zazm5w480r+zPO6Z0+8fjGuxZtb9pAuoVmQ+VkuCvgU=) + "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d" + , -- Norman Ramsey (ZI8di3a9Un0s2RBrt5GwVRvfOXVuywADfXGPZfkiDb0=) + "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921" + , -- Mathieu Boespflug (ydN1nGGQ79K1Q0nN+ul+Ln8MxikTB95w0YdGd3v3kmg=) + "be75553f3c7ba1dbe298da81f1d1b05c9d39dd8ed2616c9bddf1525ca8c03e48" + , -- Joachim Breitner (5iUgwqZCWrCJktqMx0bBMIuoIyT4A1RYGozzchRN9rA=) + "d26e46f3b631aae1433b89379a6c68bd417eb5d1c408f0643dcc07757fece522" + ] -- | The required threshold of root key signatures for hackage.haskell.org -- @@ -759,6 +788,7 @@ defaultHackageRemoteRepoKeyThreshold = 3 -- loadConfig :: Verbosity -> Flag FilePath -> IO SavedConfig loadConfig verbosity configFileFlag = do + warnOnTwoConfigs verbosity config <- loadRawConfig verbosity configFileFlag extendToEffectiveConfig config @@ -900,7 +930,8 @@ commentSavedConfig = do globalInstallDirs <- defaultInstallDirs defaultCompiler False True let conf0 = mempty { savedGlobalFlags = defaultGlobalFlags { - globalRemoteRepos = toNubList [defaultRemoteRepo] + globalRemoteRepos = toNubList [defaultRemoteRepo], + globalNix = mempty }, savedInitFlags = mempty { IT.interactive = toFlag False, @@ -1249,6 +1280,14 @@ parseConfig src initial = \str -> do , configConfigureArgs = splitMultiPath (configConfigureArgs scf) } + , savedGlobalFlags = + let sgf = savedGlobalFlags conf + in sgf { + globalProgPathExtra = + toNubList $ + splitMultiPath + (fromNubList $ globalProgPathExtra sgf) + } } parse = parseFields (configFieldDescriptions src diff --git a/cabal-install/src/Distribution/Client/Configure.hs b/cabal-install/src/Distribution/Client/Configure.hs index 554785ff847..2cbe16096a4 100644 --- a/cabal-install/src/Distribution/Client/Configure.hs +++ b/cabal-install/src/Distribution/Client/Configure.hs @@ -154,9 +154,6 @@ configure verbosity packageDBs repoCtxt comp platform progdb (fromFlagOrDefault (useDistPref defaultSetupScriptOptions) (configDistPref configFlags)) - (fromFlagOrDefault - (setupConfigDynamic defaultSetupScriptOptions) - (configDynExe configFlags)) (chooseCabalVersion configExFlags (flagToMaybe (configCabalVersion configExFlags))) @@ -170,7 +167,6 @@ configureSetupScript :: PackageDBStack -> Platform -> ProgramDb -> FilePath - -> Bool -> VersionRange -> Maybe Lock -> Bool @@ -182,7 +178,6 @@ configureSetupScript packageDBs platform progdb distPref - dynExe cabalVersion lock forceExternal @@ -214,7 +209,6 @@ configureSetupScript packageDBs , useDependenciesExclusive = not defaultSetupDeps && isJust explicitSetupDeps , useVersionMacros = not defaultSetupDeps && isJust explicitSetupDeps , isInteractive = False - , setupConfigDynamic = dynExe } where -- When we are compiling a legacy setup script without an explicit diff --git a/cabal-install/src/Distribution/Client/Dependency.hs b/cabal-install/src/Distribution/Client/Dependency.hs index c5cbba8d48e..11a48d8d6b5 100644 --- a/cabal-install/src/Distribution/Client/Dependency.hs +++ b/cabal-install/src/Distribution/Client/Dependency.hs @@ -397,24 +397,50 @@ dontUpgradeNonUpgradeablePackages params = | Set.notMember (mkPackageName "base") (depResolverTargets params) -- If you change this enumeration, make sure to update the list in -- "Distribution.Solver.Modular.Solver" as well - , pkgname <- [ mkPackageName "base" - , mkPackageName "ghc-bignum" - , mkPackageName "ghc-prim" - , mkPackageName "ghc-boot" - , mkPackageName "ghc" - , mkPackageName "ghci" - , mkPackageName "integer-gmp" - , mkPackageName "integer-simple" - , mkPackageName "template-haskell" - ] + , pkgname <- nonUpgradeablePackages , isInstalled pkgname ] isInstalled = not . null . InstalledPackageIndex.lookupPackageName (depResolverInstalledPkgIndex params) -addSourcePackages :: [UnresolvedSourcePackage] - -> DepResolverParams -> DepResolverParams +-- | The set of non-reinstallable packages includes those which cannot be +-- rebuilt using a GHC installation and Hackage-published source distribution. +-- There are a few reasons why this might be true: +-- +-- * the package overrides its unit ID (e.g. with ghc's @-this-unit-id@ flag), +-- which can result in multiple indistinguishable packages (having potentially +-- different ABIs) with the same unit ID. +-- +-- * the package contains definitions of wired-in declarations which tie +-- it to a particular compiler (e.g. we can't build link against +-- @base-4.18.0.0@ using GHC 9.6.1). +-- +-- * the package does not have a complete (that is, buildable) source distribution. +-- For instance, some packages provided by GHC rely on files outside of the +-- source tree generated by GHC's build system. +-- +-- Note: the list of non-upgradable/non-installable packages used to be +-- respectively in this module and in `Distribution.Solver.Modular.Solver`. +-- Since they were kept synced, they are now combined in the following list. +-- +-- See: https://github.com/haskell/cabal/issues/8581 and +-- https://github.com/haskell/cabal/issues/9064. +nonUpgradeablePackages :: [PackageName] +nonUpgradeablePackages = + [ mkPackageName "base" + , mkPackageName "ghc-bignum" + , mkPackageName "ghc-prim" + , mkPackageName "ghc" + , mkPackageName "integer-gmp" + , mkPackageName "integer-simple" + , mkPackageName "template-haskell" + ] + +addSourcePackages + :: [UnresolvedSourcePackage] + -> DepResolverParams + -> DepResolverParams addSourcePackages pkgs params = params { depResolverSourcePkgIndex = diff --git a/cabal-install/src/Distribution/Client/FetchUtils.hs b/cabal-install/src/Distribution/Client/FetchUtils.hs index 963a94c1aec..0a493d493f7 100644 --- a/cabal-install/src/Distribution/Client/FetchUtils.hs +++ b/cabal-install/src/Distribution/Client/FetchUtils.hs @@ -131,25 +131,29 @@ verifyFetchedTarball verbosity repoCtxt repo pkgid = case res of Left e -> warn verbosity ("Error verifying fetched tarball " ++ file ++ ", will redownload: " ++ show (e :: SomeException)) >> pure False Right b -> pure b - in handleError $ case repo of - -- a secure repo has hashes we can compare against to confirm this is the correct file. - RepoSecure{} -> - repoContextWithSecureRepo repoCtxt repo $ \repoSecure -> - Sec.withIndex repoSecure $ \callbacks -> - let warnAndFail s = warn verbosity ("Fetched tarball " ++ file ++ " does not match server, will redownload: " ++ s) >> return False - -- the do block in parens is due to dealing with the checked exceptions mechanism. - in (do fileInfo <- Sec.indexLookupFileInfo callbacks pkgid - sz <- Sec.FileLength . fromInteger <$> getFileSize file - if sz /= Sec.fileInfoLength (Sec.trusted fileInfo) - then warnAndFail "file length mismatch" - else do - res <- Sec.compareTrustedFileInfo (Sec.trusted fileInfo) <$> Sec.computeFileInfo (Sec.Path file :: Sec.Path Sec.Absolute) - if res - then pure True - else warnAndFail "file hash mismatch") + in handleError $ do + exists <- doesFileExist file + if not exists + then return True -- if the file does not exist, it vacuously passes validation, since it will be downloaded as necessary with what we will then check is a valid hash. + else case repo of + -- a secure repo has hashes we can compare against to confirm this is the correct file. + RepoSecure{} -> + repoContextWithSecureRepo repoCtxt repo $ \repoSecure -> + Sec.withIndex repoSecure $ \callbacks -> + let warnAndFail s = warn verbosity ("Fetched tarball " ++ file ++ " does not match server, will redownload: " ++ s) >> return False + -- the do block in parens is due to dealing with the checked exceptions mechanism. + in (do fileInfo <- Sec.indexLookupFileInfo callbacks pkgid + sz <- Sec.FileLength . fromInteger <$> getFileSize file + if sz /= Sec.fileInfoLength (Sec.trusted fileInfo) + then warnAndFail "file length mismatch" + else do + res <- Sec.compareTrustedFileInfo (Sec.trusted fileInfo) <$> Sec.computeFileInfo (Sec.Path file :: Sec.Path Sec.Absolute) + if res + then pure True + else warnAndFail "file hash mismatch") `Sec.catchChecked` (\(e :: Sec.InvalidPackageException) -> warnAndFail (show e)) `Sec.catchChecked` (\(e :: Sec.VerificationError) -> warnAndFail (show e)) - _ -> pure True + _ -> pure True -- | Fetch a package if we don't have it already. -- diff --git a/cabal-install/src/Distribution/Client/Get.hs b/cabal-install/src/Distribution/Client/Get.hs index d5670096991..c35b1ebd473 100644 --- a/cabal-install/src/Distribution/Client/Get.hs +++ b/cabal-install/src/Distribution/Client/Get.hs @@ -37,6 +37,8 @@ import Distribution.Simple.Program ( programName ) import Distribution.Types.SourceRepo (RepoKind (..)) import Distribution.Client.Types.SourceRepo (SourceRepositoryPackage (..), SourceRepoProxy, srpToProxy) +import Distribution.Utils.NubList + ( fromNubList ) import Distribution.Client.Setup ( GlobalFlags(..), GetFlags(..), RepoContext(..) ) @@ -54,6 +56,7 @@ import Distribution.PackageDescription.PrettyPrint import qualified Data.Map as Map import Control.Monad ( mapM_ ) + import System.Directory ( createDirectoryIfMissing, doesDirectoryExist, doesFileExist ) import System.FilePath @@ -70,7 +73,7 @@ get :: Verbosity get verbosity _ _ _ [] = notice verbosity "No packages requested. Nothing to do." -get verbosity repoCtxt _ getFlags userTargets = do +get verbosity repoCtxt globalFlags getFlags userTargets = do let useSourceRepo = case getSourceRepository getFlags of NoFlag -> False _ -> True @@ -121,7 +124,7 @@ get verbosity repoCtxt _ getFlags userTargets = do prefix = fromFlagOrDefault "" (getDestDir getFlags) clone :: [UnresolvedSourcePackage] -> IO () - clone = clonePackagesFromSourceRepo verbosity prefix kind + clone = clonePackagesFromSourceRepo verbosity prefix kind (fromNubList $ globalProgPathExtra globalFlags) . map (\pkg -> (packageId pkg, packageSourceRepos pkg)) where kind :: Maybe RepoKind @@ -278,18 +281,19 @@ instance Exception ClonePackageException where clonePackagesFromSourceRepo :: Verbosity -> FilePath -- ^ destination dir prefix -> Maybe RepoKind -- ^ preferred 'RepoKind' + -> [FilePath] -- ^ Extra prog paths -> [(PackageId, [PD.SourceRepo])] -- ^ the packages and their -- available 'SourceRepo's -> IO () clonePackagesFromSourceRepo verbosity destDirPrefix - preferredRepoKind pkgrepos = do + preferredRepoKind progPaths pkgrepos = do -- Do a bunch of checks and collect the required info pkgrepos' <- traverse preCloneChecks pkgrepos -- Configure the VCS drivers for all the repository types we may need - vcss <- configureVCSs verbosity $ + vcss <- configureVCSs verbosity progPaths $ Map.fromList [ (vcsRepoType vcs, vcs) | (_, _, vcs, _) <- pkgrepos' ] diff --git a/cabal-install/src/Distribution/Client/HashValue.hs b/cabal-install/src/Distribution/Client/HashValue.hs index 67117b231cc..3fc9c7ce9df 100644 --- a/cabal-install/src/Distribution/Client/HashValue.hs +++ b/cabal-install/src/Distribution/Client/HashValue.hs @@ -15,9 +15,9 @@ import Prelude () import qualified Hackage.Security.Client as Sec -import qualified Crypto.Hash.SHA256 as SHA256 -import qualified Data.ByteString.Base16 as Base16 -import qualified Data.ByteString.Char8 as BS +import qualified Crypto.Hash.SHA256 as SHA256 +import qualified Data.ByteString.Base16 as Base16 +import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy.Char8 as LBS import System.IO (IOMode (..), withBinaryFile) diff --git a/cabal-install/src/Distribution/Client/HttpUtils.hs b/cabal-install/src/Distribution/Client/HttpUtils.hs index 54c88d97ea5..67aa55a18ee 100644 --- a/cabal-install/src/Distribution/Client/HttpUtils.hs +++ b/cabal-install/src/Distribution/Client/HttpUtils.hs @@ -54,13 +54,12 @@ import System.IO.Error import Distribution.Simple.Program ( Program, simpleProgram, ConfiguredProgram, programPath , ProgramInvocation(..), programInvocation - , ProgramSearchPathEntry(..) , getProgramInvocationOutput ) import Distribution.Simple.Program.Db ( ProgramDb, emptyProgramDb, addKnownPrograms , configureAllKnownPrograms , requireProgram, lookupProgram - , modifyProgramSearchPath ) + , appendProgramSearchPath ) import Distribution.Simple.Program.Run ( getProgramInvocationOutputAndErrors ) import Numeric (showHex) @@ -336,7 +335,7 @@ configureTransport verbosity extraPath (Just name) = case find (\(name',_,_,_) -> name' == name) supportedTransports of Just (_, mprog, _tls, mkTrans) -> do - let baseProgDb = modifyProgramSearchPath (\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb + baseProgDb <- appendProgramSearchPath verbosity extraPath emptyProgramDb progdb <- case mprog of Nothing -> return emptyProgramDb Just prog -> snd <$> requireProgram verbosity prog baseProgDb @@ -356,7 +355,7 @@ configureTransport verbosity extraPath Nothing = do -- for all the transports except plain-http we need to try and find -- their external executable - let baseProgDb = modifyProgramSearchPath (\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb + baseProgDb <- appendProgramSearchPath verbosity extraPath emptyProgramDb progdb <- configureAllKnownPrograms verbosity $ addKnownPrograms [ prog | (_, Just prog, _, _) <- supportedTransports ] diff --git a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs index ca63d80ad37..046f7dd8084 100644 --- a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs +++ b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs @@ -356,14 +356,10 @@ licensePrompt flags = getLicense flags $ do else fmap prettyShow knownLicenses authorPrompt :: Interactive m => InitFlags -> m String -authorPrompt flags = getAuthor flags $ do - name <- guessAuthorName - promptStr "Author name" (DefaultPrompt name) +authorPrompt flags = getAuthor flags $ guessAuthorName >>= promptOrDefault "Author name" emailPrompt :: Interactive m => InitFlags -> m String -emailPrompt flags = getEmail flags $ do - email' <- guessAuthorEmail - promptStr "Maintainer email" (DefaultPrompt email') +emailPrompt flags = getEmail flags $ guessAuthorEmail >>= promptOrDefault "Maintainer email" homepagePrompt :: Interactive m => InitFlags -> m String homepagePrompt flags = getHomepage flags $ @@ -468,3 +464,6 @@ srcDirsPrompt flags = getSrcDirs flags $ do True return [dir] + +promptOrDefault :: Interactive m => String -> Maybe String -> m String +promptOrDefault s = maybe (promptStr s MandatoryPrompt) (promptStr s . DefaultPrompt) diff --git a/cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs b/cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs index 6f382f5807d..bc317247dfe 100644 --- a/cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs +++ b/cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs @@ -274,14 +274,16 @@ licenseHeuristics :: Interactive m => InitFlags -> m SpecLicense licenseHeuristics flags = getLicense flags $ guessLicense flags -- | The author's name. Prompt, or try to guess from an existing --- darcs repo. +-- git repo. authorHeuristics :: Interactive m => InitFlags -> m String -authorHeuristics flags = getAuthor flags guessAuthorEmail +authorHeuristics flags = guessAuthorName >>= + maybe (getAuthor flags $ return "Unknown") (getAuthor flags . return) -- | The author's email. Prompt, or try to guess from an existing --- darcs repo. +-- git repo. emailHeuristics :: Interactive m => InitFlags -> m String -emailHeuristics flags = getEmail flags guessAuthorName +emailHeuristics flags = guessAuthorEmail >>= + maybe (getEmail flags $ return "Unknown") (getEmail flags . return) -- | Prompt for a homepage URL for the package. homepageHeuristics :: Interactive m => InitFlags -> m String diff --git a/cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs b/cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs index ad947ec7ed2..04c49279871 100644 --- a/cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs +++ b/cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs @@ -151,18 +151,23 @@ guessSourceDirectories flags = do True -> ["src"] -- | Guess author and email using git configuration options. -guessAuthorName :: Interactive m => m String +guessAuthorName :: Interactive m => m (Maybe String) guessAuthorName = guessGitInfo "user.name" -guessAuthorEmail :: Interactive m => m String +guessAuthorEmail :: Interactive m => m (Maybe String) guessAuthorEmail = guessGitInfo "user.email" -guessGitInfo :: Interactive m => String -> m String +guessGitInfo :: Interactive m => String -> m (Maybe String) guessGitInfo target = do - info <- readProcessWithExitCode "git" ["config", "--local", target] "" - if null $ snd' info - then trim . snd' <$> readProcessWithExitCode "git" ["config", "--global", target] "" - else return . trim $ snd' info + localInfo <- readProcessWithExitCode "git" ["config", "--local", target] "" + if null $ snd' localInfo + then do + globalInfo <- readProcessWithExitCode "git" ["config", "--global", target] "" + case fst' globalInfo of + ExitSuccess -> return $ Just (trim $ snd' globalInfo) + _ -> return Nothing + else return $ Just (trim $ snd' localInfo) where + fst' (x, _, _) = x snd' (_, x, _) = x diff --git a/cabal-install/src/Distribution/Client/Install.hs b/cabal-install/src/Distribution/Client/Install.hs index a53c7ded1aa..2baa8af9e49 100644 --- a/cabal-install/src/Distribution/Client/Install.hs +++ b/cabal-install/src/Distribution/Client/Install.hs @@ -1059,7 +1059,6 @@ performInstallations verbosity platform progdb distPref - (fromFlagOrDefault (setupConfigDynamic defaultSetupScriptOptions) $ configDynExe configFlags) (chooseCabalVersion configExFlags (libVersion miscOptions)) (Just lock) parallelInstall diff --git a/cabal-install/src/Distribution/Client/Main.hs b/cabal-install/src/Distribution/Client/Main.hs new file mode 100644 index 00000000000..889fa634390 --- /dev/null +++ b/cabal-install/src/Distribution/Client/Main.hs @@ -0,0 +1,1013 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE ScopedTypeVariables #-} + +----------------------------------------------------------------------------- +-- | +-- Module : Main +-- Copyright : (c) David Himmelstrup 2005 +-- License : BSD-like +-- +-- Maintainer : lemmih@gmail.com +-- Stability : provisional +-- Portability : portable +-- +-- Entry point to the default cabal-install front-end. +-- +-- @since 3.10.0.0 +----------------------------------------------------------------------------- + +module Distribution.Client.Main (main) where + +import Distribution.Client.Setup + ( GlobalFlags(..), globalCommand, withRepoContext + , ConfigFlags(..) + , ConfigExFlags(..), defaultConfigExFlags, configureExCommand + , reconfigureCommand + , configCompilerAux', configPackageDB' + , BuildFlags(..) + , buildCommand, replCommand, testCommand, benchmarkCommand + , InstallFlags(..), defaultInstallFlags + , installCommand + , FetchFlags(..), fetchCommand + , FreezeFlags(..), freezeCommand + , genBoundsCommand + , GetFlags(..), getCommand, unpackCommand + , checkCommand + , formatCommand + , ListFlags(..), listCommand, listNeedsCompiler + , InfoFlags(..), infoCommand + , UploadFlags(..), uploadCommand + , ReportFlags(..), reportCommand + , runCommand + , InitFlags(initVerbosity, initHcPath), initCommand + , ActAsSetupFlags(..), actAsSetupCommand + , UserConfigFlags(..), userConfigCommand + , reportCommand + , manpageCommand + , haddockCommand + , cleanCommand + , copyCommand + , registerCommand + ) +import Distribution.Simple.Setup + ( HaddockTarget(..) + , HaddockFlags(..), defaultHaddockFlags + , HscolourFlags(..), hscolourCommand + , ReplFlags(..) + , CopyFlags(..) + , RegisterFlags(..) + , CleanFlags(..) + , TestFlags(..), BenchmarkFlags(..) + , Flag(..), fromFlag, fromFlagOrDefault, flagToMaybe, toFlag + , configAbsolutePaths + ) + +import Prelude () +import Distribution.Client.Compat.Prelude hiding (get) + +import Distribution.Client.SetupWrapper + ( setupWrapper, SetupScriptOptions(..), defaultSetupScriptOptions ) +import Distribution.Client.Config + ( SavedConfig(..), loadConfig, defaultConfigFile, userConfigDiff + , userConfigUpdate, createDefaultConfigFile, getConfigFilePath ) +import Distribution.Client.Targets + ( readUserTargets ) +import qualified Distribution.Client.List as List + ( list, info ) + +import qualified Distribution.Client.CmdConfigure as CmdConfigure +import qualified Distribution.Client.CmdUpdate as CmdUpdate +import qualified Distribution.Client.CmdBuild as CmdBuild +import qualified Distribution.Client.CmdRepl as CmdRepl +import qualified Distribution.Client.CmdFreeze as CmdFreeze +import qualified Distribution.Client.CmdHaddock as CmdHaddock +import qualified Distribution.Client.CmdHaddockProject as CmdHaddockProject +import qualified Distribution.Client.CmdInstall as CmdInstall +import qualified Distribution.Client.CmdRun as CmdRun +import qualified Distribution.Client.CmdTest as CmdTest +import qualified Distribution.Client.CmdBench as CmdBench +import qualified Distribution.Client.CmdExec as CmdExec +import qualified Distribution.Client.CmdClean as CmdClean +import qualified Distribution.Client.CmdSdist as CmdSdist +import qualified Distribution.Client.CmdListBin as CmdListBin +import qualified Distribution.Client.CmdOutdated as CmdOutdated +import Distribution.Client.CmdLegacy + +import Distribution.Client.Install (install) +import Distribution.Client.Configure (configure, writeConfigFlags) +import Distribution.Client.Fetch (fetch) +import Distribution.Client.Freeze (freeze) +import Distribution.Client.GenBounds (genBounds) +import Distribution.Client.Check as Check (check) +--import Distribution.Client.Clean (clean) +import qualified Distribution.Client.Upload as Upload +import Distribution.Client.Run (run, splitRunArgs) +import Distribution.Client.Get (get) +import Distribution.Client.Reconfigure (Check(..), reconfigure) +import Distribution.Client.Nix (nixInstantiate + ,nixShell + ) +import Distribution.Client.Sandbox (loadConfigOrSandboxConfig + ,findSavedDistPref + ,updateInstallDirs) +import Distribution.Client.Tar (createTarGzFile) +import Distribution.Client.Types.Credentials (Password (..)) +import Distribution.Client.Init (initCmd) +import Distribution.Client.Manpage (manpageCmd) +import Distribution.Client.ManpageFlags (ManpageFlags (..)) +import Distribution.Client.Utils + ( determineNumJobs, relaxEncodingErrors ) +import Distribution.Client.Signal + ( installTerminationHandler ) +import Distribution.Client.Version + ( cabalInstallVersion ) + +import Distribution.Package (packageId) +import Distribution.PackageDescription + ( BuildType(..), Executable(..), buildable ) + +import Distribution.PackageDescription.PrettyPrint + ( writeGenericPackageDescription ) +import qualified Distribution.Simple as Simple +import qualified Distribution.Make as Make +import qualified Distribution.Types.UnqualComponentName as Make +import Distribution.Simple.Build + ( startInterpreter ) +import Distribution.Simple.Command + ( CommandParse(..), CommandUI(..), Command, CommandSpec(..) + , CommandType(..), commandsRun, commandAddAction, hiddenCommand + , commandFromSpec, commandShowOptions ) +import Distribution.Simple.Compiler (PackageDBStack) +import Distribution.Simple.Configure + ( configCompilerAuxEx, ConfigStateFileError(..) + , getPersistBuildConfig, interpretPackageDbFlags + , tryGetPersistBuildConfig ) +import qualified Distribution.Simple.LocalBuildInfo as LBI +import Distribution.Simple.PackageDescription ( readGenericPackageDescription ) +import Distribution.Simple.Program (defaultProgramDb + ,configureAllKnownPrograms + ,simpleProgramInvocation + ,getProgramInvocationOutput) +import Distribution.Simple.Program.Db (reconfigurePrograms) +import qualified Distribution.Simple.Setup as Cabal +import Distribution.Simple.Utils + ( cabalVersion, die', dieNoVerbosity, info, notice, topHandler + , findPackageDesc, tryFindPackageDesc, createDirectoryIfMissingVerbose ) +import Distribution.Text + ( display ) +import Distribution.Verbosity as Verbosity + ( normal ) +import Distribution.Version + ( Version, mkVersion, orLaterVersion ) + +import Distribution.Compat.ResponseFile +import System.Environment (getProgName) +import System.FilePath ( dropExtension, splitExtension + , takeExtension, (), (<.>) ) +import System.IO ( BufferMode(LineBuffering), hSetBuffering + , hPutStrLn, stderr, stdout ) +import System.Directory ( doesFileExist, getCurrentDirectory + , withCurrentDirectory) +import Data.Monoid (Any(..)) +import Control.Exception (AssertionFailed, assert, try) + + +-- | Entry point +-- +main :: [String] -> IO () +main args = do + installTerminationHandler + -- Enable line buffering so that we can get fast feedback even when piped. + -- This is especially important for CI and build systems. + hSetBuffering stdout LineBuffering + + -- If the locale encoding for CLI doesn't support all Unicode characters, + -- printing to it may fail unless we relax the handling of encoding errors + -- when writing to stderr and stdout. + relaxEncodingErrors stdout + relaxEncodingErrors stderr + let (args0, args1) = break (== "--") args + + mainWorker =<< (++ args1) <$> expandResponse args0 + +-- | Check whether assertions are enabled and print a warning in that case. +warnIfAssertionsAreEnabled :: IO () +warnIfAssertionsAreEnabled = + assert False (return ()) `catch` + (\(_e :: AssertionFailed) -> hPutStrLn stderr assertionsEnabledMsg) + -- Andreas, 2022-12-30, issue #8654: + -- The verbosity machinery is not in place at this point (option -v not parsed), + -- so instead of using function @warn@, we print straight to stderr. + where + assertionsEnabledMsg = + "Warning: this is a debug build of cabal-install with assertions enabled." + +mainWorker :: [String] -> IO () +mainWorker args = do + topHandler $ + case commandsRun (globalCommand commands) commands args of + CommandHelp help -> printGlobalHelp help + CommandList opts -> printOptionsList opts + CommandErrors errs -> printErrors errs + CommandReadyToGo (globalFlags, commandParse) -> + case commandParse of + _ | fromFlagOrDefault False (globalVersion globalFlags) + -> printVersion + | fromFlagOrDefault False (globalNumericVersion globalFlags) + -> printNumericVersion + CommandHelp help -> printCommandHelp help + CommandList opts -> printOptionsList opts + + CommandErrors errs -> do + -- Check whether cabal is called from a script, like #!/path/to/cabal. + case args of + [] -> printErrors errs + script : scriptArgs -> CmdRun.validScript script >>= \case + False -> printErrors errs + True -> do + -- In main operation (not help, version etc.) print warning if assertions are on. + warnIfAssertionsAreEnabled + CmdRun.handleShebang script scriptArgs + + CommandReadyToGo action -> do + -- In main operation (not help, version etc.) print warning if assertions are on. + warnIfAssertionsAreEnabled + action globalFlags + + where + printCommandHelp help = do + pname <- getProgName + putStr (help pname) + printGlobalHelp help = do + pname <- getProgName + configFile <- defaultConfigFile + putStr (help pname) + putStr $ "\nYou can edit the cabal configuration file to set defaults:\n" + ++ " " ++ configFile ++ "\n" + exists <- doesFileExist configFile + unless exists $ + putStrLn $ "This file will be generated with sensible " + ++ "defaults if you run 'cabal update'." + printOptionsList = putStr . unlines + printErrors errs = dieNoVerbosity $ intercalate "\n" errs + printNumericVersion = putStrLn $ display cabalInstallVersion + printVersion = putStrLn $ "cabal-install version " + ++ display cabalInstallVersion + ++ "\ncompiled using version " + ++ display cabalVersion + ++ " of the Cabal library " + + commands = map commandFromSpec commandSpecs + commandSpecs = + [ regularCmd listCommand listAction + , regularCmd infoCommand infoAction + , regularCmd fetchCommand fetchAction + , regularCmd getCommand getAction + , regularCmd unpackCommand unpackAction + , regularCmd checkCommand checkAction + , regularCmd uploadCommand uploadAction + , regularCmd reportCommand reportAction + , regularCmd initCommand initAction + , regularCmd userConfigCommand userConfigAction + , regularCmd genBoundsCommand genBoundsAction + , regularCmd CmdOutdated.outdatedCommand CmdOutdated.outdatedAction + , wrapperCmd hscolourCommand hscolourVerbosity hscolourDistPref + , hiddenCmd formatCommand formatAction + , hiddenCmd actAsSetupCommand actAsSetupAction + , hiddenCmd manpageCommand (manpageAction commandSpecs) + , regularCmd CmdListBin.listbinCommand CmdListBin.listbinAction + + ] ++ concat + [ newCmd CmdConfigure.configureCommand CmdConfigure.configureAction + , newCmd CmdUpdate.updateCommand CmdUpdate.updateAction + , newCmd CmdBuild.buildCommand CmdBuild.buildAction + , newCmd CmdRepl.replCommand CmdRepl.replAction + , newCmd CmdFreeze.freezeCommand CmdFreeze.freezeAction + , newCmd CmdHaddock.haddockCommand CmdHaddock.haddockAction + , newCmd CmdHaddockProject.haddockProjectCommand + CmdHaddockProject.haddockProjectAction + , newCmd CmdInstall.installCommand CmdInstall.installAction + , newCmd CmdRun.runCommand CmdRun.runAction + , newCmd CmdTest.testCommand CmdTest.testAction + , newCmd CmdBench.benchCommand CmdBench.benchAction + , newCmd CmdExec.execCommand CmdExec.execAction + , newCmd CmdClean.cleanCommand CmdClean.cleanAction + , newCmd CmdSdist.sdistCommand CmdSdist.sdistAction + + , legacyCmd configureExCommand configureAction + , legacyCmd buildCommand buildAction + , legacyCmd replCommand replAction + , legacyCmd freezeCommand freezeAction + , legacyCmd haddockCommand haddockAction + , legacyCmd installCommand installAction + , legacyCmd runCommand runAction + , legacyCmd testCommand testAction + , legacyCmd benchmarkCommand benchmarkAction + , legacyCmd cleanCommand cleanAction + , legacyWrapperCmd copyCommand copyVerbosity copyDistPref + , legacyWrapperCmd registerCommand regVerbosity regDistPref + , legacyCmd reconfigureCommand reconfigureAction + ] + +type Action = GlobalFlags -> IO () + +-- Duplicated in Distribution.Client.CmdLegacy. Any changes must be +-- reflected there, as well. +regularCmd :: CommandUI flags -> (flags -> [String] -> action) + -> CommandSpec action +regularCmd ui action = + CommandSpec ui ((flip commandAddAction) action) NormalCommand + +hiddenCmd :: CommandUI flags -> (flags -> [String] -> action) + -> CommandSpec action +hiddenCmd ui action = + CommandSpec ui (\ui' -> hiddenCommand (commandAddAction ui' action)) + HiddenCommand + +wrapperCmd :: Monoid flags => CommandUI flags -> (flags -> Flag Verbosity) + -> (flags -> Flag String) -> CommandSpec Action +wrapperCmd ui verbosity distPref = + CommandSpec ui (\ui' -> wrapperAction ui' verbosity distPref) NormalCommand + +wrapperAction :: Monoid flags + => CommandUI flags + -> (flags -> Flag Verbosity) + -> (flags -> Flag String) + -> Command Action +wrapperAction command verbosityFlag distPrefFlag = + commandAddAction command + { commandDefaultFlags = mempty } $ \flags extraArgs globalFlags -> do + let verbosity = fromFlagOrDefault normal (verbosityFlag flags) + load <- try (loadConfigOrSandboxConfig verbosity globalFlags) + let config = either (\(SomeException _) -> mempty) id load + distPref <- findSavedDistPref config (distPrefFlag flags) + let setupScriptOptions = defaultSetupScriptOptions { useDistPref = distPref } + setupWrapper verbosity setupScriptOptions Nothing + command (const flags) (const extraArgs) + +configureAction :: (ConfigFlags, ConfigExFlags) + -> [String] -> Action +configureAction (configFlags, configExFlags) extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) + config <- updateInstallDirs (configUserInstall configFlags) + <$> loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (configDistPref configFlags) + nixInstantiate verbosity distPref True globalFlags config + nixShell verbosity distPref globalFlags config $ do + let configFlags' = savedConfigureFlags config `mappend` configFlags + configExFlags' = savedConfigureExFlags config `mappend` configExFlags + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, platform, progdb) <- configCompilerAuxEx configFlags' + + writeConfigFlags verbosity distPref (configFlags', configExFlags') + + -- What package database(s) to use + let packageDBs :: PackageDBStack + packageDBs + = interpretPackageDbFlags + (fromFlag (configUserInstall configFlags')) + (configPackageDBs configFlags') + + withRepoContext verbosity globalFlags' $ \repoContext -> + configure verbosity packageDBs repoContext + comp platform progdb configFlags' configExFlags' extraArgs + +reconfigureAction :: (ConfigFlags, ConfigExFlags) + -> [String] -> Action +reconfigureAction flags@(configFlags, _) _ globalFlags = do + let verbosity = fromFlagOrDefault normal (configVerbosity configFlags) + config <- updateInstallDirs (configUserInstall configFlags) + <$> loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (configDistPref configFlags) + let checkFlags = Check $ \_ saved -> do + let flags' = saved <> flags + unless (saved == flags') $ info verbosity message + pure (Any True, flags') + where + -- This message is correct, but not very specific: it will list all + -- of the new flags, even if some have not actually changed. The + -- *minimal* set of changes is more difficult to determine. + message = + "flags changed: " + ++ unwords (commandShowOptions configureExCommand flags) + nixInstantiate verbosity distPref True globalFlags config + _ <- + reconfigure configureAction + verbosity distPref NoFlag + checkFlags [] globalFlags config + pure () + +buildAction :: BuildFlags -> [String] -> Action +buildAction buildFlags extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (buildDistPref buildFlags) + -- Calls 'configureAction' to do the real work, so nothing special has to be + -- done to support sandboxes. + config' <- + reconfigure configureAction + verbosity distPref (buildNumJobs buildFlags) + mempty [] globalFlags config + nixShell verbosity distPref globalFlags config $ do + build verbosity config' distPref buildFlags extraArgs + + +-- | Actually do the work of building the package. This is separate from +-- 'buildAction' so that 'testAction' and 'benchmarkAction' do not invoke +-- 'reconfigure' twice. +build :: Verbosity -> SavedConfig -> FilePath -> BuildFlags -> [String] -> IO () +build verbosity config distPref buildFlags extraArgs = + setupWrapper verbosity setupOptions Nothing + (Cabal.buildCommand progDb) mkBuildFlags (const extraArgs) + where + progDb = defaultProgramDb + setupOptions = defaultSetupScriptOptions { useDistPref = distPref } + + mkBuildFlags version = filterBuildFlags version config buildFlags' + buildFlags' = buildFlags + { buildVerbosity = toFlag verbosity + , buildDistPref = toFlag distPref + } + +-- | Make sure that we don't pass new flags to setup scripts compiled against +-- old versions of Cabal. +filterBuildFlags :: Version -> SavedConfig -> BuildFlags -> BuildFlags +filterBuildFlags version config buildFlags + | version >= mkVersion [1,19,1] = buildFlags_latest + -- Cabal < 1.19.1 doesn't support 'build -j'. + | otherwise = buildFlags_pre_1_19_1 + where + buildFlags_pre_1_19_1 = buildFlags { + buildNumJobs = NoFlag + } + buildFlags_latest = buildFlags { + -- Take the 'jobs' setting config file into account. + buildNumJobs = Flag . Just . determineNumJobs $ + (numJobsConfigFlag `mappend` numJobsCmdLineFlag) + } + numJobsConfigFlag = installNumJobs . savedInstallFlags $ config + numJobsCmdLineFlag = buildNumJobs buildFlags + + +replAction :: ReplFlags -> [String] -> Action +replAction replFlags extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal (replVerbosity replFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (replDistPref replFlags) + cwd <- getCurrentDirectory + pkgDesc <- findPackageDesc cwd + let + -- There is a .cabal file in the current directory: start a REPL and load + -- the project's modules. + onPkgDesc = do + -- Calls 'configureAction' to do the real work, so nothing special has to + -- be done to support sandboxes. + _ <- + reconfigure configureAction + verbosity distPref NoFlag + mempty [] globalFlags config + let progDb = defaultProgramDb + setupOptions = defaultSetupScriptOptions + { useCabalVersion = orLaterVersion $ mkVersion [1,18,0] + , useDistPref = distPref + } + replFlags' = replFlags + { replVerbosity = toFlag verbosity + , replDistPref = toFlag distPref + } + + nixShell verbosity distPref globalFlags config $ + setupWrapper verbosity setupOptions Nothing (Cabal.replCommand progDb) (const replFlags') (const extraArgs) + + -- No .cabal file in the current directory: just start the REPL (possibly + -- using the sandbox package DB). + onNoPkgDesc = do + let configFlags = savedConfigureFlags config + (comp, platform, programDb) <- configCompilerAux' configFlags + programDb' <- reconfigurePrograms verbosity + (replProgramPaths replFlags) + (replProgramArgs replFlags) + programDb + nixShell verbosity distPref globalFlags config $ do + startInterpreter verbosity programDb' comp platform + (configPackageDB' configFlags) + + either (const onNoPkgDesc) (const onPkgDesc) pkgDesc + +installAction :: ( ConfigFlags, ConfigExFlags, InstallFlags + , HaddockFlags, TestFlags, BenchmarkFlags ) + -> [String] -> Action +installAction (configFlags, _, installFlags, _, _, _) _ globalFlags + | fromFlagOrDefault False (installOnly installFlags) = do + let verb = fromFlagOrDefault normal (configVerbosity configFlags) + config <- loadConfigOrSandboxConfig verb globalFlags + dist <- findSavedDistPref config (configDistPref configFlags) + let setupOpts = defaultSetupScriptOptions { useDistPref = dist } + setupWrapper + verb setupOpts Nothing + installCommand (const (mempty, mempty, mempty, mempty, mempty, mempty)) + (const []) + +installAction + ( configFlags, configExFlags, installFlags + , haddockFlags, testFlags, benchmarkFlags ) + extraArgs globalFlags = do + let verb = fromFlagOrDefault normal (configVerbosity configFlags) + config <- updateInstallDirs (configUserInstall configFlags) + <$> loadConfigOrSandboxConfig verb globalFlags + + dist <- findSavedDistPref config (configDistPref configFlags) + + do + targets <- readUserTargets verb extraArgs + + let configFlags' = maybeForceTests installFlags' $ + savedConfigureFlags config `mappend` + configFlags { configDistPref = toFlag dist } + configExFlags' = defaultConfigExFlags `mappend` + savedConfigureExFlags config `mappend` configExFlags + installFlags' = defaultInstallFlags `mappend` + savedInstallFlags config `mappend` installFlags + haddockFlags' = defaultHaddockFlags `mappend` + savedHaddockFlags config `mappend` + haddockFlags { haddockDistPref = toFlag dist } + testFlags' = Cabal.defaultTestFlags `mappend` + savedTestFlags config `mappend` + testFlags { testDistPref = toFlag dist } + benchmarkFlags' = Cabal.defaultBenchmarkFlags `mappend` + savedBenchmarkFlags config `mappend` + benchmarkFlags { benchmarkDistPref = toFlag dist } + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, platform, progdb) <- configCompilerAux' configFlags' + + -- TODO: Redesign ProgramDB API to prevent such problems as #2241 in the + -- future. + progdb' <- configureAllKnownPrograms verb progdb + + configFlags'' <- configAbsolutePaths configFlags' + + withRepoContext verb globalFlags' $ \repoContext -> + install verb + (configPackageDB' configFlags'') + repoContext + comp platform progdb' + globalFlags' configFlags'' configExFlags' + installFlags' haddockFlags' testFlags' benchmarkFlags' + targets + + where + -- '--run-tests' implies '--enable-tests'. + maybeForceTests installFlags' configFlags' = + if fromFlagOrDefault False (installRunTests installFlags') + then configFlags' { configTests = toFlag True } + else configFlags' + +testAction :: (BuildFlags, TestFlags) -> [String] -> GlobalFlags + -> IO () +testAction (buildFlags, testFlags) extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (testDistPref testFlags) + let buildFlags' = buildFlags + { buildVerbosity = testVerbosity testFlags } + checkFlags = Check $ \_ flags@(configFlags, configExFlags) -> + if fromFlagOrDefault False (configTests configFlags) + then pure (mempty, flags) + else do + info verbosity "reconfiguring to enable tests" + let flags' = ( configFlags { configTests = toFlag True } + , configExFlags + ) + pure (Any True, flags') + + _ <- + reconfigure configureAction + verbosity distPref (buildNumJobs buildFlags') + checkFlags [] globalFlags config + nixShell verbosity distPref globalFlags config $ do + let setupOptions = defaultSetupScriptOptions { useDistPref = distPref } + testFlags' = testFlags { testDistPref = toFlag distPref } + + -- The package was just configured, so the LBI must be available. + names <- componentNamesFromLBI verbosity distPref "test suites" + (\c -> case c of { LBI.CTest{} -> True; _ -> False }) + let extraArgs' + | null extraArgs = case names of + ComponentNamesUnknown -> [] + ComponentNames names' -> [ Make.unUnqualComponentName name + | LBI.CTestName name <- names' ] + | otherwise = extraArgs + + build verbosity config distPref buildFlags' extraArgs' + setupWrapper verbosity setupOptions Nothing Cabal.testCommand (const testFlags') (const extraArgs') + +data ComponentNames = ComponentNamesUnknown + | ComponentNames [LBI.ComponentName] + +-- | Return the names of all buildable components matching a given predicate. +componentNamesFromLBI :: Verbosity -> FilePath -> String + -> (LBI.Component -> Bool) + -> IO ComponentNames +componentNamesFromLBI verbosity distPref targetsDescr compPred = do + eLBI <- tryGetPersistBuildConfig distPref + case eLBI of + Left err -> case err of + -- Note: the build config could have been generated by a custom setup + -- script built against a different Cabal version, so it's crucial that + -- we ignore the bad version error here. + ConfigStateFileBadVersion _ _ _ -> return ComponentNamesUnknown + _ -> die' verbosity (show err) + Right lbi -> do + let pkgDescr = LBI.localPkgDescr lbi + names = map LBI.componentName + . filter (buildable . LBI.componentBuildInfo) + . filter compPred $ + LBI.pkgComponents pkgDescr + if null names + then do notice verbosity $ "Package has no buildable " + ++ targetsDescr ++ "." + exitSuccess -- See #3215. + + else return $! (ComponentNames names) + +benchmarkAction :: (BuildFlags, BenchmarkFlags) + -> [String] -> GlobalFlags + -> IO () +benchmarkAction + (buildFlags, benchmarkFlags) + extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal + (buildVerbosity buildFlags) + + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (benchmarkDistPref benchmarkFlags) + let buildFlags' = buildFlags + { buildVerbosity = benchmarkVerbosity benchmarkFlags } + + let checkFlags = Check $ \_ flags@(configFlags, configExFlags) -> + if fromFlagOrDefault False (configBenchmarks configFlags) + then pure (mempty, flags) + else do + info verbosity "reconfiguring to enable benchmarks" + let flags' = ( configFlags { configBenchmarks = toFlag True } + , configExFlags + ) + pure (Any True, flags') + + config' <- + reconfigure configureAction + verbosity distPref (buildNumJobs buildFlags') + checkFlags [] globalFlags config + nixShell verbosity distPref globalFlags config $ do + let setupOptions = defaultSetupScriptOptions { useDistPref = distPref } + benchmarkFlags'= benchmarkFlags { benchmarkDistPref = toFlag distPref } + + -- The package was just configured, so the LBI must be available. + names <- componentNamesFromLBI verbosity distPref "benchmarks" + (\c -> case c of { LBI.CBench{} -> True; _ -> False; }) + let extraArgs' + | null extraArgs = case names of + ComponentNamesUnknown -> [] + ComponentNames names' -> [ Make.unUnqualComponentName name + | LBI.CBenchName name <- names'] + | otherwise = extraArgs + + build verbosity config' distPref buildFlags' extraArgs' + setupWrapper verbosity setupOptions Nothing Cabal.benchmarkCommand (const benchmarkFlags') (const extraArgs') + +haddockAction :: HaddockFlags -> [String] -> Action +haddockAction haddockFlags extraArgs globalFlags = do + let verbosity = fromFlag (haddockVerbosity haddockFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (haddockDistPref haddockFlags) + config' <- + reconfigure configureAction + verbosity distPref NoFlag + mempty [] globalFlags config + nixShell verbosity distPref globalFlags config $ do + let haddockFlags' = defaultHaddockFlags `mappend` + savedHaddockFlags config' `mappend` + haddockFlags { haddockDistPref = toFlag distPref } + setupScriptOptions = defaultSetupScriptOptions + { useDistPref = distPref } + setupWrapper verbosity setupScriptOptions Nothing + haddockCommand (const haddockFlags') (const extraArgs) + when (haddockForHackage haddockFlags == Flag ForHackage) $ do + pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref) + let dest = distPref name <.> "tar.gz" + name = display (packageId pkg) ++ "-docs" + docDir = distPref "doc" "html" + createTarGzFile dest docDir name + notice verbosity $ "Documentation tarball created: " ++ dest + +cleanAction :: CleanFlags -> [String] -> Action +cleanAction cleanFlags extraArgs globalFlags = do + load <- try (loadConfigOrSandboxConfig verbosity globalFlags) + let config = either (\(SomeException _) -> mempty) id load + distPref <- findSavedDistPref config (cleanDistPref cleanFlags) + let setupScriptOptions = defaultSetupScriptOptions + { useDistPref = distPref + , useWin32CleanHack = True + } + cleanFlags' = cleanFlags { cleanDistPref = toFlag distPref } + setupWrapper verbosity setupScriptOptions Nothing + cleanCommand (const cleanFlags') (const extraArgs) + where + verbosity = fromFlagOrDefault normal (cleanVerbosity cleanFlags) + +listAction :: ListFlags -> [String] -> Action +listAction listFlags extraArgs globalFlags = do + let verbosity = fromFlag (listVerbosity listFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + let configFlags' = savedConfigureFlags config + configFlags = configFlags' + { configPackageDBs = configPackageDBs configFlags' + `mappend` listPackageDBs listFlags + , configHcPath = listHcPath listFlags + } + globalFlags' = savedGlobalFlags config `mappend` globalFlags + compProgdb <- if listNeedsCompiler listFlags + then do + (comp, _, progdb) <- configCompilerAux' configFlags + return (Just (comp, progdb)) + else return Nothing + withRepoContext verbosity globalFlags' $ \repoContext -> + List.list verbosity + (configPackageDB' configFlags) + repoContext + compProgdb + listFlags + extraArgs + +infoAction :: InfoFlags -> [String] -> Action +infoAction infoFlags extraArgs globalFlags = do + let verbosity = fromFlag (infoVerbosity infoFlags) + targets <- readUserTargets verbosity extraArgs + config <- loadConfigOrSandboxConfig verbosity globalFlags + let configFlags' = savedConfigureFlags config + configFlags = configFlags' { + configPackageDBs = configPackageDBs configFlags' + `mappend` infoPackageDBs infoFlags + } + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, _, progdb) <- configCompilerAuxEx configFlags + withRepoContext verbosity globalFlags' $ \repoContext -> + List.info verbosity + (configPackageDB' configFlags) + repoContext + comp + progdb + globalFlags' + infoFlags + targets + +fetchAction :: FetchFlags -> [String] -> Action +fetchAction fetchFlags extraArgs globalFlags = do + let verbosity = fromFlag (fetchVerbosity fetchFlags) + targets <- readUserTargets verbosity extraArgs + config <- loadConfig verbosity (globalConfigFile globalFlags) + let configFlags = savedConfigureFlags config + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, platform, progdb) <- configCompilerAux' configFlags + withRepoContext verbosity globalFlags' $ \repoContext -> + fetch verbosity + (configPackageDB' configFlags) + repoContext + comp platform progdb globalFlags' fetchFlags + targets + +freezeAction :: FreezeFlags -> [String] -> Action +freezeAction freezeFlags _extraArgs globalFlags = do + let verbosity = fromFlag (freezeVerbosity freezeFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config NoFlag + nixShell verbosity distPref globalFlags config $ do + let configFlags = savedConfigureFlags config + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, platform, progdb) <- configCompilerAux' configFlags + + withRepoContext verbosity globalFlags' $ \repoContext -> + freeze verbosity + (configPackageDB' configFlags) + repoContext + comp platform progdb + globalFlags' freezeFlags + +genBoundsAction :: FreezeFlags -> [String] -> GlobalFlags -> IO () +genBoundsAction freezeFlags _extraArgs globalFlags = do + let verbosity = fromFlag (freezeVerbosity freezeFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config NoFlag + nixShell verbosity distPref globalFlags config $ do + let configFlags = savedConfigureFlags config + globalFlags' = savedGlobalFlags config `mappend` globalFlags + (comp, platform, progdb) <- configCompilerAux' configFlags + + withRepoContext verbosity globalFlags' $ \repoContext -> + genBounds verbosity + (configPackageDB' configFlags) + repoContext + comp platform progdb + globalFlags' freezeFlags + +uploadAction :: UploadFlags -> [String] -> Action +uploadAction uploadFlags extraArgs globalFlags = do + config <- loadConfig verbosity (globalConfigFile globalFlags) + let uploadFlags' = savedUploadFlags config `mappend` uploadFlags + globalFlags' = savedGlobalFlags config `mappend` globalFlags + tarfiles = extraArgs + when (null tarfiles && not (fromFlag (uploadDoc uploadFlags'))) $ + die' verbosity "the 'upload' command expects at least one .tar.gz archive." + checkTarFiles extraArgs + maybe_password <- + case uploadPasswordCmd uploadFlags' + of Flag (xs:xss) -> Just . Password <$> + getProgramInvocationOutput verbosity + (simpleProgramInvocation xs xss) + _ -> pure $ flagToMaybe $ uploadPassword uploadFlags' + withRepoContext verbosity globalFlags' $ \repoContext -> do + if fromFlag (uploadDoc uploadFlags') + then do + when (length tarfiles > 1) $ + die' verbosity $ "the 'upload' command can only upload documentation " + ++ "for one package at a time." + tarfile <- maybe (generateDocTarball config) return $ listToMaybe tarfiles + Upload.uploadDoc verbosity + repoContext + (flagToMaybe $ uploadUsername uploadFlags') + maybe_password + (fromFlag (uploadCandidate uploadFlags')) + tarfile + else do + Upload.upload verbosity + repoContext + (flagToMaybe $ uploadUsername uploadFlags') + maybe_password + (fromFlag (uploadCandidate uploadFlags')) + tarfiles + where + verbosity = fromFlag (uploadVerbosity uploadFlags) + checkTarFiles tarfiles + | not (null otherFiles) + = die' verbosity $ "the 'upload' command expects only .tar.gz archives: " + ++ intercalate ", " otherFiles + | otherwise = sequence_ + [ do exists <- doesFileExist tarfile + unless exists $ die' verbosity $ "file not found: " ++ tarfile + | tarfile <- tarfiles ] + + where otherFiles = filter (not . isTarGzFile) tarfiles + isTarGzFile file = case splitExtension file of + (file', ".gz") -> takeExtension file' == ".tar" + _ -> False + generateDocTarball config = do + notice verbosity $ + "No documentation tarball specified. " + ++ "Building a documentation tarball with default settings...\n" + ++ "If you need to customise Haddock options, " + ++ "run 'haddock --for-hackage' first " + ++ "to generate a documentation tarball." + haddockAction (defaultHaddockFlags { haddockForHackage = Flag ForHackage }) + [] globalFlags + distPref <- findSavedDistPref config NoFlag + pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref) + return $ distPref display (packageId pkg) ++ "-docs" <.> "tar.gz" + +checkAction :: Flag Verbosity -> [String] -> Action +checkAction verbosityFlag extraArgs _globalFlags = do + let verbosity = fromFlag verbosityFlag + unless (null extraArgs) $ + die' verbosity $ "'check' doesn't take any extra arguments: " ++ unwords extraArgs + allOk <- Check.check (fromFlag verbosityFlag) + unless allOk exitFailure + +formatAction :: Flag Verbosity -> [String] -> Action +formatAction verbosityFlag extraArgs _globalFlags = do + let verbosity = fromFlag verbosityFlag + path <- case extraArgs of + [] -> do cwd <- getCurrentDirectory + tryFindPackageDesc verbosity cwd + (p:_) -> return p + pkgDesc <- readGenericPackageDescription verbosity path + -- Uses 'writeFileAtomic' under the hood. + writeGenericPackageDescription path pkgDesc + +reportAction :: ReportFlags -> [String] -> Action +reportAction reportFlags extraArgs globalFlags = do + let verbosity = fromFlag (reportVerbosity reportFlags) + unless (null extraArgs) $ + die' verbosity $ "'report' doesn't take any extra arguments: " ++ unwords extraArgs + config <- loadConfig verbosity (globalConfigFile globalFlags) + let globalFlags' = savedGlobalFlags config `mappend` globalFlags + reportFlags' = savedReportFlags config `mappend` reportFlags + + withRepoContext verbosity globalFlags' $ \repoContext -> + Upload.report verbosity repoContext + (flagToMaybe $ reportUsername reportFlags') + (flagToMaybe $ reportPassword reportFlags') + +runAction :: BuildFlags -> [String] -> Action +runAction buildFlags extraArgs globalFlags = do + let verbosity = fromFlagOrDefault normal (buildVerbosity buildFlags) + config <- loadConfigOrSandboxConfig verbosity globalFlags + distPref <- findSavedDistPref config (buildDistPref buildFlags) + config' <- + reconfigure configureAction + verbosity distPref (buildNumJobs buildFlags) + mempty [] globalFlags config + nixShell verbosity distPref globalFlags config $ do + lbi <- getPersistBuildConfig distPref + (exe, exeArgs) <- splitRunArgs verbosity lbi extraArgs + + build verbosity config' distPref buildFlags ["exe:" ++ display (exeName exe)] + run verbosity lbi exe exeArgs + +getAction :: GetFlags -> [String] -> Action +getAction getFlags extraArgs globalFlags = do + let verbosity = fromFlag (getVerbosity getFlags) + targets <- readUserTargets verbosity extraArgs + config <- loadConfigOrSandboxConfig verbosity globalFlags + let globalFlags' = savedGlobalFlags config `mappend` globalFlags + withRepoContext verbosity (savedGlobalFlags config) $ \repoContext -> + get verbosity + repoContext + globalFlags' + getFlags + targets + +unpackAction :: GetFlags -> [String] -> Action +unpackAction getFlags extraArgs globalFlags = do + getAction getFlags extraArgs globalFlags + +initAction :: InitFlags -> [String] -> Action +initAction initFlags extraArgs globalFlags = do + -- it takes the first value within extraArgs (if there's one) + -- and uses it as the root directory for the new project + case extraArgs of + [] -> initAction' + [projectDir] -> do + createDirectoryIfMissingVerbose verbosity True projectDir + withCurrentDirectory projectDir initAction' + _ -> die' verbosity $ + "'init' only takes a single, optional, extra " ++ + "argument for the project root directory" + where + initAction' = do + confFlags <- loadConfigOrSandboxConfig verbosity globalFlags + -- override with `--with-compiler` from CLI if available + let confFlags' = savedConfigureFlags confFlags `mappend` compFlags + initFlags' = savedInitFlags confFlags `mappend` initFlags + globalFlags' = savedGlobalFlags confFlags `mappend` globalFlags + + (comp, _, progdb) <- configCompilerAux' confFlags' + + withRepoContext verbosity globalFlags' $ \repoContext -> + initCmd verbosity (configPackageDB' confFlags') + repoContext comp progdb initFlags' + + verbosity = fromFlag (initVerbosity initFlags) + compFlags = mempty { configHcPath = initHcPath initFlags } + +userConfigAction :: UserConfigFlags -> [String] -> Action +userConfigAction ucflags extraArgs globalFlags = do + let verbosity = fromFlag (userConfigVerbosity ucflags) + frc = fromFlag (userConfigForce ucflags) + extraLines = fromFlag (userConfigAppendLines ucflags) + case extraArgs of + ("init":_) -> do + path <- configFile + fileExists <- doesFileExist path + if (not fileExists || (fileExists && frc)) + then void $ createDefaultConfigFile verbosity extraLines path + else die' verbosity $ path ++ " already exists." + ("diff":_) -> traverse_ putStrLn =<< userConfigDiff verbosity globalFlags extraLines + ("update":_) -> userConfigUpdate verbosity globalFlags extraLines + -- Error handling. + [] -> die' verbosity $ "Please specify a subcommand (see 'help user-config')" + _ -> die' verbosity $ "Unknown 'user-config' subcommand: " ++ unwords extraArgs + where configFile = getConfigFilePath (globalConfigFile globalFlags) + +-- | Used as an entry point when cabal-install needs to invoke itself +-- as a setup script. This can happen e.g. when doing parallel builds. +-- +actAsSetupAction :: ActAsSetupFlags -> [String] -> Action +actAsSetupAction actAsSetupFlags args _globalFlags = + let bt = fromFlag (actAsSetupBuildType actAsSetupFlags) + in case bt of + Simple -> Simple.defaultMainArgs args + Configure -> Simple.defaultMainWithHooksArgs + Simple.autoconfUserHooks args + Make -> Make.defaultMainArgs args + Custom -> error "actAsSetupAction Custom" + +manpageAction :: [CommandSpec action] -> ManpageFlags -> [String] -> Action +manpageAction commands flags extraArgs _ = do + let verbosity = fromFlag (manpageVerbosity flags) + unless (null extraArgs) $ + die' verbosity $ "'man' doesn't take any extra arguments: " ++ unwords extraArgs + pname <- getProgName + let cabalCmd = if takeExtension pname == ".exe" + then dropExtension pname + else pname + manpageCmd cabalCmd commands flags diff --git a/cabal-install/src/Distribution/Client/ProjectConfig.hs b/cabal-install/src/Distribution/Client/ProjectConfig.hs index 83184d5902c..9d15c4d5137 100644 --- a/cabal-install/src/Distribution/Client/ProjectConfig.hs +++ b/cabal-install/src/Distribution/Client/ProjectConfig.hs @@ -31,6 +31,7 @@ module Distribution.Client.ProjectConfig ( readProjectLocalFreezeConfig, reportParseResult, showProjectConfig, + withGlobalConfig, withProjectOrGlobalConfig, writeProjectLocalExtraConfig, writeProjectLocalFreezeConfig, @@ -462,6 +463,15 @@ renderBadProjectRoot :: BadProjectRoot -> String renderBadProjectRoot (BadProjectRootExplicitFile projectFile) = "The given project file '" ++ projectFile ++ "' does not exist." +withGlobalConfig + :: Verbosity -- ^ verbosity + -> Flag FilePath -- ^ @--cabal-config@ + -> (ProjectConfig -> IO a) -- ^ with global + -> IO a +withGlobalConfig verbosity gcf with = do + globalConfig <- runRebuild "" $ readGlobalConfig verbosity gcf + with globalConfig + withProjectOrGlobalConfig :: Verbosity -- ^ verbosity -> Flag Bool -- ^ whether to ignore local project (--ignore-project flag) @@ -1139,11 +1149,10 @@ syncAndReadSourcePackagesRemoteRepos verbosity [ ((rtype, rloc), [(repo, vcsRepoType vcs)]) | (repo, rloc, rtype, vcs) <- repos' ] - --TODO: pass progPathExtra on to 'configureVCS' - let _progPathExtra = fromNubList projectConfigProgPathExtra + let progPathExtra = fromNubList projectConfigProgPathExtra getConfiguredVCS <- delayInitSharedResources $ \repoType -> let vcs = Map.findWithDefault (error $ "Unknown VCS: " ++ prettyShow repoType) repoType knownVCSs in - configureVCS verbosity {-progPathExtra-} vcs + configureVCS verbosity progPathExtra vcs concat <$> sequenceA [ rerunIfChanged verbosity monitor repoGroup' $ do diff --git a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs index da67b8a3ef4..3e77ae346ca 100644 --- a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs +++ b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs @@ -190,7 +190,7 @@ data CurrentCommand = InstallCommand | HaddockCommand | BuildCommand | ReplComma deriving (Show, Eq) -- | This holds the context of a project prior to solving: the content of the --- @cabal.project@ and all the local package @.cabal@ files. +-- @cabal.project@, @cabal/config@ and all the local package @.cabal@ files. -- data ProjectBaseContext = ProjectBaseContext { distDirLayout :: DistDirLayout, diff --git a/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs b/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs index fde7ea8b97a..c9243c310e0 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanOutput.hs @@ -272,9 +272,9 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig = comp2str = prettyShow style2str :: Bool -> BuildStyle -> String - style2str _ BuildAndInstall = "global" style2str True _ = "local" style2str False BuildInplaceOnly = "inplace" + style2str False BuildAndInstall = "global" jdisplay :: Pretty a => a -> J.Value jdisplay = J.String . prettyShow diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning.hs b/cabal-install/src/Distribution/Client/ProjectPlanning.hs index 978af213b1b..395e5e9dcb3 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning.hs @@ -321,9 +321,17 @@ rebuildProjectConfig verbosity } cliConfig = do + progsearchpath <- liftIO $ getSystemSearchPath + + let fileMonitorProjectConfig = newFileMonitor (distProjectCacheFile "config") + fileMonitorProjectConfigKey <- do configPath <- getConfigFilePath projectConfigConfigFile - return (configPath, distProjectFile "") + return (configPath, distProjectFile "", + (projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg), + progsearchpath, + packageConfigProgramPaths, + packageConfigProgramPathExtra) (projectConfig, localPackages) <- runRebuild distProjectRootDirectory @@ -354,18 +362,11 @@ rebuildProjectConfig verbosity where - ProjectConfigShared { projectConfigConfigFile } = + ProjectConfigShared { projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg, projectConfigIgnoreProject, projectConfigConfigFile } = projectConfigShared cliConfig - ProjectConfigShared { projectConfigIgnoreProject } = - projectConfigShared cliConfig - - fileMonitorProjectConfig :: - FileMonitor - (FilePath, FilePath) - (ProjectConfig, [PackageSpecifier UnresolvedSourcePackage]) - fileMonitorProjectConfig = - newFileMonitor (distProjectCacheFile "config") + PackageConfig { packageConfigProgramPaths, packageConfigProgramPathExtra } = + projectConfigLocalPackages cliConfig -- Read the cabal.project (or implicit config) and combine it with -- arguments from the command line @@ -425,10 +426,12 @@ configureCompiler verbosity packageConfigProgramPathExtra) $ do liftIO $ info verbosity "Compiler settings changed, reconfiguring..." - result@(_, _, progdb') <- liftIO $ + progdb <- liftIO $ appendProgramSearchPath verbosity (fromNubList packageConfigProgramPathExtra) defaultProgramDb + let progdb' = userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) progdb + result@(_, _, progdb'') <- liftIO $ Cabal.configCompilerEx hcFlavor hcPath hcPkg - progdb verbosity + progdb' verbosity -- Note that we added the user-supplied program locations and args -- for /all/ programs, not just those for the compiler prog and @@ -436,19 +439,14 @@ configureCompiler verbosity -- the compiler will configure (and it does vary between compilers). -- We do know however that the compiler will only configure the -- programs it cares about, and those are the ones we monitor here. - monitorFiles (programsMonitorFiles progdb') + monitorFiles (programsMonitorFiles progdb'') return result where hcFlavor = flagToMaybe projectConfigHcFlavor hcPath = flagToMaybe projectConfigHcPath hcPkg = flagToMaybe projectConfigHcPkg - progdb = - userSpecifyPaths (Map.toList (getMapLast packageConfigProgramPaths)) - . modifyProgramSearchPath - ([ ProgramSearchPathDir dir - | dir <- fromNubList packageConfigProgramPathExtra ] ++) - $ defaultProgramDb + -- | Return an up-to-date elaborated install plan. @@ -672,7 +670,6 @@ rebuildInstallPlan verbosity projectConfigAllPackages, projectConfigLocalPackages, projectConfigSpecificPackage, - projectPackagesNamed, projectConfigBuildOnly } (compiler, platform, progdb) pkgConfigDB @@ -698,7 +695,6 @@ rebuildInstallPlan verbosity localPackages sourcePackageHashes installDirs - projectPackagesNamed projectConfigShared projectConfigAllPackages projectConfigLocalPackages @@ -935,7 +931,7 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do _ -> Right (pkgid, repo) | (pkgid, RepoTarballPackage repo _ _) <- allPkgLocations ] - (repoTarballPkgsWithMetadata, repoTarballPkgsToRedownload) <- fmap partitionEithers $ + (repoTarballPkgsWithMetadata, repoTarballPkgsToDownloadWithMeta) <- fmap partitionEithers $ liftIO $ withRepoCtx $ \repoctx -> forM repoTarballPkgsWithMetadataUnvalidated $ \x@(pkg, repo) -> verifyFetchedTarball verbosity repoctx repo pkg >>= \b -> case b of True -> return $ Left x @@ -944,7 +940,7 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do -- For tarballs from repos that do not have hashes available we now have -- to check if the packages were downloaded already. -- - (repoTarballPkgsToDownload', + (repoTarballPkgsToDownloadWithNoMeta, repoTarballPkgsDownloaded) <- fmap partitionEithers $ liftIO $ sequence @@ -954,7 +950,7 @@ getPackageSourceHashes verbosity withRepoCtx solverPlan = do Just tarball -> return (Right (pkgid, tarball)) | (pkgid, repo) <- repoTarballPkgsWithoutMetadata ] - let repoTarballPkgsToDownload = repoTarballPkgsToRedownload ++ repoTarballPkgsToDownload' + let repoTarballPkgsToDownload = repoTarballPkgsToDownloadWithMeta ++ repoTarballPkgsToDownloadWithNoMeta (hashesFromRepoMetadata, repoTarballPkgsNewlyDownloaded) <- -- Avoid having to initialise the repository (ie 'withRepoCtx') if we @@ -1202,6 +1198,7 @@ planPackages verbosity comp platform solver SolverSettings{..} -- respective major Cabal version bundled with the respective GHC -- release). -- + -- etc. -- GHC 9.2 needs Cabal >= 3.6 -- GHC 9.0 needs Cabal >= 3.4 -- GHC 8.10 needs Cabal >= 3.2 @@ -1218,6 +1215,8 @@ planPackages verbosity comp platform solver SolverSettings{..} -- TODO: long-term, this compatibility matrix should be -- stored as a field inside 'Distribution.Compiler.Compiler' setupMinCabalVersionConstraint + | isGHC, compVer >= mkVersion [9,8] = mkVersion [3,10,2] + | isGHC, compVer >= mkVersion [9,6] = mkVersion [3,10] | isGHC, compVer >= mkVersion [9,4] = mkVersion [3,8] | isGHC, compVer >= mkVersion [9,2] = mkVersion [3,6] | isGHC, compVer >= mkVersion [9,0] = mkVersion [3,4] @@ -1363,7 +1362,6 @@ elaborateInstallPlan -> [PackageSpecifier (SourcePackage (PackageLocation loc))] -> Map PackageId PackageSourceHash -> InstallDirs.InstallDirTemplates - -> [PackageVersionConstraint] -> ProjectConfigShared -> PackageConfig -> PackageConfig @@ -1375,7 +1373,6 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB solverPlan localPackages sourcePackageHashes defaultInstallDirs - extraPackages sharedPackageConfig allPackagesConfig localPackagesConfig @@ -2046,21 +2043,15 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB $ map packageId $ SolverInstallPlan.reverseDependencyClosure solverPlan - (map PlannedId (Set.toList pkgsInplaceToProject)) + (map PlannedId (Set.toList pkgsLocalToProject)) isLocalToProject :: Package pkg => pkg -> Bool isLocalToProject pkg = Set.member (packageId pkg) pkgsLocalToProject - pkgsInplaceToProject :: Set PackageId - pkgsInplaceToProject = - Set.fromList (catMaybes (map shouldBeLocal localPackages)) - --TODO: localPackages is a misnomer, it's all project packages - -- here is where we decide which ones will be local! - pkgsLocalToProject :: Set PackageId pkgsLocalToProject = - Set.fromList (catMaybes (map (isInLocal extraPackages) localPackages)) + Set.fromList (catMaybes (map shouldBeLocal localPackages)) --TODO: localPackages is a misnomer, it's all project packages -- here is where we decide which ones will be local! @@ -2129,28 +2120,6 @@ shouldBeLocal (SpecificSourcePackage pkg) = case srcpkgSource pkg of LocalUnpackedPackage _ -> Just (packageId pkg) _ -> Nothing --- Used to determine which packages are affected by local package configuration --- flags like ‘--enable-shared --enable-executable-dynamic --disable-library-vanilla’. -isInLocal :: [PackageVersionConstraint] -> PackageSpecifier (SourcePackage (PackageLocation loc)) -> Maybe PackageId -isInLocal _ NamedPackage{} = Nothing -isInLocal _extraPackages (SpecificSourcePackage pkg) = case srcpkgSource pkg of - LocalUnpackedPackage _ -> Just (packageId pkg) - -- LocalTarballPackage is matched here too, because otherwise ‘sdistize’ - -- produces for ‘localPackages’ in the ‘ProjectBaseContext’ a - -- LocalTarballPackage, and ‘shouldBeLocal’ will make flags like - -- ‘--disable-library-vanilla’ have no effect for a typical - -- ‘cabal install --lib --enable-shared enable-executable-dynamic --disable-library-vanilla’, - -- as these flags would apply to local packages, but the sdist would - -- erroneously not get categorized as a local package, so the flags would be - -- ignored and produce a package with an unchanged hash. - LocalTarballPackage _ -> Just (packageId pkg) - -- TODO: the docs say ‘extra-packages’ is implemented in cabal project - -- files. We can fix that here by checking that the version range matches. - --RemoteTarballPackage _ -> _ - --RepoTarballPackage _ -> _ - --RemoteSourceRepoPackage _ -> _ - _ -> Nothing - -- | Given a 'ElaboratedPlanPackage', report if it matches a 'ComponentName'. matchPlanPkg :: (ComponentName -> Bool) -> ElaboratedPlanPackage -> Bool matchPlanPkg p = InstallPlan.foldPlanPackage (p . ipiComponentName) (matchElabPkg p) @@ -3425,13 +3394,15 @@ setupHsScriptOptions (ReadyPackage elab@ElaboratedConfiguredPackage{..}) useDistPref = builddir, useLoggingHandle = Nothing, -- this gets set later useWorkingDir = Just srcdir, - useExtraPathEnv = elabExeDependencyPaths elab, + useExtraPathEnv = elabExeDependencyPaths elab ++ elabProgramPathExtra, + -- note that the above adds the extra-prog-path directly following the elaborated + -- dep paths, so that it overrides the normal path, but _not_ the elaborated extensions + -- for build-tools-depends. useExtraEnvOverrides = dataDirsEnvironmentForPlan distdir plan, useWin32CleanHack = False, --TODO: [required eventually] forceExternalSetupMethod = isParallelBuild, setupCacheLock = Just cacheLock, - isInteractive = False, - setupConfigDynamic = elabDynExe + isInteractive = False } diff --git a/cabal-install/src/Distribution/Client/ScriptUtils.hs b/cabal-install/src/Distribution/Client/ScriptUtils.hs index db377c8f10a..6f692fa2ebf 100644 --- a/cabal-install/src/Distribution/Client/ScriptUtils.hs +++ b/cabal-install/src/Distribution/Client/ScriptUtils.hs @@ -9,7 +9,8 @@ module Distribution.Client.ScriptUtils ( getScriptHash, getScriptCacheDirectory, ensureScriptCacheDirectory, withContextAndSelectors, AcceptNoTargets(..), TargetContext(..), updateContextAndWriteProjectFile, updateContextAndWriteProjectFile', - fakeProjectSourcePackage, lSrcpkgDescription + fakeProjectSourcePackage, lSrcpkgDescription, + movedExePath ) where import Prelude () @@ -24,22 +25,24 @@ import Distribution.Client.ProjectOrchestration import Distribution.Client.Config ( defaultScriptBuildsDir ) import Distribution.Client.DistDirLayout - ( DistDirLayout(..) ) + ( DistDirLayout(..), DistDirParams(..) ) import Distribution.Client.HashValue - ( hashValue, showHashValue ) + ( hashValue, showHashValue, truncateHash ) import Distribution.Client.HttpUtils ( HttpTransport, configureTransport ) import Distribution.Client.NixStyleOptions ( NixStyleFlags (..) ) import Distribution.Client.ProjectConfig - ( ProjectConfig(..), ProjectConfigShared(..) - , reportParseResult, withProjectOrGlobalConfig + ( ProjectConfig(..), ProjectConfigShared(..), PackageConfig(..) + , reportParseResult, withGlobalConfig, withProjectOrGlobalConfig , projectConfigHttpTransport ) import Distribution.Client.ProjectConfig.Legacy ( ProjectConfigSkeleton , parseProjectSkeleton, instantiateProjectConfigSkeletonFetchingCompiler ) import Distribution.Client.ProjectFlags ( flagIgnoreProject ) +import Distribution.Client.ProjectPlanning + ( ElaboratedSharedConfig(..), ElaboratedConfiguredPackage(..) ) import Distribution.Client.RebuildMonad ( runRebuild ) import Distribution.Client.Setup @@ -48,6 +51,8 @@ import Distribution.Client.TargetSelector ( TargetSelectorProblem(..), TargetString(..) ) import Distribution.Client.Types ( PackageLocation(..), PackageSpecifier(..), UnresolvedSourcePackage ) +import Distribution.Compiler + ( CompilerId(..), perCompilerFlavorToList ) import Distribution.FieldGrammar ( parseFieldGrammar, takeFields ) import Distribution.Fields @@ -67,7 +72,7 @@ import Distribution.Simple.PackageDescription import Distribution.Simple.Setup ( Flag(..) ) import Distribution.Simple.Compiler - ( compilerInfo ) + ( Compiler(..), OptimisationLevel(..), compilerInfo ) import Distribution.Simple.Utils ( createDirectoryIfMissingVerbose, createTempDirectory, die', handleDoesNotExist, readUTF8File, warn, writeUTF8File ) import qualified Distribution.SPDX.License as SPDX @@ -77,6 +82,8 @@ import Distribution.System ( Platform(..) ) import Distribution.Types.BuildInfo ( BuildInfo(..) ) +import Distribution.Types.ComponentId + ( mkComponentId ) import Distribution.Types.CondTree ( CondTree(..) ) import Distribution.Types.Executable @@ -87,6 +94,10 @@ import Distribution.Types.PackageDescription ( PackageDescription(..), emptyPackageDescription ) import Distribution.Types.PackageName.Magic ( fakePackageCabalFileName, fakePackageId ) +import Distribution.Types.UnitId + ( newSimpleUnitId ) +import Distribution.Types.UnqualComponentName + ( UnqualComponentName ) import Distribution.Utils.NubList ( fromNubList ) import Distribution.Client.ProjectPlanning @@ -106,7 +117,7 @@ import qualified Data.Set as S import System.Directory ( canonicalizePath, doesFileExist, getTemporaryDirectory, removeDirectoryRecursive ) import System.FilePath - ( (), takeFileName ) + ( (), makeRelative, takeDirectory, takeFileName ) import qualified Text.Parsec as P -- A note on multi-module script support #6787: @@ -120,12 +131,18 @@ import qualified Text.Parsec as P -- repl to deal with the fact that the repl is relative to the working directory and not -- the project root. --- | Get the hash of a script's absolute path) +-- | Get the hash of a script's absolute path. -- -- Two hashes will be the same as long as the absolute paths -- are the same. getScriptHash :: FilePath -> IO String -getScriptHash script = showHashValue . hashValue . fromString <$> canonicalizePath script +getScriptHash script = + -- Truncation here tries to help with long path issues on Windows. + showHashValue + . truncateHash 26 + . hashValue + . fromString + <$> canonicalizePath script -- | Get the directory for caching a script build. -- @@ -177,7 +194,7 @@ withContextAndSelectors -> IO b withContextAndSelectors noTargets kind flags@NixStyleFlags {..} targetStrings globalFlags cmd act = withTemporaryTempDirectory $ \mkTmpDir -> do - (tc, ctx) <- withProjectOrGlobalConfig verbosity ignoreProject globalConfigFlag with (without mkTmpDir) + (tc, ctx) <- withProjectOrGlobalConfig verbosity ignoreProject globalConfigFlag withProject (withoutProject mkTmpDir) (tc', ctx', sels) <- case targetStrings of -- Only script targets may contain spaces and or end with ':'. @@ -209,19 +226,25 @@ withContextAndSelectors noTargets kind flags@NixStyleFlags {..} targetStrings gl globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig) defaultTarget = [TargetPackage TargetExplicitNamed [fakePackageId] Nothing] - with = do + withProject = do ctx <- establishProjectBaseContext verbosity cliConfig cmd return (ProjectContext, ctx) - without mkDir globalConfig = do - distDirLayout <- establishDummyDistDirLayout verbosity (globalConfig <> cliConfig) =<< mkDir + withoutProject mkTmpDir globalConfig = do + distDirLayout <- establishDummyDistDirLayout verbosity (globalConfig <> cliConfig) =<< mkTmpDir ctx <- establishDummyProjectBaseContext verbosity (globalConfig <> cliConfig) distDirLayout [] cmd return (GlobalContext, ctx) + + scriptBaseCtx script globalConfig = do + let noDistDir = mempty { projectConfigShared = mempty { projectConfigDistDir = Flag "" } } + let cfg = noDistDir <> globalConfig <> cliConfig + rootDir <- ensureScriptCacheDirectory verbosity script + distDirLayout <- establishDummyDistDirLayout verbosity cfg rootDir + establishDummyProjectBaseContext verbosity cfg distDirLayout [] cmd + scriptOrError script err = do exists <- doesFileExist script if exists then do - -- In the script case we always want a dummy context even when ignoreProject is False - let mkCacheDir = ensureScriptCacheDirectory verbosity script - (_, ctx) <- withProjectOrGlobalConfig verbosity (Flag True) globalConfigFlag with (without mkCacheDir) + ctx <- withGlobalConfig verbosity globalConfigFlag (scriptBaseCtx script) let projectRoot = distProjectRootDirectory $ distDirLayout ctx writeFile (projectRoot "scriptlocation") =<< canonicalizePath script @@ -236,14 +259,22 @@ withContextAndSelectors noTargets kind flags@NixStyleFlags {..} targetStrings gl projectCfgSkeleton <- readProjectBlockFromScript verbosity httpTransport (distDirLayout ctx) (takeFileName script) scriptContents - let fetchCompiler = do - (compiler, Platform arch os, _) <- runRebuild (distProjectRootDirectory . distDirLayout $ ctx) $ configureCompiler verbosity (distDirLayout ctx) ((fst $ ignoreConditions projectCfgSkeleton) <> projectConfig ctx) - pure (os, arch, compilerInfo compiler) + createDirectoryIfMissingVerbose verbosity True (distProjectCacheDirectory $ distDirLayout ctx) + (compiler, platform@(Platform arch os), _) <- runRebuild projectRoot $ configureCompiler verbosity (distDirLayout ctx) (fst (ignoreConditions projectCfgSkeleton) <> projectConfig ctx) + + projectCfg <- instantiateProjectConfigSkeletonFetchingCompiler (pure (os, arch, compilerInfo compiler)) mempty projectCfgSkeleton + + let ctx' = ctx & lProjectConfig %~ (<> projectCfg) - projectCfg <- instantiateProjectConfigSkeletonFetchingCompiler fetchCompiler mempty projectCfgSkeleton + build_dir = distBuildDirectory (distDirLayout ctx') $ (scriptDistDirParams script) ctx' compiler platform + exePath = build_dir "bin" scriptExeFileName script + exePathRel = makeRelative projectRoot exePath + + executable' = executable & L.buildInfo . L.defaultLanguage %~ maybe (Just Haskell2010) Just + & L.buildInfo . L.options %~ fmap (setExePath exePathRel) + + createDirectoryIfMissingVerbose verbosity True (takeDirectory exePath) - let executable' = executable & L.buildInfo . L.defaultLanguage %~ maybe (Just Haskell2010) Just - ctx' = ctx & lProjectConfig %~ (<> projectCfg) return (ScriptContext script executable', ctx', defaultTarget) else reportTargetSelectorProblems verbosity err @@ -260,6 +291,36 @@ withTemporaryTempDirectory act = newEmptyMVar >>= \m -> bracket (getMkTmp m) (rm return tmpDir rmTmp m _ = tryTakeMVar m >>= maybe (return ()) (handleDoesNotExist () . removeDirectoryRecursive) +scriptComponenetName :: IsString s => FilePath -> s +scriptComponenetName scriptPath = fromString cname + where + cname = "script-" ++ map censor (takeFileName scriptPath) + censor c | c `S.member` ccNamecore = c + | otherwise = '_' + +scriptExeFileName :: FilePath -> FilePath +scriptExeFileName scriptPath = "cabal-script-" ++ takeFileName scriptPath + +scriptDistDirParams :: FilePath -> ProjectBaseContext -> Compiler -> Platform -> DistDirParams +scriptDistDirParams scriptPath ctx compiler platform = DistDirParams + { distParamUnitId = newSimpleUnitId cid + , distParamPackageId = fakePackageId + , distParamComponentId = cid + , distParamComponentName = Just $ CExeName cn + , distParamCompilerId = compilerId compiler + , distParamPlatform = platform + , distParamOptimization = fromFlagOrDefault NormalOptimisation optimization + } + where + cn = scriptComponenetName scriptPath + cid = mkComponentId $ prettyShow fakePackageId <> "-inplace-" <> prettyShow cn + optimization = (packageConfigOptimization . projectConfigLocalPackages . projectConfig) ctx + +setExePath :: FilePath -> [String] -> [String] +setExePath exePath options + | "-o" `notElem` options = "-o" : exePath : options + | otherwise = options + -- | Add the 'SourcePackage' to the context and use it to write a .cabal file. updateContextAndWriteProjectFile' :: ProjectBaseContext -> SourcePackage (PackageLocation (Maybe FilePath)) -> IO ProjectBaseContext updateContextAndWriteProjectFile' ctx srcPkg = do @@ -284,15 +345,9 @@ updateContextAndWriteProjectFile ctx scriptPath scriptExecutable = do absScript <- canonicalizePath scriptPath let - -- Replace characters which aren't allowed in the executable component name with '_' - -- Prefix with "cabal-script-" to make it clear to end users that the name may be mangled - scriptExeName = "cabal-script-" ++ map censor (takeFileName scriptPath) - censor c | c `S.member` ccNamecore = c - | otherwise = '_' - sourcePackage = fakeProjectSourcePackage projectRoot & lSrcpkgDescription . L.condExecutables - .~ [(fromString scriptExeName, CondNode executable (targetBuildDepends $ buildInfo executable) [])] + .~ [(scriptComponenetName scriptPath, CondNode executable (targetBuildDepends $ buildInfo executable) [])] executable = scriptExecutable & L.modulePath .~ absScript @@ -395,6 +450,15 @@ fakeProjectSourcePackage projectRoot = sourcePackage , licenseRaw = Left SPDX.NONE } +-- | Find the path of an exe that has been relocated with a "-o" option +movedExePath :: UnqualComponentName -> DistDirLayout -> ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> Maybe FilePath +movedExePath selectedComponent distDirLayout elabShared elabConfigured = do + exe <- find ((== selectedComponent) . exeName) . executables $ elabPkgDescription elabConfigured + let CompilerId flavor _ = (compilerId . pkgConfigCompiler) elabShared + opts <- lookup flavor (perCompilerFlavorToList . options $ buildInfo exe) + let projectRoot = distProjectRootDirectory distDirLayout + fmap (projectRoot ) . lookup "-o" $ reverse (zip opts (drop 1 opts)) + -- Lenses -- | A lens for the 'srcpkgDescription' field of 'SourcePackage' lSrcpkgDescription :: Lens' (SourcePackage loc) GenericPackageDescription diff --git a/cabal-install/src/Distribution/Client/Setup.hs b/cabal-install/src/Distribution/Client/Setup.hs index 6db91d9cf98..385f0a0a672 100644 --- a/cabal-install/src/Distribution/Client/Setup.hs +++ b/cabal-install/src/Distribution/Client/Setup.hs @@ -72,7 +72,11 @@ import Distribution.Client.IndexUtils.IndexState import qualified Distribution.Client.Init.Types as IT import qualified Distribution.Client.Init.Defaults as IT import Distribution.Client.Targets - ( UserConstraint, readUserConstraint ) + ( UserConstraint + , readUserConstraint + ) +import Distribution.Deprecated.ParseUtils (parseSpaceList, parseTokenQ) +import Distribution.Deprecated.ReadP (readP_to_E) import Distribution.Utils.NubList ( NubList, toNubList, fromNubList) @@ -369,7 +373,7 @@ globalCommand commands = CommandUI { optArg' "(True or False)" (maybeToFlag . (readMaybe =<<)) (\case Flag True -> [Just "enable"] Flag False -> [Just "disable"] - NoFlag -> [Just "disable"]) "" ["nix"] + NoFlag -> []) "" ["nix"] -- Must be empty because we need to return PP.empty from viewAsFieldDescr "Nix integration: run commands through nix-shell if a 'shell.nix' file exists (default is False)", noArg (Flag True) [] ["enable-nix"] "Enable Nix integration: run commands through nix-shell if a 'shell.nix' file exists", @@ -2004,51 +2008,77 @@ defaultUploadFlags = UploadFlags { } uploadCommand :: CommandUI UploadFlags -uploadCommand = CommandUI { - commandName = "upload", - commandSynopsis = "Uploads source packages or documentation to Hackage.", - commandDescription = Nothing, - commandNotes = Just $ \_ -> - "You can store your Hackage login in the ~/.config/cabal/config file\n" - ++ relevantConfigValuesText ["username", "password", "password-command"], - commandUsage = \pname -> - "Usage: " ++ pname ++ " upload [FLAGS] TARFILES\n", - commandDefaultFlags = defaultUploadFlags, - commandOptions = \_ -> - [optionVerbosity uploadVerbosity - (\v flags -> flags { uploadVerbosity = v }) - - ,option [] ["publish"] - "Publish the package instead of uploading it as a candidate." - uploadCandidate (\v flags -> flags { uploadCandidate = v }) - (noArg (Flag IsPublished)) - - ,option ['d'] ["documentation"] - ("Upload documentation instead of a source package. " - ++ "By default, this uploads documentation for a package candidate. " - ++ "To upload documentation for " - ++ "a published package, combine with --publish.") - uploadDoc (\v flags -> flags { uploadDoc = v }) - trueArg - - ,option ['u'] ["username"] - "Hackage username." - uploadUsername (\v flags -> flags { uploadUsername = v }) - (reqArg' "USERNAME" (toFlag . Username) - (flagToList . fmap unUsername)) - - ,option ['p'] ["password"] - "Hackage password." - uploadPassword (\v flags -> flags { uploadPassword = v }) - (reqArg' "PASSWORD" (toFlag . Password) - (flagToList . fmap unPassword)) - - ,option ['P'] ["password-command"] - "Command to get Hackage password." - uploadPasswordCmd (\v flags -> flags { uploadPasswordCmd = v }) - (reqArg' "PASSWORD" (Flag . words) (fromMaybe [] . flagToMaybe)) - ] - } +uploadCommand = + CommandUI + { commandName = "upload" + , commandSynopsis = "Uploads source packages or documentation to Hackage." + , commandDescription = Nothing + , commandNotes = Just $ \_ -> + "You can store your Hackage login in the ~/.config/cabal/config file\n" + ++ relevantConfigValuesText ["username", "password", "password-command"] + , commandUsage = \pname -> + "Usage: " ++ pname ++ " upload [FLAGS] TARFILES\n" + , commandDefaultFlags = defaultUploadFlags + , commandOptions = \_ -> + [ optionVerbosity + uploadVerbosity + (\v flags -> flags{uploadVerbosity = v}) + , option + [] + ["publish"] + "Publish the package instead of uploading it as a candidate." + uploadCandidate + (\v flags -> flags{uploadCandidate = v}) + (noArg (Flag IsPublished)) + , option + ['d'] + ["documentation"] + ( "Upload documentation instead of a source package. " + ++ "By default, this uploads documentation for a package candidate. " + ++ "To upload documentation for " + ++ "a published package, combine with --publish." + ) + uploadDoc + (\v flags -> flags{uploadDoc = v}) + trueArg + , option + ['u'] + ["username"] + "Hackage username." + uploadUsername + (\v flags -> flags{uploadUsername = v}) + ( reqArg' + "USERNAME" + (toFlag . Username) + (flagToList . fmap unUsername) + ) + , option + ['p'] + ["password"] + "Hackage password." + uploadPassword + (\v flags -> flags{uploadPassword = v}) + ( reqArg' + "PASSWORD" + (toFlag . Password) + (flagToList . fmap unPassword) + ) + , option + ['P'] + ["password-command"] + "Command to get Hackage password." + uploadPasswordCmd + (\v flags -> flags{uploadPasswordCmd = v}) + ( reqArg + "COMMAND" + ( readP_to_E + ("Cannot parse command: " ++) + (Flag <$> parseSpaceList parseTokenQ) + ) + (flagElim [] (pure . unwords . fmap show)) + ) + ] + } instance Monoid UploadFlags where mempty = gmempty diff --git a/cabal-install/src/Distribution/Client/SetupWrapper.hs b/cabal-install/src/Distribution/Client/SetupWrapper.hs index 239e1a37908..23a788a8997 100644 --- a/cabal-install/src/Distribution/Client/SetupWrapper.hs +++ b/cabal-install/src/Distribution/Client/SetupWrapper.hs @@ -29,6 +29,7 @@ import Distribution.Client.Compat.Prelude import Distribution.CabalSpecVersion (cabalSpecMinimumLibraryVersion) import qualified Distribution.Make as Make import qualified Distribution.Simple as Simple + import Distribution.Version ( Version, mkVersion, versionNumbers, VersionRange, anyVersion , intersectVersionRanges, orLaterVersion @@ -59,9 +60,10 @@ import Distribution.Simple.Program ( ProgramDb, emptyProgramDb , getProgramSearchPath, getDbProgramOutput, runDbProgram, ghcProgram , ghcjsProgram ) +import Distribution.Simple.Program.Db + ( appendProgramSearchPath ) import Distribution.Simple.Program.Find - ( programSearchPathAsPATHVar - , ProgramSearchPathEntry(ProgramSearchPathDir) ) + ( programSearchPathAsPATHVar ) import Distribution.Simple.Program.Run ( getEffectiveEnvironment ) import qualified Distribution.Simple.Program.Strip as Strip @@ -71,7 +73,7 @@ import Distribution.Simple.BuildPaths import Distribution.Simple.Command ( CommandUI(..), commandShowOptions ) import Distribution.Simple.Program.GHC - ( GhcMode(..), GhcDynLinkMode(..), GhcOptions(..), renderGhcOptions ) + ( GhcMode(..), GhcOptions(..), renderGhcOptions ) import qualified Distribution.Simple.PackageIndex as PackageIndex import Distribution.Simple.PackageIndex (InstalledPackageIndex) import qualified Distribution.InstalledPackageInfo as IPI @@ -249,12 +251,7 @@ data SetupScriptOptions = SetupScriptOptions { -- | Is the task we are going to run an interactive foreground task, -- or an non-interactive background task? Based on this flag we -- decide whether or not to delegate ctrl+c to the spawned task - isInteractive :: Bool, - - -- Also track build output artifact configuration. - - -- | Pass `-dynamic` to `ghc` for dynamic rather than static linking. - setupConfigDynamic :: Bool + isInteractive :: Bool } defaultSetupScriptOptions :: SetupScriptOptions @@ -277,8 +274,7 @@ defaultSetupScriptOptions = SetupScriptOptions { useWin32CleanHack = False, forceExternalSetupMethod = False, setupCacheLock = Nothing, - isInteractive = False, - setupConfigDynamic = False + isInteractive = False } workingDir :: SetupScriptOptions -> FilePath @@ -449,9 +445,9 @@ invoke verbosity path args options = do Nothing -> return () Just logHandle -> info verbosity $ "Redirecting build log to " ++ show logHandle - searchpath <- programSearchPathAsPATHVar - (map ProgramSearchPathDir (useExtraPathEnv options) ++ - getProgramSearchPath (useProgramDb options)) + progDb <- appendProgramSearchPath verbosity (useExtraPathEnv options) (useProgramDb options) + + searchpath <- programSearchPathAsPATHVar $ getProgramSearchPath progDb env <- getEffectiveEnvironment $ [ ("PATH", Just searchpath) , ("HASKELL_DIST_DIR", Just (useDistPref options)) @@ -846,9 +842,6 @@ getExternalSetupMethod verbosity options pkg bt = do -- --ghc-option=-v instead! ghcOptVerbosity = Flag (min verbosity normal) , ghcOptMode = Flag GhcModeMake - , ghcOptDynLinkMode = case setupConfigDynamic options'' of - True -> Flag GhcDynamicOnly - False -> Flag GhcStaticOnly , ghcOptInputFiles = toNubListR [setupHs] , ghcOptOutputFile = Flag setupProgFile , ghcOptObjDir = Flag setupDir diff --git a/cabal-install/src/Distribution/Client/Tar.hs b/cabal-install/src/Distribution/Client/Tar.hs index d59dcf8160a..f9b146a3dd4 100644 --- a/cabal-install/src/Distribution/Client/Tar.hs +++ b/cabal-install/src/Distribution/Client/Tar.hs @@ -14,10 +14,11 @@ -- Reading, writing and manipulating \"@.tar@\" archive files. -- ----------------------------------------------------------------------------- -module Distribution.Client.Tar ( - -- * @tar.gz@ operations + +module Distribution.Client.Tar + ( -- * @tar.gz@ operations createTarGzFile, - extractTarGzFile, + TarComp.extractTarGzFile, -- * Other local utils buildTreeRefTypeCode, @@ -31,12 +32,11 @@ module Distribution.Client.Tar ( import Distribution.Client.Compat.Prelude import Prelude () -import qualified Data.ByteString.Lazy as BS -import qualified Codec.Archive.Tar as Tar +import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar -import qualified Codec.Archive.Tar.Check as Tar -import qualified Codec.Compression.GZip as GZip -import qualified Distribution.Client.GZipUtils as GZipUtils +import qualified Codec.Compression.GZip as GZip +import qualified Data.ByteString.Lazy as BS +import qualified Distribution.Client.Compat.Tar as TarComp -- for foldEntries... import Control.Exception (throw) @@ -52,26 +52,6 @@ createTarGzFile :: FilePath -- ^ Full Tarball path createTarGzFile tar base dir = BS.writeFile tar . GZip.compress . Tar.write =<< Tar.pack base [dir] -extractTarGzFile :: FilePath -- ^ Destination directory - -> FilePath -- ^ Expected subdir (to check for tarbombs) - -> FilePath -- ^ Tarball - -> IO () -extractTarGzFile dir expected tar = - Tar.unpack dir . Tar.checkTarbomb expected . Tar.read - . GZipUtils.maybeDecompress =<< BS.readFile tar - -instance (Exception a, Exception b) => Exception (Either a b) where - toException (Left e) = toException e - toException (Right e) = toException e - - fromException e = - case fromException e of - Just e' -> Just (Left e') - Nothing -> case fromException e of - Just e' -> Just (Right e') - Nothing -> Nothing - - -- | Type code for the local build tree reference entry type. We don't use the -- symbolic link entry type because it allows only 100 ASCII characters for the -- path. diff --git a/cabal-install/src/Distribution/Client/VCS.hs b/cabal-install/src/Distribution/Client/VCS.hs index 8b0a95462da..04803c6a4f5 100644 --- a/cabal-install/src/Distribution/Client/VCS.hs +++ b/cabal-install/src/Distribution/Client/VCS.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NamedFieldPuns, RecordWildCards, RankNTypes #-} @@ -49,12 +50,17 @@ import Distribution.Simple.Program , simpleProgram, findProgramVersion , ProgramInvocation(..), programInvocation, runProgramInvocation, getProgramInvocationOutput , emptyProgramDb, requireProgram ) +import Distribution.Simple.Program.Db + ( appendProgramSearchPath ) import Distribution.Version ( mkVersion ) import qualified Distribution.PackageDescription as PD +#if !MIN_VERSION_base(4,18,0) import Control.Applicative ( liftA2 ) +#endif + import Control.Exception ( throw, try ) import Control.Monad.Trans @@ -165,17 +171,20 @@ validateSourceRepos rs = configureVCS :: Verbosity + -> [FilePath] -- ^ Extra prog paths -> VCS Program -> IO (VCS ConfiguredProgram) -configureVCS verbosity vcs@VCS{vcsProgram = prog} = - asVcsConfigured <$> requireProgram verbosity prog emptyProgramDb +configureVCS verbosity progPaths vcs@VCS{vcsProgram = prog} = do + progPath <- appendProgramSearchPath verbosity progPaths emptyProgramDb + asVcsConfigured <$> requireProgram verbosity prog progPath where asVcsConfigured (prog', _) = vcs { vcsProgram = prog' } configureVCSs :: Verbosity + -> [FilePath] -- ^ Extra prog paths -> Map RepoType (VCS Program) -> IO (Map RepoType (VCS ConfiguredProgram)) -configureVCSs verbosity = traverse (configureVCS verbosity) +configureVCSs verbosity progPaths = traverse (configureVCS verbosity progPaths) -- ------------------------------------------------------------ diff --git a/cabal-install/src/Distribution/Client/Version.hs b/cabal-install/src/Distribution/Client/Version.hs index 36f10ea3df0..0c499fe6484 100644 --- a/cabal-install/src/Distribution/Client/Version.hs +++ b/cabal-install/src/Distribution/Client/Version.hs @@ -6,11 +6,9 @@ module Distribution.Client.Version import Distribution.Version --- This value determines the `cabal-install --version` output. --- --- It is used in several places throughout the project, including anonymous build reports, client configuration, --- and project planning output. Historically, this was a @Paths_*@ module, however, this conflicted with --- program coverage information generated by HPC, and hence was moved to be a standalone value. --- +import qualified Paths_cabal_install as PackageInfo + +-- | +-- This value determines the output of `cabal-install --version`. cabalInstallVersion :: Version -cabalInstallVersion = mkVersion [3,9] +cabalInstallVersion = mkVersion' PackageInfo.version diff --git a/cabal-install/src/Distribution/Deprecated/ParseUtils.hs b/cabal-install/src/Distribution/Deprecated/ParseUtils.hs index 6ac62a6e82d..a4b6fbec836 100644 --- a/cabal-install/src/Distribution/Deprecated/ParseUtils.hs +++ b/cabal-install/src/Distribution/Deprecated/ParseUtils.hs @@ -21,25 +21,43 @@ {-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE Rank2Types #-} -module Distribution.Deprecated.ParseUtils ( - LineNo, PError(..), PWarning(..), locatedErrorMsg, syntaxError, warning, - runP, runE, ParseResult(..), parseFail, showPWarning, - Field(..), lineNo, - FieldDescr(..), readFields, - parseHaskellString, parseTokenQ, - parseOptCommaList, - showFilePath, showToken, showFreeText, - field, simpleField, listField, listFieldWithSep, spaceListField, - newLineListField, - liftField, - readPToMaybe, - - fieldParsec, simpleFieldParsec, - listFieldParsec, - commaListFieldParsec, - commaNewLineListFieldParsec, - - UnrecFieldParser, +module Distribution.Deprecated.ParseUtils + ( LineNo + , PError (..) + , PWarning (..) + , locatedErrorMsg + , syntaxError + , warning + , runP + , runE + , ParseResult (..) + , parseFail + , showPWarning + , Field (..) + , lineNo + , FieldDescr (..) + , readFields + , parseHaskellString + , parseTokenQ + , parseSpaceList + , parseOptCommaList + , showFilePath + , showToken + , showFreeText + , field + , simpleField + , listField + , listFieldWithSep + , spaceListField + , newLineListField + , liftField + , readPToMaybe + , fieldParsec + , simpleFieldParsec + , listFieldParsec + , commaListFieldParsec + , commaNewLineListFieldParsec + , UnrecFieldParser ) where import Distribution.Client.Compat.Prelude hiding (get) diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index 6b81643fe0b..3d8ea79c238 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -37,20 +37,20 @@ import Distribution.Solver.Types.ConstraintSource import Distribution.Solver.Types.PackageConstraint ( PackageProperty(PackagePropertySource) ) -import qualified Distribution.Client.CmdBuild as CmdBuild -import qualified Distribution.Client.CmdRepl as CmdRepl -import qualified Distribution.Client.CmdRun as CmdRun -import qualified Distribution.Client.CmdTest as CmdTest -import qualified Distribution.Client.CmdBench as CmdBench -import qualified Distribution.Client.CmdHaddock as CmdHaddock -import qualified Distribution.Client.CmdListBin as CmdListBin +import qualified Distribution.Client.CmdBuild as CmdBuild +import qualified Distribution.Client.CmdRepl as CmdRepl +import qualified Distribution.Client.CmdRun as CmdRun +import qualified Distribution.Client.CmdTest as CmdTest +import qualified Distribution.Client.CmdBench as CmdBench +import qualified Distribution.Client.CmdHaddock as CmdHaddock +import qualified Distribution.Client.CmdListBin as CmdListBin import Distribution.Package import Distribution.PackageDescription import Distribution.InstalledPackageInfo (InstalledPackageInfo) import Distribution.Simple.Setup (toFlag, HaddockFlags(..), defaultHaddockFlags) import Distribution.Client.Setup (globalCommand) -import Distribution.Client.Config (loadConfig, SavedConfig(savedGlobalFlags)) +import Distribution.Client.Config (loadConfig, SavedConfig(savedGlobalFlags), createDefaultConfigFile) import Distribution.Simple.Compiler import Distribution.Simple.Command import qualified Distribution.Simple.Flag as Flag @@ -59,9 +59,15 @@ import Distribution.Version import Distribution.ModuleName (ModuleName) import Distribution.Text import Distribution.Utils.Path +import qualified Distribution.Client.CmdHaddockProject as CmdHaddockProject +import Distribution.Client.Setup (globalStoreDir) +import Distribution.Client.GlobalFlags (defaultGlobalFlags) +import Distribution.Simple.Setup (HaddockProjectFlags(..), defaultHaddockProjectFlags) import qualified Data.Map as Map import qualified Data.Set as Set +import Data.List (isInfixOf) + import Control.Monad import Control.Concurrent (threadDelay) import Control.Exception hiding (assert) @@ -73,6 +79,7 @@ import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.Options import Data.Tagged (Tagged(..)) +import qualified Data.List as L import qualified Data.ByteString as BS import Distribution.Client.GlobalFlags (GlobalFlags, globalNix) @@ -149,8 +156,12 @@ tests config = , testGroup "Flag tests" $ [ testCase "Test Nix Flag" testNixFlags, + testCase "Test Config options for commented options" testConfigOptionComments, testCase "Test Ignore Project Flag" testIgnoreProjectFlag ] + , testGroup "haddock-project" + [ testCase "dependencies" (testHaddockProjectDependencies config) + ] ] testFindProjectRoot :: Assertion @@ -1591,7 +1602,7 @@ testProgramOptionsLocal config0 = do (Just [ghcFlag]) (getProgArgs localPackages "q") assertEqual "p" - (Just [ghcFlag]) + Nothing (getProgArgs localPackages "p") where testdir = "regression/program-options" @@ -1958,13 +1969,12 @@ testNixFlags = do Nothing @=? (fromFlag . globalNix . fromJust $ nixDefaultFlags) -- Config file options - defaultConfig <- loadConfig verbosity (Flag (basedir "nix-config/default-config")) trueConfig <- loadConfig verbosity (Flag (basedir "nix-config/nix-true")) falseConfig <- loadConfig verbosity (Flag (basedir "nix-config/nix-false")) - Nothing @=? (fromFlag . globalNix . savedGlobalFlags $ defaultConfig) Just True @=? (fromFlag . globalNix . savedGlobalFlags $ trueConfig) Just False @=? (fromFlag . globalNix . savedGlobalFlags $ falseConfig) + where fromFlag :: Flag Bool -> Maybe Bool fromFlag (Flag x) = Just x @@ -1973,6 +1983,225 @@ testNixFlags = do getFlags cui (CommandReadyToGo (mkflags, _)) = Just . mkflags . commandDefaultFlags $ cui getFlags _ _ = Nothing +-- Tests whether config options are commented or not +testConfigOptionComments :: Assertion +testConfigOptionComments = do + _ <- createDefaultConfigFile verbosity [] (basedir "config/default-config") + defaultConfigFile <- readFile (basedir "config/default-config") + + " url" @=? findLineWith False "url" defaultConfigFile + " -- secure" @=? findLineWith True "secure" defaultConfigFile + " -- root-keys" @=? findLineWith True "root-keys" defaultConfigFile + " -- key-threshold" @=? findLineWith True "key-threshold" defaultConfigFile + + "-- ignore-expiry" @=? findLineWith True "ignore-expiry" defaultConfigFile + "-- http-transport" @=? findLineWith True "http-transport" defaultConfigFile + "-- nix" @=? findLineWith True "nix" defaultConfigFile + "-- store-dir" @=? findLineWith True "store-dir" defaultConfigFile + "-- active-repositories" @=? findLineWith True "active-repositories" defaultConfigFile + "-- local-no-index-repo" @=? findLineWith True "local-no-index-repo" defaultConfigFile + "remote-repo-cache" @=? findLineWith False "remote-repo-cache" defaultConfigFile + "-- logs-dir" @=? findLineWith True "logs-dir" defaultConfigFile + "-- default-user-config" @=? findLineWith True "default-user-config" defaultConfigFile + "-- verbose" @=? findLineWith True "verbose" defaultConfigFile + "-- compiler" @=? findLineWith True "compiler" defaultConfigFile + "-- cabal-file" @=? findLineWith True "cabal-file" defaultConfigFile + "-- with-compiler" @=? findLineWith True "with-compiler" defaultConfigFile + "-- with-hc-pkg" @=? findLineWith True "with-hc-pkg" defaultConfigFile + "-- program-prefix" @=? findLineWith True "program-prefix" defaultConfigFile + "-- program-suffix" @=? findLineWith True "program-suffix" defaultConfigFile + "-- library-vanilla" @=? findLineWith True "library-vanilla" defaultConfigFile + "-- library-profiling" @=? findLineWith True "library-profiling" defaultConfigFile + "-- shared" @=? findLineWith True "shared" defaultConfigFile + "-- static" @=? findLineWith True "static" defaultConfigFile + "-- executable-dynamic" @=? findLineWith True "executable-dynamic" defaultConfigFile + "-- executable-static" @=? findLineWith True "executable-static" defaultConfigFile + "-- profiling" @=? findLineWith True "profiling" defaultConfigFile + "-- executable-profiling" @=? findLineWith True "executable-profiling" defaultConfigFile + "-- profiling-detail" @=? findLineWith True "profiling-detail" defaultConfigFile + "-- library-profiling-detail" @=? findLineWith True "library-profiling-detail" defaultConfigFile + "-- optimization" @=? findLineWith True "optimization" defaultConfigFile + "-- debug-info" @=? findLineWith True "debug-info" defaultConfigFile + "-- build-info" @=? findLineWith True "build-info" defaultConfigFile + "-- library-for-ghci" @=? findLineWith True "library-for-ghci" defaultConfigFile + "-- split-sections" @=? findLineWith True "split-sections" defaultConfigFile + "-- split-objs" @=? findLineWith True "split-objs" defaultConfigFile + "-- executable-stripping" @=? findLineWith True "executable-stripping" defaultConfigFile + "-- library-stripping" @=? findLineWith True "library-stripping" defaultConfigFile + "-- configure-option" @=? findLineWith True "configure-option" defaultConfigFile + "-- user-install" @=? findLineWith True "user-install" defaultConfigFile + "-- package-db" @=? findLineWith True "package-db" defaultConfigFile + "-- flags" @=? findLineWith True "flags" defaultConfigFile + "-- extra-include-dirs" @=? findLineWith True "extra-include-dirs" defaultConfigFile + "-- deterministic" @=? findLineWith True "deterministic" defaultConfigFile + "-- cid" @=? findLineWith True "cid" defaultConfigFile + "-- extra-lib-dirs" @=? findLineWith True "extra-lib-dirs" defaultConfigFile + "-- extra-lib-dirs-static" @=? findLineWith True "extra-lib-dirs-static" defaultConfigFile + "-- extra-framework-dirs" @=? findLineWith True "extra-framework-dirs" defaultConfigFile + "-- extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile + "-- instantiate-with" @=? findLineWith True "instantiate-with" defaultConfigFile + "-- tests" @=? findLineWith True "tests" defaultConfigFile + "-- coverage" @=? findLineWith True "coverage" defaultConfigFile + "-- library-coverage" @=? findLineWith True "library-coverage" defaultConfigFile + "-- exact-configuration" @=? findLineWith True "exact-configuration" defaultConfigFile + "-- benchmarks" @=? findLineWith True "benchmarks" defaultConfigFile + "-- relocatable" @=? findLineWith True "relocatable" defaultConfigFile + "-- response-files" @=? findLineWith True "response-files" defaultConfigFile + "-- allow-depending-on-private-libs" @=? findLineWith True "allow-depending-on-private-libs" defaultConfigFile + "-- cabal-lib-version" @=? findLineWith True "cabal-lib-version" defaultConfigFile + "-- append" @=? findLineWith True "append" defaultConfigFile + "-- backup" @=? findLineWith True "backup" defaultConfigFile + "-- constraint" @=? findLineWith True "constraint" defaultConfigFile + "-- preference" @=? findLineWith True "preference" defaultConfigFile + "-- solver" @=? findLineWith True "solver" defaultConfigFile + "-- allow-older" @=? findLineWith True "allow-older" defaultConfigFile + "-- allow-newer" @=? findLineWith True "allow-newer" defaultConfigFile + "-- write-ghc-environment-files" @=? findLineWith True "write-ghc-environment-files" defaultConfigFile + "-- documentation" @=? findLineWith True "documentation" defaultConfigFile + "-- doc-index-file" @=? findLineWith True "doc-index-file" defaultConfigFile + "-- only-download" @=? findLineWith True "only-download" defaultConfigFile + "-- target-package-db" @=? findLineWith True "target-package-db" defaultConfigFile + "-- max-backjumps" @=? findLineWith True "max-backjumps" defaultConfigFile + "-- reorder-goals" @=? findLineWith True "reorder-goals" defaultConfigFile + "-- count-conflicts" @=? findLineWith True "count-conflicts" defaultConfigFile + "-- fine-grained-conflicts" @=? findLineWith True "fine-grained-conflicts" defaultConfigFile + "-- minimize-conflict-set" @=? findLineWith True "minimize-conflict-set" defaultConfigFile + "-- independent-goals" @=? findLineWith True "independent-goals" defaultConfigFile + "-- prefer-oldest" @=? findLineWith True "prefer-oldest" defaultConfigFile + "-- shadow-installed-packages" @=? findLineWith True "shadow-installed-packages" defaultConfigFile + "-- strong-flags" @=? findLineWith True "strong-flags" defaultConfigFile + "-- allow-boot-library-installs" @=? findLineWith True "allow-boot-library-installs" defaultConfigFile + "-- reject-unconstrained-dependencies" @=? findLineWith True "reject-unconstrained-dependencies" defaultConfigFile + "-- reinstall" @=? findLineWith True "reinstall" defaultConfigFile + "-- avoid-reinstalls" @=? findLineWith True "avoid-reinstalls" defaultConfigFile + "-- force-reinstalls" @=? findLineWith True "force-reinstalls" defaultConfigFile + "-- upgrade-dependencies" @=? findLineWith True "upgrade-dependencies" defaultConfigFile + "-- index-state" @=? findLineWith True "index-state" defaultConfigFile + "-- root-cmd" @=? findLineWith True "root-cmd" defaultConfigFile + "-- symlink-bindir" @=? findLineWith True "symlink-bindir" defaultConfigFile + "build-summary" @=? findLineWith False "build-summary" defaultConfigFile + "-- build-log" @=? findLineWith True "build-log" defaultConfigFile + "remote-build-reporting" @=? findLineWith False "remote-build-reporting" defaultConfigFile + "-- report-planning-failure" @=? findLineWith True "report-planning-failure" defaultConfigFile + "-- per-component" @=? findLineWith True "per-component" defaultConfigFile + "-- run-tests" @=? findLineWith True "run-tests" defaultConfigFile + "jobs" @=? findLineWith False "jobs" defaultConfigFile + "-- keep-going" @=? findLineWith True "keep-going" defaultConfigFile + "-- offline" @=? findLineWith True "offline" defaultConfigFile + "-- lib" @=? findLineWith True "lib" defaultConfigFile + "-- package-env" @=? findLineWith True "package-env" defaultConfigFile + "-- overwrite-policy" @=? findLineWith True "overwrite-policy" defaultConfigFile + "-- install-method" @=? findLineWith True "install-method" defaultConfigFile + "installdir" @=? findLineWith False "installdir" defaultConfigFile + "-- username" @=? findLineWith True "username" defaultConfigFile + "-- password" @=? findLineWith True "password" defaultConfigFile + "-- password-command" @=? findLineWith True "password-command" defaultConfigFile + "-- builddir" @=? findLineWith True "builddir" defaultConfigFile + + " -- keep-temp-files" @=? findLineWith True "keep-temp-files" defaultConfigFile + " -- hoogle" @=? findLineWith True "hoogle" defaultConfigFile + " -- html" @=? findLineWith True "html" defaultConfigFile + " -- html-location" @=? findLineWith True "html-location" defaultConfigFile + " -- executables" @=? findLineWith True "executables" defaultConfigFile + " -- foreign-libraries" @=? findLineWith True "foreign-libraries" defaultConfigFile + " -- all" @=? findLineWith True "all" defaultConfigFile + " -- internal" @=? findLineWith True "internal" defaultConfigFile + " -- css" @=? findLineWith True "css" defaultConfigFile + " -- hyperlink-source" @=? findLineWith True "hyperlink-source" defaultConfigFile + " -- quickjump" @=? findLineWith True "quickjump" defaultConfigFile + " -- hscolour-css" @=? findLineWith True "hscolour-css" defaultConfigFile + " -- contents-location" @=? findLineWith True "contents-location" defaultConfigFile + " -- index-location" @=? findLineWith True "index-location" defaultConfigFile + " -- base-url" @=? findLineWith True "base-url" defaultConfigFile + + " -- interactive" @=? findLineWith True "interactive" defaultConfigFile + " -- cabal-version" @=? findLineWith True "cabal-version" defaultConfigFile + " -- license" @=? findLineWith True "license" defaultConfigFile + " -- extra-doc-file" @=? findLineWith True "extra-doc-file" defaultConfigFile + " -- test-dir" @=? findLineWith True "test-dir" defaultConfigFile + " -- language" @=? findLineWith True "language" defaultConfigFile + " -- application-dir" @=? findLineWith True "application-dir" defaultConfigFile + " -- source-dir" @=? findLineWith True "source-dir" defaultConfigFile + + " -- prefix" @=? findLineWith True "prefix" defaultConfigFile + " -- bindir"@=? findLineWith True "bindir" defaultConfigFile + " -- libdir" @=? findLineWith True "libdir" defaultConfigFile + " -- libsubdir" @=? findLineWith True "libsubdir" defaultConfigFile + " -- dynlibdir" @=? findLineWith True "dynlibdir" defaultConfigFile + " -- libexecdir" @=? findLineWith True "libexecdir" defaultConfigFile + " -- libexecsubdir" @=? findLineWith True "libexecsubdir" defaultConfigFile + " -- datadir" @=? findLineWith True "datadir" defaultConfigFile + " -- datasubdir" @=? findLineWith True "datasubdir" defaultConfigFile + " -- docdir" @=? findLineWith True "docdir" defaultConfigFile + " -- htmldir" @=? findLineWith True "htmldir" defaultConfigFile + " -- haddockdir" @=? findLineWith True "haddockdir" defaultConfigFile + " -- sysconfdir" @=? findLineWith True "sysconfdir" defaultConfigFile + + " -- alex-location" @=? findLineWith True "alex-location" defaultConfigFile + " -- ar-location" @=? findLineWith True "ar-location" defaultConfigFile + " -- c2hs-location" @=? findLineWith True "c2hs-location" defaultConfigFile + " -- cpphs-location" @=? findLineWith True "cpphs-location" defaultConfigFile + " -- doctest-location" @=? findLineWith True "doctest-location" defaultConfigFile + " -- gcc-location" @=? findLineWith True "gcc-location" defaultConfigFile + " -- ghc-location" @=? findLineWith True "ghc-location" defaultConfigFile + " -- ghc-pkg-location" @=? findLineWith True "ghc-pkg-location" defaultConfigFile + " -- ghcjs-location" @=? findLineWith True "ghcjs-location" defaultConfigFile + " -- ghcjs-pkg-location" @=? findLineWith True "ghcjs-pkg-location" defaultConfigFile + " -- greencard-location" @=? findLineWith True "greencard-location" defaultConfigFile + " -- haddock-location" @=? findLineWith True "haddock-location" defaultConfigFile + " -- happy-location" @=? findLineWith True "happy-location" defaultConfigFile + " -- haskell-suite-location" @=? findLineWith True "haskell-suite-location" defaultConfigFile + " -- haskell-suite-pkg-location" @=? findLineWith True "haskell-suite-pkg-location" defaultConfigFile + " -- hmake-location" @=? findLineWith True "hmake-location" defaultConfigFile + " -- hpc-location" @=? findLineWith True "hpc-location" defaultConfigFile + " -- hscolour-location" @=? findLineWith True "hscolour-location" defaultConfigFile + " -- jhc-location" @=? findLineWith True "jhc-location" defaultConfigFile + " -- ld-location" @=? findLineWith True "ld-location" defaultConfigFile + " -- pkg-config-location" @=? findLineWith True "pkg-config-location" defaultConfigFile + " -- runghc-location" @=? findLineWith True "runghc-location" defaultConfigFile + " -- strip-location" @=? findLineWith True "strip-location" defaultConfigFile + " -- tar-location" @=? findLineWith True "tar-location" defaultConfigFile + " -- uhc-location" @=? findLineWith True "uhc-location" defaultConfigFile + + " -- alex-options" @=? findLineWith True "alex-options" defaultConfigFile + " -- ar-options" @=? findLineWith True "ar-options" defaultConfigFile + " -- c2hs-options" @=? findLineWith True "c2hs-options" defaultConfigFile + " -- cpphs-options" @=? findLineWith True "cpphs-options" defaultConfigFile + " -- doctest-options" @=? findLineWith True "doctest-options" defaultConfigFile + " -- gcc-options" @=? findLineWith True "gcc-options" defaultConfigFile + " -- ghc-options" @=? findLineWith True "ghc-options" defaultConfigFile + " -- ghc-pkg-options" @=? findLineWith True "ghc-pkg-options" defaultConfigFile + " -- ghcjs-options" @=? findLineWith True "ghcjs-options" defaultConfigFile + " -- ghcjs-pkg-options" @=? findLineWith True "ghcjs-pkg-options" defaultConfigFile + " -- greencard-options" @=? findLineWith True "greencard-options" defaultConfigFile + " -- haddock-options" @=? findLineWith True "haddock-options" defaultConfigFile + " -- happy-options" @=? findLineWith True "happy-options" defaultConfigFile + " -- haskell-suite-options" @=? findLineWith True "haskell-suite-options" defaultConfigFile + " -- haskell-suite-pkg-options" @=? findLineWith True "haskell-suite-pkg-options" defaultConfigFile + " -- hmake-options" @=? findLineWith True "hmake-options" defaultConfigFile + " -- hpc-options" @=? findLineWith True "hpc-options" defaultConfigFile + " -- hsc2hs-options" @=? findLineWith True "hsc2hs-options" defaultConfigFile + " -- hscolour-options" @=? findLineWith True "hscolour-options" defaultConfigFile + " -- jhc-options" @=? findLineWith True "jhc-options" defaultConfigFile + " -- ld-options" @=? findLineWith True "ld-options" defaultConfigFile + " -- pkg-config-options" @=? findLineWith True "pkg-config-options" defaultConfigFile + " -- runghc-options" @=? findLineWith True "runghc-options" defaultConfigFile + " -- strip-options" @=? findLineWith True "strip-options" defaultConfigFile + " -- tar-options" @=? findLineWith True "tar-options" defaultConfigFile + " -- uhc-options" @=? findLineWith True "uhc-options" defaultConfigFile + where + -- | Find lines containing a target string. + findLineWith :: Bool -> String -> String -> String + findLineWith isComment target text + | not . null $ findLinesWith isComment target text = removeCommentValue . L.head $ findLinesWith isComment target text + | otherwise = text + findLinesWith :: Bool -> String -> String -> [String] + findLinesWith isComment target + | isComment = filter (isInfixOf (" " ++ target ++ ":")) . lines + | otherwise = filter (isInfixOf (target ++ ":")) . lines + removeCommentValue :: String -> String + removeCommentValue = takeWhile (/= ':') + testIgnoreProjectFlag :: Assertion testIgnoreProjectFlag = do -- Coverage flag should be false globally by default (~/.cabal folder) @@ -1988,3 +2217,36 @@ testIgnoreProjectFlag = do emptyConfig = mempty ignoreSetConfig :: ProjectConfig ignoreSetConfig = mempty { projectConfigShared = mempty { projectConfigIgnoreProject = Flag True } } + + +cleanHaddockProject :: FilePath -> IO () +cleanHaddockProject testdir = do + cleanProject testdir + let haddocksdir = basedir testdir "haddocks" + alreadyExists <- doesDirectoryExist haddocksdir + when alreadyExists $ removePathForcibly haddocksdir + let storedir = basedir testdir "store" + alreadyExists' <- doesDirectoryExist storedir + when alreadyExists' $ removePathForcibly storedir + + +testHaddockProjectDependencies :: ProjectConfig -> Assertion +testHaddockProjectDependencies config = do + (_,_,sharedConfig) <- planProject testdir config + -- `haddock-project` is only supported by `haddock-2.26.1` and above which is + -- shipped with `ghc-9.4` + when (compilerVersion (pkgConfigCompiler sharedConfig) > mkVersion [9,4]) $ do + let dir = basedir testdir + cleanHaddockProject testdir + withCurrentDirectory dir $ do + CmdHaddockProject.haddockProjectAction + defaultHaddockProjectFlags { haddockProjectVerbosity = Flag verbosity } + ["all"] + defaultGlobalFlags { globalStoreDir = Flag "store" } + + let haddock = "haddocks" "async" "async.haddock" + hasHaddock <- doesFileExist haddock + unless hasHaddock $ assertFailure ("File `" ++ haddock ++ "` does not exist.") + cleanHaddockProject testdir + where + testdir = "haddock-project/dependencies" diff --git a/cabal-install/tests/IntegrationTests2/nix-config/default-config b/cabal-install/tests/IntegrationTests2/config/default-config similarity index 89% rename from cabal-install/tests/IntegrationTests2/nix-config/default-config rename to cabal-install/tests/IntegrationTests2/config/default-config index 342121f7092..fab39496295 100644 --- a/cabal-install/tests/IntegrationTests2/nix-config/default-config +++ b/cabal-install/tests/IntegrationTests2/config/default-config @@ -9,8 +9,8 @@ -- -- This config file was generated using the following versions -- of Cabal and cabal-install: --- Cabal library version: 3.6.2.0 --- cabal-install version: 3.6.2.0 +-- Cabal library version: 3.11.0.0 +-- cabal-install version: 3.11 repository hackage.haskell.org @@ -19,15 +19,15 @@ repository hackage.haskell.org -- root-keys: -- key-threshold: 3 --- default-user-config: -- ignore-expiry: False -- http-transport: --- nix: False --- local-no-index-repo: - ---debug-info: 1 +-- nix: -- store-dir: -- active-repositories: +-- local-no-index-repo: +remote-repo-cache: /home/colton/.cabal/packages +-- logs-dir: /home/colton/.cabal/logs +-- default-user-config: -- verbose: 1 -- compiler: ghc -- cabal-file: @@ -47,6 +47,7 @@ repository hackage.haskell.org -- library-profiling-detail: -- optimization: True -- debug-info: False +-- build-info: -- library-for-ghci: -- split-sections: False -- split-objs: False @@ -60,7 +61,9 @@ repository hackage.haskell.org -- deterministic: -- cid: -- extra-lib-dirs: +-- extra-lib-dirs-static: -- extra-framework-dirs: +-- extra-prog-path: -- instantiate-with: -- tests: False -- coverage: False @@ -71,6 +74,8 @@ repository hackage.haskell.org -- response-files: -- allow-depending-on-private-libs: -- cabal-lib-version: +-- append: +-- backup: -- constraint: -- preference: -- solver: modular @@ -87,6 +92,7 @@ repository hackage.haskell.org -- fine-grained-conflicts: True -- minimize-conflict-set: False -- independent-goals: False +-- prefer-oldest: False -- shadow-installed-packages: False -- strong-flags: False -- allow-boot-library-installs: False @@ -98,11 +104,11 @@ repository hackage.haskell.org -- index-state: -- root-cmd: -- symlink-bindir: +build-summary: /home/colton/.cabal/logs/build.log -- build-log: remote-build-reporting: none -- report-planning-failure: False -- per-component: True --- one-shot: False -- run-tests: jobs: $ncpus -- keep-going: False @@ -111,6 +117,7 @@ jobs: $ncpus -- package-env: -- overwrite-policy: -- install-method: +installdir: /home/colton/.cabal/bin -- username: -- password: -- password-command: @@ -132,18 +139,28 @@ haddock -- quickjump: False -- hscolour-css: -- contents-location: + -- index-location: + -- base-url: + -- lib: + -- output-dir: init -- interactive: False - -- cabal-version: 2.4 + -- quiet: False + -- no-comments: False + -- minimal: False + -- cabal-version: 3.0 -- license: + -- extra-doc-file: -- tests: -- test-dir: + -- simple: False -- language: Haskell2010 -- application-dir: app -- source-dir: src install-dirs user + -- prefix: /home/colton/.cabal -- bindir: $prefix/bin -- libdir: $prefix/lib -- libsubdir: $abi/$libname @@ -226,4 +243,4 @@ program-default-options -- runghc-options: -- strip-options: -- tar-options: - -- uhc-options: \ No newline at end of file + -- uhc-options: diff --git a/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/a.cabal b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/a.cabal new file mode 100644 index 00000000000..831be636bec --- /dev/null +++ b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/a.cabal @@ -0,0 +1,10 @@ +name: a +version: 0.1.0.0 +build-type: Simple +cabal-version: >= 1.10 + +library + exposed-modules: MyLib + build-depends: base, async + hs-source-dirs: src + default-language: Haskell2010 diff --git a/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/cabal.project b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/cabal.project new file mode 100644 index 00000000000..052c3c8685d --- /dev/null +++ b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/cabal.project @@ -0,0 +1,8 @@ +packages: . +-- `jobs` is necessary to use `InternalMethod :: SetupMethod`. +jobs: 1 + +documentation: True + +package async + documentation: True diff --git a/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/src/MyLib.hs b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/src/MyLib.hs new file mode 100644 index 00000000000..b0b955743ad --- /dev/null +++ b/cabal-install/tests/IntegrationTests2/haddock-project/dependencies/src/MyLib.hs @@ -0,0 +1,6 @@ +module MyLib (someFunc) where + +import Control.Concurrent.Async + +someFunc :: IO (Async ()) +someFunc = async (return ()) diff --git a/cabal-install/tests/UnitTests/Distribution/Client/ArbitraryInstances.hs b/cabal-install/tests/UnitTests/Distribution/Client/ArbitraryInstances.hs index 3a26ca2e560..84c9cfa44e1 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/ArbitraryInstances.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/ArbitraryInstances.hs @@ -44,7 +44,7 @@ import Distribution.Solver.Types.PackageConstraint (PackageProperty (..)) import Data.Coerce (Coercible, coerce) import Network.URI (URI (..), URIAuth (..), isUnreserved) import Test.QuickCheck -import Test.QuickCheck.GenericArbitrary +import Test.QuickCheck.GenericArbitrary (genericArbitrary) import Test.QuickCheck.Instances.Cabal () -- note: there are plenty of instances defined in ProjectConfig test file. @@ -107,11 +107,6 @@ arbitraryURIPort = -- cabal-install (and Cabal) types ------------------------------------------------------------------------------- -shrinkBoundedEnum :: (Eq a, Enum a, Bounded a) => a -> [a] -shrinkBoundedEnum x - | x == minBound = [] - | otherwise = [pred x] - adjustSize :: (Int -> Int) -> Gen a -> Gen a adjustSize adjust gen = sized (\n -> resize (adjust n) gen) diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Get.hs b/cabal-install/tests/UnitTests/Distribution/Client/Get.hs index e5527a63647..eae8f76dc65 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Get.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Get.hs @@ -62,7 +62,7 @@ pkgidfoo = PackageIdentifier (mkPackageName "foo") (mkVersion [1,0]) testNoRepos :: Assertion testNoRepos = do e <- assertException $ - clonePackagesFromSourceRepo verbosity "." Nothing pkgrepos + clonePackagesFromSourceRepo verbosity "." Nothing [] pkgrepos e @?= ClonePackageNoSourceRepos pkgidfoo where pkgrepos = [(pkgidfoo, [])] @@ -71,7 +71,7 @@ testNoRepos = do testNoReposOfKind :: Assertion testNoReposOfKind = do e <- assertException $ - clonePackagesFromSourceRepo verbosity "." repokind pkgrepos + clonePackagesFromSourceRepo verbosity "." repokind [] pkgrepos e @?= ClonePackageNoSourceReposOfKind pkgidfoo repokind where pkgrepos = [(pkgidfoo, [repo])] @@ -82,7 +82,7 @@ testNoReposOfKind = do testNoRepoType :: Assertion testNoRepoType = do e <- assertException $ - clonePackagesFromSourceRepo verbosity "." Nothing pkgrepos + clonePackagesFromSourceRepo verbosity "." Nothing []pkgrepos e @?= ClonePackageNoRepoType pkgidfoo repo where pkgrepos = [(pkgidfoo, [repo])] @@ -92,7 +92,7 @@ testNoRepoType = do testUnsupportedRepoType :: Assertion testUnsupportedRepoType = do e <- assertException $ - clonePackagesFromSourceRepo verbosity "." Nothing pkgrepos + clonePackagesFromSourceRepo verbosity "." Nothing [] pkgrepos e @?= ClonePackageUnsupportedRepoType pkgidfoo repo' repotype where pkgrepos = [(pkgidfoo, [repo])] @@ -114,7 +114,7 @@ testUnsupportedRepoType = do testNoRepoLocation :: Assertion testNoRepoLocation = do e <- assertException $ - clonePackagesFromSourceRepo verbosity "." Nothing pkgrepos + clonePackagesFromSourceRepo verbosity "." Nothing [] pkgrepos e @?= ClonePackageNoRepoLocation pkgidfoo repo where pkgrepos = [(pkgidfoo, [repo])] @@ -133,7 +133,7 @@ testSelectRepoKind = e' <- test requestedRepoType (reverse pkgrepos) e' @?= ClonePackageNoRepoType pkgidfoo expectedRepo | let test rt rs = assertException $ - clonePackagesFromSourceRepo verbosity "." rt rs + clonePackagesFromSourceRepo verbosity "." rt [] rs , (requestedRepoType, expectedRepo) <- cases ] where @@ -154,14 +154,14 @@ testRepoDestinationExists = let pkgdir = tmpdir "foo" createDirectory pkgdir e1 <- assertException $ - clonePackagesFromSourceRepo verbosity tmpdir Nothing pkgrepos + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] pkgrepos e1 @?= ClonePackageDestinationExists pkgidfoo pkgdir True {- isdir -} removeDirectory pkgdir writeFile pkgdir "" e2 <- assertException $ - clonePackagesFromSourceRepo verbosity tmpdir Nothing pkgrepos + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] pkgrepos e2 @?= ClonePackageDestinationExists pkgidfoo pkgdir False {- isfile -} where pkgrepos = [(pkgidfoo, [repo])] @@ -189,7 +189,7 @@ testGitFetchFailed = } pkgrepos = [(pkgidfoo, [repo])] e1 <- assertException $ - clonePackagesFromSourceRepo verbosity tmpdir Nothing pkgrepos + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] pkgrepos e1 @?= ClonePackageFailedWithExitCode pkgidfoo repo' "git" (ExitFailure 128) @@ -200,7 +200,7 @@ testNetworkGitClone = repoType = Just (KnownRepoType Git), repoLocation = Just "https://github.com/haskell/zlib.git" } - clonePackagesFromSourceRepo verbosity tmpdir Nothing + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] [(mkpkgid "zlib1", [repo1])] assertFileContains (tmpdir "zlib1/zlib.cabal") ["name:", "zlib"] @@ -208,7 +208,7 @@ testNetworkGitClone = repoType = Just (KnownRepoType Git), repoLocation = Just (tmpdir "zlib1") } - clonePackagesFromSourceRepo verbosity tmpdir Nothing + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] [(mkpkgid "zlib2", [repo2])] assertFileContains (tmpdir "zlib2/zlib.cabal") ["name:", "zlib"] @@ -217,7 +217,7 @@ testNetworkGitClone = repoLocation = Just (tmpdir "zlib1"), repoTag = Just "0.5.0.0" } - clonePackagesFromSourceRepo verbosity tmpdir Nothing + clonePackagesFromSourceRepo verbosity tmpdir Nothing [] [(mkpkgid "zlib3", [repo3])] assertFileContains (tmpdir "zlib3/zlib.cabal") ["version:", "0.5.0.0"] where diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs index cbc3623ec76..2c0ab936669 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/FileCreators.hs @@ -44,7 +44,9 @@ tests _v _initFlags comp pkgIx srcDb = } inputs = -- createProject stuff - [ "True" + [ "Foobar" + , "foobar@qux.com" + , "True" , "[\"quxTest/Main.hs\"]" -- writeProject stuff -- writeLicense diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs index 3466ac0eb0e..d63e8110549 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs @@ -73,7 +73,9 @@ driverFunctionTest pkgIx srcDb comp = testGroup "createProject" , dependencies = Flag [] } inputs = NEL.fromList - [ "True" + ["Foobar" + , "foobar@qux.com" + , "True" , "[\"quxTest/Main.hs\"]" ] @@ -149,8 +151,11 @@ driverFunctionTest pkgIx srcDb comp = testGroup "createProject" , dependencies = Flag [] } inputs = NEL.fromList + + [ "Foobar" + , "foobar@qux.com" -- extra sources - [ "[\"CHANGELOG.md\"]" + , "[\"CHANGELOG.md\"]" -- lib other modules , "False" -- exe other modules diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs b/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs index 8b70dd89e4c..62f725e270e 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs @@ -2,17 +2,17 @@ module UnitTests.Distribution.Client.Tar ( tests ) where -import Distribution.Client.Tar ( filterEntries - , filterEntriesM - ) -import Codec.Archive.Tar ( Entries(..) - , foldEntries - ) -import Codec.Archive.Tar.Entry ( EntryContent(..) - , simpleEntry - , Entry(..) - , toTarPath - ) +import Codec.Archive.Tar + ( foldEntries + ) +import Codec.Archive.Tar.Entry + ( simpleEntry + , toTarPath + ) +import Distribution.Client.Tar + ( filterEntries + , filterEntriesM + ) import Test.Tasty import Test.Tasty.HUnit @@ -21,6 +21,8 @@ import qualified Data.ByteString.Lazy as BS import qualified Data.ByteString.Lazy.Char8 as BS.Char8 import Control.Monad.Writer.Lazy (runWriterT, tell) +import Distribution.Client.Compat.Tar + tests :: [TestTree] tests = [ testCase "filterEntries" filterTest , testCase "filterEntriesM" filterMTest diff --git a/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs b/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs index b361bdd8ff3..9b4cd6e4511 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/VCS.hs @@ -179,7 +179,7 @@ testSetup :: VCS Program -> IO a testSetup vcs mkVCSTestDriver repoRecipe theTest = do -- test setup - vcs' <- configureVCS verbosity vcs + vcs' <- configureVCS verbosity [] vcs withTestDir verbosity "vcstest" $ \tmpdir -> do let srcRepoPath = tmpdir "src" submodulesPath = tmpdir "submodules" diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs index 1101e05aff9..11f09f3e1bb 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs @@ -155,10 +155,6 @@ tests = [ solverSuccess [("base", 1), ("ghc-prim", 1), ("integer-gmp", 1), ("integer-simple", 1)] , runTest $ mkTest dbNonupgrade "Refuse to install newer ghc requested by another library" ["A"] $ solverFailure (isInfixOf "rejecting: ghc-2.0.0 (constraint from non-upgradeable package requires installed instance)") - , runTest $ mkTest dbNonupgrade "Refuse to install newer ghci requested by another library" ["B"] $ - solverFailure (isInfixOf "rejecting: ghci-2.0.0 (constraint from non-upgradeable package requires installed instance)") - , runTest $ mkTest dbNonupgrade "Refuse to install newer ghc-boot requested by another library" ["C"] $ - solverFailure (isInfixOf "rejecting: ghc-boot-2.0.0 (constraint from non-upgradeable package requires installed instance)") ] , testGroup "reject-unconstrained" [ runTest $ onlyConstrained $ mkTest db12 "missing syb" ["E"] $ @@ -1132,14 +1128,8 @@ dbBase = [ dbNonupgrade :: ExampleDb dbNonupgrade = [ Left $ exInst "ghc" 1 "ghc-1" [] - , Left $ exInst "ghci" 1 "ghci-1" [] - , Left $ exInst "ghc-boot" 1 "ghc-boot-1" [] , Right $ exAv "ghc" 2 [] - , Right $ exAv "ghci" 2 [] - , Right $ exAv "ghc-boot" 2 [] , Right $ exAv "A" 1 [ExFix "ghc" 2] - , Right $ exAv "B" 1 [ExFix "ghci" 2] - , Right $ exAv "C" 1 [ExFix "ghc-boot" 2] ] db13 :: ExampleDb diff --git a/cabal-testsuite/LICENSE b/cabal-testsuite/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/cabal-testsuite/LICENSE +++ b/cabal-testsuite/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out index a650205c593..07433c25abb 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out @@ -15,6 +15,7 @@ On test suite 'Test' an 'autogen-module' is not on 'other-modules' On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out index c6203a64130..1c31921678a 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out @@ -15,6 +15,7 @@ On test suite 'Test' an 'autogen-module' is not on 'other-modules' On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... diff --git a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.cabal.out b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.cabal.out index 774f230f1b9..96f54d60e07 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.cabal.out +++ b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.cabal.out @@ -1,6 +1,9 @@ # Setup configure Configuring AutogenModules-0.1... # Setup sdist +Distribution quality errors: +To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! +Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... Source tarball created: setup.cabal.dist/work/dist/AutogenModules-0.1.tar.gz # Setup sdist diff --git a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.out b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.out index 30f213c7cb1..661c24594f9 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.out +++ b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.out @@ -1,6 +1,9 @@ # Setup configure Configuring AutogenModules-0.1... # Setup sdist +Distribution quality errors: +To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! +Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... Source tarball created: setup.dist/work/dist/AutogenModules-0.1.tar.gz # Setup sdist diff --git a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs index 84d702c57d2..64bf2f84446 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs +++ b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs @@ -61,7 +61,6 @@ main = setupAndCabalTest $ do assertOutputDoesNotContain pathsAutogenMsg configureResult -- Asserts for the undesired check messages after sdist. - assertOutputDoesNotContain "Distribution quality errors:" sdistResult assertOutputDoesNotContain libAutogenMsg sdistResult assertOutputDoesNotContain exeAutogenMsg sdistResult assertOutputDoesNotContain testAutogenMsg sdistResult diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out index 28d34c68971..835dd4e11e0 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out @@ -8,7 +8,7 @@ for mylib-0.1.0.0.. Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = for mylib-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0.. # Setup haddock Preprocessing library for mysql-0.1.0.0.. Running Haddock on library for mysql-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql/index.html +Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql/ # Setup copy Installing library in # Setup register @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0.. # Setup haddock Preprocessing library for postgresql-0.1.0.0.. Running Haddock on library for postgresql-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql/index.html +Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql/ # Setup copy Installing library in # Setup register @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = mysql-0.1.0.0:Database.MySQL for mylib-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL for mylib-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -84,7 +84,7 @@ Building library for src-0.1.0.0.. # Setup haddock Preprocessing library for src-0.1.0.0.. Running Haddock on library for src-0.1.0.0.. -Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src/index.html +Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out index af72c0bf26d..bb2feec4554 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out @@ -8,7 +8,7 @@ for mylib-0.1.0.0.. Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = for mylib-0.1.0.0.. -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0.. # Setup haddock Preprocessing library for mysql-0.1.0.0.. Running Haddock on library for mysql-0.1.0.0.. -Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql/index.html +Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql/ # Setup copy Installing library in # Setup register @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0.. # Setup haddock Preprocessing library for postgresql-0.1.0.0.. Running Haddock on library for postgresql-0.1.0.0.. -Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql/index.html +Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql/ # Setup copy Installing library in # Setup register @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = mysql-0.1.0.0:Database.MySQL for mylib-0.1.0.0.. -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0.. Running Haddock on library instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL for mylib-0.1.0.0.. -Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html +Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/ # Setup copy Installing library in # Setup register @@ -84,7 +84,7 @@ Building library for src-0.1.0.0.. # Setup haddock Preprocessing library for src-0.1.0.0.. Running Haddock on library for src-0.1.0.0.. -Documentation created: ../setup-external.dist/work/src/dist/doc/html/src/index.html +Documentation created: ../setup-external.dist/work/src/dist/doc/html/src/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs index fb6843f5a52..3e4577aecfa 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ do withPackageDb $ do withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out index 1735b0ac541..943686c035f 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out @@ -8,7 +8,7 @@ for Includes2-0.1.0.0.. Preprocessing library 'mylib' for Includes2-0.1.0.0.. Running Haddock on library 'mylib' instantiated with Database = for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing internal library mylib in # Setup register @@ -22,7 +22,7 @@ Building library 'mysql' for Includes2-0.1.0.0.. # Setup haddock Preprocessing library 'mysql' for Includes2-0.1.0.0.. Running Haddock on library 'mysql' for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing internal library mysql in # Setup register @@ -35,7 +35,7 @@ Building library 'postgresql' for Includes2-0.1.0.0.. # Setup haddock Preprocessing library 'postgresql' for Includes2-0.1.0.0.. Running Haddock on library 'postgresql' for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing internal library postgresql in # Setup register @@ -54,7 +54,7 @@ Preprocessing library 'mylib' for Includes2-0.1.0.0.. Running Haddock on library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing internal library mylib in # Setup register @@ -75,7 +75,7 @@ Preprocessing library 'mylib' for Includes2-0.1.0.0.. Running Haddock on library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing internal library mylib in # Setup register @@ -90,7 +90,7 @@ Building library for Includes2-0.1.0.0.. # Setup haddock Preprocessing library for Includes2-0.1.0.0.. Running Haddock on library for Includes2-0.1.0.0.. -Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/index.html +Documentation created: setup-per-component.dist/work/dist/doc/html/Includes2/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs index 1f01eff1efa..5196d404f65 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs @@ -2,7 +2,7 @@ import Test.Cabal.Prelude main = setupTest $ do -- No cabal test because per-component is broken with it skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ withPackageDb $ do let setup_install' args = setup_install_with_docs (["--cabal-file", "Includes2.cabal"] ++ args) diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out index da91bf8ad36..d46f08127ef 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0.. Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0.. -Documentation created: ../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/index.html +Documentation created: ../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0.. Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0.. -Documentation created: ../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/index.html +Documentation created: ../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out index c661e2a14ed..bdf40c0039f 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0.. Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0.. -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/index.html +Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0.. Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0.. -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/index.html +Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ # Setup copy Installing library in # Setup register @@ -41,7 +41,7 @@ Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = containers-:Data.Map for sigs-0.1.0.0.. -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/index.html +Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ # Setup copy Installing library in # Setup register @@ -58,7 +58,7 @@ Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = containers-:Data.Map for indef-0.1.0.0.. -Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/index.html +Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out index 474250807c8..125ebe2cf05 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out @@ -8,7 +8,7 @@ for sigs-0.1.0.0.. Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0.. -Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/index.html +Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ # Setup copy Installing library in # Setup register @@ -24,7 +24,7 @@ for indef-0.1.0.0.. Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0.. -Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/index.html +Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ # Setup copy Installing library in # Setup register @@ -41,7 +41,7 @@ Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = containers-:Data.Map for sigs-0.1.0.0.. -Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/index.html +Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs/ # Setup copy Installing library in # Setup register @@ -58,7 +58,7 @@ Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = containers-:Data.Map for indef-0.1.0.0.. -Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/index.html +Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef/ # Setup copy Installing library in # Setup register diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs index bea7f9a089d..d7ae9a1921d 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs @@ -3,7 +3,7 @@ import Data.List import qualified Data.Char as Char main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ withPackageDb $ do containers_id <- getIPID "containers" diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out index 925eb46040b..07eb138e639 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out @@ -6,7 +6,7 @@ Building library for p-0.1.0.0.. # Setup haddock Preprocessing library for p-0.1.0.0.. Running Haddock on library for p-0.1.0.0.. -Documentation created: ../setup.cabal.dist/work/p/dist/doc/html/p/index.html +Documentation created: ../setup.cabal.dist/work/p/dist/doc/html/p/ # Setup copy Installing library in # Setup register @@ -19,4 +19,4 @@ Building library for q-0.1.0.0.. # Setup haddock Preprocessing library for q-0.1.0.0.. Running Haddock on library for q-0.1.0.0.. -Documentation created: ../setup.cabal.dist/work/q/dist/doc/html/q/index.html +Documentation created: ../setup.cabal.dist/work/q/dist/doc/html/q/ diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out index 47cafd236af..75143237c17 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out @@ -6,7 +6,7 @@ Building library for p-0.1.0.0.. # Setup haddock Preprocessing library for p-0.1.0.0.. Running Haddock on library for p-0.1.0.0.. -Documentation created: ../setup.dist/work/p/dist/doc/html/p/index.html +Documentation created: ../setup.dist/work/p/dist/doc/html/p/ # Setup copy Installing library in # Setup register @@ -19,4 +19,4 @@ Building library for q-0.1.0.0.. # Setup haddock Preprocessing library for q-0.1.0.0.. Running Haddock on library for q-0.1.0.0.. -Documentation created: ../setup.dist/work/q/dist/doc/html/q/index.html +Documentation created: ../setup.dist/work/q/dist/doc/html/q/ diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/Main.hs b/cabal-testsuite/PackageTests/CSourcesSanitisation/Main.hs new file mode 100644 index 00000000000..694e8564328 --- /dev/null +++ b/cabal-testsuite/PackageTests/CSourcesSanitisation/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "main" diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/build.out b/cabal-testsuite/PackageTests/CSourcesSanitisation/build.out new file mode 100644 index 00000000000..c66b5962369 --- /dev/null +++ b/cabal-testsuite/PackageTests/CSourcesSanitisation/build.out @@ -0,0 +1,42 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - repro-0.1.0.0 (lib) (first run) + - repro-0.1.0.0 (exe:exec1) (first run) + - repro-0.1.0.0 (lib:lib2) (first run) + - repro-0.1.0.0 (lib:lib3) (first run) + - repro-0.1.0.0 (lib:lib4) (first run) +Configuring library for repro-0.1.0.0.. +Preprocessing library for repro-0.1.0.0.. +Building library for repro-0.1.0.0.. +Warning: The following header files listed in the main library's c-sources will not be used: cbits/gwinsz.h. +Header files should be in the 'include' or 'install-include' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes +Configuring executable 'exec1' for repro-0.1.0.0.. +Preprocessing executable 'exec1' for repro-0.1.0.0.. +Building executable 'exec1' for repro-0.1.0.0.. +Warning: The following header files listed in exec1's c-sources will not be used: cbits/gwinsz.h. +Header files should be in the 'include' or 'install-include' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes +Configuring library 'lib2' for repro-0.1.0.0.. +Preprocessing library 'lib2' for repro-0.1.0.0.. +Building library 'lib2' for repro-0.1.0.0.. +Warning: The following header files listed in library lib2's c-sources will not be used: cbits/gwinsz.h. +Header files should be in the 'include' or 'install-include' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes +Configuring library 'lib3' for repro-0.1.0.0.. +Preprocessing library 'lib3' for repro-0.1.0.0.. +Building library 'lib3' for repro-0.1.0.0.. +Warning: The following header files listed in library lib3's c-sources will not be used: cbits/gwinsz.h. +Header files should be in the 'include' or 'install-include' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-includes +Warning: The following files listed in library lib3's c-sources do not have the expected '.c' extension cbits/gwinsz.cc. +C++ files should be in the 'cxx-sources' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-cxx-sources +Configuring library 'lib4' for repro-0.1.0.0.. +Preprocessing library 'lib4' for repro-0.1.0.0.. +Building library 'lib4' for repro-0.1.0.0.. +Warning: The following files listed in library lib4's c-sources do not have the expected '.c' extension cbits/gwinsz.cc. +C++ files should be in the 'cxx-sources' stanza. +See https://cabal.readthedocs.io/en/3.10/cabal-package.html#pkg-field-cxx-sources diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/build.test.hs b/cabal-testsuite/PackageTests/CSourcesSanitisation/build.test.hs new file mode 100644 index 00000000000..db6203e6546 --- /dev/null +++ b/cabal-testsuite/PackageTests/CSourcesSanitisation/build.test.hs @@ -0,0 +1,4 @@ +import Test.Cabal.Prelude + +main = cabalTest $ do + cabal "build" [] diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/cabal.project b/cabal-testsuite/PackageTests/CSourcesSanitisation/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/CSourcesSanitisation/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/ChangeLog.md b/cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.c similarity index 100% rename from cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/ChangeLog.md rename to cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.c diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.cc b/cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.cc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.h b/cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/CSourcesSanitisation/repro.cabal b/cabal-testsuite/PackageTests/CSourcesSanitisation/repro.cabal new file mode 100644 index 00000000000..1cf6d295fb4 --- /dev/null +++ b/cabal-testsuite/PackageTests/CSourcesSanitisation/repro.cabal @@ -0,0 +1,34 @@ +cabal-version: 3.0 +name: repro +version: 0.1.0.0 +build-type: Simple + +library + default-language: Haskell2010 + c-sources: cbits/gwinsz.h + cbits/gwinsz.c + build-depends: base + +library lib2 + default-language: Haskell2010 + c-sources: cbits/gwinsz.h + cbits/gwinsz.c + build-depends: base + +library lib3 + default-language: Haskell2010 + c-sources: cbits/gwinsz.h + cbits/gwinsz.cc + build-depends: base + +library lib4 + default-language: Haskell2010 + c-sources: cbits/gwinsz.cc + build-depends: base + +executable exec1 + main-is: Main.hs + default-language: Haskell2010 + c-sources: cbits/gwinsz.h + cbits/gwinsz.c + build-depends: base diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out index 6ed067c93ac..a98c76501b3 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out @@ -2,4 +2,5 @@ Warning: The following errors will cause portability problems on other environments: Warning: Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. Warning: Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +Warning: To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! Warning: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out new file mode 100644 index 00000000000..37aa169b416 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out @@ -0,0 +1,2 @@ +# cabal check +No errors or warnings could be found in the package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs new file mode 100644 index 00000000000..5865ce8893a --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +-- Uknown extension, exception for TypeAbstractions, see #9496 +main = cabalTest $ + cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal new file mode 100644 index 00000000000..10a8974db90 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 +name: pkg +synopsis: synopsis +description: description +version: 0 +category: example +maintainer: none@example.com +license: GPL-3.0-or-later + +library + exposed-modules: Module + default-language: Haskell2010 + default-extensions: TypeAbstractions diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.out new file mode 100644 index 00000000000..3717e18e0f7 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.out @@ -0,0 +1,4 @@ +# cabal check +Warning: The following errors will cause portability problems on other environments: +Warning: To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! +Warning: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.test.hs new file mode 100644 index 00000000000..c9c2e56de21 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude + +-- #9331: PackageInfo functionality should be guarded by cabal-version. +main = cabalTest $ + fails $ cabal "check" [] + diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/pkg.cabal b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/pkg.cabal new file mode 100644 index 00000000000..aeef460f7f0 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenVersion/pkg.cabal @@ -0,0 +1,16 @@ +cabal-version: 2.4 +name: pkg +version: 0 +license: GPL-3.0-or-later +maintainer: Someone +category: Example +synopsis: Foo +description: FooBar +build-type: Simple + +library + default-language: Haskell2010 + build-depends: base <5 + autogen-modules: PackageInfo_pkg + exposed-modules: PackageInfo_pkg + diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.out new file mode 100644 index 00000000000..37aa169b416 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.out @@ -0,0 +1,2 @@ +# cabal check +No errors or warnings could be found in the package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.test.hs b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.test.hs new file mode 100644 index 00000000000..70228e5a4a7 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +-- Internal targets (tests, benchmarks) should not be checked. +main = cabalTest $ + cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/pkg.cabal b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/pkg.cabal new file mode 100644 index 00000000000..b7f6f6ac75b --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsNoCheck/pkg.cabal @@ -0,0 +1,20 @@ +cabal-version: 3.0 +name: pkg +synopsis: synopsis +description: description +version: 0 +category: example +maintainer: none@example.com +license: GPL-3.0-or-later + +library + exposed-modules: Foo + default-language: Haskell2010 + build-depends: base == 2.2.* + +test-suite test + type: exitcode-stdio-1.0 + main-is: Test.hs + default-language: Haskell2010 + build-depends: base == 2.2.*, + criterion diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out index d21149b6c45..4dab53146a7 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out @@ -2,4 +2,6 @@ Warning: The package will not build sanely due to these errors: Warning: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'. Warning: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module PackageInfo_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a PackageInfo_* autogen module, specify at least 'cabal-version: 2.2'. +Warning: The following errors will cause portability problems on other environments: +Warning: To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher. This is not possible in `cabal 3.10`. To use this feature and be able to upload your package to Hackage, download `cabal 3.12`! Warning: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out index 8d2ce00a951..696de1ec938 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out @@ -1,6 +1,6 @@ # cabal check Warning: These warnings may cause trouble when distributing the package: -Warning: pkg.cabal:1:2: Byte-order mark found at the beginning of the file +Warning: pkg.cabal:1:1: Byte-order mark found at the beginning of the file Warning: The following errors will cause portability problems on other environments: Warning: ./pkg.cabal starts with an Unicode byte order mark (BOM). This may cause problems with older cabal versions. Warning: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.test.hs b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.test.hs index 28a6cd72ac0..4cb629752f4 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotExisting/cabal.test.hs @@ -1,7 +1,5 @@ import Test.Cabal.Prelude -import System.Directory (createDirectoryIfMissing) - -- Omitting ChangeLog.md but not README in extra-doc-files main = cabalTest $ do cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/.gitignore b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/.gitignore new file mode 100644 index 00000000000..3e339695267 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/.gitignore @@ -0,0 +1,2 @@ +# Needed for test, to ensure we test the file extension as well. +!ChangeLog.md~ diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/ChangeLog.md~ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/ChangeLog.md~ new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.test.hs b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.test.hs index 28a6cd72ac0..4cb629752f4 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.test.hs @@ -1,7 +1,5 @@ import Test.Cabal.Prelude -import System.Directory (createDirectoryIfMissing) - -- Omitting ChangeLog.md but not README in extra-doc-files main = cabalTest $ do cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/CHANGELOG.TXT b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/CHANGELOG.TXT new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out index f97aa4a73f7..d2df818ef58 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out @@ -1,3 +1,3 @@ # cabal check Warning: These warnings may cause trouble when distributing the package: -Warning: Please consider including the file './ChangeLog.md' in the 'extra-doc-files' section of the .cabal file if it contains useful information for users of the package. +Warning: Please consider including the file './CHANGELOG.TXT' in the 'extra-doc-files' section of the .cabal file if it contains useful information for users of the package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.test.hs b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.test.hs index 28a6cd72ac0..4cb629752f4 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.test.hs @@ -1,7 +1,5 @@ import Test.Cabal.Prelude -import System.Directory (createDirectoryIfMissing) - -- Omitting ChangeLog.md but not README in extra-doc-files main = cabalTest $ do cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.test.hs b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.test.hs index 5bb91450c87..b491c58e1a6 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.test.hs @@ -1,7 +1,5 @@ import Test.Cabal.Prelude -import System.Directory (createDirectoryIfMissing) - -- Included ChangeLog.md but not in extra-doc-files main = cabalTest $ do cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.test.hs b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.test.hs index 5bb91450c87..b491c58e1a6 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.test.hs @@ -1,7 +1,5 @@ import Test.Cabal.Prelude -import System.Directory (createDirectoryIfMissing) - -- Included ChangeLog.md but not in extra-doc-files main = cabalTest $ do cabal "check" [] diff --git a/cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs b/cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs index b492140b4ed..93588d88c3f 100644 --- a/cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs +++ b/cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude -- Test internal custom preprocessor main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do skipUnless "no Cabal for GHC" =<< hasCabalForGhc -- old Cabal's ./Setup.hs output is difficult to normalise diff --git a/cabal-testsuite/PackageTests/ExtraProgPath/pkg-config b/cabal-testsuite/PackageTests/ExtraProgPath/pkg-config index 7c5fafbf0ca..195df7c2c41 100755 --- a/cabal-testsuite/PackageTests/ExtraProgPath/pkg-config +++ b/cabal-testsuite/PackageTests/ExtraProgPath/pkg-config @@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/sh exit 1; diff --git a/cabal-testsuite/PackageTests/FFI/ForeignOptsC/cabal.test.hs b/cabal-testsuite/PackageTests/FFI/ForeignOptsC/cabal.test.hs index 377b4a01466..7d5d4f0aff9 100644 --- a/cabal-testsuite/PackageTests/FFI/ForeignOptsC/cabal.test.hs +++ b/cabal-testsuite/PackageTests/FFI/ForeignOptsC/cabal.test.hs @@ -1,7 +1,4 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal "v2-build" ["foreign-opts-c-exe"] withPlan $ runPlanExe "foreign-opts-c" "foreign-opts-c-exe" [] diff --git a/cabal-testsuite/PackageTests/FFI/ForeignOptsCxx/cabal.test.hs b/cabal-testsuite/PackageTests/FFI/ForeignOptsCxx/cabal.test.hs index 83177d702e3..10024955a78 100644 --- a/cabal-testsuite/PackageTests/FFI/ForeignOptsCxx/cabal.test.hs +++ b/cabal-testsuite/PackageTests/FFI/ForeignOptsCxx/cabal.test.hs @@ -1,7 +1,4 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal "v2-build" ["foreign-opts-cxx-exe"] withPlan $ runPlanExe "foreign-opts-cxx" "foreign-opts-cxx-exe" [] diff --git a/cabal-testsuite/PackageTests/Haddock/setup.cabal.out b/cabal-testsuite/PackageTests/Haddock/setup.cabal.out index 09430defb6f..ca5b8af65b9 100644 --- a/cabal-testsuite/PackageTests/Haddock/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Haddock/setup.cabal.out @@ -3,4 +3,4 @@ Configuring Haddock-0.1... # Setup haddock Preprocessing library for Haddock-0.1.. Running Haddock on library for Haddock-0.1.. -Documentation created: setup.cabal.dist/work/dist/doc/html/Haddock/index.html +Documentation created: setup.cabal.dist/work/dist/doc/html/Haddock/ diff --git a/cabal-testsuite/PackageTests/Haddock/setup.out b/cabal-testsuite/PackageTests/Haddock/setup.out index d7e7e38acbb..351dc0b0955 100644 --- a/cabal-testsuite/PackageTests/Haddock/setup.out +++ b/cabal-testsuite/PackageTests/Haddock/setup.out @@ -3,4 +3,4 @@ Configuring Haddock-0.1... # Setup haddock Preprocessing library for Haddock-0.1.. Running Haddock on library for Haddock-0.1.. -Documentation created: setup.dist/work/dist/doc/html/Haddock/index.html +Documentation created: setup.dist/work/dist/doc/html/Haddock/ diff --git a/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out b/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out index 3cafb20670e..6597cffcc0d 100644 --- a/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out +++ b/cabal-testsuite/PackageTests/HaddockArgs/quickjump.out @@ -14,7 +14,7 @@ for sigs-0.1.0.0.. Preprocessing library for sigs-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for sigs-0.1.0.0.. -Documentation created: dist/doc/html/sigs/index.html +Documentation created: dist/doc/html/sigs/ Installing library in Configuring library for indef-0.1.0.0.. Preprocessing library for indef-0.1.0.0.. @@ -23,7 +23,7 @@ for indef-0.1.0.0.. Preprocessing library for indef-0.1.0.0.. Running Haddock on library instantiated with Data.Map = for indef-0.1.0.0.. -Documentation created: dist/doc/html/indef/index.html +Documentation created: dist/doc/html/indef/ Installing library in Configuring library for example-1.0.. Preprocessing library for example-1.0.. @@ -32,4 +32,4 @@ for example-1.0.. Preprocessing library for example-1.0.. Running Haddock on library instantiated with Data.Map = for example-1.0.. -Documentation created: /quickjump.dist/work/dist/build//ghc-/example-1.0/doc/html/example/index.html \ No newline at end of file +Documentation created: /quickjump.dist/work/dist/build//ghc-/example-1.0/doc/html/example/ diff --git a/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out b/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out index a0978c99d95..d81487bbcec 100644 --- a/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out +++ b/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out @@ -3,4 +3,4 @@ Configuring HaddockNewline-0.1.0.0... # Setup haddock Preprocessing library for HaddockNewline-0.1.0.0.. Running Haddock on library for HaddockNewline-0.1.0.0.. -Documentation created: setup.cabal.dist/work/dist/doc/html/HaddockNewline/index.html +Documentation created: setup.cabal.dist/work/dist/doc/html/HaddockNewline/ diff --git a/cabal-testsuite/PackageTests/HaddockNewline/setup.out b/cabal-testsuite/PackageTests/HaddockNewline/setup.out index 60784ec862c..112cf17ce0f 100644 --- a/cabal-testsuite/PackageTests/HaddockNewline/setup.out +++ b/cabal-testsuite/PackageTests/HaddockNewline/setup.out @@ -3,4 +3,4 @@ Configuring HaddockNewline-0.1.0.0... # Setup haddock Preprocessing library for HaddockNewline-0.1.0.0.. Running Haddock on library for HaddockNewline-0.1.0.0.. -Documentation created: setup.dist/work/dist/doc/html/HaddockNewline/index.html +Documentation created: setup.dist/work/dist/doc/html/HaddockNewline/ diff --git a/cabal-testsuite/PackageTests/HaddockProject/a.cabal b/cabal-testsuite/PackageTests/HaddockProject/a.cabal new file mode 100644 index 00000000000..831be636bec --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/a.cabal @@ -0,0 +1,10 @@ +name: a +version: 0.1.0.0 +build-type: Simple +cabal-version: >= 1.10 + +library + exposed-modules: MyLib + build-depends: base, async + hs-source-dirs: src + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/HaddockProject/cabal.project b/cabal-testsuite/PackageTests/HaddockProject/cabal.project new file mode 100644 index 00000000000..052c3c8685d --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/cabal.project @@ -0,0 +1,8 @@ +packages: . +-- `jobs` is necessary to use `InternalMethod :: SetupMethod`. +jobs: 1 + +documentation: True + +package async + documentation: True diff --git a/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out new file mode 100644 index 00000000000..82067670822 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.out @@ -0,0 +1,25 @@ +# cabal v2-update +Downloading the latest package list from test-local-repo +# cabal haddock-project +Warning: haddock-project command is experimental, it might break in the future +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - async-2.2.4 (lib) (requires build) + - a-0.1.0.0 (lib) (first run) +Build profile: -w ghc- -O1 +In order, the following will be built: + - async-2.2.4 (lib) (requires build) + - a-0.1.0.0 (lib) (configuration changed) +Configuring library for async-2.2.4.. +Preprocessing library for async-2.2.4.. +Building library for async-2.2.4.. +Preprocessing library for async-2.2.4.. +Running Haddock on library for async-2.2.4.. +Documentation created: dist/doc/html/async/ +Installing library in +Configuring library for a-0.1.0.0.. +Preprocessing library for a-0.1.0.0.. +Running Haddock on library for a-0.1.0.0.. +Documentation created: /haddock-project.dist/source/dist-newstyle/build//ghc-/a-0.1.0.0/doc/html/a/ +Documentation created: haddocks/index.html diff --git a/cabal-testsuite/PackageTests/HaddockProject/haddock-project.test.hs b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.test.hs new file mode 100644 index 00000000000..6d889a14163 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/haddock-project.test.hs @@ -0,0 +1,13 @@ +import Test.Cabal.Prelude +import System.Directory (doesFileExist, removeDirectory) + +main = cabalTest . withRepo "repo" . withSourceCopy $ do + skipUnlessGhcVersion ">= 9.4.0" + env <- getTestEnv + let testDir = testCurrentDir env + + cabal "haddock-project" ["all"] + let asyncHaddocks = "haddocks" "async" "async.haddock" + liftIO (doesFileExist (testDir asyncHaddocks)) + >>= assertBool ("'" ++ asyncHaddocks ++ "'" ++ "should exist") + diff --git a/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Control/Concurrent/Async.hs b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Control/Concurrent/Async.hs new file mode 100644 index 00000000000..cedaa25747e --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Control/Concurrent/Async.hs @@ -0,0 +1,25 @@ +module Control.Concurrent.Async ( + Async, + async + ) where + + +-- ----------------------------------------------------------------------------- +-- STM Async API + + +-- | An asynchronous action spawned by 'async' or 'withAsync'. +-- Asynchronous actions are executed in a separate thread, and +-- operations are provided for waiting for asynchronous actions to +-- complete and obtaining their results (see e.g. 'wait'). +-- +data Async a = Async + +-- | Spawn an asynchronous action in a separate thread. +-- +-- Like for 'forkIO', the action may be left running unintentinally +-- (see module-level documentation for details). +-- +-- __Use 'withAsync' style functions wherever you can instead!__ +async :: IO a -> IO (Async a) +async = undefined diff --git a/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/LICENSE b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/LICENSE new file mode 100644 index 00000000000..0acbb121f46 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2012, Simon Marlow + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Simon Marlow nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Setup.hs b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/async.cabal b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/async.cabal new file mode 100644 index 00000000000..27736a4eee1 --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/async.cabal @@ -0,0 +1,22 @@ +name: async +version: 2.2.4 +synopsis: Run IO operations asynchronously and wait for their results +license: BSD3 +license-file: LICENSE +author: Simon Marlow +maintainer: Simon Marlow +copyright: (c) Simon Marlow 2012 +category: Concurrency +build-type: Simple +cabal-version: >=1.10 +homepage: https://github.com/simonmar/async +bug-reports: https://github.com/simonmar/async/issues + +source-repository head + type: git + location: https://github.com/simonmar/async.git + +library + default-language: Haskell2010 + exposed-modules: Control.Concurrent.Async + build-depends: base diff --git a/cabal-testsuite/PackageTests/HaddockProject/src/MyLib.hs b/cabal-testsuite/PackageTests/HaddockProject/src/MyLib.hs new file mode 100644 index 00000000000..b0b955743ad --- /dev/null +++ b/cabal-testsuite/PackageTests/HaddockProject/src/MyLib.hs @@ -0,0 +1,6 @@ +module MyLib (someFunc) where + +import Control.Concurrent.Async + +someFunc :: IO (Async ()) +someFunc = async (return ()) diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out index 0488cfda73e..679ab70bf19 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out +++ b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out @@ -18,10 +18,10 @@ Registering library 'foo-internal-after' for foo-0.1.0.0.. # Setup haddock Preprocessing library 'foo-internal-before' for foo-0.1.0.0.. Running Haddock on library 'foo-internal-before' for foo-0.1.0.0.. -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ Preprocessing library for foo-0.1.0.0.. Running Haddock on library for foo-0.1.0.0.. -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ Preprocessing library 'foo-internal-after' for foo-0.1.0.0.. Running Haddock on library 'foo-internal-after' for foo-0.1.0.0.. -Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.cabal.dist/work/dist/doc/html/foo/ diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out index e469bdded3f..077dc9b86c5 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out +++ b/cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out @@ -18,10 +18,10 @@ Registering library 'foo-internal-after' for foo-0.1.0.0.. # Setup haddock Preprocessing library 'foo-internal-before' for foo-0.1.0.0.. Running Haddock on library 'foo-internal-before' for foo-0.1.0.0.. -Documentation created: haddock.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.dist/work/dist/doc/html/foo/ Preprocessing library for foo-0.1.0.0.. Running Haddock on library for foo-0.1.0.0.. -Documentation created: haddock.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.dist/work/dist/doc/html/foo/ Preprocessing library 'foo-internal-after' for foo-0.1.0.0.. Running Haddock on library 'foo-internal-after' for foo-0.1.0.0.. -Documentation created: haddock.dist/work/dist/doc/html/foo/index.html +Documentation created: haddock.dist/work/dist/doc/html/foo/ diff --git a/cabal-testsuite/PackageTests/JS/JsSources/cabal.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs similarity index 91% rename from cabal-testsuite/PackageTests/JS/JsSources/cabal.test.hs rename to cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs index 612c9829cde..1fed749bdb8 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/cabal.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs @@ -3,6 +3,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 9.6" skipUnlessJavaScript + skipIfWindows res <- cabal' "v2-run" ["demo"] assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSources/jssources.cabal b/cabal-testsuite/PackageTests/JS/JsSources/jssources.cabal index 581d8921026..4595a6cfc2b 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/jssources.cabal +++ b/cabal-testsuite/PackageTests/JS/JsSources/jssources.cabal @@ -6,7 +6,10 @@ build-type: Simple library default-language: Haskell2010 js-sources: jsbits/lib.js - hs-source-dirs: src + if arch(JavaScript) + hs-source-dirs: srcJS + else + hs-source-dirs: src exposed-modules: Lib build-depends: base diff --git a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.out b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.out new file mode 100644 index 00000000000..9f64e6764c5 --- /dev/null +++ b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.out @@ -0,0 +1,12 @@ +# cabal v2-run +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - jssources-0 (lib) (first run) + - jssources-0 (exe:demo) (first run) +Configuring library for jssources-0.. +Preprocessing library for jssources-0.. +Building library for jssources-0.. +Configuring executable 'demo' for jssources-0.. +Preprocessing executable 'demo' for jssources-0.. +Building executable 'demo' for jssources-0.. diff --git a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs new file mode 100644 index 00000000000..187a9cf73bd --- /dev/null +++ b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs @@ -0,0 +1,7 @@ +import Test.Cabal.Prelude + +main = cabalTest $ do + skipIfJavaScript + -- Ensure the field `js-sources` does not raise issues + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello Not JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSources/src/Lib.hs b/cabal-testsuite/PackageTests/JS/JsSources/src/Lib.hs index af628af03ec..7937e6f34ed 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/src/Lib.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/src/Lib.hs @@ -1,3 +1,4 @@ module Lib where -foreign import javascript foo :: IO () +foo :: IO () +foo = putStrLn "Hello Not JS!" diff --git a/cabal-testsuite/PackageTests/JS/JsSources/srcJS/Lib.hs b/cabal-testsuite/PackageTests/JS/JsSources/srcJS/Lib.hs new file mode 100644 index 00000000000..af628af03ec --- /dev/null +++ b/cabal-testsuite/PackageTests/JS/JsSources/srcJS/Lib.hs @@ -0,0 +1,3 @@ +module Lib where + +foreign import javascript foo :: IO () diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/T19350.script b/cabal-testsuite/PackageTests/LinkerOptions/T7339/T19350.script new file mode 100644 index 00000000000..d5b619f7bff --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/T19350.script @@ -0,0 +1,3 @@ +import Hello +hello +:q diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/clib/lib.c b/cabal-testsuite/PackageTests/LinkerOptions/T7339/clib/lib.c new file mode 100644 index 00000000000..556c1dcb748 --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/clib/lib.c @@ -0,0 +1,6 @@ +#include + +void hello_world(void) { + printf("hello world!"); +} + diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Hello.hs b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Hello.hs new file mode 100644 index 00000000000..0dd0de66f74 --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Hello.hs @@ -0,0 +1,3 @@ +module Hello (hello) where + +foreign import ccall "hello_world" hello :: IO () diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Setup.hs b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/T7339.cabal b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/T7339.cabal new file mode 100644 index 00000000000..d4ea571a2c0 --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/lib/T7339.cabal @@ -0,0 +1,11 @@ +cabal-version: >=1.10 +name: T7339 +version: 1.0 +build-type: Simple + +library + build-depends: base + exposed-modules: Hello + default-language: Haskell2010 + extra-libraries: hello + diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.out b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.out new file mode 100644 index 00000000000..39707500a5e --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.out @@ -0,0 +1,6 @@ +# Setup configure +# Setup build +Preprocessing library for T7339-1.0.. +Building library for T7339-1.0.. +# Setup register +Registering library for T7339-1.0.. diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs new file mode 100644 index 00000000000..a46921de895 --- /dev/null +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs @@ -0,0 +1,67 @@ +-- Test for #19350, #7339 originally by @bgamari +-- ============================================= +-- +-- The plan +-- --------- +-- We build a C shared library (`libhello`, contained in ./clib) and then build +-- a Haskell library (`T19350-lib`, in ./lib) which depends upon it via `foreign +-- import`. We make sure that the libhello shared object can only be found via +-- the extra-lib-dirs from the package database registration (which we do by +-- moving libhello.so from its original place). +-- +-- Finally, we enter GHCi, load the Haskell library, and try to use it to call +-- into libhello. + +import System.Directory +import Distribution.System +import Test.Cabal.Prelude + + +main = setupTest $ do + + skipIfWindows + skipUnlessGhcVersion ">= 8.4" + + withPackageDb $ do + cwd <- takeDirectory . testCurrentDir <$> getTestEnv + plat <- testPlatform <$> getTestEnv + let libExt = case plat of + Platform _ OSX -> "dylib" + Platform _ Windows -> "dll" + Platform _ _other -> "so" + + + -- Link a C program against the library + _ <- runProgramM ghcProgram + [ "-fPIC", "-c", "clib/lib.c" + , "-o", "clib/lib.o" ] + Nothing + _ <- runProgramM ghcProgram + [ "-shared", "-no-hs-main", "clib/lib.o" + , "-o", "clib/libhello" <.> libExt ] + Nothing + + withDirectory "lib" $ do + setup "configure" ["-v0" + , "--extra-lib-dirs=" ++ (cwd "clib") + , "--extra-lib-dirs=" ++ (cwd "clib-install") + , "--disable-library-vanilla" + , "--enable-shared"] + setup "build" [] + setup "register" ["--inplace"] + + -- Move libhello from its original place to ensure it isn't found via RPATH + liftIO $ do + createDirectoryIfMissing False (cwd "clib-install") + copyFile (cwd "clib/libhello" <.> libExt) ( cwd "clib-install/libhello" <.> libExt) + removeFile (cwd "clib/libhello" <.> libExt) + + pkgDb <- testPackageDbDir <$> getTestEnv + ghciScript <- liftIO $ readFile (cwd "T19350.script") + _ <- runProgramM ghcProgram + [ "--interactive" + , "-package", "T7339" + , "-package-db", pkgDb + ] (Just ghciScript) + + return () diff --git a/cabal-testsuite/PackageTests/ListBin/Script/cabal.out b/cabal-testsuite/PackageTests/ListBin/Script/cabal.out index dcb26e397f1..63d1cab2c01 100644 --- a/cabal-testsuite/PackageTests/ListBin/Script/cabal.out +++ b/cabal-testsuite/PackageTests/ListBin/Script/cabal.out @@ -2,5 +2,5 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -/cabal.dist/work/./dist/build//ghc-/fake-package-0/x/cabal-script-script.hs/build/cabal-script-script.hs/cabal-script-script.hs + - fake-package-0 (exe:script-script.hs) (first run) +/cabal.dist/work/./dist/build//ghc-/fake-package-0/x/script-script.hs/bin/cabal-script-script.hs diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBench/OptionsFlag/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdBench/OptionsFlag/cabal.test.hs index 055979ea65c..9174ba94a6c 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBench/OptionsFlag/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBench/OptionsFlag/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal "v2-bench" [ "--benchmark-option=1" , "--benchmark-options=\"2 3\"" diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.out index 0c647f80d90..282562011fa 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.out @@ -2,6 +2,6 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.test.hs index 7e4c31a6af7..db31636dc42 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-build" ["script.hs"] env <- getTestEnv diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.out index 71653f09844..e492d1b1f88 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.out @@ -2,10 +2,10 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-repl Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (ephemeral targets) + - fake-package-0 (exe:script-script.hs) (ephemeral targets) diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.test.hs index f09f7f8a4fa..9c0f021da5d 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.test.hs @@ -1,8 +1,5 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-build" ["script.hs"] cabalWithStdin "v2-repl" ["script.hs"] "" diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.out index 208af7b3a0b..097822b36ab 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.out @@ -2,7 +2,7 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. -# cabal v2-run \ No newline at end of file + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. +# cabal v2-run diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.test.hs index 23d49e3f73f..e46b56d4afd 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.test.hs @@ -1,8 +1,5 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-build" ["script.hs"] cabal' "v2-run" ["script.hs"] diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.out index ff6bbcc5c6e..680900c3692 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.out @@ -2,8 +2,8 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-build Up to date diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.test.hs index 863d7706ab2..18c1becba42 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.test.hs @@ -1,8 +1,5 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-build" ["script.hs"] cabal' "v2-build" ["script.hs"] diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.out index 634c825fcf9..9e0eab19a2b 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.out @@ -2,14 +2,14 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-build Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script2.hs) (first run) -Configuring executable 'cabal-script-script2.hs' for fake-package-0.. -Building executable 'cabal-script-script2.hs' for fake-package-0.. + - fake-package-0 (exe:script-script2.hs) (first run) +Configuring executable 'script-script2.hs' for fake-package-0.. +Building executable 'script-script2.hs' for fake-package-0.. # cabal v2-clean diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.test.hs index f54bf5a4bcf..8063d229034 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.test.hs @@ -2,9 +2,6 @@ import Test.Cabal.Prelude import System.Directory (copyFile, removeFile) main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do env <- getTestEnv let td = testCurrentDir env diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.out index 634c825fcf9..9e0eab19a2b 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.out @@ -2,14 +2,14 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-build Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script2.hs) (first run) -Configuring executable 'cabal-script-script2.hs' for fake-package-0.. -Building executable 'cabal-script-script2.hs' for fake-package-0.. + - fake-package-0 (exe:script-script2.hs) (first run) +Configuring executable 'script-script2.hs' for fake-package-0.. +Building executable 'script-script2.hs' for fake-package-0.. # cabal v2-clean diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.test.hs index 0eac6291ff2..39ba5185e94 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.test.hs @@ -2,9 +2,6 @@ import Test.Cabal.Prelude import System.Directory (copyFile, removeFile) main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do env <- getTestEnv let td = testCurrentDir env diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.out index 9075c0f276a..becc8985243 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.out @@ -2,7 +2,7 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-clean diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.test.hs index aa0fc3e9d2f..d3870ce1520 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-build" ["script.hs"] cabal' "v2-clean" ["script.hs"] diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/Script/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/Script/cabal.out index cba93d1cfd8..369c11213fd 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/Script/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/Script/cabal.out @@ -2,5 +2,5 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/ScriptRerun/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/ScriptRerun/cabal.out index 135f9694e0e..eb2e5aed262 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRepl/ScriptRerun/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRepl/ScriptRerun/cabal.out @@ -2,9 +2,9 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. # cabal v2-repl Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) + - fake-package-0 (exe:script-script.hs) (first run) diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.out index 0cc95e6299f..5379babf9c4 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.out @@ -2,6 +2,6 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.test.hs index e145dc9d863..045c88117d7 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do res <- cabal' "v2-run" ["script.hs"] assertOutputContains "Hello World" res diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.out index 7520d95a5a0..d0c7fb13eb4 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.out @@ -2,6 +2,6 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.lhs) (first run) -Configuring executable 'cabal-script-script.lhs' for fake-package-0.. -Building executable 'cabal-script-script.lhs' for fake-package-0.. + - fake-package-0 (exe:script-script.lhs) (first run) +Configuring executable 'script-script.lhs' for fake-package-0.. +Building executable 'script-script.lhs' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs index 1754c7cb4a5..64c858e8d0d 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs @@ -1,8 +1,5 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do res <- cabal' "v2-run" ["script.lhs"] assertOutputContains "Hello World" res diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.out index e0e127886ed..0a3810d6240 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.out @@ -2,6 +2,6 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-with_sp) (first run) -Configuring executable 'cabal-script-with_sp' for fake-package-0.. -Building executable 'cabal-script-with_sp' for fake-package-0.. + - fake-package-0 (exe:script-with_sp) (first run) +Configuring executable 'script-with_sp' for fake-package-0.. +Building executable 'script-with_sp' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.test.hs index e010ea6ec05..b78a6941a79 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.test.hs @@ -1,7 +1,4 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-run" ["with sp"] >>= assertOutputContains "Hello World" diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.out index 5384fa3bbe5..412392689bd 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.out @@ -2,7 +2,7 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - fake-package-0 (exe:cabal-script-script.hs) (first run) -Configuring executable 'cabal-script-script.hs' for fake-package-0.. -Building executable 'cabal-script-script.hs' for fake-package-0.. + - fake-package-0 (exe:script-script.hs) (first run) +Configuring executable 'script-script.hs' for fake-package-0.. +Building executable 'script-script.hs' for fake-package-0.. # cabal v2-run diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.test.hs index 3092a6ea57b..7df7f1451bc 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.test.hs @@ -1,8 +1,5 @@ import Test.Cabal.Prelude main = cabalTest . void $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal' "v2-run" ["script.hs"] cabal' "v2-run" ["script.hs"] diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.out b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.out index ec27da9398e..24962dc65ab 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.out +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.out @@ -2,6 +2,6 @@ Resolving dependencies... Build profile: -w ghc- -O2 In order, the following will be built: - - fake-package-0 (exe:cabal-script-s.hs) (first run) -Configuring executable 'cabal-script-s.hs' for fake-package-0.. -Building executable 'cabal-script-s.hs' for fake-package-0.. + - fake-package-0 (exe:script-s.hs) (first run) +Configuring executable 'script-s.hs' for fake-package-0.. +Building executable 'script-s.hs' for fake-package-0.. diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs index 731fb7182da..8c92079136b 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do -- script is called "s.hs" to avoid Windows long path issue in CI res <- cabal' "v2-run" ["s.hs"] assertOutputContains "Hello World" res diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdTest/OptionsFlag/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdTest/OptionsFlag/cabal.test.hs index c0493cf4629..e9b8f5b6c12 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdTest/OptionsFlag/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdTest/OptionsFlag/cabal.test.hs @@ -1,9 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ do - isWin <- isWindows - ghc94 <- isGhcVersion "== 9.4.*" - expectBrokenIf (isWin && ghc94) 8451 $ do cabal "v2-test" [ "--test-option=1" , "--test-options=\"2 3\"" diff --git a/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out index 8966072f81f..1a4d580a56e 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out @@ -13,4 +13,4 @@ Installing library in Configuring library for B-0.1.0.0.. Preprocessing library for B-0.1.0.0.. Running Haddock on library for B-0.1.0.0.. -Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/index.html +Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/ diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out new file mode 100644 index 00000000000..38e56384678 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out @@ -0,0 +1,11 @@ +# cabal v2-update +Downloading the latest package list from test-local-repo +# cabal haddock +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - A-0.0.0 (lib) (first run) +Configuring library for A-0.0.0... +Preprocessing library for A-0.0.0... +Running Haddock on library for A-0.0.0... +Documentation created: /docs/ diff --git a/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out new file mode 100644 index 00000000000..38e56384678 --- /dev/null +++ b/cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out @@ -0,0 +1,11 @@ +# cabal v2-update +Downloading the latest package list from test-local-repo +# cabal haddock +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - A-0.0.0 (lib) (first run) +Configuring library for A-0.0.0... +Preprocessing library for A-0.0.0... +Running Haddock on library for A-0.0.0... +Documentation created: /docs/ diff --git a/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out b/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out index 42d235c367e..1fc340b970e 100644 --- a/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out +++ b/cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out @@ -11,9 +11,9 @@ Preprocessing library for A-0.1.0.0.. Building library for A-0.1.0.0.. Preprocessing library for A-0.1.0.0.. Running Haddock on library for A-0.1.0.0.. -Documentation created: dist/doc/html/A/index.html +Documentation created: dist/doc/html/A/ Installing library in Configuring library for B-0.1.0.0.. Preprocessing library for B-0.1.0.0.. Running Haddock on library for B-0.1.0.0.. -Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/index.html +Documentation created: /cabal.dist/work/dist/build//ghc-/B-0.1.0.0/doc/html/B/ diff --git a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.out b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.out index cee2a5a19de..d63c65ec921 100644 --- a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.out +++ b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.out @@ -1,10 +1,4 @@ # cabal update -Warning: Caught exception during _mirrors lookup:user error (res_query(3) failed) -Warning: No mirrors found for http://localhost:8000/ -Downloading the latest package list from repository.localhost -Package list of repository.localhost has been updated. -The index-state is set to 2022-01-28T02:36:41Z. -# cabal update Downloading the latest package list from repository.localhost Package list of repository.localhost is up to date. The index-state is set to 2016-09-24T17:47:48Z. diff --git a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs index 047d70b29c1..2be563c6bec 100644 --- a/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs +++ b/cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs @@ -1,9 +1,12 @@ import Test.Cabal.Prelude main = cabalTest $ withRemoteRepo "repo" $ do - -- This test causes a warning about missing mirrors, the warning is - -- included in the expected output to make the test pass but it's not - -- part of the test expectations. - cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"] + -- The _first_ update call causes a warning about missing mirrors, the warning + -- is platform-dependent and it's not part of the test expectations, so we + -- check the output manually. + res <- recordMode DoNotRecord $ + cabal' "update" ["repository.localhost,2022-01-28T02:36:41Z"] + assertOutputContains "The index-state is set to 2022-01-28T02:36:41Z" res + assertOutputDoesNotContain "revert" res cabal "update" ["repository.localhost,2016-09-24T17:47:48Z"] cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"] diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/MyLibrary.hs b/cabal-testsuite/PackageTests/PkgConfigParse/MyLibrary.hs new file mode 100644 index 00000000000..a51c414bcd2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/MyLibrary.hs @@ -0,0 +1 @@ +module MyLibrary () where diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project b/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project new file mode 100644 index 00000000000..5a93e28e878 --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/cabal.project @@ -0,0 +1 @@ +packages: *.cabal \ No newline at end of file diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/my.cabal b/cabal-testsuite/PackageTests/PkgConfigParse/my.cabal new file mode 100644 index 00000000000..38b7020b8a1 --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/my.cabal @@ -0,0 +1,19 @@ +name: PkgConfigParse +version: 0.1 +license: BSD3 +author: Tom Smeding +maintainer: Tom Smeding +synopsis: Pkg Config Parse +category: PackageTests +build-type: Simple +cabal-version: 2.0 + +description: + Check that Cabal does not crash when pkg-config outputs invalid Unicode. + +Library + pkgconfig-depends: vpl + default-language: Haskell2010 + build-depends: base <5.0 + exposed-modules: + MyLibrary diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config new file mode 100755 index 00000000000..183d08e0a00 --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/pkg-config @@ -0,0 +1,49 @@ +#!/bin/sh + +set -eu + +# ugly, but "good enough" for this test +# This will need to be updated whenever cabal invokes pkg-config +# in new ways +case "$*" in + '--version') + echo 2.1.0 # whatever + ;; + + '--variable pc_path pkg-config') + echo '.' + ;; + + '--list-all') + printf 'zlib zlib - zlib compression library\n' + # \256 = \xAE is the iso-8859-1 (latin-1) encoded version of U+00AE, + # i.e. the "registered sign": ® + # This resulted in problems, see #9608 + printf 'vpl Intel\256 Video Processing Library - Accelerated video decode, encode, and frame processing capabilities on Intel\256 GPUs\n' + # \360 = \xF0 is latin-1 for ð; this is orð, Icelandic for "word"/"words". + printf 'or\360 Icelandic characters\n' + ;; + + '--modversion '*) + shift # drop the --modversion + for arg; do + case "$arg" in + zlib) echo 1.3; ;; # whatever + vpl) echo 2.10; ;; # whatever + # No entry for orð here; let's not even try to match on that + *) + echo >&2 "Package $arg was not found in the pkg-config search path." + exit 1 + esac + done + ;; + + # Ignore some stuff we're not implementing + '--cflags '*) ;; + '--libs '*) ;; + + *) + echo >&2 "pkg-config: unrecognised arguments $* (this is an incomplete shim)" + exit 1 + ;; +esac diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/setup.out b/cabal-testsuite/PackageTests/PkgConfigParse/setup.out new file mode 100644 index 00000000000..92fd8204a40 --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/setup.out @@ -0,0 +1 @@ +# cabal v2-build diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs new file mode 100644 index 00000000000..0f860ab637a --- /dev/null +++ b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs @@ -0,0 +1,9 @@ +import Test.Cabal.Prelude + +-- Test that invalid unicode in pkg-config output doesn't trip up cabal very much +main = cabalTest $ do + -- skipped on windows because using a script to dummy up an executable doesn't work the same. + skipIfWindows + cdir <- testCurrentDir `fmap` getTestEnv + res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"] + assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res diff --git a/cabal-testsuite/PackageTests/Regression/T9122/p/p.cabal b/cabal-testsuite/PackageTests/Regression/T9122/p/p.cabal new file mode 100644 index 00000000000..1100690129a --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9122/p/p.cabal @@ -0,0 +1,6 @@ +cabal-version: 3.4 +name: p +Version: 2 +Build-Type: Simple + +library diff --git a/cabal-testsuite/PackageTests/Regression/T9122/q/q.cabal b/cabal-testsuite/PackageTests/Regression/T9122/q/q.cabal new file mode 100644 index 00000000000..d9bd9b331e5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9122/q/q.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.4 +name: q +Version: 1 +Build-Type: Simple + +library + build-depends: q:p + +library p + build-depends: p:p == 2 diff --git a/cabal-testsuite/PackageTests/Regression/T9122/setup.cabal.out b/cabal-testsuite/PackageTests/Regression/T9122/setup.cabal.out new file mode 100644 index 00000000000..8957672640b --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9122/setup.cabal.out @@ -0,0 +1,11 @@ +# Setup configure +Configuring p-2... +# Setup build +Preprocessing library for p-2.. +Building library for p-2.. +# Setup copy +Installing library in +# Setup register +Registering library for p-2.. +# Setup configure +Configuring q-1... diff --git a/cabal-testsuite/PackageTests/Regression/T9122/setup.out b/cabal-testsuite/PackageTests/Regression/T9122/setup.out new file mode 100644 index 00000000000..8957672640b --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9122/setup.out @@ -0,0 +1,11 @@ +# Setup configure +Configuring p-2... +# Setup build +Preprocessing library for p-2.. +Building library for p-2.. +# Setup copy +Installing library in +# Setup register +Registering library for p-2.. +# Setup configure +Configuring q-1... diff --git a/cabal-testsuite/PackageTests/Regression/T9122/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T9122/setup.test.hs new file mode 100644 index 00000000000..93a4a976b3b --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9122/setup.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +main = setupAndCabalTest $ withPackageDb $ do + withDirectory "p" $ setup_install [] + withDirectory "q" $ setup "configure" [] diff --git a/cabal-testsuite/PackageTests/Regression/T9756/OK.hs b/cabal-testsuite/PackageTests/Regression/T9756/OK.hs new file mode 100644 index 00000000000..1846f8c9d0e --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/OK.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TemplateHaskell #-} +module OK where + +import Data.List +import System.Process +import Language.Haskell.TH + +$(do + out <- runIO $ readProcess "mybuilder" [] "" + if "0.2.0.0" `isInfixOf` out then + [d| x = () |] + else + error ("Expecting Version 0.2.0.0, but got: " ++ out) + ) diff --git a/cabal-testsuite/PackageTests/Regression/T9756/cabal-bug-build-tool.cabal b/cabal-testsuite/PackageTests/Regression/T9756/cabal-bug-build-tool.cabal new file mode 100644 index 00000000000..941ac8fbca6 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/cabal-bug-build-tool.cabal @@ -0,0 +1,10 @@ +cabal-version: 1.12 +name: cabal-bug-build-tool +version: 0 +build-type: Simple + +library + exposed-modules: OK + default-language: Haskell2010 + build-depends: base, template-haskell, process + build-tool-depends: mybuilder:mybuilder >=0.2.0.0 diff --git a/cabal-testsuite/PackageTests/Regression/T9756/cabal.out b/cabal-testsuite/PackageTests/Regression/T9756/cabal.out new file mode 100644 index 00000000000..e00a7105944 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/cabal.out @@ -0,0 +1,27 @@ +# cabal v2-update +Downloading the latest package list from test-local-repo +# cabal v2-install +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - mybuilder-0.1.0.0 (exe:mybuilder) (requires build) +Configuring executable 'mybuilder' for mybuilder-0.1.0.0.. +Preprocessing executable 'mybuilder' for mybuilder-0.1.0.0.. +Building executable 'mybuilder' for mybuilder-0.1.0.0.. +Installing executable mybuilder in +Warning: The directory /cabal.dist/home/.cabal/store/ghc-/incoming/new-/cabal.dist/home/.cabal/store/ghc-/-/bin is not in the system search path. +Symlinking 'mybuilder' to '/cabal.dist/install/mybuilder' +# cabal v2-build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - mybuilder-0.2.0.0 (exe:mybuilder) (requires build) + - cabal-bug-build-tool-0 (lib) (first run) +Configuring executable 'mybuilder' for mybuilder-0.2.0.0.. +Preprocessing executable 'mybuilder' for mybuilder-0.2.0.0.. +Building executable 'mybuilder' for mybuilder-0.2.0.0.. +Installing executable mybuilder in +Warning: The directory /cabal.dist/home/.cabal/store/ghc-/incoming/new-/cabal.dist/home/.cabal/store/ghc-/-/bin is not in the system search path. +Configuring library for cabal-bug-build-tool-0.. +Preprocessing library for cabal-bug-build-tool-0.. +Building library for cabal-bug-build-tool-0.. diff --git a/cabal-testsuite/PackageTests/Regression/T9756/cabal.project b/cabal-testsuite/PackageTests/Regression/T9756/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/Regression/T9756/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T9756/cabal.test.hs new file mode 100644 index 00000000000..65b1acb5b70 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/cabal.test.hs @@ -0,0 +1,13 @@ +import Test.Cabal.Prelude + +-- We are testing if the build-tools program is found in path before programs e.g. in extra-prog-path or the system path +-- For that, we need +-- * A repo with a build tool that is up to date +-- * An older version of the build tool in the extra-prog-path +-- * A project that requires the more up-to-date version of the build-tool + +main = cabalTest $ withRepo "repo" $ do + dir <- testWorkDir <$> getTestEnv + cabal "v2-install" ["mybuilder-0.1.0.0", "--installdir=" ++ dir ++ "/install", "--overwrite-policy=always"] + cabal "v2-build" ["cabal-bug-build-tool", "--extra-prog-path=" ++ dir ++ "/install"] + diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/CHANGELOG.md b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/CHANGELOG.md new file mode 100644 index 00000000000..60a3351b163 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for mybuilder0100 + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/app/Main.hs b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/app/Main.hs new file mode 100644 index 00000000000..7de3bfe00bb --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/app/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "0.1.0.0" diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/mybuilder.cabal b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/mybuilder.cabal new file mode 100644 index 00000000000..0649d81c4e0 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.1.0.0/mybuilder.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.0 +name: mybuilder +version: 0.1.0.0 +license: NONE +author: Rodrigo Mesquita +maintainer: rodrigo.m.mesquita@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +executable mybuilder + import: warnings + main-is: Main.hs + build-depends: base + hs-source-dirs: app + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/CHANGELOG.md b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/CHANGELOG.md new file mode 100644 index 00000000000..60a3351b163 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for mybuilder0100 + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/app/Main.hs b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/app/Main.hs new file mode 100644 index 00000000000..3550f30bd2f --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/app/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "0.2.0.0" diff --git a/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/mybuilder.cabal b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/mybuilder.cabal new file mode 100644 index 00000000000..c98f493aa14 --- /dev/null +++ b/cabal-testsuite/PackageTests/Regression/T9756/repo/mybuilder-0.2.0.0/mybuilder.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.0 +name: mybuilder +version: 0.2.0.0 +license: NONE +author: Rodrigo Mesquita +maintainer: rodrigo.m.mesquita@gmail.com +build-type: Simple +extra-doc-files: CHANGELOG.md + +common warnings + ghc-options: -Wall + +executable mybuilder + import: warnings + main-is: Main.hs + build-depends: base + hs-source-dirs: app + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/Foo.hs b/cabal-testsuite/PackageTests/ReplBuildDepends/Foo.hs new file mode 100644 index 00000000000..8a39fe134cf --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/Foo.hs @@ -0,0 +1,4 @@ +module Foo where + +a :: Int +a = 42 diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-newer.out b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-newer.out new file mode 100644 index 00000000000..f7fe5f202cf --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-newer.out @@ -0,0 +1,2 @@ +# cabal clean +# cabal repl diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-older.out b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-older.out new file mode 100644 index 00000000000..f7fe5f202cf --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.allow-older.out @@ -0,0 +1,2 @@ +# cabal clean +# cabal repl diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.normal.out b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.normal.out new file mode 100644 index 00000000000..f7fe5f202cf --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.normal.out @@ -0,0 +1,2 @@ +# cabal clean +# cabal repl diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.project b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.test.hs b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.test.hs new file mode 100644 index 00000000000..e5b63af3dae --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/cabal.test.hs @@ -0,0 +1,19 @@ +import Test.Cabal.Prelude + +-- Test “repl --build-depends” +main = do + testWithByteString "normal" [] + -- See https://github.com/haskell/cabal/issues/6859 + testWithByteString "allow-newer" ["--allow-newer"] + -- See https://github.com/haskell/cabal/issues/6859 + testWithByteString "allow-older" ["--allow-older"] + where + testWithByteString label extraArgs = cabalTest' label $ do + cabal' "clean" [] + res <- cabalWithStdin + "repl" + ("-v2" : "--build-depends" : "bytestring" : extraArgs) + "import qualified Data.ByteString as BS" + assertOutputContains "Ok, one module loaded." res + -- Ensure we can load ‘bytestring’ + assertOutputDoesNotContain "Could not load" res diff --git a/cabal-testsuite/PackageTests/ReplBuildDepends/pkg.cabal b/cabal-testsuite/PackageTests/ReplBuildDepends/pkg.cabal new file mode 100644 index 00000000000..c6cc87f1117 --- /dev/null +++ b/cabal-testsuite/PackageTests/ReplBuildDepends/pkg.cabal @@ -0,0 +1,7 @@ +cabal-version: 2.4 +name: pkg +version: 0.1.0.0 +library + exposed-modules: Foo + build-depends: base + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/UserConfig/cabal.out b/cabal-testsuite/PackageTests/UserConfig/cabal.out index b5e1f5ef9f8..2c6e1a3cd14 100644 --- a/cabal-testsuite/PackageTests/UserConfig/cabal.out +++ b/cabal-testsuite/PackageTests/UserConfig/cabal.out @@ -12,3 +12,6 @@ Writing merged config to /cabal.dist/cabal-config. # cabal user-config Renaming /cabal.dist/cabal-config to /cabal.dist/cabal-config.backup. Writing merged config to /cabal.dist/cabal-config. +# cabal user-config +Renaming /cabal.dist/cabal-config to /cabal.dist/cabal-config.backup. +Writing merged config to /cabal.dist/cabal-config. diff --git a/cabal-testsuite/PackageTests/UserConfig/cabal.test.hs b/cabal-testsuite/PackageTests/UserConfig/cabal.test.hs index 85d67212d4c..300bcc59ea5 100644 --- a/cabal-testsuite/PackageTests/UserConfig/cabal.test.hs +++ b/cabal-testsuite/PackageTests/UserConfig/cabal.test.hs @@ -15,3 +15,9 @@ main = cabalTest $ do assertFileDoesContain conf "foo,bar" cabalG ["--config-file", conf] "user-config" ["update", "-f", "-a", "extra-prog-path: foo, bar"] assertFileDoesContain conf "foo,bar" + + -- regression test for #6268 (password-command parsing) + cabalG ["--config-file", conf] + "user-config" ["update", "-f", "-a", "password-command: sh -c \"echo secret\""] + -- non-quoted tokens do get quoted when writing, but this is expected + assertFileDoesContain conf "password-command: \"sh\" \"-c\" \"echo secret\"" diff --git a/cabal-testsuite/README.md b/cabal-testsuite/README.md index 4b6643eec56..0bf85b760c1 100644 --- a/cabal-testsuite/README.md +++ b/cabal-testsuite/README.md @@ -25,6 +25,28 @@ There are a few useful flags: the autodetection doesn't work correctly (which may be the case for old versions of GHC.) +doctests +======== + +You need to install the doctest tool. Make sure it's compiled with your current +GHC, and don't forget to reinstall it every time you switch GHC version: + +``` shellsession +cabal install doctest --overwrite-policy=always --ignore-project +``` + +After that you can run doctests for a component of your choice via the following command: + +``` shellsession +cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.validate" Cabal-syntax +``` + +In this example we have run doctests in `Cabal-syntax`. Notice, that some +components have broken doctests +([#8734](https://github.com/haskell/cabal/issues/8734)); +our CI currently checks that `Cabal-syntax` and `Cabal` doctests pass via +`make doctest-install && make doctest` (you can use this make-based workflow too). + How to write ------------ diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index e78435b3ec9..1d544e0d368 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: cabal-testsuite version: 3 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -26,10 +26,10 @@ common shared default-language: Haskell2010 build-depends: - , base >= 4.6 && <4.18 + , base >= 4.9 && <4.20 -- this needs to match the in-tree lib:Cabal version - , Cabal ^>= 3.9.0.0 - , Cabal-syntax ^>= 3.9.0.0 + , Cabal ^>= 3.10.3.0 + , Cabal-syntax ^>= 3.10.3.0 ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns @@ -57,30 +57,30 @@ library Test.Cabal.ScriptEnv0 build-depends: - , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 || ^>= 2.0.0.0 || ^>= 2.1.0.0 + , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 || ^>= 2.0.0.0 || ^>= 2.1.0.0 || ^>= 2.2.1.0 , async ^>= 2.2.1 , attoparsec ^>= 0.13.2.2 || ^>=0.14.1 - , base16-bytestring ^>= 0.1.1.6 || ^>= 1.0.0.0 - , bytestring ^>= 0.10.0.2 || ^>= 0.11.0.0 - , containers ^>= 0.5.0.0 || ^>= 0.6.0.1 + , base16-bytestring ^>= 0.1.1.5 || ^>= 1.0 + , bytestring ^>= 0.10.0.2 || ^>= 0.11.0.0 || ^>= 0.12.0.0 + , containers ^>= 0.5.0.0 || ^>= 0.6.0.1 || ^>= 0.7 , cryptohash-sha256 ^>= 0.11.101.0 , directory ^>= 1.2.0.1 || ^>= 1.3.0.0 , exceptions ^>= 0.10.0 - , filepath ^>= 1.3.0.1 || ^>= 1.4.0.0 + , filepath >= 1.3.0.1 && < 1.6 , network-wait ^>= 0.1.2.0 || ^>= 0.2.0.0 - , optparse-applicative ^>= 0.14.3.0 || ^>=0.15.1.0 || ^>=0.16.0.0 || ^>= 0.17.0.0 + , optparse-applicative ^>= 0.14.3.0 || ^>=0.15.1.0 || ^>=0.16.0.0 || ^>= 0.17.0.0 || ^>= 0.18.1.0 , process ^>= 1.2.1.0 || ^>= 1.4.2.0 || ^>= 1.6.1.0 , regex-base ^>= 0.94.0.1 , regex-tdfa ^>= 1.2.3.1 || ^>=1.3.1.0 , retry ^>= 0.9.1.0 , array ^>= 0.4.0.1 || ^>= 0.5.0.0 , temporary ^>= 1.3 - , text ^>= 1.2.3.1 || ^>= 2.0.1 + , text ^>= 1.2.3.1 || ^>= 2.0.1 || ^>= 2.1 , transformers ^>= 0.3.0.0 || ^>= 0.4.2.0 || ^>= 0.5.2.0 || ^>= 0.6.0.2 if !os(windows) build-depends: - , unix ^>= 2.6.0.0 || ^>= 2.7.0.0 + , unix ^>= 2.6.0.0 || ^>= 2.7.0.0 || ^>= 2.8.0.0 else build-depends: , Win32 @@ -115,6 +115,6 @@ custom-setup -- and due to Custom complexity and ConstraintSetupCabalMaxVersion -- it has to be the latest release version plus -- you have to use the latest cabal-install release - setup-depends: Cabal == 3.8.*, - Cabal-syntax == 3.8.*, + setup-depends: Cabal == 3.10.3.0, + Cabal-syntax == 3.10.3.0, base, filepath, directory diff --git a/cabal-testsuite/src/Test/Cabal/Prelude.hs b/cabal-testsuite/src/Test/Cabal/Prelude.hs index 4ad7b68d116..934cf5ce355 100644 --- a/cabal-testsuite/src/Test/Cabal/Prelude.hs +++ b/cabal-testsuite/src/Test/Cabal/Prelude.hs @@ -293,6 +293,7 @@ cabalGArgs global_args cmd args input = do , "get", "unpack" , "info" , "init" + , "haddock-project" ] = [ ] @@ -841,7 +842,7 @@ getScriptCacheDirectory :: FilePath -> TestM FilePath getScriptCacheDirectory script = do cabalDir <- testCabalDir `fmap` getTestEnv hashinput <- liftIO $ canonicalizePath script - let hash = C.unpack . Base16.encode . SHA256.hash . C.pack $ hashinput + let hash = C.unpack . Base16.encode . C.take 26 . SHA256.hash . C.pack $ hashinput return $ cabalDir "script-builds" hash ------------------------------------------------------------------------ diff --git a/cabal.project b/cabal.project index 5f0af8dfa4c..8cd40a33fc4 100644 --- a/cabal.project +++ b/cabal.project @@ -13,17 +13,9 @@ packages: cabal-benchmarks/ optional-packages: ./vendored/*/*.cabal -allow-newer: - hackage-security:Cabal - -- avoiding extra dependencies constraints: rere -rere-cfg constraints: these -assoc --- Andreas, 2022-08-19, https://github.com/haskell/cabal/issues/8377 --- Force latest dependencies in the development version: -constraints: text >= 2.0 -constraints: time >= 1.12 - program-options ghc-options: -fno-ignore-asserts diff --git a/cabal.project.doctest b/cabal.project.doctest new file mode 100644 index 00000000000..dac9b0d88a9 --- /dev/null +++ b/cabal.project.doctest @@ -0,0 +1,24 @@ +packages: Cabal-syntax/ +packages: Cabal/ +packages: cabal-testsuite/ +packages: cabal-install/ +packages: solver-benchmarks/ + +packages: cabal-install-solver/ +packages: Cabal-QuickCheck/ +packages: Cabal-tree-diff +packages: Cabal-described +packages: Cabal-tests +packages: cabal-benchmarks + +tests: True + +-- avoiding extra dependencies +constraints: rere -rere-cfg +constraints: these -assoc + +write-ghc-environment-files: never + +program-options + ghc-options: -fno-ignore-asserts + diff --git a/cabal.project.release b/cabal.project.release index 1f50c83e324..82289e18c82 100644 --- a/cabal.project.release +++ b/cabal.project.release @@ -5,3 +5,13 @@ packages: cabal-install/ tests: False benchmarks: False optimization: True +constraints: tar >= 0.6.2.0, + bzlib-conduit >= 0.3.0.3, + bz2 >= 1.0.1.1, + bzlib >= 0.5.2.0, + directory >= 1.3.8.3, + filepath == 1.4.101.0 || == 1.4.300.1 || >= 1.5.2.0 + +package zlib + flags: -pkg-config +bundled-c-zlib + diff --git a/cabal.project.validate b/cabal.project.validate index 66e823f62b1..2eb9e3558aa 100644 --- a/cabal.project.validate +++ b/cabal.project.validate @@ -30,3 +30,14 @@ package cabal-testsuite ghc-options: -Werror package cabal-install ghc-options: -Werror + +constraints: tar >= 0.6.2.0, + bzlib-conduit >= 0.3.0.3, + bz2 >= 1.0.1.1, + bzlib >= 0.5.2.0, + directory >= 1.3.8.3, + filepath == 1.4.101.0 || == 1.4.300.1 || >= 1.5.2.0 + +package zlib + flags: -pkg-config +bundled-c-zlib + diff --git a/changelog.d/issue-1954 b/changelog.d/issue-1954 deleted file mode 100644 index 49650160579..00000000000 --- a/changelog.d/issue-1954 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Add `cabal get --only-package-description` -packages: cabal-install -prs: #1977 #5162 #8263 -issues: #1954 diff --git a/changelog.d/issue-4255 b/changelog.d/issue-4255 deleted file mode 100644 index b1a5f199660..00000000000 --- a/changelog.d/issue-4255 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Avoid spurious warnings from -with-rtsopts -packages: Cabal -issues: #4255 -prs: #8183 diff --git a/changelog.d/issue-4994 b/changelog.d/issue-4994 deleted file mode 100644 index e5b829599d3..00000000000 --- a/changelog.d/issue-4994 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Do not print "up to date" for commands unless running "cabal build" -packages: Cabal -issues: #4994 -prs: #8569 diff --git a/changelog.d/issue-7462 b/changelog.d/issue-7462 deleted file mode 100644 index e12d63d793f..00000000000 --- a/changelog.d/issue-7462 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: `cabal haddock` now implies `--enable-documentation` -packages: cabal-install -issues: #7462 -prs: #8259 diff --git a/changelog.d/issue-8189 b/changelog.d/issue-8189 deleted file mode 100644 index 0d7372e2db7..00000000000 --- a/changelog.d/issue-8189 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Pretty-print run targets on failure -packages: cabal-install -prs: #8234 -issues: #8189 - -description: { - -- Targets of the `run` command are pretty-printed when failing due to multiple targets. -- Duplicate targets are removed in the output. - -} \ No newline at end of file diff --git a/changelog.d/issue-8351 b/changelog.d/issue-8351 deleted file mode 100644 index 59101a589fc..00000000000 --- a/changelog.d/issue-8351 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Expose BuildFlags and ClientHaddockFlags -packages: cabal-install -prs: #8353 -issues: #8351 - -description: { - -Some types are present in public functions in cabal-install, but they are not exported. -This PR fix it for BuildFlags and ClientHaddockFlags. - -} \ No newline at end of file diff --git a/changelog.d/issue-8405 b/changelog.d/issue-8405 deleted file mode 100644 index 5ed2759fec9..00000000000 --- a/changelog.d/issue-8405 +++ /dev/null @@ -1,14 +0,0 @@ -synopsis: `cabal man` handles $PAGER containing arguments now -packages: cabal-install -prs: #8353 -issues: #8405 - -description: { - -Things like `PAGER="less -FX" cabal man` work now. - -There's a slight change in the default behavior. We still use `less -R` as the default, -but if the user passes `PAGER=less`, we won't add -R to that, unlike before. This is -reasonable, as the user should be able to set the variable as they see fit. - -} diff --git a/changelog.d/issue-8452 b/changelog.d/issue-8452 deleted file mode 100644 index 4cc4baa39e4..00000000000 --- a/changelog.d/issue-8452 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: Fix issue with "nix" config option -packages: cabal-install -prs: #8522 -issues: #8452 - -description: { - Nix option in config file was broken with #8054, this should fix it. -} \ No newline at end of file diff --git a/changelog.d/issue-8487 b/changelog.d/issue-8487 deleted file mode 100644 index 432c74d81d6..00000000000 --- a/changelog.d/issue-8487 +++ /dev/null @@ -1,12 +0,0 @@ -synopsis: "Build profile" message now reflects optimization level set in global config -packages: cabal-install -prs: #8488 -issues: #8487 - -description: { - -Imagine you have `optimization: 2` in your `~/.cabal/config`, and you call `cabal build` -in a project that doesn't have optimization level explicitly set in its project file. -You will still see 'Build profile: -w ghc- -O1'. This is incorrect and was fixed -in this patch: now you'll see '-O2'. -} diff --git a/changelog.d/issue-8489 b/changelog.d/issue-8489 deleted file mode 100644 index 32f4c25ff8d..00000000000 --- a/changelog.d/issue-8489 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: `ghc`, `ghc-boot`, `ghci` packages should be non-upgradable -packages: cabal-install -prs: #8501 -issues: #8489 - -description: { - -- Changed both `Distribution.Client.Dependency`'s `dontUpgradeNonUpgradeablePackages` - and `Distribution.Solver.Modular.Solver`'s `nonInstallable` to be in sync. - -} \ No newline at end of file diff --git a/changelog.d/issue-8564 b/changelog.d/issue-8564 deleted file mode 100644 index b6882027f06..00000000000 --- a/changelog.d/issue-8564 +++ /dev/null @@ -1,5 +0,0 @@ -synopsis: The `configure` script of `build-type: configure` packages now has access to the flag assignment of the package being built via the `CABAL_FLAGS` and `CABAL_FLAG_` environment variables -packages: Cabal -prs: #8565 -issues: #8564 - diff --git a/changelog.d/issue-8646 b/changelog.d/issue-8646 deleted file mode 100644 index 6025a712a70..00000000000 --- a/changelog.d/issue-8646 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Remove "'-main-is' is not portable" check -packages: Cabal -prs: #8651 -issues: #8646 - -description: { - -'cabal check' no longer complains about '-main-is' flag in 'ghc-options' - -} diff --git a/changelog.d/pr-7386 b/changelog.d/pr-7386 deleted file mode 100644 index 36c81b21e65..00000000000 --- a/changelog.d/pr-7386 +++ /dev/null @@ -1,32 +0,0 @@ -synopsis: Switch to using XDG directories -prs: #7386 -issues: #680 -significance: significant - -description: { - -Cabal/cabal-install now uses the XDG Base Directory Specification to -store configuration, caches, and the store. Specifically, -`$XDG_CONFIG_HOME/cabal` stores the configuration file, -`$XDG_CACHE_HOME/cabal` stores downloaded packages and similar, and -`$XDG_STATE_HOME/cabal` mainly contains the store of compiled -packages. Further, `cabal install will put executables in -`~/.local/bin` by default. - -The `dist`/`dist-newstyle` directories are not affected. - -On Windows, these XDG paths are mapped to other (hopefully) -appropriate locations. See the Cabal User Guide for information. - -If the `CABAL_DIR` environment variable is set, the indicated -directory will be used to store all Cabal-related files, as in -previous versions. - -Backwards compatibility: If `~/.cabal` already exists, this will be -interpreted as `CABAL_DIR=~/.cabal`. This means that upgrading on an -existing system already using cabal-install should not cause any -change in behaviour. An existing system can be migrated by deleting -`~/.cabal` (possibly copying `~/.cabal/config` to -`~/.config/cabal/config` first). - -} diff --git a/changelog.d/pr-7794 b/changelog.d/pr-7794 deleted file mode 100644 index 744707b1255..00000000000 --- a/changelog.d/pr-7794 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Include extra-lib-dirs-static into PackageHash -packages: cabal-install -prs: #7794 -issues: #6935 \ No newline at end of file diff --git a/changelog.d/pr-8162 b/changelog.d/pr-8162 deleted file mode 100644 index de63109cb99..00000000000 --- a/changelog.d/pr-8162 +++ /dev/null @@ -1,17 +0,0 @@ -synopsis: Added haddock-project command -packages: cabal-install -prs: #8162 -issues: #7669 -description: { - -The `haddock-project` command can be used to build documentation of multiple -packages. By passing `--local` option the directory will be self contained, -by passing `--hackage` links to dependencies will link to `hackage`. Both -`--local` and `--hackage` options imply `--quickfix`, `--gen-index`, -`--gen-contents`, and `--hyperlinked-source`. - -Building self contained directory is the default, unless `--hackage` or -`--html-location`. - -The PR #8162 also fixes the `--with-haddock` option. -} diff --git a/changelog.d/pr-8220 b/changelog.d/pr-8220 deleted file mode 100644 index 4df5b0ca56c..00000000000 --- a/changelog.d/pr-8220 +++ /dev/null @@ -1,12 +0,0 @@ -synopsis: Fix generation of Path_ modules with relocatable -packages: Cabal -prs: #8220 -issues: #8219 -description: { - -The generation of the functions `minusFileName` and `splitFileName` -are now in the same conditional block as their call, -preventing generation of inconsistent Paths_ files -where those functions are used but not defined. - -} diff --git a/changelog.d/pr-8237 b/changelog.d/pr-8237 deleted file mode 100644 index e4e6f4fae66..00000000000 --- a/changelog.d/pr-8237 +++ /dev/null @@ -1,3 +0,0 @@ -synopsis: Document `cabal check` in the user guide -packages: cabal-install -prs: #8237 diff --git a/changelog.d/pr-8240 b/changelog.d/pr-8240 deleted file mode 100644 index 51722217aea..00000000000 --- a/changelog.d/pr-8240 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Print a warning when assertions are enabled -packages: cabal-install -prs: #8240 -issues: #4377 - -description: { - -- Now cabal-install executable will print a warning if assertions are enabled - -} diff --git a/changelog.d/pr-8261 b/changelog.d/pr-8261 deleted file mode 100644 index 55be68e49a0..00000000000 --- a/changelog.d/pr-8261 +++ /dev/null @@ -1,9 +0,0 @@ -synopsis: Implement --prefer-oldest -packages: cabal-install -prs: #8261 - -description: { - -- Implement `--prefer-oldest` flag for Cabal solver, which tries to find a build plan with the oldest versions possible. This is useful to establish lower bounds. - -} diff --git a/changelog.d/pr-8281 b/changelog.d/pr-8281 deleted file mode 100644 index 9e62a5c9ea6..00000000000 --- a/changelog.d/pr-8281 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Relax language selection parsing in `cabal init` -packages: Cabal-syntax -prs: #8281 -issues: #8278 diff --git a/changelog.d/pr-8309 b/changelog.d/pr-8309 deleted file mode 100644 index cbbd417b8ec..00000000000 --- a/changelog.d/pr-8309 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Add documentation for cabal-install commands: user-config, -report, list, init, fetch, info, upload, get. -prs: #8309 -issues: #8308 #7884 #7978 diff --git a/changelog.d/pr-8311 b/changelog.d/pr-8311 deleted file mode 100644 index 87f72a47a44..00000000000 --- a/changelog.d/pr-8311 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Export pretty printer `ppPackageCheck` from -Distribution.PackageDescription.Check -packages: Cabal -prs: #8311 diff --git a/changelog.d/pr-8339 b/changelog.d/pr-8339 deleted file mode 100644 index 1e602c1e985..00000000000 --- a/changelog.d/pr-8339 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Add check for upper bound on any dependency in cabal check -report, list, init, fetch, info, upload, get. -prs: #8339 -issues: #8291 diff --git a/changelog.d/pr-8358 b/changelog.d/pr-8358 deleted file mode 100644 index ef1afa7e3b9..00000000000 --- a/changelog.d/pr-8358 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Update and sdist now only check for compiler when project file has conditionals -packages: cabal-install -prs: #8358 #8627 -issues: #8352 #8550 #8589 - -description: { - -- Cabal update and sdist will not require a ghc in path unless the project has conditionals that require it - -} diff --git a/changelog.d/pr-8368 b/changelog.d/pr-8368 deleted file mode 100644 index cf74efb48d7..00000000000 --- a/changelog.d/pr-8368 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Allow offline bootstrapping of cabal-install -prs: #8368 -packages: cabal-install - -description: { - -- The bootstrap script for cabal-install now supports fetching the sources of the dependencies in a separate step. - One can then copy over the resulting archive and perform offline bootstrapping of cabal-install. - -} \ No newline at end of file diff --git a/changelog.d/pr-8414 b/changelog.d/pr-8414 deleted file mode 100644 index b046cea70e0..00000000000 --- a/changelog.d/pr-8414 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Pass some haddock flags to dependencies -packages: cabal-install -prs: #8414 -issues: #8104 #395 - -description: { - -- Pass "--haddock-hoogle", "--haddock-html", "--haddock-internal", "--haddock-quickjump", "--haddock-hyperlinked-source" - to all the dependencies if they are specified as command line args - -} diff --git a/changelog.d/pr-8432 b/changelog.d/pr-8432 deleted file mode 100644 index 2ac22987260..00000000000 --- a/changelog.d/pr-8432 +++ /dev/null @@ -1,15 +0,0 @@ -synopsis: Remove warning on option -threaded when building libraries -packages: Cabal -prs: #8432 -issues: #8431 #774 - -description: { - -- Accompanied by option `-flink-rts`, option `-threaded` defines the flavour of - the ghc RTS library the built library will be linked against. Note that bare - ghc does not warn when option `-threaded` is used for building a library - either. -- Note that the changes require modification of the regression check for issue - #774 which can be regarded as a proper test for this PR. - -} diff --git a/changelog.d/pr-8441 b/changelog.d/pr-8441 deleted file mode 100644 index 39e8feac2c5..00000000000 --- a/changelog.d/pr-8441 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Add warning about expensive globs -packages: Cabal -prs: #8441 -issues: #5311 -description: { - -- Now cabal check will emit a warning when package uses -recursive globs starting at root of the project - -} diff --git a/changelog.d/pr-8493 b/changelog.d/pr-8493 deleted file mode 100644 index 27344116e27..00000000000 --- a/changelog.d/pr-8493 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Add language extensions DeepSubsumption and TypeData -packages: Cabal-syntax -prs: #8493 -significance: significant - -description: { - -- adds support for the DeepSubsumption language extension (GHC proposal #511) -- adds support for the TypeData language extension (GHC proposal #106) - -} diff --git a/changelog.d/pr-8496 b/changelog.d/pr-8496 deleted file mode 100644 index d35a68d867e..00000000000 --- a/changelog.d/pr-8496 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: build pkgconfig db individually when bulk fails -packages: cabal-install cabal-install-solver -prs: #8496 -issues: #8494 - -description: { - -- When pkg-config fails to get versions for all packages in bulk, falls back to querying one-by-one. - -} diff --git a/changelog.d/pr-8498 b/changelog.d/pr-8498 deleted file mode 100644 index b285ef0210b..00000000000 --- a/changelog.d/pr-8498 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: improve install target handling logic regarding of project files -packages: cabal-install -issues: #8352 #8094 -prs: #8498 - -description: { - -- fixes an issue where cabal install pkg-x.y.z fails unless --ignore-project is given -- fixes an issue where cabal install --ignore-project crashes when project file is present - -} diff --git a/changelog.d/pr-8499 b/changelog.d/pr-8499 deleted file mode 100644 index f909fbf18fd..00000000000 --- a/changelog.d/pr-8499 +++ /dev/null @@ -1,7 +0,0 @@ -synopsis: orders extra stanzas -packages: Cabal -prs: #8499 -issues: #8458 -description: { - Ensure that extra-src-dirs, extra sources, and extra other modules all are added using ordNub rather than incidentally alphabetized. -} diff --git a/changelog.d/pr-8500 b/changelog.d/pr-8500 deleted file mode 100644 index a443764e90f..00000000000 --- a/changelog.d/pr-8500 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Redownload pkgs when source hash verification fails -packages: cabal-install -prs: #8500 -issues: #7541 - -description: { - -- Cabal-install will verify source hashes on cached downloads against the current index, and redownload on mismatch. (Which can occur with e.g. head.hackage) - -} diff --git a/changelog.d/pr-8506 b/changelog.d/pr-8506 deleted file mode 100644 index 445f2320e69..00000000000 --- a/changelog.d/pr-8506 +++ /dev/null @@ -1,7 +0,0 @@ -synopsis: prepend rather than append extra prog path -packages: Cabal -prs: #8506 -issues: #6304 -description: { - Prepends the extra-prog-path to the system path rather than appending, to allow binaries in the extra path to override defaults. -} diff --git a/changelog.d/pr-8510 b/changelog.d/pr-8510 deleted file mode 100644 index 2c29db01ab1..00000000000 --- a/changelog.d/pr-8510 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: don't send non-extant extra-lib-dirs to ghc -packages: Cabal -prs: #8510 -issues: #6492 - -description: { -If an extra-libs-dir does not exist, it does not get sent to ghc, which can error on windows. -} diff --git a/changelog.d/pr-8528 b/changelog.d/pr-8528 deleted file mode 100644 index d11da20adbe..00000000000 --- a/changelog.d/pr-8528 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Add support for ghc-9.4s -fprof-late flag. -packages: Cabal cabal-install -prs: #8528 - -description: { - -- This adds the new late-toplevel profiling-detail option which enables `-fprof-late` based automatic cost centre annotations for ghcs which support it. - -} - - diff --git a/changelog.d/pr-8534 b/changelog.d/pr-8534 deleted file mode 100644 index 2e654063ca6..00000000000 --- a/changelog.d/pr-8534 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Add PackageInfo_ module -packages: Cabal -prs: #8534 -significance: significant - -description: { - -- Add PackageInfo_ module to embed portable package-related informations (issue #3909) - -} diff --git a/changelog.d/pr-8556 b/changelog.d/pr-8556 deleted file mode 100644 index bb4e7894427..00000000000 --- a/changelog.d/pr-8556 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Add installDirs (datadir, etc) to v2-build and remove them from v2-install -packages: cabal-install -prs: #8556 -significance: significant - -description: { - -- Passes through --prefix --datadir and other installdir arguments properly in v2-build, allowing its use in perparing somewhat more relocatable compilation targets (no worse than v1-build). -- Removes these flags (which never worked) from v2-install - -} diff --git a/changelog.d/pr-8561 b/changelog.d/pr-8561 deleted file mode 100644 index f860867228c..00000000000 --- a/changelog.d/pr-8561 +++ /dev/null @@ -1,9 +0,0 @@ -synopsis: cabal init -i should sanitize package name guessed from the directory name -packages: cabal-install -prs: #8561 -issues: #8404 -description: { - If the current directory name has any non-alphanumeric symbol in its name, the symbol will be replaced with a dash. Also, will make sure that the resulting package name starts with a letter. - - This worked for cabal init -n already, and this PR only moves code around so that cabal init -i also benefits from this logic. -} diff --git a/changelog.d/pr-8582 b/changelog.d/pr-8582 deleted file mode 100644 index 01889700ea9..00000000000 --- a/changelog.d/pr-8582 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: Improve mutually recursive unit identifier error message -packages: Cabal -prs: #8582 -description: { -Improves the error message in case of mutually recursive unit identifiers -by specifying the name of the identifier, the name of the signature, and a suggestion -to check the 'build-depends:' section. -} diff --git a/changelog.d/pr-8607 b/changelog.d/pr-8607 deleted file mode 100644 index 8490646121f..00000000000 --- a/changelog.d/pr-8607 +++ /dev/null @@ -1,13 +0,0 @@ -synopsis: No global packages auto written to env files, allow --force-reinstalls -packages: cabal-install -issues: #6165 #5559 -prs: #8607 -significance: significant - -description: { - -- When v2-install runs on a library, it does not pin global packages in the env file, only those directly necessary for the library. - --- Further, it now fails if there is a reinstall in the plan, and suggests the --force-reinstalls flag, which also now works, cleaning out previous entries from the env file for any target which is reinstalled. - -} diff --git a/changelog.d/pr-8623 b/changelog.d/pr-8623 deleted file mode 100644 index 29c9c3bb2c5..00000000000 --- a/changelog.d/pr-8623 +++ /dev/null @@ -1,7 +0,0 @@ -synopsis: Fix project-local flags being ignored -packages: cabal-install -prs: #8623 -description: { - Fix some cases of configuration flags being dropped, e.g. with `v2-install` - and `--enable-shared --enable-executable-dynamic --disable-library-vanilla`. -} diff --git a/changelog.d/pr-8633 b/changelog.d/pr-8633 deleted file mode 100644 index 2aafda9a837..00000000000 --- a/changelog.d/pr-8633 +++ /dev/null @@ -1,7 +0,0 @@ -synopsis: Specify default exe extension on wasm32 to be .wasm -packages: Cabal -prs: #8633 -issues: -description: { - Specify default exe extension on wasm32 to be .wasm, following the convention in other WebAssembly toolchains. -} diff --git a/changelog.d/pr-8636 b/changelog.d/pr-8636 deleted file mode 100644 index 863104601e1..00000000000 --- a/changelog.d/pr-8636 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: Support `js-sources` with GHC, not only with GHCJS -prs: #8636 -description: { - -- Take into account js-sources when building library components with GHC -- Missing support for js-sources in executable components is tracked in #8639 - -} diff --git a/changelog.d/pr-8640 b/changelog.d/pr-8640 deleted file mode 100644 index 2ea80c8dc32..00000000000 --- a/changelog.d/pr-8640 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Fix extra-source-file rebuild tracking when run in a multi-package project -packages: cabal-install -issues: #8632 #8634 -prs: #8640 - -description: { - -- Fixes an issue where glob expansion of extra-source-files for rebuild tracking purposes was not occuring correctly when run in a multi-package setting (i.e. when the globs needed to be expanded relative to something other than "."). - -} diff --git a/changelog.d/pr-8647 b/changelog.d/pr-8647 deleted file mode 100644 index 341e492b7f0..00000000000 --- a/changelog.d/pr-8647 +++ /dev/null @@ -1,13 +0,0 @@ -synopsis: No up-front warning that assertions are on for special commands (help, version, numeric-version) -packages: cabal-install -prs: #8647 -issues: #8645 - -description: { - -- When compiled with ghc option `-fno-ignore-assert`, `cabal-install` will issue a generic warning that assertions are on. - This warning will no longer be emitted for special modes of operation like `cabal --numeric-version`, `--version` and help, - and also not if `cabal` could not parse its command line. - Further, the warning now goes to `stderr` rather than `stdout`. - -} diff --git a/changelog.d/pr-8648 b/changelog.d/pr-8648 deleted file mode 100644 index 7a4e47931e8..00000000000 --- a/changelog.d/pr-8648 +++ /dev/null @@ -1,12 +0,0 @@ -synopsis: Tiny refactor of how Cabal handles configure scripts -packages: Cabal -prs: #8648 - -description: { -None of this is visible downstream - -- Remove needless parameter on one private function. - -- Move another internal function (and ones that only it uses from the same module) to new private module. - -} diff --git a/changelog.d/pr-8657 b/changelog.d/pr-8657 deleted file mode 100644 index 752d79ca135..00000000000 --- a/changelog.d/pr-8657 +++ /dev/null @@ -1,13 +0,0 @@ -synopsis: Warn if expected files are omitted from extra-doc-files -packages: Cabal -prs: #8657 -issues: #3964 - -description: { - -- Emit a warning if there exist a “changelog” file at the root of the - package which is not included in any field. -- Emit a warning if a “changelog” file at the root of the package is included - in a field different from “extra-doc-files” (Cabal spec >= 1.18) or - “extra-source-files” (spec < 1.18). -} \ No newline at end of file diff --git a/changelog.d/pr-8663 b/changelog.d/pr-8663 deleted file mode 100644 index f70b312fb2b..00000000000 --- a/changelog.d/pr-8663 +++ /dev/null @@ -1,19 +0,0 @@ -synopsis: Fix and improve list parser of cabal init cli -packages: cabal-install -prs: #8663 -issues: #8659 - -description: { -Occurrences of 'Flag [a]' seem to behave in an unexpected way. The monoid -instance of 'Flag' is right associative and discard the value on the -left, but we want to merge the contents of 'Flag'. - -Permits: -- cabal init -d base -d vector -d containers - -Fixes for all Flag '[a]' the cli parser in cabal init. Adds cli parser tests. - -Adds the feature to specify a comma-separated list of dependencies: -- cabal init -d base,vector,containers - -} diff --git a/changelog.d/pr-8686 b/changelog.d/pr-8686 deleted file mode 100644 index 4db79be2d6b..00000000000 --- a/changelog.d/pr-8686 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Fix resolution of imports by relative paths in cabal.project -packages: cabal-install -prs: #8686 - -description: { - -Fix bug where cabal tries to resolve imports by relative paths against -the directory cabal executable was invoked in rather than directory of -cabal.project file that does the import. - -} diff --git a/changelog.d/pr-9443 b/changelog.d/pr-9443 new file mode 100644 index 00000000000..353f1fb8cbd --- /dev/null +++ b/changelog.d/pr-9443 @@ -0,0 +1,11 @@ +synopsis: Use linker capability detection to improve linker use +packages: Cabal +prs: #9443 + +description: { + +- Previously the GHC version number and platform were used as a proxy for whether + the linker can generate relocatable objects. +- Now, the ability of the linker to create relocatable objects is detected. + +} diff --git a/doc/Makefile b/doc/Makefile index 4e12ab8e87a..5ef45877223 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -23,6 +23,7 @@ build-and-check-requirements: requirements.txt check-requirements # See https://modelpredict.com/wht-requirements-txt-is-not-enough requirements.txt: requirements.in . ../.python-sphinx-virtualenv/bin/activate \ + && pip install --upgrade pip \ && pip install pip-tools \ && pip-compile requirements.in diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 0ea968b0f5d..b3ee41aa34d 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -191,7 +191,7 @@ Target Forms A cabal command target can take any of the following forms: -- A package target: ``package``, which specifies that all enabled +- A package target: ``[pkg:]package``, which specifies that all enabled components of a package to be built. By default, test suites and benchmarks are *not* enabled, unless they are explicitly requested (e.g., via ``--enable-tests``.) @@ -705,12 +705,8 @@ By default the documentation will be put in ``./haddocks`` folder, this can be modified with the ``--output`` flag. This command supports two primary modes: building a self contained directory -(by specifying ``--local`` flag) or documentation that links to hackage (with -``--hackage`` flag). Both options imply: ``--quickjump``, ``--gen-index``, -``--gen-contents`` and ``--hyperlinked-source``. - -If neither ``--local`` nor ``--hackage`` option is specified a self contained -directory will only be build if ``--html-location`` is not specified. +(which is the default mode) or documentation that links to hackage (with +``--hackage`` flag). In both cases the html index as well as quickjump index will include all terms and types defined in any of the local packages, but not ones that are included @@ -791,51 +787,75 @@ it may invoke the configuration step (see ``cabal configure``). cabal repl ^^^^^^^^^^ -``cabal repl TARGET`` loads all of the modules of the target into -GHCi as interpreted bytecode. In addition to ``cabal build``'s flags, -it additionally takes the ``--repl-options`` and ``--repl-no-load`` flags. - -To avoid ``ghci`` specific flags from triggering unneeded global rebuilds these -flags are now stripped from the internal configuration. As a result -``--ghc-options`` will no longer (reliably) work to pass flags to ``ghci`` (or -other repls). Instead, you should use the new ``--repl-options`` flag to -specify these options to the invoked repl. (This flag also works on ``cabal -repl`` and ``Setup repl`` on sufficiently new versions of Cabal.) - -The ``repl-no-load`` flag disables the loading of target modules at startup. +``cabal repl TARGET [FLAGS]`` +opens an interactive session for the target component within the project and +loads all of the modules of the target into GHCi as interpreted bytecode. +The available targets are the same as for the ``build`` command: individual components +within packages in the project, including libraries, executables, test-suites +and benchmarks (see `the build section <#cabal-build>`__ for the target syntax). +Local packages can also be specified, in which case the library +component in the package will be used, or the (first listed) executable in the +package if there is no library. Dependencies are built or rebuilt as necessary. Currently, it is not supported to pass multiple targets to ``repl`` (``repl`` will just successively open a separate GHCi session for each target.) -It also provides a way to experiment with libraries without needing to download -them manually or to install them globally. - -This command opens a REPL with the current default target loaded, and a version -of the ``vector`` package matching that specification exposed. +Examples: :: - $ cabal repl --build-depends "vector >= 0.12 && < 0.13" + $ cabal repl # default component in the package in the current directory + $ cabal repl pkgname # default component in the package named 'pkgname' + $ cabal repl ./pkgfoo # default component in the package in the ./pkgfoo directory + $ cabal repl cname # component named 'cname' + $ cabal repl pkgname:cname # component 'cname' in the package 'pkgname' -Both of these commands do the same thing as the above, but only exposes ``base``, -``vector``, and the ``vector`` package's transitive dependencies even if the user -is in a project context. +Configuration flags can be specified on the command line and these extend the project +configuration from the 'cabal.project', 'cabal.project.local' and other files. -:: +.. option:: --repl-options - $ cabal repl --ignore-project --build-depends "vector >= 0.12 && < 0.13" - $ cabal repl --project='' --build-depends "vector >= 0.12 && < 0.13" + To avoid ``ghci``-specific flags from triggering unneeded global rebuilds, these + flags are stripped from the internal configuration. As a result, + ``--ghc-options`` will no longer (reliably) work to pass flags to ``ghci`` (or + other REPLs). Instead, you should use the ``--repl-options`` flag to + specify these options to the invoked REPL. -This command would add ``vector``, but not (for example) ``primitive``, because -it only includes the packages specified on the command line (and ``base``, which -cannot be excluded for technical reasons). +.. option:: --repl-no-load -:: + Disables the loading of target modules at startup. + +.. option:: -b, --build-depends - $ cabal repl --build-depends vector --no-transitive-deps + A way to experiment with libraries without needing to download + them manually or to install them globally. + + This command opens a REPL with the current default target loaded, and a version + of the ``vector`` package matching that specification exposed. + + :: + + $ cabal repl --build-depends "vector >= 0.12 && < 0.13" + + Both of these commands do the same thing as the above, but only expose ``base``, + ``vector``, and the ``vector`` package's transitive dependencies even if the user + is in a project context. + + :: -``repl`` can open scripts by passing the path to the script as the target. + $ cabal repl --ignore-project --build-depends "vector >= 0.12 && < 0.13" + $ cabal repl --project='' --build-depends "vector >= 0.12 && < 0.13" + + This command would add ``vector``, but not (for example) ``primitive``, because + it only includes the packages specified on the command line (and ``base``, which + cannot be excluded for technical reasons). + + :: + + $ cabal repl --build-depends vector --no-transitive-deps + +``cabal repl`` can open scripts by passing the path to the script as the target. :: @@ -1042,7 +1062,19 @@ to Hackage. .. option:: -P, --password-command - Command to get your Hackage password. + Command to get your Hackage password. Arguments with whitespace + must be quoted (double-quotes only). For example: + + :: + + --password-command 'sh -c "grep hackage ~/secrets | cut -d : -f 2"' + + Or in the config file: + + :: + + password-command: sh -c "grep hackage ~/secrets | cut -d : -f 2" + cabal report ^^^^^^^^^^^^ diff --git a/doc/cabal-package.rst b/doc/cabal-package.rst index c25290419bc..8b1c4fa515f 100644 --- a/doc/cabal-package.rst +++ b/doc/cabal-package.rst @@ -774,9 +774,9 @@ describe the package as a whole: .. pkg-field:: extra-source-files: filename list - A list of additional files to be included in source distributions - built with :ref:`setup-sdist`. As with :pkg-field:`data-files` it can use - a limited form of ``*`` wildcards in file names. + A list of additional files to be included in source distributions built with :ref:`setup-sdist`. + As with :pkg-field:`data-files` it can use a limited form of ``*`` wildcards in file names. + Files listed here are tracked by ``cabal build``; changes in these files cause (partial) rebuilds. .. pkg-field:: extra-doc-files: filename list :since: 1.18 @@ -1256,6 +1256,25 @@ the :pkg-field:`test-module` field. The module exporting the ``tests`` symbol. +.. pkg-field:: code-generators + + An optional list of preprocessors which can generate new modules + for use in the test-suite. + + A list of executabes (possibly brought into scope by + :pkg-field:`build-tool-depends`) that are run after all other + preprocessors. These executables are invoked as so: ``exe-name + TARGETDIR [SOURCEDIRS] -- [GHCOPTIONS]``. The arguments are, in order a target dir for + output, a sequence of all source directories with source files of + local lib components that the given test stanza dependens on, and + following a double dash, all options cabal would pass to ghc for a + build. They are expected to output a newline-seperated list of + generated modules which have been written to the targetdir + (excepting, if written, the main module). This can + be used for driving doctests and other discover-style tests generated + from source code. + + Example: Package using ``exitcode-stdio-1.0`` interface """"""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/doc/cabal-project.rst b/doc/cabal-project.rst index 2e47dfdc53c..de8451bedc7 100644 --- a/doc/cabal-project.rst +++ b/doc/cabal-project.rst @@ -1747,7 +1747,7 @@ Most users generally won't need these. --prefer-oldest --no-prefer-oldest :synopsis: Prefer the oldest versions of packages available. - :since: 3.8 + :since: 3.10 :default: False diff --git a/doc/conf.py b/doc/conf.py index 80bd6fba554..a7f63111174 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,7 +13,7 @@ sys.path.insert(0, os.path.abspath('.')) import cabaldomain -version = "3.9.0.0" +version = "3.10.3.0" extensions = [ 'sphinx.ext.extlinks', @@ -39,7 +39,7 @@ # General information about the project. project = u'Cabal' -copyright = u'2003-2022, Cabal Team' +copyright = u'2003-2023, Cabal Team' # N.B. version comes from ghc_config release = version # The full version, including alpha/beta/rc tags. diff --git a/doc/config.rst b/doc/config.rst index 34d0fcf35d5..d7717ca95a8 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -61,9 +61,10 @@ Various environment variables affect ``cabal-install``. .. note:: For backwards compatibility, if the directory ``~/.cabal`` on - Unix or ``%APPDATA%\cabal`` on Windows exist and ``CABAL_DIR`` - is unset, ``cabal-install`` will behave as if ``CABAL_DIR`` was - set to point at this directory. + Unix or ``%APPDATA%\cabal`` on Windows exists, and + ``$XDG_CONFIG_HOME/cabal/config`` does not exist, and + ``CABAL_DIR`` is unset, ``cabal-install`` will behave as if + ``CABAL_DIR`` was set to point at this directory. ``CABAL_BUILDDIR`` diff --git a/doc/nix-local-build.rst b/doc/nix-local-build.rst index 70ebd28359d..0391077a908 100644 --- a/doc/nix-local-build.rst +++ b/doc/nix-local-build.rst @@ -11,19 +11,19 @@ local builds with this command (configuring is not necessary): :: - $ cabal v2-build + $ cabal build To open a GHCi shell with this package, use this command: :: - $ cabal v2-repl + $ cabal repl To run an executable defined in this package, use this command: :: - $ cabal v2-run [executable args] + $ cabal run [executable args] Developing multiple packages ---------------------------- @@ -51,29 +51,29 @@ directory, run the command: (using cabal-install-2.0 or greater.) :: - $ cabal v2-build all + $ cabal build all -To build a specific package, you can either run ``v2-build`` from the +To build a specific package, you can either run ``build`` from the directory of the package in question: :: $ cd cabal-install - $ cabal v2-build + $ cabal build or you can pass the name of the package as an argument to -``cabal v2-build`` (this works in any subdirectory of the project): +``cabal build`` (this works in any subdirectory of the project): :: - $ cabal v2-build cabal-install + $ cabal build cabal-install You can also specify a specific component of the package to build. For example, to build a test suite named ``package-tests``, use the command: :: - $ cabal v2-build package-tests + $ cabal build package-tests Targets can be qualified with package names. So to request ``package-tests`` *from* the ``Cabal`` package, use @@ -81,7 +81,7 @@ Targets can be qualified with package names. So to request Unlike sandboxes, there is no need to setup a sandbox or ``add-source`` projects; just check in ``cabal.project`` to your repository and -``v2-build`` will just work. +``build`` will just work. Cookbook ======== @@ -94,14 +94,14 @@ line:: profiling: True -Now, ``cabal v2-build`` will automatically build all libraries and +Now, ``cabal build`` will automatically build all libraries and executables with profiling. You can fine-tune the profiling settings for each package using :cfg-field:`profiling-detail`:: package p profiling-detail: toplevel-functions -Alternately, you can call ``cabal v2-build --enable-profiling`` to +Alternately, you can call ``cabal build --enable-profiling`` to temporarily build with profiling. How can I have a reproducible set of versions for my dependencies? @@ -173,13 +173,13 @@ built version. The global package store is ``~/.cabal/store`` (configurable via global `store-dir` option); if you need to clear your store for whatever reason (e.g., to reclaim disk space or because the global -store is corrupted), deleting this directory is safe (``v2-build`` +store is corrupted), deleting this directory is safe (``build`` will just rebuild everything it needs on its next invocation). This split motivates some of the UI choices for Nix-style local build -commands. For example, flags passed to ``cabal v2-build`` are only +commands. For example, flags passed to ``cabal build`` are only applied to *local* packages, so that adding a flag to -``cabal v2-build`` doesn't necessitate a rebuild of *every* transitive +``cabal build`` doesn't necessitate a rebuild of *every* transitive dependency in the global package store. In cabal-install 2.0 and above, Nix-style local builds also take advantage of a @@ -194,10 +194,10 @@ are not currently built on a per-component basis. Where are my build products? ---------------------------- -A major deficiency in the current implementation of v2-build is that +A major deficiency in the current implementation of ``cabal build`` is that there is no programmatic way to access the location of build products. The location of the build products is intended to be an internal -implementation detail of v2-build, but we also understand that many +implementation detail of ``cabal build``, but we also understand that many unimplemented features can only be reasonably worked around by accessing build products directly. @@ -245,7 +245,7 @@ the time it takes to execute a rebuild cycle. While the details of how ``cabal-install`` does caching are an implementation detail and may change in the future, knowing what gets cached is helpful for understanding the performance characteristics of invocations to -``v2-build``. The cached intermediate results are stored in +``build``. The cached intermediate results are stored in ``dist-newstyle/cache``; this folder can be safely deleted to clear the cache. @@ -261,7 +261,7 @@ this folder (the most important two are first): already available in the store.) ``source-hashes`` (binary) The hashes of all local source files. When all local source files of - a local package are unchanged, ``cabal v2-build`` will skip + a local package are unchanged, ``cabal build`` will skip invoking ``setup build`` entirely (saving us from a possibly expensive call to ``ghc --make``). The full list of source files participating in compilation is determined using diff --git a/doc/requirements.in b/doc/requirements.in index 3638f36e09a..c8a3a7692a2 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -1,6 +1,12 @@ -sphinx >= 5 -sphinx_rtd_theme >= 1 +sphinx == 5.3.0 +sphinx_rtd_theme >= 1.2 sphinx-jsonschema sphinxnotes-strike # Pygments>=2.7.4 suggested by CVE-2021-20270 CVE-2021-27291 Pygments >= 2.7.4 +# CVE-2023-37920 +certifi >= 2023.07.22 +# CVE-2023-45803 +urllib3 >= 2.0.7 +# CVE-2024-22195 +jinja2 == 3.1.3 diff --git a/doc/requirements.txt b/doc/requirements.txt index 256b6bf407d..b9cddab40e4 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # # pip-compile requirements.in # @@ -8,38 +8,38 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2021.10.8 - # via requests +certifi==2022.12.7 + # via + # -r requirements.in + # requests charset-normalizer==2.0.7 # via requests -docutils==0.17.1 +docutils==0.18.1 # via # sphinx # sphinx-jsonschema # sphinx-rtd-theme idna==2.10 # via requests -imagesize==1.2.0 - # via sphinx -importlib-metadata==4.11.4 +imagesize==1.4.1 # via sphinx -jinja2==2.11.3 - # via sphinx -jsonpointer==2.1 +jinja2==3.1.3 + # via + # -r requirements.in + # sphinx +jsonpointer==2.3 # via sphinx-jsonschema -markupsafe==1.1.1 +markupsafe==2.1.2 # via jinja2 -packaging==20.9 +packaging==23.0 # via sphinx -pygments==2.10.0 +pygments==2.14.0 # via # -r requirements.in # sphinx -pyparsing==2.4.7 - # via packaging pytz==2021.3 # via babel -pyyaml==5.4.1 +pyyaml==6.0.1 # via sphinx-jsonschema requests==2.26.0 # via @@ -47,14 +47,14 @@ requests==2.26.0 # sphinx-jsonschema snowballstemmer==2.1.0 # via sphinx -sphinx==5.0.1 +sphinx==5.3.0 # via # -r requirements.in # sphinx-rtd-theme # sphinxnotes-strike sphinx-jsonschema==1.16.11 # via -r requirements.in -sphinx-rtd-theme==1.0.0 +sphinx-rtd-theme==1.2.0 # via -r requirements.in sphinxcontrib-applehelp==1.0.2 # via sphinx @@ -62,6 +62,8 @@ sphinxcontrib-devhelp==1.0.2 # via sphinx sphinxcontrib-htmlhelp==2.0.0 # via sphinx +sphinxcontrib-jquery==2.0.0 + # via sphinx-rtd-theme sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-qthelp==1.0.3 @@ -72,5 +74,6 @@ sphinxnotes-strike==1.1 # via -r requirements.in urllib3==1.26.7 # via requests -zipp==3.8.0 - # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/doc/setup-commands.rst b/doc/setup-commands.rst index 12af7db7fd6..988d431e693 100644 --- a/doc/setup-commands.rst +++ b/doc/setup-commands.rst @@ -880,37 +880,29 @@ Miscellaneous options .. option:: --constraint=constraint Restrict solutions involving a package to given version - bounds, flag settings, and other properties. For example, to - consider only install plans that use version 2.1 of ``bar`` - or do not use ``bar`` at all, write: + bounds, flag settings, and other properties. + + The following considers only install plans where ``bar``, + if used, is restricted to version 2.1: :: $ cabal install --constraint="bar == 2.1" - Version bounds have the same syntax as :pkg-field:`build-depends`. - As a special case, the following prevents ``bar`` from being - used at all: + The following prevents ``bar`` from being used at all: :: - # Note: this is just syntax sugar for '> 1 && < 1', and is - # supported by build-depends. - $ cabal install --constraint="bar -none" - - You can also specify flag assignments: + $ cabal install --constraint="bar <0" - :: - - # Require bar to be installed with the foo flag turned on and - # the baz flag turned off. - $ cabal install --constraint="bar +foo -baz" + Version bounds have the same syntax as :pkg-field:`build-depends`. + Yet extra pseudo version bounds are available here in addition: - To specify multiple constraints, you may pass the - ``constraint`` option multiple times. + - ``installed`` to fix a package to the already installed version. + Often useful for GHC-supplied packages in combination with :cfg-field:`allow-newer`, + e.g., ``--allow-newer='*:base' --constraint='base installed'``. - There are also some more specialized constraints, which most people - don't generally need: + - ``source`` to fix a package to the local source copy. :: @@ -924,9 +916,21 @@ Miscellaneous options # specify this.) $ cabal install --constraint="bar source" + Further, we can specify flag assignments with ``+FLAG`` and ``-FLAG`` + or enable test (``test``) and benchmark (``bench``) suites: + + :: + + # Require bar to be installed with the foo flag turned on and + # the baz flag turned off. + $ cabal install --constraint="bar +foo -baz" + # Require that bar have test suites and benchmarks enabled. $ cabal install --constraint="bar test" --constraint="bar bench" + To specify multiple constraints, you may pass the + ``constraint`` option multiple times. + By default, constraints only apply to build dependencies (:pkg-field:`build-depends`), build dependencies of build dependencies, and so on. Constraints normally do not apply to @@ -934,8 +938,8 @@ Miscellaneous options (:pkg-field:`custom-setup:setup-depends`) nor do they apply to build tools (:pkg-field:`build-tool-depends`) or the dependencies of build tools. To explicitly apply a constraint to a setup or build - tool dependency, you can add a qualifier to the constraint as - follows: + tool dependency, you can add a qualifier ``setup`` or ``any`` + to the constraint as follows: :: diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index 1fc84f4d8af..fa52f12a168 100644 --- a/editors/vim/syntax/cabal.vim +++ b/editors/vim/syntax/cabal.vim @@ -267,6 +267,7 @@ syn keyword cabalExtension contained \ TraditionalRecordSyntax \ TransformListComp \ TupleSections + \ TypeAbstractions \ TypeApplications \ TypeData \ TypeFamilies @@ -405,6 +406,7 @@ syn keyword cabalExtension contained \ NoTraditionalRecordSyntax \ NoTransformListComp \ NoTupleSections + \ NoTypeAbstractions \ NoTypeApplications \ NoTypeFamilies \ NoTypeFamilyDependencies diff --git a/release-notes/Cabal-3.10.1.0.md b/release-notes/Cabal-3.10.1.0.md new file mode 100644 index 00000000000..02824484dae --- /dev/null +++ b/release-notes/Cabal-3.10.1.0.md @@ -0,0 +1,145 @@ +Cabal and Cabal-syntax 3.10.1.0 changelog and release notes +--- + +Release 3.10.1.0 of cabal now sets the `--enable-documentation` option by default +when running `cabal haddock` (https://github.com/haskell/cabal/issues/7462). +If the new default does not fit your workflow, pass an explicit `--disable-documentation` +option or consider (helping to implement) the other workarounds proposed +in https://github.com/haskell/cabal/issues/8725. + +This version of cabal introduces support for JS cross-compilation (https://github.com/haskell/cabal/pull/8636). +We've seen related Windows segfaults on CI, so please kindly report if you can reproduce either +cabal or GHC segfaults when cross-compiling for JS or compiling normally but with any files +listed in the `js-sources` field of a .cabal file. + +This release of cabal also fixes a lot of bugs in cabal 3.8.1.0 and not all of the fixes +are listed here. + + +### Significant changes + +- Add support for the XDG Base Directory Specification [#680](https://github.com/haskell/cabal/issues/680) [#7386](https://github.com/haskell/cabal/pull/7386) + + Cabal/cabal-install now uses the XDG Base Directory Specification to + store configuration, caches, and the store. Specifically, + `$XDG_CONFIG_HOME/cabal` stores the configuration file, + `$XDG_CACHE_HOME/cabal` stores downloaded packages and similar, and + `$XDG_STATE_HOME/cabal` mainly contains the store of compiled + packages. Further, `cabal install` will put executables in + `~/.local/bin` by default. + + The `dist`/`dist-newstyle` directories are not affected. + + On Windows, these XDG paths are mapped to other (hopefully) + appropriate locations. See the Cabal User Guide for information. + + If the `CABAL_DIR` environment variable is set, the indicated + directory will be used to store all Cabal-related files, as in + previous versions. + + **Backwards compatibility**: If `~/.cabal` already exists, this will be + interpreted as `CABAL_DIR=~/.cabal`. This means that upgrading on an + existing system already using cabal-install should not cause any + change in behaviour. An existing system can be migrated by deleting + `~/.cabal` (possibly copying `~/.cabal/config` to + `~/.config/cabal/config` first). + +- Add `PackageInfo_` module [#8534](https://github.com/haskell/cabal/pull/8534) + + - Add `PackageInfo_` module to embed portable package-related informations (issue #3909) + +- *Cabal-syntax* Add language extensions `DeepSubsumption` and `TypeData` [#8493](https://github.com/haskell/cabal/pull/8493) + + - adds support for the `DeepSubsumption` language extension ([GHC proposal #511](https://github.com/ghc-proposals/ghc-proposals/pull/511)) + - adds support for the `TypeData` language extension ([GHC proposal #106](https://github.com/ghc-proposals/ghc-proposals/pull/106)) + +- Add support for GHC 9.4+ `-fprof-late` flag. [#8528](https://github.com/haskell/cabal/pull/8528) + +- This adds the new `late-toplevel` (and its alias `late`) profiling-detail option which enables `-fprof-late`-based automatic cost centre annotations for GHCs that support it ([earliest is GHC 9.4.1](https://downloads.haskell.org/ghc/9.4.1/docs/users_guide/profiling.html#ghc-flag--fprof-late)). + + +### Other changes + +- Remove "'-main-is' is not portable" check [#8646](https://github.com/haskell/cabal/issues/8646) [#8651](https://github.com/haskell/cabal/pull/8651) + + `cabal check` no longer complains about `-main-is` flag in `ghc-options` + +- Fix generation of Path_ modules with relocatable [#8219](https://github.com/haskell/cabal/issues/8219) [#8220](https://github.com/haskell/cabal/pull/8220) + + The generation of the functions `minusFileName` and `splitFileName` + are now in the same conditional block as their call, + preventing generation of inconsistent Paths_ files + where those functions are used but not defined. + +- Remove warning on option -threaded when building libraries [#774](https://github.com/haskell/cabal/issues/774) [#8431](https://github.com/haskell/cabal/issues/8431) [#8432](https://github.com/haskell/cabal/pull/8432) + + - Accompanied by option `-flink-rts`, option `-threaded` defines the flavour of + the ghc RTS library the built library will be linked against. Note that bare + ghc does not warn when option `-threaded` is used for building a library + either. + - Note that the changes require modification of the regression check for issue + #774 which can be regarded as a proper test for this PR. + +- Add warning about expensive globs [#5311](https://github.com/haskell/cabal/issues/5311) [#8441](https://github.com/haskell/cabal/pull/8441) + + - Now cabal check will emit a warning when package uses + recursive globs starting at root of the project + +- Order `extra*` stanzas [#8458](https://github.com/haskell/cabal/issues/8458) [#8499](https://github.com/haskell/cabal/pull/8499) + + Ensure that `extra-src-dirs`, extra sources, and extra other modules all are added using `ordNub` rather than incidentally alphabetized. + +- Prepend rather than append `extra-prog-path` [#6304](https://github.com/haskell/cabal/issues/6304) [#8506](https://github.com/haskell/cabal/pull/8506) + + Prepends the `extra-prog-path` to the system path rather than appending, to allow binaries in the extra path to override defaults. + +- don't send non-extant `extra-lib-dirs` to GHC [#6492](https://github.com/haskell/cabal/issues/6492) [#8510](https://github.com/haskell/cabal/pull/8510) + + If an extra-libs-dir does not exist, it does not get sent to ghc, which can error on windows. + +- Improve mutually recursive unit identifier error message [#8582](https://github.com/haskell/cabal/pull/8582) + + Improves the error message in case of mutually recursive unit identifiers + by specifying the name of the identifier, the name of the signature, and a suggestion + to check the 'build-depends:' section. + +- Specify default exe extension on wasm32 to be .wasm [#8633](https://github.com/haskell/cabal/pull/8633) + + Specify default exe extension on wasm32 to be .wasm, following the convention in other WebAssembly toolchains. + +- Support `js-sources` with GHC, not only with GHCJS [#8636](https://github.com/haskell/cabal/pull/8636) + + - Take into account js-sources when building library components with GHC + - Missing support for js-sources in executable components is tracked in #8639 + +- Tiny refactor of how Cabal handles configure scripts [#8648](https://github.com/haskell/cabal/pull/8648) + + None of this is visible downstream + + - Remove needless parameter on one private function. + + - Move another internal function (and ones that only it uses from the same module) to new private module. + +- Warn if expected files are omitted from extra-doc-files [#3964](https://github.com/haskell/cabal/issues/3964) [#8657](https://github.com/haskell/cabal/pull/8657) + + - Emit a warning if there exist a “changelog” file at the root of the + package which is not included in any field. + - Emit a warning if a “changelog” file at the root of the package is included + in a field different from “extra-doc-files” (Cabal spec >= 1.18) or + “extra-source-files” (spec < 1.18). + +- Disallow GHC <8.0 for [#7531](https://github.com/haskell/cabal/issues/7531) [#8715](https://github.com/haskell/cabal/issues/8715) [#8794](https://github.com/haskell/cabal/pull/8794) + + Disallow GHC <8.0 by restricting the version of base that can be used to at least 4.9 + +- Avoid spurious warnings from -with-rtsopts [#4255](https://github.com/haskell/cabal/issues/4255) [#8183](https://github.com/haskell/cabal/pull/8183) + +- Do not print "up to date" for commands unless running "cabal build" [#4994](https://github.com/haskell/cabal/issues/4994) [#8569](https://github.com/haskell/cabal/pull/8569) + +- The `configure` script of `build-type: configure` packages now has access to the flag assignment of the package being built via the `CABAL_FLAGS` and `CABAL_FLAG_` environment variables [#8564](https://github.com/haskell/cabal/issues/8564) [#8565](https://github.com/haskell/cabal/pull/8565) + +- Export pretty printer `ppPackageCheck` from [#8311](https://github.com/haskell/cabal/pull/8311) + +- Add check for upper bound on any dependency in `cabal check` [#8291](https://github.com/haskell/cabal/issues/8291) [#8339](https://github.com/haskell/cabal/pull/8339) + +- *Cabal-syntax* Relax language selection parsing in `cabal init` [#8278](https://github.com/haskell/cabal/issues/8278) [#8281](https://github.com/haskell/cabal/pull/8281) diff --git a/release-notes/Cabal-3.10.2.0.md b/release-notes/Cabal-3.10.2.0.md new file mode 100644 index 00000000000..0c60f7ff239 --- /dev/null +++ b/release-notes/Cabal-3.10.2.0.md @@ -0,0 +1,26 @@ +Cabal and Cabal-syntax 3.10.2.0 changelog and release notes +--- + +## Release 3.10.2.0 is strictly a bug-fix release, with the fixes listed below + +- Shorten script-builds paths [#8841](https://github.com/haskell/cabal/issues/8841) [#8898](https://github.com/haskell/cabal/pull/8898) + + - Use Base64 hash truncated to 26 chars for script-build cache directories. + - Use the cache directory as the dist directory. + - Use script- as the component name instead of cabal-script-<...>. + - Use cabal-script- for the executable name. + - This change is incompatible with previous cabal versions in terms of cache location, + you should manually remove your old caches once you no longer need them. + +- Do not always pass --quickjump to haddock #9049 [#9060](https://github.com/haskell/cabal/issues/9060) [#9049](https://github.com/haskell/cabal/pull/9049) + + 6d8adf13101 caused `cabal` to always pass the `--quickjump` flag to Haddock. + Not only does this waste memory for a service that user hasn't asked for, + but also leads to a failure with Haddocks shipped with GHC 9.0 and 9.2, + which had a separate bug (fixed in later versions but not backported) when + Haddock does not pass `--quickjump` recursively to the package dependencies. + +- Regenerate Lexer.hs to avoid out-of-bound array access due to a bug in Alex [#8892](https://github.com/haskell/cabal/issues/8892) [#8896](https://github.com/haskell/cabal/pull/8896) + + - Regenerate Cabal-syntax's Lexer.hs with Alex 3.2.7.3 which includes a fix for + an out-of-bound array access (only noticeable with GHC's JavaScript backend). diff --git a/release-notes/Cabal-3.10.2.1.md b/release-notes/Cabal-3.10.2.1.md new file mode 100644 index 00000000000..bfa8fa750b5 --- /dev/null +++ b/release-notes/Cabal-3.10.2.1.md @@ -0,0 +1,9 @@ +Cabal and Cabal-syntax 3.10.2.1 changelog and release notes +--- + +## Release 3.10.2.1 is strictly a bug-fix release, with the fixes listed below + +- Relax extension .c requirement for c-sources [#9285](https://github.com/haskell/cabal/pull/9285) + +We will be tightening the behaviour of Cabal in the future, when users list files ending with extensions other than `.c` in the `c-sources` field of their cabal file. These files were never processed properly. +This PR displays more warnings and prepares the transition. diff --git a/release-notes/Cabal-3.10.3.0.md b/release-notes/Cabal-3.10.3.0.md new file mode 100644 index 00000000000..3488616b920 --- /dev/null +++ b/release-notes/Cabal-3.10.3.0.md @@ -0,0 +1,15 @@ +Cabal and Cabal-syntax 3.10.3.0 changelog and release notes +--- + +## Release 3.10.3.0 is strictly a bug-fix release, with the fixes listed below + +- PkgConfig environment variables [#9134](https://github.com/haskell/cabal/pull/9134) + - `cabal` invokes `pkg-config` with `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS` and `PKG_CONFIG_ALLOW_SYSTEM_LIBS` set + +- Support text-2.1 in Cabal and Cabal-syntax [#9242](https://github.com/haskell/cabal/pull/9242) + +- Fix extra-prog-path propagation [#7649](https://github.com/haskell/cabal/issues/7649) [#9519](https://github.com/haskell/cabal/issues/9519) [#9527](https://github.com/haskell/cabal/pull/9527) + - extra-prog-paths are now propagated to all commands. This in particular helps + when running a MinGW cabal in the PowerShell, where the MSYS2 paths are + usually not available in the PowerShell PATH. GHCup already sets them up for + us but they were sometimes lost on the way. diff --git a/release-notes/cabal-install-3.10.1.0.md b/release-notes/cabal-install-3.10.1.0.md new file mode 100644 index 00000000000..88cae108891 --- /dev/null +++ b/release-notes/cabal-install-3.10.1.0.md @@ -0,0 +1,213 @@ +cabal-install and cabal-install-solver 3.10.1.0 changelog and release notes +--- + +Release 3.10.1.0 of cabal now sets the `--enable-documentation` option by default +when running `cabal haddock` (https://github.com/haskell/cabal/issues/7462). +If the new default does not fit your workflow, pass an explicit `--disable-documentation` +option or consider (helping to implement) the other workarounds proposed +in https://github.com/haskell/cabal/issues/8725. + +This version of cabal introduces support for JS cross-compilation (https://github.com/haskell/cabal/pull/8636). +We've seen related Windows segfaults on CI, so please kindly report if you can reproduce either +cabal or GHC segfaults when cross-compiling for JS or compiling normally but with any files +listed in the `js-sources` field of a .cabal file. + +This release of cabal also fixes a lot of bugs in cabal 3.8.1.0 and not all of the fixes +are listed here. + + +### Significant changes + +- `Cabal-3.10.1.0` is used, which brings [its own set of changes](./Cabal-3.10.1.0.md), + many of which are significant. The Cabal and Cabal-syntax changes that touch + the cabal-install or cabal-install-solver codebases are pasted here again in full. + +- Add support for the XDG Base Directory Specification [#680](https://github.com/haskell/cabal/issues/680) [#7386](https://github.com/haskell/cabal/pull/7386) + + Cabal/cabal-install now uses the XDG Base Directory Specification to + store configuration, caches, and the store. Specifically, + `$XDG_CONFIG_HOME/cabal` stores the configuration file, + `$XDG_CACHE_HOME/cabal` stores downloaded packages and similar, and + `$XDG_STATE_HOME/cabal` mainly contains the store of compiled + packages. Further, `cabal install` will put executables in + `~/.local/bin` by default. + + The `dist`/`dist-newstyle` directories are not affected. + + On Windows, these XDG paths are mapped to other (hopefully) + appropriate locations. See the Cabal User Guide for information. + + If the `CABAL_DIR` environment variable is set, the indicated + directory will be used to store all Cabal-related files, as in + previous versions. + + **Backwards compatibility**: If `~/.cabal` already exists, this will be + interpreted as `CABAL_DIR=~/.cabal`. This means that upgrading on an + existing system already using cabal-install should not cause any + change in behaviour. An existing system can be migrated by deleting + `~/.cabal` (possibly copying `~/.cabal/config` to + `~/.config/cabal/config` first). + +- Add `installDirs` (`datadir`, etc) to v2-build and remove them from v2-install [#8556](https://github.com/haskell/cabal/pull/8556) + + - Passes through `--prefix`, `--datadir` and other `installdir`-arguments properly in v2-build, allowing its use in preparing somewhat more relocatable compilation targets (no worse than v1-build). + - Removes these flags (which never worked) from v2-install + +- No global packages auto written to environment files, allow `--force-reinstalls` [#5559](https://github.com/haskell/cabal/issues/5559) [#6165](https://github.com/haskell/cabal/issues/6165) [#8607](https://github.com/haskell/cabal/pull/8607) + + - When v2-install runs on a library, it does not pin global packages in the env file, only those directly necessary for the library. + +- Add support for GHC 9.4+ `-fprof-late` flag [#8528](https://github.com/haskell/cabal/pull/8528) + + - This adds the new `late-toplevel` (and its alias `late`) profiling-detail option which enables `-fprof-late`-based automatic cost centre annotations for GHCs that support it ([earliest is GHC 9.4.1](https://downloads.haskell.org/ghc/9.4.1/docs/users_guide/profiling.html#ghc-flag--fprof-late)). + +- Added `haddock-project` command [#7669](https://github.com/haskell/cabal/issues/7669) [#8162](https://github.com/haskell/cabal/pull/8162) + + The `haddock-project` command can be used to build documentation of multiple + packages. By passing `--local` option the directory will be self contained, + by passing `--hackage` links to dependencies will link to `hackage`. Both + `--local` and `--hackage` options imply `--quickfix`, `--gen-index`, + `--gen-contents`, and `--hyperlinked-source`. + + Building self contained directory is the default, unless `--hackage` or + `--html-location`. + + The PR #8162 also fixes the `--with-haddock` option. + + +### Other changes + +- Pretty-print run targets on failure [#8189](https://github.com/haskell/cabal/issues/8189) [#8234](https://github.com/haskell/cabal/pull/8234) + + - Targets of the `run` command are pretty-printed when failing due to multiple targets. + - Duplicate targets are removed in the output. + +- Expose `BuildFlags` and `ClientHaddockFlags` [#8351](https://github.com/haskell/cabal/issues/8351) [#8353](https://github.com/haskell/cabal/pull/8353) + + Some types are present in public functions in cabal-install, but they are not exported. + This PR fix it for BuildFlags and ClientHaddockFlags. + +- `cabal man` handles `$PAGER` containing arguments now [#8405](https://github.com/haskell/cabal/issues/8405) [#8353](https://github.com/haskell/cabal/pull/8353) + + Things like `PAGER="less -FX" cabal man` work now. + + There's a slight change in the default behavior. We still use `less -R` as the default, + but if the user passes `PAGER=less`, we won't add -R to that, unlike before. This is + reasonable, as the user should be able to set the variable as they see fit. + +- Fix issue with "nix" config option [#8452](https://github.com/haskell/cabal/issues/8452) [#8522](https://github.com/haskell/cabal/pull/8522) + + Nix option in config file was broken with [#8054](https://github.com/haskell/cabal/pull/8054), this should fix it. + +- "Build profile" message now reflects optimization level set in global config [#8487](https://github.com/haskell/cabal/issues/8487) [#8488](https://github.com/haskell/cabal/pull/8488) + + Imagine you have `optimization: 2` in your `~/.cabal/config`, and you call `cabal build` + in a project that doesn't have optimization level explicitly set in its project file. + You will still see 'Build profile: -w ghc- -O1'. This is incorrect and was fixed + in this patch: now you'll see '-O2'. + +- `ghc`, `ghc-boot`, `ghci` packages should be non-upgradable [#8489](https://github.com/haskell/cabal/issues/8489) [#8501](https://github.com/haskell/cabal/pull/8501) + + - Changed both `Distribution.Client.Dependency`'s `dontUpgradeNonUpgradeablePackages` + and `Distribution.Solver.Modular.Solver`'s `nonInstallable` to be in sync. + +- Apply command line flags to install packages [#8637](https://github.com/haskell/cabal/issues/8637) [#8779](https://github.com/haskell/cabal/pull/8779) + + - Command line flags usually only apply to "local" packages (packages specified + in the cabal.project). This change causes the v2-install command to ignore + that distinction to better match the expected behavior for packages specified + directly in the command. + +- Print a warning when assertions are enabled [#4377](https://github.com/haskell/cabal/issues/4377) [#8240](https://github.com/haskell/cabal/pull/8240) + + - Now cabal-install executable will print a warning if assertions are enabled + +- Implement `--prefer-oldest` [#8261](https://github.com/haskell/cabal/pull/8261) + + - The new flag makes Cabal solver try to find a build plan with the oldest versions possible. This is useful to establish lower bounds. + +- Update and sdist now only check for compiler when project file has conditionals [#8352](https://github.com/haskell/cabal/issues/8352) [#8550](https://github.com/haskell/cabal/issues/8550) [#8589](https://github.com/haskell/cabal/issues/8589) [#8358](https://github.com/haskell/cabal/pull/8358) [#8627](https://github.com/haskell/cabal/pull/8627) + + - Cabal update and sdist will not require a ghc in path unless the project has conditionals that require it + +- Allow offline bootstrapping of cabal-install [#8368](https://github.com/haskell/cabal/pull/8368) + + - The bootstrap script for cabal-install now supports fetching the sources of the dependencies in a separate step. + One can then copy over the resulting archive and perform offline bootstrapping of cabal-install. + +- Pass some haddock flags to dependencies [#395](https://github.com/haskell/cabal/issues/395) [#8104](https://github.com/haskell/cabal/issues/8104) [#8414](https://github.com/haskell/cabal/pull/8414) + + - Pass `--haddock-hoogle`, `--haddock-html`, `--haddock-internal`, `--haddock-quickjump`, `--haddock-hyperlinked-source` + to all the dependencies if they are specified as command line args + +- build pkgconfig db individually when bulk fails [#8494](https://github.com/haskell/cabal/issues/8494) [#8496](https://github.com/haskell/cabal/pull/8496) + + - When pkg-config fails to get versions for all packages in bulk, falls back to querying one-by-one. + +- improve install target handling logic regarding of project files [#8094](https://github.com/haskell/cabal/issues/8094) [#8352](https://github.com/haskell/cabal/issues/8352) [#8498](https://github.com/haskell/cabal/pull/8498) + + - fixes an issue where `cabal install pkg-x.y.z` fails unless `--ignore-project` is given + - fixes an issue where `cabal install --ignore-project` crashes when a project file is present + +- Redownload packages when source hash verification fails [#7541](https://github.com/haskell/cabal/issues/7541) [#8500](https://github.com/haskell/cabal/pull/8500) + + - Cabal-install will verify source hashes on cached downloads against the current index, and redownload on mismatch. (Which can occur with e.g. head.hackage) + +- `cabal init -i` should sanitize package name guessed from the directory name [#8404](https://github.com/haskell/cabal/issues/8404) [#8561](https://github.com/haskell/cabal/pull/8561) + + If the current directory name has any non-alphanumeric symbols in its name, the symbols will be replaced with a dash. Also, will make sure that the resulting package name starts with a letter. + + This worked for cabal init -n already, and this PR only moves code around so that cabal init -i also benefits from this logic. + +- Support `js-sources` with GHC, not only with GHCJS [#8636](https://github.com/haskell/cabal/pull/8636) + + - Take into account `js-sources` when building library components with GHC + - Missing support for `js-sources` in executable components is tracked in #8639 + +- Fix `extra-source-file` rebuild tracking when run in a multi-package project [#8632](https://github.com/haskell/cabal/issues/8632) [#8634](https://github.com/haskell/cabal/issues/8634) [#8640](https://github.com/haskell/cabal/pull/8640) + + - Fixes an issue where glob expansion of `extra-source-files` for rebuild tracking purposes was not occurring correctly when run in a multi-package setting (i.e. when the globs needed to be expanded relative to something other than "."). + +- No up-front warning that assertions are on for special commands (help, version, numeric-version) [#8645](https://github.com/haskell/cabal/issues/8645) [#8647](https://github.com/haskell/cabal/pull/8647) + + - When compiled with ghc option `-fno-ignore-assert`, `cabal-install` will issue a generic warning that assertions are on. + This warning will no longer be emitted for special modes of operation like `cabal --numeric-version`, `--version` and help, + and also not if `cabal` could not parse its command line. + Further, the warning now goes to `stderr` rather than `stdout`. + +- Fix and improve list parser for `cabal init` arguments [#8659](https://github.com/haskell/cabal/issues/8659) [#8663](https://github.com/haskell/cabal/pull/8663) + + Occurrences of 'Flag [a]' seem to behave in an unexpected way. The monoid + instance of 'Flag' is right associative and discard the value on the + left, but we want to merge the contents of 'Flag'. + + Permits: + - `cabal init -d base -d vector -d containers` + + Fixes for all Flag '[a]' the cli parser in cabal init. Adds cli parser tests. + + Adds the feature to specify a comma-separated list of dependencies: + - `cabal init -d base,vector,containers` + +- Fix resolution of imports by relative paths in cabal.project [#8686](https://github.com/haskell/cabal/pull/8686) + + Fix bug where cabal tries to resolve imports by relative paths against + the directory cabal executable was invoked in rather than directory of + cabal.project file that does the import. + +- Fix `cabal repl` discarding `--build-depends` [#6859](https://github.com/haskell/cabal/issues/6859) [#7081](https://github.com/haskell/cabal/issues/7081) [#8732](https://github.com/haskell/cabal/pull/8732) + + - Fix `repl` command discarding `--build-depends` argument when using + `allow-newer` or `allow-older`. + +- Add `cabal get --only-package-description` [#1954](https://github.com/haskell/cabal/issues/1954) [#1977](https://github.com/haskell/cabal/pull/1977) [#5162](https://github.com/haskell/cabal/pull/5162) [#8263](https://github.com/haskell/cabal/pull/8263) + +- `cabal haddock` now implies `--enable-documentation` [#7462](https://github.com/haskell/cabal/issues/7462) [#8259](https://github.com/haskell/cabal/pull/8259) + +- Include `extra-lib-dirs-static` into `PackageHash` [#6935](https://github.com/haskell/cabal/issues/6935) [#7794](https://github.com/haskell/cabal/pull/7794) + +- Document `cabal check` in the user guide [#8237](https://github.com/haskell/cabal/pull/8237) + +- Add documentation (or stubs) for cabal-install commands: `fetch`, `get`, `info`, `init`, `list`, `report`, `unpack`, `upload`, `user-config` [#7884](https://github.com/haskell/cabal/issues/7884) [#7978](https://github.com/haskell/cabal/issues/7978) [#8308](https://github.com/haskell/cabal/issues/8308) [#8309](https://github.com/haskell/cabal/pull/8309) + +- Add check for upper bound on any dependency in `cabal check` [#8291](https://github.com/haskell/cabal/issues/8291) [#8339](https://github.com/haskell/cabal/pull/8339) diff --git a/release-notes/cabal-install-3.10.2.0.md b/release-notes/cabal-install-3.10.2.0.md new file mode 100644 index 00000000000..52dc5de7b8f --- /dev/null +++ b/release-notes/cabal-install-3.10.2.0.md @@ -0,0 +1,60 @@ +cabal-install and cabal-install-solver 3.10.2.0 changelog and release notes +--- + +## Release 3.10.2.0 is strictly a bug-fix release, with the fixes listed below + +- Fix parsing of password-command option [#9002](https://github.com/haskell/cabal/pull/9002) + + The password-command option did not parse its value correctly. + Quotes were ignored, making many kinds of commands impossible to + express (e.g. `sh -c "foo | bar"`). Also, `cabal user-config` + treated the argument list as a *list of option values*, rather than a + *value that is a list*. As a consequence, `cabal user-config + update` corrupted the value in the config file. + + Fixed these issues by parsing the command as a space separated list + of tokens (which may be enclosed in double quotes), and treating the + parsed list-of-token as one value (not multiple). + +- Existence of $XDG_CONFIG_HOME/cabal/config now overrides existence of $HOME/.cabal [#8577](https://github.com/haskell/cabal/issues/8577) + + To avoid pre-XDG backwards compatibility from triggering due to other + tools accidentally creating a $HOME/.cabal directory, the presence of + $XDG_CONFIG_HOME/cabal/config now disables pre-XDG backwards + compatibility. Presumably $XDG_CONFIG_HOME/cabal/config will never be + created by accident. + +- Shorten script-builds paths [#8841](https://github.com/haskell/cabal/issues/8841) [#8898](https://github.com/haskell/cabal/pull/8898) + + - Use Base64 hash truncated to 26 chars for script-build cache directories. + - Use the cache directory as the dist directory. + - Use script- as the component name instead of cabal-script-<...>. + - Use cabal-script- for the executable name. + - This change is incompatible with previous cabal versions in terms of cache location, + you should manually remove your old caches once you no longer need them. + +- Don't add `extra-prog-path: ~/.local/bin` when initially creating `~/.config/cabal/config` [#8951](https://github.com/haskell/cabal/issues/8951) + +- Use compiler flags for caching project config [#8819](https://github.com/haskell/cabal/pull/8819) + + This ensures that cached project configs with conditionals re-execute the conditional logic when the compiler changes. + +- Fix default Nix configuration option in generated ~/.cabal/config file [#8878](https://github.com/haskell/cabal/pull/8878) + + Fixes the default for ~/.cabal/config file. The nix option should now be commented out by default. + +- add base to cabal install --lib default env file [#8903](https://github.com/haskell/cabal/pull/8903) + + This adds base by default to the env file created by `cabal install --lib`. Further it ensures that packagedbs have been created before adding them to the env file. + +- Do not check PVP on internal targets [#8361](https://github.com/haskell/cabal/issues/8361) [#9004](https://github.com/haskell/cabal/pull/9004) + + - `cabal check` will not check for dependencies upper bounds in internal + targets (i.e. test-suites and benchmarks) + +- Add new Hackage root keys to bootstrap set [#9068](https://github.com/haskell/cabal/pull/9068) + + The two new [Hackage root keyholders](https://github.com/haskell-infra/hackage-root-keys/tree/master/root-keys) were added to the bootstrap set. + + - Added Hackage root key for Joachim Breitner + - Added Hackage root key for Mathieu Boespflug diff --git a/release-notes/cabal-install-3.10.2.1.md b/release-notes/cabal-install-3.10.2.1.md new file mode 100644 index 00000000000..3f971275c80 --- /dev/null +++ b/release-notes/cabal-install-3.10.2.1.md @@ -0,0 +1,4 @@ +cabal-install and cabal-install-solver 3.10.2.1 changelog and release notes +--- + +## Release 3.10.2.1 is strictly a bounds bump release for GHC 9.8 compatibility diff --git a/release-notes/cabal-install-3.10.3.0.md b/release-notes/cabal-install-3.10.3.0.md new file mode 100644 index 00000000000..f057eb4ca53 --- /dev/null +++ b/release-notes/cabal-install-3.10.3.0.md @@ -0,0 +1,45 @@ +cabal-install and cabal-install-solver 3.10.3.0 changelog and release notes +--- + +## Release 3.10.3.0 is strictly a bug-fix release, with the fixes listed below + +- PkgConfig individual calls [#9134](https://github.com/haskell/cabal/pull/9134) + + - `cabal` invokes `pkg-config` individually for each lib if querying for all doesn't return the expected result + +- Use compiler flags for caching project config [#8819](https://github.com/haskell/cabal/pull/8819) + + This ensures that cached project configs with conditionals re-execute the conditional logic when the compiler changes. + +- Make `check` recognise `TypeAbstractions` [#9496](https://github.com/haskell/cabal/issues/9496) [#9503](https://github.com/haskell/cabal/pull/9503) + + - `cabal check` will not complain about “Unknown extension” when + finding `TypeAbstractions`. + +- `check`: add PackageInfo warning [#9331](https://github.com/haskell/cabal/issues/9331) [#9525](https://github.com/haskell/cabal/pull/9525) + + `cabal check` will warn about PackageInfo_* modules and provide an upgrade path to 3.12. + +- Fix extra-prog-path propagation [#7649](https://github.com/haskell/cabal/issues/7649) [#9519](https://github.com/haskell/cabal/issues/9519) [#9527](https://github.com/haskell/cabal/pull/9527) + + - extra-prog-paths are now propagated to all commands. This in particular helps + when running a MinGW cabal in the PowerShell, where the MSYS2 paths are + usually not available in the PowerShell PATH. GHCup already sets them up for + us but they were sometimes lost on the way. + +- fix pkgconfig-depends for pkgconf-1.9 [#8923](https://github.com/haskell/cabal/issues/8923) [#9391](https://github.com/haskell/cabal/pull/9391) + +- Ignore invalid Unicode in pkg-config descriptions [#9608](https://github.com/haskell/cabal/issues/9608) [#9609](https://github.com/haskell/cabal/pull/9609) + + Previously, cabal-install would crash when `pkg-config --list-all` contained + invalid Unicode. With this change, invalid unicode in package descriptions is + ignored, and unparseable package names are considered nonexistent. + +- Script cache dir is the base16 hash of the canonical path of the script. [#9459](https://github.com/haskell/cabal/pull/9459) + + Script cache dir is the base16 hash of the canonical path of the script. + +- Fix run command environment [#8391](https://github.com/haskell/cabal/issues/8391) [#9341](https://github.com/haskell/cabal/pull/9341) + + - The Run command will now add binary paths of dependencies + (build-tool-depends) to PATH, just like Exec and Test commands. diff --git a/scripts/release/create-yaml-snippet.sh b/scripts/release/create-yaml-snippet.sh new file mode 100755 index 00000000000..1cfeda5f997 --- /dev/null +++ b/scripts/release/create-yaml-snippet.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +set -eu +set -o pipefail + +RELEASE=$1 +VERSION=${RELEASE#cabal-install-v} + +cd "gh-release-artifacts/cabal-${VERSION}" +BASE_URL=https://downloads.haskell.org/ghcup/unofficial-bindists/cabal/$VERSION + +cat < /dev/stdout + $VERSION: + viTags: + - Latest + viChangeLog: https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-$VERSION.md + viArch: + A_64: + Linux_Debian: + '< 10': &cabal-${VERSION//./}-64-deb9 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-deb9.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-deb9.tar.xz" | awk '{ print $1 }') + '(>= 10 && < 11)': &cabal-${VERSION//./}-64-deb10 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-deb10.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-deb10.tar.xz" | awk '{ print $1 }') + '( >= 11)': &cabal-${VERSION//./}-64-deb11 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-deb11.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-deb11.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-deb9 + Linux_Ubuntu: + '( >= 16 && < 19 )': &cabal-${VERSION//./}-64-ubuntu18 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-ubuntu18.04.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-ubuntu18.04.tar.xz" | awk '{ print $1 }') + '( >= 20 && < 22 )': &cabal-${VERSION//./}-64-ubuntu20 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-ubuntu20.04.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-ubuntu20.04.tar.xz" | awk '{ print $1 }') + '( >= 22 )': &cabal-${VERSION//./}-64-ubuntu22 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-ubuntu22.04.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-ubuntu22.04.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-ubuntu18 + Linux_Mint: + '(>= 20 && < 21)': &cabal-${VERSION//./}-64-mint20 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-mint20.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-mint20.tar.xz" | awk '{ print $1 }') + '>= 21': &cabal-${VERSION//./}-64-mint21 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-mint21.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-mint21.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-mint20 + Linux_Fedora: + '< 33': &cabal-${VERSION//./}-64-fedora27 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-fedora27.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-fedora27.tar.xz" | awk '{ print $1 }') + '(>= 33 && < 37)': &cabal-${VERSION//./}-64-fedora33 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-fedora33.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-fedora33.tar.xz" | awk '{ print $1 }') + '>= 37': &cabal-${VERSION//./}-64-fedora37 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-fedora37.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-fedora37.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-fedora27 + Linux_CentOS: + '( >= 7 && < 8 )': &cabal-${VERSION//./}-64-centos + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-centos7.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-centos7.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-centos + Linux_Rocky: + '( >= 8 && < 9 )': &cabal-${VERSION//./}-64-rocky8 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-rocky8.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-rocky8.tar.xz" | awk '{ print $1 }') + '( >= 9 )': &cabal-${VERSION//./}-64-rocky9 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-rocky9.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-rocky9.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-rocky8 + Linux_RedHat: + unknown_versioning: *cabal-${VERSION//./}-64-centos + Linux_UnknownLinux: + unknown_versioning: &cabal-${VERSION//./}-64-unknown + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-unknown.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-unknown.tar.xz" | awk '{ print $1 }') + Linux_Alpine: + '( >= 3.12 && < 3.19 )': &cabal-${VERSION//./}-64-alpine312 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-alpine312.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-alpine312.tar.xz" | awk '{ print $1 }') + '( >= 3.19 )': &cabal-${VERSION//./}-64-alpine319 + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-linux-alpine319.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-linux-alpine319.tar.xz" | awk '{ print $1 }') + unknown_versioning: *cabal-${VERSION//./}-64-unknown + Linux_Void: + unknown_versioning: *cabal-${VERSION//./}-64-unknown + Darwin: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-apple-darwin.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-apple-darwin.tar.xz" | awk '{ print $1 }') + Windows: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-mingw64.zip + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-mingw64.zip" | awk '{ print $1 }') + FreeBSD: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-x86_64-portbld-freebsd.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-x86_64-portbld-freebsd.tar.xz" | awk '{ print $1 }') + A_32: + Linux_UnknownLinux: + unknown_versioning: &cabal-${VERSION//./}-32-unknown + dlUri: ${BASE_URL}/cabal-install-$VERSION-i386-linux-unknown.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-i386-linux-unknown.tar.xz" | awk '{ print $1 }') + Linux_Alpine: + unknown_versioning: *cabal-${VERSION//./}-32-unknown + A_ARM64: + Linux_UnknownLinux: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-aarch64-linux-deb10.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-aarch64-linux-deb10.tar.xz" | awk '{ print $1 }') + Darwin: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-aarch64-apple-darwin.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-aarch64-apple-darwin.tar.xz" | awk '{ print $1 }') + A_ARM: + Linux_UnknownLinux: + unknown_versioning: + dlUri: ${BASE_URL}/cabal-install-$VERSION-armv7-linux-deb10.tar.xz + dlHash: $(sha256sum "cabal-install-$VERSION-armv7-linux-deb10.tar.xz" | awk '{ print $1 }') +EOF + diff --git a/scripts/release/download-gh-artifacts.sh b/scripts/release/download-gh-artifacts.sh new file mode 100755 index 00000000000..38c57169187 --- /dev/null +++ b/scripts/release/download-gh-artifacts.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -eu +set -o pipefail + +RELEASE=$1 +VERSION=${RELEASE#cabal-install-v} +SIGNER=$2 + +echo "RELEASE: $RELEASE" +echo "SIGNER: $SIGNER" + +for com in gh gpg curl sha256sum ; do + command -V ${com} >/dev/null 2>&1 +done + +[ ! -e "gh-release-artifacts/cabal-${VERSION}" ] + +mkdir -p "gh-release-artifacts/cabal-${VERSION}" + +git archive --format=tar.gz -o "gh-release-artifacts/cabal-${VERSION}/cabal-${VERSION}-src.tar.gz" --prefix="cabal-${VERSION}/" HEAD + +cd "gh-release-artifacts/cabal-${VERSION}" + +# github +gh release download "$RELEASE" + +sha256sum ./* > SHA256SUMS +gpg --detach-sign -u "${SIGNER}" SHA256SUMS + +gh release upload "$RELEASE" "cabal-${VERSION}-src.tar.gz" SHA256SUMS SHA256SUMS.sig + diff --git a/solver-benchmarks/LICENSE b/solver-benchmarks/LICENSE index 0a4969ac826..a3a25c7d9e4 100644 --- a/solver-benchmarks/LICENSE +++ b/solver-benchmarks/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2003-2022, Cabal Development Team. +Copyright (c) 2003-2023, Cabal Development Team. See the AUTHORS file for the full list of copyright holders. See */LICENSE for the copyright holders of the subcomponents. diff --git a/solver-benchmarks/solver-benchmarks.cabal b/solver-benchmarks/solver-benchmarks.cabal index a1c974a6cb8..b64e9d9f846 100644 --- a/solver-benchmarks/solver-benchmarks.cabal +++ b/solver-benchmarks/solver-benchmarks.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: solver-benchmarks version: 3 -copyright: 2003-2022, Cabal Development Team (see AUTHORS file) +copyright: 2003-2023, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team @@ -31,7 +31,7 @@ library base, bytestring, containers, - Cabal-syntax ^>= 3.9, + Cabal-syntax ^>= 3.10, directory, filepath, optparse-applicative, diff --git a/templates/Lexer.x b/templates/Lexer.x index b9f2d833082..a10045e137e 100644 --- a/templates/Lexer.x +++ b/templates/Lexer.x @@ -83,22 +83,22 @@ $instresc = $printable tokens :- <0> { - @bom? { \_ len _ -> do - when (len /= 0) $ addWarning LexWarningBOM + @bom? { \pos len _ -> do + when (len /= 0) $ addWarningAt pos LexWarningBOM setStartCode bol_section lexToken } } { - @nbspspacetab* @nl { \_pos len inp -> checkWhitespace len inp >> adjustPos retPos >> lexToken } + @nbspspacetab* @nl { \pos len inp -> checkWhitespace pos len inp >> adjustPos retPos >> lexToken } -- no @nl here to allow for comments on last line of the file with no trailing \n $spacetab* "--" $comment* ; -- TODO: check the lack of @nl works here -- including counting line numbers } { - @nbspspacetab* { \pos len inp -> checkLeadingWhitespace len inp >> + @nbspspacetab* { \pos len inp -> checkLeadingWhitespace pos len inp >> if B.length inp == len then return (L pos EOF) else setStartCode in_section @@ -123,7 +123,7 @@ tokens :- } { - @nbspspacetab* { \pos len inp -> checkLeadingWhitespace len inp >>= \len' -> + @nbspspacetab* { \pos len inp -> checkLeadingWhitespace pos len inp >>= \len' -> if B.length inp == len then return (L pos EOF) else setStartCode in_field_layout @@ -172,17 +172,17 @@ toki t pos len input = return $! L pos (t (B.take len input)) tok :: Token -> Position -> Int -> ByteString -> Lex LToken tok t pos _len _input = return $! L pos t -checkLeadingWhitespace :: Int -> ByteString -> Lex Int -checkLeadingWhitespace len bs +checkLeadingWhitespace :: Position -> Int -> ByteString -> Lex Int +checkLeadingWhitespace pos len bs | B.any (== 9) (B.take len bs) = do - addWarning LexWarningTab - checkWhitespace len bs - | otherwise = checkWhitespace len bs + addWarningAt pos LexWarningTab + checkWhitespace pos len bs + | otherwise = checkWhitespace pos len bs -checkWhitespace :: Int -> ByteString -> Lex Int -checkWhitespace len bs +checkWhitespace :: Position -> Int -> ByteString -> Lex Int +checkWhitespace pos len bs | B.any (== 194) (B.take len bs) = do - addWarning LexWarningNBSP + addWarningAt pos LexWarningNBSP return $ len - B.count 194 (B.take len bs) | otherwise = return len diff --git a/tests/IntegrationTests2/config/default-config b/tests/IntegrationTests2/config/default-config new file mode 100644 index 00000000000..8e3aa02742c --- /dev/null +++ b/tests/IntegrationTests2/config/default-config @@ -0,0 +1,246 @@ +-- This is the configuration file for the 'cabal' command line tool. +-- +-- The available configuration options are listed below. +-- Some of them have default values listed. +-- +-- Lines (like this one) beginning with '--' are comments. +-- Be careful with spaces and indentation because they are +-- used to indicate layout for nested sections. +-- +-- This config file was generated using the following versions +-- of Cabal and cabal-install: +-- Cabal library version: 3.11.0.0 +-- cabal-install version: 3.11 + + +repository hackage.haskell.org + url: http://hackage.haskell.org/ + -- secure: True + -- root-keys: + -- key-threshold: 3 + +-- ignore-expiry: False +-- http-transport: +-- nix: +-- store-dir: +-- active-repositories: +-- local-no-index-repo: +remote-repo-cache: /home/colton/.cabal/packages +-- logs-dir: /home/colton/.cabal/logs +-- default-user-config: +-- verbose: 1 +-- compiler: ghc +-- cabal-file: +-- with-compiler: +-- with-hc-pkg: +-- program-prefix: +-- program-suffix: +-- library-vanilla: True +-- library-profiling: +-- shared: +-- static: +-- executable-dynamic: False +-- executable-static: False +-- profiling: +-- executable-profiling: +-- profiling-detail: +-- library-profiling-detail: +-- optimization: True +-- debug-info: False +-- build-info: +-- library-for-ghci: +-- split-sections: False +-- split-objs: False +-- executable-stripping: +-- library-stripping: +-- configure-option: +-- user-install: True +-- package-db: +-- flags: +-- extra-include-dirs: +-- deterministic: +-- cid: +-- extra-lib-dirs: +-- extra-lib-dirs-static: +-- extra-framework-dirs: +extra-prog-path: /home/colton/.cabal/bin +-- instantiate-with: +-- tests: False +-- coverage: False +-- library-coverage: +-- exact-configuration: False +-- benchmarks: False +-- relocatable: False +-- response-files: +-- allow-depending-on-private-libs: +-- cabal-lib-version: +-- append: +-- backup: +-- constraint: +-- preference: +-- solver: modular +-- allow-older: False +-- allow-newer: False +-- write-ghc-environment-files: +-- documentation: False +-- doc-index-file: $datadir/doc/$arch-$os-$compiler/index.html +-- only-download: False +-- target-package-db: +-- max-backjumps: 4000 +-- reorder-goals: False +-- count-conflicts: True +-- fine-grained-conflicts: True +-- minimize-conflict-set: False +-- independent-goals: False +-- prefer-oldest: False +-- shadow-installed-packages: False +-- strong-flags: False +-- allow-boot-library-installs: False +-- reject-unconstrained-dependencies: none +-- reinstall: False +-- avoid-reinstalls: False +-- force-reinstalls: False +-- upgrade-dependencies: False +-- index-state: +-- root-cmd: +-- symlink-bindir: +build-summary: /home/colton/.cabal/logs/build.log +-- build-log: +remote-build-reporting: none +-- report-planning-failure: False +-- per-component: True +-- run-tests: +jobs: $ncpus +-- keep-going: False +-- offline: False +-- lib: False +-- package-env: +-- overwrite-policy: +-- install-method: +installdir: /home/colton/.cabal/bin +-- username: +-- password: +-- password-command: +-- builddir: + +haddock + -- keep-temp-files: False + -- hoogle: False + -- html: False + -- html-location: + -- executables: False + -- tests: False + -- benchmarks: False + -- foreign-libraries: False + -- all: + -- internal: False + -- css: + -- hyperlink-source: False + -- quickjump: False + -- hscolour-css: + -- contents-location: + -- index-location: + -- base-url: + -- lib: + -- output-dir: + +init + -- interactive: False + -- quiet: False + -- no-comments: False + -- minimal: False + -- cabal-version: 3.0 + -- license: + -- extra-doc-file: + -- tests: + -- test-dir: + -- simple: False + -- language: Haskell2010 + -- application-dir: app + -- source-dir: src + +install-dirs user + -- prefix: /home/colton/.cabal + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +install-dirs global + -- prefix: /usr/local + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +program-locations + -- alex-location: + -- ar-location: + -- c2hs-location: + -- cpphs-location: + -- doctest-location: + -- gcc-location: + -- ghc-location: + -- ghc-pkg-location: + -- ghcjs-location: + -- ghcjs-pkg-location: + -- greencard-location: + -- haddock-location: + -- happy-location: + -- haskell-suite-location: + -- haskell-suite-pkg-location: + -- hmake-location: + -- hpc-location: + -- hsc2hs-location: + -- hscolour-location: + -- jhc-location: + -- ld-location: + -- pkg-config-location: + -- runghc-location: + -- strip-location: + -- tar-location: + -- uhc-location: + +program-default-options + -- alex-options: + -- ar-options: + -- c2hs-options: + -- cpphs-options: + -- doctest-options: + -- gcc-options: + -- ghc-options: + -- ghc-pkg-options: + -- ghcjs-options: + -- ghcjs-pkg-options: + -- greencard-options: + -- haddock-options: + -- happy-options: + -- haskell-suite-options: + -- haskell-suite-pkg-options: + -- hmake-options: + -- hpc-options: + -- hsc2hs-options: + -- hscolour-options: + -- jhc-options: + -- ld-options: + -- pkg-config-options: + -- runghc-options: + -- strip-options: + -- tar-options: + -- uhc-options: diff --git a/tests/IntegrationTests2/nix-config/default-config b/tests/IntegrationTests2/nix-config/default-config new file mode 100644 index 00000000000..8e3aa02742c --- /dev/null +++ b/tests/IntegrationTests2/nix-config/default-config @@ -0,0 +1,246 @@ +-- This is the configuration file for the 'cabal' command line tool. +-- +-- The available configuration options are listed below. +-- Some of them have default values listed. +-- +-- Lines (like this one) beginning with '--' are comments. +-- Be careful with spaces and indentation because they are +-- used to indicate layout for nested sections. +-- +-- This config file was generated using the following versions +-- of Cabal and cabal-install: +-- Cabal library version: 3.11.0.0 +-- cabal-install version: 3.11 + + +repository hackage.haskell.org + url: http://hackage.haskell.org/ + -- secure: True + -- root-keys: + -- key-threshold: 3 + +-- ignore-expiry: False +-- http-transport: +-- nix: +-- store-dir: +-- active-repositories: +-- local-no-index-repo: +remote-repo-cache: /home/colton/.cabal/packages +-- logs-dir: /home/colton/.cabal/logs +-- default-user-config: +-- verbose: 1 +-- compiler: ghc +-- cabal-file: +-- with-compiler: +-- with-hc-pkg: +-- program-prefix: +-- program-suffix: +-- library-vanilla: True +-- library-profiling: +-- shared: +-- static: +-- executable-dynamic: False +-- executable-static: False +-- profiling: +-- executable-profiling: +-- profiling-detail: +-- library-profiling-detail: +-- optimization: True +-- debug-info: False +-- build-info: +-- library-for-ghci: +-- split-sections: False +-- split-objs: False +-- executable-stripping: +-- library-stripping: +-- configure-option: +-- user-install: True +-- package-db: +-- flags: +-- extra-include-dirs: +-- deterministic: +-- cid: +-- extra-lib-dirs: +-- extra-lib-dirs-static: +-- extra-framework-dirs: +extra-prog-path: /home/colton/.cabal/bin +-- instantiate-with: +-- tests: False +-- coverage: False +-- library-coverage: +-- exact-configuration: False +-- benchmarks: False +-- relocatable: False +-- response-files: +-- allow-depending-on-private-libs: +-- cabal-lib-version: +-- append: +-- backup: +-- constraint: +-- preference: +-- solver: modular +-- allow-older: False +-- allow-newer: False +-- write-ghc-environment-files: +-- documentation: False +-- doc-index-file: $datadir/doc/$arch-$os-$compiler/index.html +-- only-download: False +-- target-package-db: +-- max-backjumps: 4000 +-- reorder-goals: False +-- count-conflicts: True +-- fine-grained-conflicts: True +-- minimize-conflict-set: False +-- independent-goals: False +-- prefer-oldest: False +-- shadow-installed-packages: False +-- strong-flags: False +-- allow-boot-library-installs: False +-- reject-unconstrained-dependencies: none +-- reinstall: False +-- avoid-reinstalls: False +-- force-reinstalls: False +-- upgrade-dependencies: False +-- index-state: +-- root-cmd: +-- symlink-bindir: +build-summary: /home/colton/.cabal/logs/build.log +-- build-log: +remote-build-reporting: none +-- report-planning-failure: False +-- per-component: True +-- run-tests: +jobs: $ncpus +-- keep-going: False +-- offline: False +-- lib: False +-- package-env: +-- overwrite-policy: +-- install-method: +installdir: /home/colton/.cabal/bin +-- username: +-- password: +-- password-command: +-- builddir: + +haddock + -- keep-temp-files: False + -- hoogle: False + -- html: False + -- html-location: + -- executables: False + -- tests: False + -- benchmarks: False + -- foreign-libraries: False + -- all: + -- internal: False + -- css: + -- hyperlink-source: False + -- quickjump: False + -- hscolour-css: + -- contents-location: + -- index-location: + -- base-url: + -- lib: + -- output-dir: + +init + -- interactive: False + -- quiet: False + -- no-comments: False + -- minimal: False + -- cabal-version: 3.0 + -- license: + -- extra-doc-file: + -- tests: + -- test-dir: + -- simple: False + -- language: Haskell2010 + -- application-dir: app + -- source-dir: src + +install-dirs user + -- prefix: /home/colton/.cabal + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +install-dirs global + -- prefix: /usr/local + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +program-locations + -- alex-location: + -- ar-location: + -- c2hs-location: + -- cpphs-location: + -- doctest-location: + -- gcc-location: + -- ghc-location: + -- ghc-pkg-location: + -- ghcjs-location: + -- ghcjs-pkg-location: + -- greencard-location: + -- haddock-location: + -- happy-location: + -- haskell-suite-location: + -- haskell-suite-pkg-location: + -- hmake-location: + -- hpc-location: + -- hsc2hs-location: + -- hscolour-location: + -- jhc-location: + -- ld-location: + -- pkg-config-location: + -- runghc-location: + -- strip-location: + -- tar-location: + -- uhc-location: + +program-default-options + -- alex-options: + -- ar-options: + -- c2hs-options: + -- cpphs-options: + -- doctest-options: + -- gcc-options: + -- ghc-options: + -- ghc-pkg-options: + -- ghcjs-options: + -- ghcjs-pkg-options: + -- greencard-options: + -- haddock-options: + -- happy-options: + -- haskell-suite-options: + -- haskell-suite-pkg-options: + -- hmake-options: + -- hpc-options: + -- hsc2hs-options: + -- hscolour-options: + -- jhc-options: + -- ld-options: + -- pkg-config-options: + -- runghc-options: + -- strip-options: + -- tar-options: + -- uhc-options: