diff --git a/.github/actions/download/action.yml b/.github/actions/download/action.yml new file mode 100644 index 00000000000..cfb4e283c80 --- /dev/null +++ b/.github/actions/download/action.yml @@ -0,0 +1,25 @@ +name: 'Download artifact' +description: 'Download artifacts with normalized names' +inputs: + name: + required: true + type: string + path: + required: true + type: string + +runs: + using: "composite" + steps: + - name: Normalise name + run: | + name=${{ inputs.name }} + echo "NAME=${name//\//_}" >> "$GITHUB_ENV" + shell: bash + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ env.NAME }} + path: ${{ inputs.path }} + diff --git a/.github/actions/upload/action.yml b/.github/actions/upload/action.yml new file mode 100644 index 00000000000..927974ad581 --- /dev/null +++ b/.github/actions/upload/action.yml @@ -0,0 +1,33 @@ +name: 'Upload artifact' +description: 'Upload artifacts with normalized names' +inputs: + if-no-files-found: + default: 'error' + type: string + name: + required: true + type: string + path: + required: true + type: string + retention-days: + default: 0 + type: number + +runs: + using: "composite" + steps: + - name: Normalise name + run: | + name=${{ inputs.name }} + echo "NAME=${name//\//_}" >> "$GITHUB_ENV" + shell: bash + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + if-no-files-found: ${{ inputs.if-no-files-found }} + retention-days: ${{ inputs.retention-days }} + name: ${{ env.NAME }} + path: ${{ inputs.path }} + diff --git a/.github/scripts/build.bash b/.github/scripts/build.bash new file mode 100644 index 00000000000..27263fc822b --- /dev/null +++ b/.github/scripts/build.bash @@ -0,0 +1,55 @@ +set -eux + +uname -a +uname -p +uname +pwd +env + +if [ "${RUNNER_OS}" = Windows ] ; then + ext=".exe" +else + ext="" +fi + +ghcup --no-verbose install ghc --set --install-targets "${GHC_TARGETS}" "${GHC_VERSION}" + +cabal update +cabal user-config diff +cabal user-config init -f +"ghc-${GHC_VERSION}" --info +"ghc" --info + +# shellcheck disable=SC2206 +args=( + -w "ghc-$GHC_VERSION" + --disable-profiling + --enable-executable-stripping + --project-file=cabal.release.project + ${ADD_CABAL_ARGS} +) + +cabal v2-build "${args[@]}" cabal-install + +mkdir -p "out" +# shellcheck disable=SC2154 +cp "$(cabal list-bin "${args[@]}" cabal-install:exe:cabal)" "out/cabal$ext" +cp dist-newstyle/cache/plan.json "out/plan.json" +cd "out/" + +# create tarball/zip +TARBALL_PREFIX="cabal-install-$("./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${ext}" plan.json + diff --git a/.github/scripts/test.bash b/.github/scripts/test.bash new file mode 100644 index 00000000000..9c83dbb32d7 --- /dev/null +++ b/.github/scripts/test.bash @@ -0,0 +1,34 @@ +set -eux + +env +pwd +ls -lah + +cd out +case "${TARBALL_EXT}" in + zip) + unzip ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}" + ;; + tar.xz) + tar xf ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}" + ;; + *) + fail "Unknown TARBALL_EXT: ${TARBALL_EXT}" + ;; +esac +cd .. + +ghcup --no-verbose install ghc --set --install-targets "${GHC_TEST_TARGETS}" "${GHC_TEST_VERSION}" + +cabal update + +# TODO: we want to avoid building here... we should just +# be using the previously built 'cabal-tests' binary +# Also see https://github.com/haskell/cabal/issues/11048 +cabal run -w "ghc-${GHC_TEST_VERSION}" ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \ + --with-cabal "$(pwd)/out/cabal" \ + --intree-cabal-lib "$(pwd)" \ + --test-tmp "$(pwd)/testdb" \ + --skip-setup-tests \ + -j "$(nproc || sysctl -n hw.ncpu || getconf _NPROCESSORS_ONLN || echo 1)" + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b16a5ef0925..102be090d04 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: haskell-actions/hlint-setup@v2 with: - version: "3.8" + version: "3.10" - uses: haskell-actions/hlint-run@v2 with: path: "." diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000000..1a7343ba760 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,87 @@ +name: Build and release + +on: + push: + tags: + - 'v*' + - 'cabal-install-*' + pull_request: + types: [opened, synchronize, reopened, labeled] + branches: + - master + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + pull-requests: read + +env: + BUILD_LABEL: "run release build" + +jobs: + check-pr-labels: + name: check PR labels + runs-on: ubuntu-latest + outputs: + run_release_workflow: ${{ steps.gen_output.outputs.run_release_workflow }} + steps: + - id: gen_output + run: | + if [ "${{ github.event.action }}" == 'labeled' ] ; then + if [ ${{ github.event.label.name == '${{ env.BUILD_LABEL }}' }} ] ; then + echo run_release_workflow="yes" >> "$GITHUB_OUTPUT" + else + echo run_release_workflow="no" >> "$GITHUB_OUTPUT" + fi + elif [ "${{ github.event_name }}" = 'pull_request' ] ; then + run_it=$(if gh api --jq '.labels.[].name' /repos/${{ github.repository }}/pulls/${{ github.event.number }} | grep --quiet '^${{ env.BUILD_LABEL }}$' ; then printf "%s" "yes" ; else printf "%s" "no" ; fi) + echo "${run_it}" + echo run_release_workflow="${run_it}" >> "$GITHUB_OUTPUT" + else + echo run_release_workflow="yes" >> "$GITHUB_OUTPUT" + fi + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + release-workflow: + needs: ["check-pr-labels"] + if: ${{ needs.check-pr-labels.outputs.run_release_workflow == 'yes' }} + uses: ./.github/workflows/reusable-release.yml + with: + branches: '["${{ github.ref }}"]' + + release: + name: release + needs: [ "release-workflow" ] + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + merge-multiple: true + 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/reusable-release.yml b/.github/workflows/reusable-release.yml new file mode 100644 index 00000000000..9c2e738ab9c --- /dev/null +++ b/.github/workflows/reusable-release.yml @@ -0,0 +1,826 @@ +name: Build and release + +on: + workflow_call: + inputs: + branches: + required: true + type: string + ghc: + type: string + default: 9.10.2 + # speed up installation by skipping docs + # starting with GHC 9.10.x, we also need to pass the 'install_extra' target + ghc_targets: + type: string + default: "install_bin install_lib update_package_db install_extra" + cabal: + type: string + default: 3.14.2.0 + test: + type: boolean + default: true + +env: + GHC_VERSION: ${{ inputs.ghc }} + GHC_TARGETS: ${{ inputs.ghc_targets }} + # This shouldn't be necessary, but cabal developers + # want to build with 9.10.2, which causes test failures + # when used as runtime GHC version as well. + GHC_TEST_VERSION: 9.6.7 + GHC_TEST_TARGETS: "install_bin install_lib update_package_db" + CABAL_VERSION: ${{ inputs.cabal }} + BOOTSTRAP_HASKELL_NONINTERACTIVE: 1 + BOOTSTRAP_HASKELL_MINIMAL: 1 + DEBIAN_FRONTEND: noninteractive + TZ: Asia/Singapore + +jobs: + tool-output: + runs-on: ubuntu-latest + outputs: + apt_tools: ${{ steps.gen_output.outputs.apt_tools }} + apt_tools_ncurses6: ${{ steps.gen_output.outputs.apt_tools_ncurses6 }} + rpm_tools: ${{ steps.gen_output.outputs.rpm_tools }} + apk_tools: ${{ steps.gen_output.outputs.apk_tools }} + xbps_tools: ${{ steps.gen_output.outputs.xbps_tools }} + env: + APT: "groff-base 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 patchelf" + RPM: "groff-base 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" + APK: "groff 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" + XBPS: "groff 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 gzip" + steps: + - name: Generate output + id: gen_output + run: | + echo apt_tools="${{ env.APT }} libncurses5 libtinfo5" >> "$GITHUB_OUTPUT" + echo apt_tools_ncurses6="${{ env.APT }} libncurses6 libtinfo6" >> "$GITHUB_OUTPUT" + echo rpm_tools="${{ env.RPM }}" >> "$GITHUB_OUTPUT" + echo apk_tools="${{ env.APK }}" >> "$GITHUB_OUTPUT" + echo xbps_tools="${{ env.XBPS }}" >> "$GITHUB_OUTPUT" + + build-linux: + name: Build linux binaries + runs-on: ubuntu-latest + needs: ["tool-output"] + env: + TARBALL_EXT: tar.xz + ARCH: 64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { image: "debian:11" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb11" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "debian:12" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb12" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:20.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , 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: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu22.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:24.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu24.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:33" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora33" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:36" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora36" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:38" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora38" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "rockylinux:8" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky8" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , 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: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine312" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine320" + , 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 }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-linux-32bit: + name: Build linux binaries (32bit) + needs: ["tool-output"] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + env: + TARBALL_EXT: tar.xz + ARCH: 32 + DISTRO: "Unknown" + ARTIFACT: "i386-linux-unknown" + ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Run build (32 bit linux) + uses: docker://i386/alpine:3.20 + with: + args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-arm: + name: Build ARM binary + needs: ["tool-output"] + runs-on: ubuntu-22.04-arm + env: + TARBALL_EXT: tar.xz + ADD_CABAL_ARGS: "" + ARCH: ARM64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { ARCH: "ARM64" + , DISTRO: "Debian" + , ARTIFACT: "aarch64-linux-deb11" + }, + { ARCH: "ARM64" + , DISTRO: "Alpine" + , ARTIFACT: "aarch64-linux-unknown" + } + ] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - if: matrix.platform.DISTRO == 'Debian' + uses: docker://arm64v8/debian:11 + name: Run build (aarch64 linux) + with: + args: sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: "" + + - if: matrix.platform.DISTRO == 'Alpine' + uses: docker://arm64v8/alpine:3.20 + name: Run build (aarch64 linux alpine) + with: + args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-mac-x86_64: + name: Build binary (Mac x86_64) + runs-on: macOS-13 + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-apple-darwin" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-mac-aarch64: + name: Build binary (Mac aarch64) + runs-on: macos-latest + 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 + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + 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 + CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" + GHCUP_INSTALL_BASE_PREFIX: "/c" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: install windows deps + shell: pwsh + run: | + # https://www.msys2.org/docs/updating/ + 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: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - 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.bash" + shell: pwsh + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + 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 + RUNNER_OS: FreeBSD + CABAL_DIR: ${{ github.workspace }}/.cabal + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + sudo pkg install -y curl gcc gmp gmake ncurses perl5 pkgconf libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x + sudo tzsetup Etc/GMT + sudo adjkerntz -a + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + test-linux: + name: Test linux binaries + runs-on: ubuntu-latest + needs: ["tool-output", "build-linux"] + if: ${{ inputs.test }} + env: + TARBALL_EXT: tar.xz + ARCH: 64 + ADD_CABAL_ARGS: "" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { image: "debian:11" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb11" + }, + { image: "debian:12" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb12" + }, + { image: "ubuntu:20.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu20.04" + }, + { image: "ubuntu:22.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu22.04" + }, + { image: "ubuntu:24.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu24.04" + }, + { image: "fedora:33" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora33" + }, + { image: "fedora:36" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora36" + }, + { image: "fedora:38" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora38" + }, + { image: "rockylinux:8" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky8" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-unknown" + }, + { image: "alpine:3.12" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine312" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine320" + } + ] + container: + image: ${{ matrix.platform.image }} + steps: + - name: Install requirements + shell: sh + run: | + ${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} + + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + # Test suite uses 'git' to find the test files. That appears + # to cause problems in CI. A similar hack is employed in the validate + # pipeline. + - name: git clone fix + run: git config --system --add safe.directory $GITHUB_WORKSPACE + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Run test + run: | + bash .github/scripts/test.bash + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + +# TODO: https://github.com/haskell/cabal/issues/11049 +# test-linux-32bit: +# name: Test linux binaries (32bit) +# runs-on: ubuntu-latest +# needs: ["build-linux-32bit"] +# if: $ {{ inputs.test }} +# env: +# TARBALL_EXT: tar.xz +# ARCH: 32 +# DISTRO: "Unknown" +# ARTIFACT: "i386-linux-unknown" +# ADD_CABAL_ARGS: "" +# strategy: +# fail-fast: false +# matrix: +# branch: ${{ fromJSON(inputs.branches) }} +# steps: +# - uses: actions/checkout@v4 +# with: +# ref: ${{ matrix.branch }} +# +# - uses: ./.github/actions/download +# with: +# name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} +# path: ./out +# +# - name: Run build (32 bit linux) +# uses: docker://i386/alpine:3.20 +# with: +# args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} groff && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + + test-arm: + name: Test ARM binary + runs-on: ubuntu-22.04-arm + needs: ["tool-output", "build-arm"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + TARBALL_EXT: tar.xz + ARCH: ARM64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { ARCH: "ARM64" + , DISTRO: "Debian" + , ARTIFACT: "aarch64-linux-deb11" + }, + { ARCH: "ARM64" + , DISTRO: "Alpine" + , ARTIFACT: "aarch64-linux-unknown" + } + ] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - if: matrix.platform.DISTRO == 'Debian' + uses: docker://arm64v8/debian:11 + name: Run build (aarch64 linux) + with: + args: sh -c "apt-get update && apt-get install -y curl bash git groff-base ${{ needs.tool-output.outputs.apt_tools }} && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/test.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + + - if: matrix.platform.DISTRO == 'Alpine' + uses: docker://arm64v8/alpine:3.20 + name: Run build (aarch64 linux alpine) + with: + args: sh -c "apk update && apk add curl bash git groff ${{ needs.tool-output.outputs.apk_tools }} && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/test.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + + test-mac-x86_64: + name: Test binary (Mac x86_64) + runs-on: macOS-13 + needs: ["build-mac-x86_64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + MACOSX_DEPLOYMENT_TARGET: 10.13 + ARTIFACT: "x86_64-apple-darwin" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + # cabal-testsuite/PackageTests/Configure/cabal.test.hs needs it + # and it doesn't appear pre-installed here + brew install autoconf automake + + bash .github/scripts/test.bash + + test-mac-aarch64: + name: Test binary (Mac aarch64) + runs-on: macos-latest + needs: ["build-mac-aarch64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + MACOSX_DEPLOYMENT_TARGET: 10.13 + ARTIFACT: "aarch64-apple-darwin" + ARCH: ARM64 + TARBALL_EXT: tar.xz + DISTRO: na + HOMEBREW_CHANGE_ARCH_TO_ARM: 1 + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + bash .github/scripts/test.bash + + test-win: + name: Test binary (Win) + runs-on: windows-latest + needs: ["build-win"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-mingw64" + ARCH: 64 + TARBALL_EXT: "zip" + DISTRO: na + CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" + GHCUP_INSTALL_BASE_PREFIX: "/c" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - 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" + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test (windows) + run: | + $env:CHERE_INVOKING = 1 + $env:MSYS2_PATH_TYPE = "inherit" + $ErrorActionPreference = "Stop" + C:\msys64\usr\bin\bash -lc "bash .github/scripts/test.bash" + shell: pwsh + + test-freebsd-x86_64: + name: Test FreeBSD x86_64 + runs-on: [self-hosted, FreeBSD, X64] + needs: ["build-freebsd-x86_64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-portbld-freebsd" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + RUNNER_OS: FreeBSD + CABAL_DIR: ${{ github.workspace }}/.cabal + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + sudo pkg install -y curl gcc gmp gmake ncurses perl5 pkgconf libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x groff autoconf automake + sudo tzsetup Etc/GMT + sudo adjkerntz -a + bash .github/scripts/test.bash + diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index abf19bffab8..8ced64a916f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -55,11 +55,11 @@ jobs: - { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } - { os: ubuntu-22.04, shell: bash } - { os: macos-latest, shell: bash } - # If you remove something from here, then add it to the old-ghcs job. - # Also a removed GHC from here means that we are actually dropping - # support, so the PR *must* have a changelog entry. ghc: [ + # IMPORTANT: If you remove a version from this list, then add it to the old-ghcs job below. + # Also a removed GHC from here means that we are actually dropping + # support, so the PR *must* have a changelog entry. "9.12.2", "9.10.2", "9.8.4", @@ -251,7 +251,7 @@ jobs: strategy: matrix: extra-ghc: - ["8.4.4", "8.2.2", "8.0.2"] + ["8.6.5", "8.4.4", "8.2.2", "8.0.2"] ## GHC 7.10.3 does not install on ubuntu-22.04 with ghcup. ## Older GHCs are not supported by ghcup in the first place. fail-fast: false diff --git a/.hlint.yaml b/.hlint.yaml index 6c5d86998d3..c827093b84f 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -1,13 +1,12 @@ # Warnings currently triggered by your code - ignore: {name: "Avoid NonEmpty.unzip"} # 1 hint -- ignore: {name: "Avoid lambda"} # 47 hints +- ignore: {name: "Avoid lambda"} # 50 hints - ignore: {name: "Avoid lambda using `infix`"} # 23 hints -- ignore: {name: "Eta reduce"} # 124 hints +- ignore: {name: "Eta reduce"} # 132 hints - ignore: {name: "Evaluate"} # 10 hints - ignore: {name: "Functor law"} # 10 hints - ignore: {name: "Fuse concatMap/map"} # 3 hints - ignore: {name: "Fuse foldr/map"} # 3 hints -- ignore: {name: "Fuse mapMaybe/map"} # 1 hint - ignore: {name: "Fuse traverse_/fmap"} # 1 hint - ignore: {name: "Fuse traverse_/map"} # 1 hint - ignore: {name: "Hoist not"} # 16 hints @@ -16,54 +15,53 @@ - ignore: {name: "Monoid law, right identity"} # 3 hints - ignore: {name: "Move filter"} # 4 hints - ignore: {name: "Move guards forward"} # 4 hints -- ignore: {name: "Redundant $"} # 178 hints +- ignore: {name: "Redundant $"} # 192 hints - ignore: {name: "Redundant $!"} # 1 hint -- ignore: {name: "Redundant <$>"} # 16 hints +- ignore: {name: "Redundant <$>"} # 17 hints - ignore: {name: "Redundant =="} # 1 hint -- ignore: {name: "Redundant bracket"} # 240 hints +- ignore: {name: "Redundant bracket"} # 260 hints - ignore: {name: "Redundant fmap"} # 1 hint - ignore: {name: "Redundant guard"} # 2 hints - ignore: {name: "Redundant if"} # 6 hints - ignore: {name: "Redundant lambda"} # 19 hints +- ignore: {name: "Redundant maybe"} # 2 hints - ignore: {name: "Redundant multi-way if"} # 1 hint - ignore: {name: "Redundant return"} # 9 hints -- ignore: {name: "Replace case with fromMaybe"} # 6 hints +- ignore: {name: "Replace case with fromMaybe"} # 4 hints - ignore: {name: "Replace case with maybe"} # 10 hints - ignore: {name: "Use $>"} # 5 hints - ignore: {name: "Use ++"} # 4 hints -- ignore: {name: "Use :"} # 30 hints +- ignore: {name: "Use :"} # 28 hints - ignore: {name: "Use <$"} # 2 hints -- ignore: {name: "Use <$>"} # 87 hints -- ignore: {name: "Use <&>"} # 14 hints +- ignore: {name: "Use <$>"} # 86 hints +- ignore: {name: "Use <&>"} # 15 hints - ignore: {name: "Use <=<"} # 4 hints - ignore: {name: "Use =<<"} # 7 hints - ignore: {name: "Use =="} # 3 hints - ignore: {name: "Use >=>"} # 3 hints - ignore: {name: "Use ?~"} # 1 hint - ignore: {name: "Use Down"} # 3 hints -- ignore: {name: "Use Just"} # 2 hints - ignore: {name: "Use bimap"} # 7 hints -- ignore: {name: "Use camelCase"} # 98 hints +- ignore: {name: "Use camelCase"} # 94 hints - ignore: {name: "Use catMaybes"} # 3 hints - ignore: {name: "Use concatMap"} # 2 hints -- ignore: {name: "Use const"} # 36 hints +- ignore: {name: "Use const"} # 37 hints - ignore: {name: "Use elem"} # 2 hints -- ignore: {name: "Use first"} # 4 hints -- ignore: {name: "Use fmap"} # 25 hints +- ignore: {name: "Use first"} # 5 hints +- ignore: {name: "Use fmap"} # 24 hints - ignore: {name: "Use fold"} # 1 hint - ignore: {name: "Use for"} # 1 hint - ignore: {name: "Use forM_"} # 1 hint -- ignore: {name: "Use fromMaybe"} # 4 hints +- ignore: {name: "Use fromMaybe"} # 5 hints - ignore: {name: "Use fromRight"} # 1 hint -- ignore: {name: "Use fst"} # 1 hint -- ignore: {name: "Use if"} # 2 hints +- ignore: {name: "Use fst"} # 2 hints - ignore: {name: "Use infix"} # 20 hints - ignore: {name: "Use isAsciiLower"} # 2 hints - ignore: {name: "Use isAsciiUpper"} # 2 hints - ignore: {name: "Use isDigit"} # 2 hints - ignore: {name: "Use isJust"} # 1 hint - ignore: {name: "Use isNothing"} # 1 hint -- ignore: {name: "Use lambda-case"} # 55 hints +- ignore: {name: "Use lambda-case"} # 58 hints - ignore: {name: "Use lefts"} # 1 hint - ignore: {name: "Use list comprehension"} # 19 hints - ignore: {name: "Use list literal"} # 3 hints @@ -74,7 +72,7 @@ - ignore: {name: "Use max"} # 2 hints - ignore: {name: "Use maybe"} # 8 hints - ignore: {name: "Use minimumBy"} # 1 hint -- ignore: {name: "Use newtype instead of data"} # 26 hints +- ignore: {name: "Use newtype instead of data"} # 29 hints - ignore: {name: "Use notElem"} # 9 hints - ignore: {name: "Use null"} # 2 hints - ignore: {name: "Use record patterns"} # 16 hints @@ -82,12 +80,12 @@ - ignore: {name: "Use replicateM_"} # 2 hints - ignore: {name: "Use rights"} # 2 hints - ignore: {name: "Use second"} # 7 hints -- ignore: {name: "Use section"} # 17 hints +- ignore: {name: "Use section"} # 18 hints - ignore: {name: "Use traverse"} # 1 hint -- ignore: {name: "Use tuple-section"} # 28 hints +- ignore: {name: "Use tuple-section"} # 27 hints - ignore: {name: "Use typeRep"} # 2 hints - ignore: {name: "Use uncurry"} # 1 hint -- ignore: {name: "Use unless"} # 22 hints +- ignore: {name: "Use unless"} # 23 hints - ignore: {name: "Use unwords"} # 8 hints - ignore: {name: "Use void"} # 23 hints - ignore: {name: "Use when"} # 1 hint diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 697a0e490dd..4db235065c7 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -518,101 +518,104 @@ ppHsc2hs bi lbi clbi = -- directly, or via a response file. genPureArgs :: Version -> ConfiguredProgram -> String -> String -> [String] genPureArgs hsc2hsVersion gccProg inFile outFile = - -- Additional gcc options - [ "--cflag=" ++ opt - | opt <- - programDefaultArgs gccProg - ++ programOverrideArgs gccProg - ] - ++ [ "--lflag=" ++ opt - | opt <- - programDefaultArgs gccProg - ++ programOverrideArgs gccProg - ] - -- OSX frameworks: - ++ [ what ++ "=-F" ++ opt - | isOSX - , opt <- nub (concatMap Installed.frameworkDirs pkgs) - , what <- ["--cflag", "--lflag"] - ] - ++ [ "--lflag=" ++ arg - | isOSX - , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs - , arg <- ["-framework", opt] - ] - -- Note that on ELF systems, wherever we use -L, we must also use -R - -- because presumably that -L dir is not on the normal path for the - -- system's dynamic linker. This is needed because hsc2hs works by - -- compiling a C program and then running it. - - ++ ["--cflag=" ++ opt | opt <- platformDefines lbi] - -- Options from the current package: - ++ ["--cflag=-I" ++ u dir | dir <- PD.includeDirs bi] - ++ [ "--cflag=-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) - | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi - ] - ++ [ "--cflag=" ++ opt - | opt <- - PD.ccOptions bi - ++ PD.cppOptions bi - -- hsc2hs uses the C ABI - -- We assume that there are only C sources - -- and C++ functions are exported via a C - -- interface and wrapped in a C source file. - -- Therefore we do not supply C++ flags - -- because there will not be C++ sources. - -- - -- DO NOT add PD.cxxOptions unless this changes! - ] - ++ [ "--cflag=" ++ opt - | opt <- - [ "-I" ++ u (autogenComponentModulesDir lbi clbi) - , "-I" ++ u (autogenPackageModulesDir lbi) - , "-include" - , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName - ] - ] - ++ [ "--lflag=-L" ++ u opt - | opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - ++ [ "--lflag=-Wl,-R," ++ u opt - | isELF - , opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - ++ ["--lflag=-l" ++ opt | opt <- PD.extraLibs bi] - ++ ["--lflag=" ++ opt | opt <- PD.ldOptions bi] - -- Options from dependent packages - ++ [ "--cflag=" ++ opt - | pkg <- pkgs - , opt <- - ["-I" ++ opt | opt <- Installed.includeDirs pkg] - ++ Installed.ccOptions pkg - ] - ++ [ "--lflag=" ++ opt - | pkg <- pkgs - , opt <- - ["-L" ++ opt | opt <- Installed.libraryDirs pkg] - ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg - ] - ++ [ "-l" ++ opt - | opt <- - if withFullyStaticExe lbi - then Installed.extraLibrariesStatic pkg - else Installed.extraLibraries pkg - ] - ++ Installed.ldOptions pkg - ] + cflags + ++ ldflags ++ preccldFlags ++ hsc2hsOptions bi ++ postccldFlags ++ ["-o", outFile, inFile] where + ldflags = + map ("--lflag=" ++) $ + ordNub $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , [ arg + | isOSX + , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs + , arg <- ["-framework", opt] + ] + , -- Note that on ELF systems, wherever we use -L, we must also use -R + -- because presumably that -L dir is not on the normal path for the + -- system's dynamic linker. This is needed because hsc2hs works by + -- compiling a C program and then running it. + + -- Options from the current package: + [ "-L" ++ u opt + | opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , [ "-Wl,-R," ++ u opt + | isELF + , opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , ["-l" ++ opt | opt <- PD.extraLibs bi] + , PD.ldOptions bi + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-L" ++ opt | opt <- Installed.libraryDirs pkg] + ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg + ] + ++ [ "-l" ++ opt + | opt <- + if withFullyStaticExe lbi + then Installed.extraLibrariesStatic pkg + else Installed.extraLibraries pkg + ] + ++ Installed.ldOptions pkg + ] + ] + + cflags = + map ("--cflag=" ++) $ + ordNub $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , platformDefines lbi + , -- Options from the current package: + ["-I" ++ u dir | dir <- PD.includeDirs bi] + , [ "-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) + | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi + ] + , -- hsc2hs uses the C ABI + -- We assume that there are only C sources + -- and C++ functions are exported via a C + -- interface and wrapped in a C source file. + -- Therefore we do not supply C++ flags + -- because there will not be C++ sources. + -- + -- DO NOT add PD.cxxOptions unless this changes! + PD.ccOptions bi ++ PD.cppOptions bi + , + [ "-I" ++ u (autogenComponentModulesDir lbi clbi) + , "-I" ++ u (autogenPackageModulesDir lbi) + , "-include" + , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName + ] + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-I" ++ opt | opt <- Installed.includeDirs pkg] + ++ Installed.ccOptions pkg + ] + ] + + osxFrameworkDirs = + [ "-F" ++ opt + | isOSX + , opt <- ordNub (concatMap Installed.frameworkDirs pkgs) + ] + -- hsc2hs flag parsing was wrong -- (see -- https://github.com/haskell/hsc2hs/issues/35) -- so we need to put -- --cc/--ld *after* hsc2hsOptions, diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 17e9938a46e..a222410efa0 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -107,7 +107,7 @@ library , containers >=0.5.6.2 && <0.9 , edit-distance ^>= 0.2.2 , directory >= 1.3.7.0 && < 1.4 - , filepath ^>=1.4.0.0 || ^>=1.5.0.0 + , filepath >= 1.3.0.1 && < 1.6 , mtl >=2.0 && <2.4 , network-uri >= 2.6.0.2 && < 2.7 , pretty ^>=1.1 diff --git a/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs b/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs index d897955dd74..d12ab76f136 100644 --- a/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs @@ -1,5 +1,8 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do +main = do + -- TODO: this might be a GHC bug that needs fixing + skipIfAlpine "bug #11041" + setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" setup "configure" [] setup "build" [] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc new file mode 100644 index 00000000000..d1e0418a5e8 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc @@ -0,0 +1,99 @@ +-- | +-- Module: Foo +-- Copyright: (c) Sergey Vinokurov 2025 +-- License: Apache-2.0 (see LICENSE) +-- Maintainer: serg.foo@gmail.com + +{-# LANGUAGE CPP #-} + +module Foo (foo) where + +import Foo01 +import Foo02 +import Foo03 +import Foo04 +import Foo05 +import Foo06 +import Foo07 +import Foo08 +import Foo09 +import Foo10 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +foo :: Int +foo = sum + [ #{const TEST_OPTION} + , foo01 + , foo02 + , foo03 + , foo04 + , foo05 + , foo06 + , foo07 + , foo08 + , foo09 + , foo10 + + , #{const DEF_foo01} + , #{const DEF_foo02} + , #{const DEF_foo03} + , #{const DEF_foo04} + , #{const DEF_foo05} + , #{const DEF_foo06} + , #{const DEF_foo07} + , #{const DEF_foo08} + , #{const DEF_foo09} + , #{const DEF_foo10} + + , #{const DEF_fooDep01} + , #{const DEF_fooDep02} + , #{const DEF_fooDep03} + , #{const DEF_fooDep04} + , #{const DEF_fooDep05} + , #{const DEF_fooDep06} + , #{const DEF_fooDep07} + , #{const DEF_fooDep08} + , #{const DEF_fooDep09} + , #{const DEF_fooDep10} + + , #{const DEF_fooDepDep01} + , #{const DEF_fooDepDep02} + , #{const DEF_fooDepDep03} + , #{const DEF_fooDepDep04} + , #{const DEF_fooDepDep05} + , #{const DEF_fooDepDep06} + , #{const DEF_fooDepDep07} + , #{const DEF_fooDepDep08} + , #{const DEF_fooDepDep09} + , #{const DEF_fooDepDep10} + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs new file mode 100644 index 00000000000..fb4e301094d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs @@ -0,0 +1,6 @@ +module Main (main) where + +import Foo + +main :: IO () +main = putStrLn $ "Result = " ++ show foo diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project new file mode 100644 index 00000000000..004271c651b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project @@ -0,0 +1,34 @@ +packages: + my-toplevel.cabal + deps/my01/my01.cabal + deps/my02/my02.cabal + deps/my03/my03.cabal + deps/my04/my04.cabal + deps/my05/my05.cabal + deps/my06/my06.cabal + deps/my07/my07.cabal + deps/my08/my08.cabal + deps/my09/my09.cabal + deps/my10/my10.cabal + + deps/my-dep01/my-dep01.cabal + deps/my-dep02/my-dep02.cabal + deps/my-dep03/my-dep03.cabal + deps/my-dep04/my-dep04.cabal + deps/my-dep05/my-dep05.cabal + deps/my-dep06/my-dep06.cabal + deps/my-dep07/my-dep07.cabal + deps/my-dep08/my-dep08.cabal + deps/my-dep09/my-dep09.cabal + deps/my-dep10/my-dep10.cabal + + deps/my-dep-dep01/my-dep-dep01.cabal + deps/my-dep-dep02/my-dep-dep02.cabal + deps/my-dep-dep03/my-dep-dep03.cabal + deps/my-dep-dep04/my-dep-dep04.cabal + deps/my-dep-dep05/my-dep-dep05.cabal + deps/my-dep-dep06/my-dep-dep06.cabal + deps/my-dep-dep07/my-dep-dep07.cabal + deps/my-dep-dep08/my-dep-dep08.cabal + deps/my-dep-dep09/my-dep-dep09.cabal + deps/my-dep-dep10/my-dep-dep10.cabal diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc new file mode 100755 index 00000000000..79054cac89f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# NB only check for duplicated -L or -I arguments because that’s the +# primary source of duplication. Some minor duplicates can also occur, +# like -Wl,--no-as-needed but there’s not too many of them yet to +# cause command line overflow. + +# Quadratic algorithm because darwin CI doesn’t seem to have bash that +# supports associative arrays. +check_duplicate() { + local test_arg="$1" + local occurs="0" + + if ! [[ "$test_arg" == -L* || "$test_arg" == -I* ]]; then + return 0 + fi + + shift + for tmp in "${@}"; do + if [[ "$tmp" == @* ]]; then + while IFS= read -d $'\n' -r arg ; do + if [[ "$arg" == "$test_arg" ]]; then + occurs=$((occurs + 1)) + fi + done <"${tmp#@}" + else + if [[ "$tmp" == "$test_arg" ]]; then + occurs=$((occurs + 1)) + fi + fi + done + + if [[ "$occurs" -gt 1 ]]; then + return 1 + else + return 0 + fi +} + +i=1 +for x in "${@}"; do + if [[ "$x" == @* ]]; then + file= + while IFS= read -d $'\n' -r arg ; do + y="$arg" + if ! check_duplicate "$arg" "${@:$i}"; then + echo "Duplicate argument detected: '$y'" + echo "All args: ${@}" + exit 1 + fi + done <"${x#@}" + else + if ! check_duplicate "$x" "${@:$i}"; then + echo "Duplicate argument detected: '$x'" + echo "All args: ${@}" + exit 1 + fi + fi + + i=$((i + 1)) +done + +if which cc >/dev/null 2>&1; then + cc -DNOERROR6 "${@}" +elif which gcc >/dev/null 2>&1; then + gcc -DNOERROR6 "${@}" +elif which clang >/dev/null 2>&1; then + clang -DNOERROR6 "${@}" +else + echo "Cannot find C compiler" >&2 + exit 1 +fi diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs new file mode 100644 index 00000000000..9e6837fb409 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs @@ -0,0 +1,4 @@ +module FooDepDep01 (fooDepDep01) where + +fooDepDep01 :: Int +fooDepDep01 = 01 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h new file mode 100644 index 00000000000..1e2a0c2d3fd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h @@ -0,0 +1 @@ +#define DEF_fooDepDep01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal new file mode 100644 index 00000000000..075c6dadcf6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep01 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs new file mode 100644 index 00000000000..564798ff0e7 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs @@ -0,0 +1,4 @@ +module FooDepDep02 (fooDepDep02) where + +fooDepDep02 :: Int +fooDepDep02 = 02 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h new file mode 100644 index 00000000000..a05f788abf5 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h @@ -0,0 +1 @@ +#define DEF_fooDepDep02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal new file mode 100644 index 00000000000..a21e8fa002f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep02 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs new file mode 100644 index 00000000000..90d7ab99948 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs @@ -0,0 +1,4 @@ +module FooDepDep03 (fooDepDep03) where + +fooDepDep03 :: Int +fooDepDep03 = 03 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h new file mode 100644 index 00000000000..716d517d278 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h @@ -0,0 +1 @@ +#define DEF_fooDepDep03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal new file mode 100644 index 00000000000..84b24170e2a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep03 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs new file mode 100644 index 00000000000..9101849a9c6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs @@ -0,0 +1,4 @@ +module FooDepDep04 (fooDepDep04) where + +fooDepDep04 :: Int +fooDepDep04 = 04 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h new file mode 100644 index 00000000000..79fd9374863 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h @@ -0,0 +1 @@ +#define DEF_fooDepDep04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal new file mode 100644 index 00000000000..9617302f33b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep04 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs new file mode 100644 index 00000000000..1e0a4cf206f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs @@ -0,0 +1,4 @@ +module FooDepDep05 (fooDepDep05) where + +fooDepDep05 :: Int +fooDepDep05 = 05 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h new file mode 100644 index 00000000000..2f305c8d829 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h @@ -0,0 +1 @@ +#define DEF_fooDepDep05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal new file mode 100644 index 00000000000..18a94b86684 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep05 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs new file mode 100644 index 00000000000..50b2b0d3f0f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs @@ -0,0 +1,4 @@ +module FooDepDep06 (fooDepDep06) where + +fooDepDep06 :: Int +fooDepDep06 = 06 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h new file mode 100644 index 00000000000..a005ad17115 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h @@ -0,0 +1 @@ +#define DEF_fooDepDep06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal new file mode 100644 index 00000000000..492161e6751 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep06 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs new file mode 100644 index 00000000000..4ee00b0d8e9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs @@ -0,0 +1,4 @@ +module FooDepDep07 (fooDepDep07) where + +fooDepDep07 :: Int +fooDepDep07 = 07 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h new file mode 100644 index 00000000000..cd4d9c62a90 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h @@ -0,0 +1 @@ +#define DEF_fooDepDep07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal new file mode 100644 index 00000000000..d5e129e224d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep07 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs new file mode 100644 index 00000000000..bff75a8857e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs @@ -0,0 +1,4 @@ +module FooDepDep08 (fooDepDep08) where + +fooDepDep08 :: Int +fooDepDep08 = 08 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h new file mode 100644 index 00000000000..1a81f6ecc2c --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h @@ -0,0 +1 @@ +#define DEF_fooDepDep08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal new file mode 100644 index 00000000000..5070df765be --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep08 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs new file mode 100644 index 00000000000..df01fa36f21 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs @@ -0,0 +1,4 @@ +module FooDepDep09 (fooDepDep09) where + +fooDepDep09 :: Int +fooDepDep09 = 09 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h new file mode 100644 index 00000000000..7e009d23532 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h @@ -0,0 +1 @@ +#define DEF_fooDepDep09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal new file mode 100644 index 00000000000..e8ca1a6f25b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep09 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs new file mode 100644 index 00000000000..f2230e5ad60 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs @@ -0,0 +1,4 @@ +module FooDepDep10 (fooDepDep10) where + +fooDepDep10 :: Int +fooDepDep10 = 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h new file mode 100644 index 00000000000..94ec0123768 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h @@ -0,0 +1 @@ +#define DEF_fooDepDep10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal new file mode 100644 index 00000000000..fc873543421 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep10 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs new file mode 100644 index 00000000000..4f4e5022a05 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs @@ -0,0 +1,27 @@ +module FooDep01 (fooDep01) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep01 :: Int +fooDep01 = sum + [ 01 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h new file mode 100644 index 00000000000..a2beee766db --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h @@ -0,0 +1 @@ +#define DEF_fooDep01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal new file mode 100644 index 00000000000..04f1112df0d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep01 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs new file mode 100644 index 00000000000..d3768a947dd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs @@ -0,0 +1,27 @@ +module FooDep02 (fooDep02) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep02 :: Int +fooDep02 = sum + [ 02 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h new file mode 100644 index 00000000000..26bb3371de3 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h @@ -0,0 +1 @@ +#define DEF_fooDep02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal new file mode 100644 index 00000000000..7c5050f6804 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep02 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs new file mode 100644 index 00000000000..0e05fcb1662 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs @@ -0,0 +1,27 @@ +module FooDep03 (fooDep03) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep03 :: Int +fooDep03 = sum + [ 03 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h new file mode 100644 index 00000000000..400b14465ba --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h @@ -0,0 +1 @@ +#define DEF_fooDep03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal new file mode 100644 index 00000000000..fca04e84901 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep03 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs new file mode 100644 index 00000000000..99ad7dd90ba --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs @@ -0,0 +1,27 @@ +module FooDep04 (fooDep04) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep04 :: Int +fooDep04 = sum + [ 04 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h new file mode 100644 index 00000000000..705321a768a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h @@ -0,0 +1 @@ +#define DEF_fooDep04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal new file mode 100644 index 00000000000..0443c45392b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep04 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs new file mode 100644 index 00000000000..ba763dc729f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs @@ -0,0 +1,27 @@ +module FooDep05 (fooDep05) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep05 :: Int +fooDep05 = sum + [ 05 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h new file mode 100644 index 00000000000..cb4ef9e3b90 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h @@ -0,0 +1 @@ +#define DEF_fooDep05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal new file mode 100644 index 00000000000..13525f75522 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep05 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs new file mode 100644 index 00000000000..877571f3625 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs @@ -0,0 +1,27 @@ +module FooDep06 (fooDep06) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep06 :: Int +fooDep06 = sum + [ 06 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h new file mode 100644 index 00000000000..121a0893a6d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h @@ -0,0 +1 @@ +#define DEF_fooDep06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal new file mode 100644 index 00000000000..8f4fc14e383 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep06 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs new file mode 100644 index 00000000000..c0102c376f0 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs @@ -0,0 +1,27 @@ +module FooDep07 (fooDep07) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep07 :: Int +fooDep07 = sum + [ 07 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h new file mode 100644 index 00000000000..890388e96f4 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h @@ -0,0 +1 @@ +#define DEF_fooDep07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal new file mode 100644 index 00000000000..26f852fd4eb --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep07 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs new file mode 100644 index 00000000000..a867fe7416f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs @@ -0,0 +1,27 @@ +module FooDep08 (fooDep08) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep08 :: Int +fooDep08 = sum + [ 08 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h new file mode 100644 index 00000000000..a7959662c0b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h @@ -0,0 +1 @@ +#define DEF_fooDep08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal new file mode 100644 index 00000000000..6f65812163d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep08 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs new file mode 100644 index 00000000000..c2cd57e98b7 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs @@ -0,0 +1,27 @@ +module FooDep09 (fooDep09) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep09 :: Int +fooDep09 = sum + [ 09 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h new file mode 100644 index 00000000000..aa38edd5b88 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h @@ -0,0 +1 @@ +#define DEF_fooDep09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal new file mode 100644 index 00000000000..a2393c87226 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep09 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs new file mode 100644 index 00000000000..3cc38207580 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs @@ -0,0 +1,27 @@ +module FooDep10 (fooDep10) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep10 :: Int +fooDep10 = sum + [ 10 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h new file mode 100644 index 00000000000..2c4e63c62ed --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h @@ -0,0 +1 @@ +#define DEF_fooDep10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal new file mode 100644 index 00000000000..dfe7156d032 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep10 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs new file mode 100644 index 00000000000..007e3df90b6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs @@ -0,0 +1,27 @@ +module Foo01 (foo01) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo01 :: Int +foo01 = sum + [ 01 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h new file mode 100644 index 00000000000..6ce0ec798ac --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h @@ -0,0 +1 @@ +#define DEF_foo01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal new file mode 100644 index 00000000000..3aa3c5b1f12 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo01 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs new file mode 100644 index 00000000000..daeb7e06689 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs @@ -0,0 +1,27 @@ +module Foo02 (foo02) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo02 :: Int +foo02 = sum + [ 02 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h new file mode 100644 index 00000000000..016f6956b67 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h @@ -0,0 +1 @@ +#define DEF_foo02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal new file mode 100644 index 00000000000..63dc442984e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo02 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs new file mode 100644 index 00000000000..bf9cc8c495b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs @@ -0,0 +1,27 @@ +module Foo03 (foo03) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo03 :: Int +foo03 = sum + [ 03 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h new file mode 100644 index 00000000000..1ed4f567d95 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h @@ -0,0 +1 @@ +#define DEF_foo03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal new file mode 100644 index 00000000000..534c5e914fb --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo03 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs new file mode 100644 index 00000000000..654a7e0c661 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs @@ -0,0 +1,27 @@ +module Foo04 (foo04) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo04 :: Int +foo04 = sum + [ 04 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h new file mode 100644 index 00000000000..f973f5e2e28 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h @@ -0,0 +1 @@ +#define DEF_foo04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal new file mode 100644 index 00000000000..b3e7cb025e9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo04 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs new file mode 100644 index 00000000000..6f011299199 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs @@ -0,0 +1,27 @@ +module Foo05 (foo05) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo05 :: Int +foo05 = sum + [ 05 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h new file mode 100644 index 00000000000..d1554139188 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h @@ -0,0 +1 @@ +#define DEF_foo05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal new file mode 100644 index 00000000000..4d55d71db4d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo05 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs new file mode 100644 index 00000000000..4ba7567a5b2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs @@ -0,0 +1,27 @@ +module Foo06 (foo06) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo06 :: Int +foo06 = sum + [ 06 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h new file mode 100644 index 00000000000..b27035afce2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h @@ -0,0 +1 @@ +#define DEF_foo06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal new file mode 100644 index 00000000000..7e4a1f00028 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo06 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs new file mode 100644 index 00000000000..6701e0b2619 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs @@ -0,0 +1,27 @@ +module Foo07 (foo07) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo07 :: Int +foo07 = sum + [ 07 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h new file mode 100644 index 00000000000..64d8cc6a7b9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h @@ -0,0 +1 @@ +#define DEF_foo07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal new file mode 100644 index 00000000000..8f77521878d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo07 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs new file mode 100644 index 00000000000..294c7db3384 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs @@ -0,0 +1,27 @@ +module Foo08 (foo08) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo08 :: Int +foo08 = sum + [ 08 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h new file mode 100644 index 00000000000..361e7a289a6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h @@ -0,0 +1 @@ +#define DEF_foo08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal new file mode 100644 index 00000000000..2bf62465840 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo08 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs new file mode 100644 index 00000000000..74b5d2ecb7f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs @@ -0,0 +1,27 @@ +module Foo09 (foo09) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo09 :: Int +foo09 = sum + [ 09 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h new file mode 100644 index 00000000000..7d61d6507e2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h @@ -0,0 +1 @@ +#define DEF_foo09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal new file mode 100644 index 00000000000..c47b759958e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo09 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs new file mode 100644 index 00000000000..896730ca8bd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs @@ -0,0 +1,27 @@ +module Foo10 (foo10) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo10 :: Int +foo10 = sum + [ 10 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h new file mode 100644 index 00000000000..d8d5ad21d36 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h @@ -0,0 +1 @@ +#define DEF_foo10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal new file mode 100644 index 00000000000..fe9d8542e1b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo10 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal new file mode 100644 index 00000000000..62f16048d3e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal @@ -0,0 +1,33 @@ +cabal-version: 3.6 +name: my-toplevel +description: Test that extra-include-dirs and extra-lib-dirs are not duplicated unnecessarily when e.g. gcc gets ultimately invoked +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + default-language: + Haskell2010 + exposed-modules: + Foo + -- build-tool-depends: + -- , hsc2hs:hsc2hs + hsc2hs-options: + -DTEST_OPTION=42 + build-depends: + , base + , my01 + , my02 + , my03 + , my04 + , my05 + , my06 + , my07 + , my08 + , my09 + , my10 + +executable my-executable + main-is: Main.hs + build-depends: base, my-toplevel + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out new file mode 100644 index 00000000000..485946cb20a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out @@ -0,0 +1,2 @@ +# my-toplevel my-executable +Result = 6312 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs new file mode 100644 index 00000000000..036d10cbdce --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs @@ -0,0 +1,107 @@ + +import Test.Cabal.Prelude + +-- --extra-include-dirs have to be absolute paths so this cannot +-- be specified in the cabal.project nor cabal.config. +includeDirs :: [String] +includeDirs = + [ "deps/my01/include" + , "deps/my02/include" + , "deps/my03/include" + , "deps/my04/include" + , "deps/my05/include" + , "deps/my06/include" + , "deps/my07/include" + , "deps/my08/include" + , "deps/my09/include" + , "deps/my10/include" + , "deps/my-dep01/include" + , "deps/my-dep02/include" + , "deps/my-dep03/include" + , "deps/my-dep04/include" + , "deps/my-dep05/include" + , "deps/my-dep06/include" + , "deps/my-dep07/include" + , "deps/my-dep08/include" + , "deps/my-dep09/include" + , "deps/my-dep10/include" + , "deps/my-dep-dep01/include" + , "deps/my-dep-dep02/include" + , "deps/my-dep-dep03/include" + , "deps/my-dep-dep04/include" + , "deps/my-dep-dep05/include" + , "deps/my-dep-dep06/include" + , "deps/my-dep-dep07/include" + , "deps/my-dep-dep08/include" + , "deps/my-dep-dep09/include" + , "deps/my-dep-dep10/include" + ] + +-- --extra-lib-dirs have to be absolute paths so this cannot +-- be specified in the cabal.project nor cabal.config. +libDirs :: [String] +libDirs = + [ "deps/my01/lib" + , "deps/my02/lib" + , "deps/my03/lib" + , "deps/my04/lib" + , "deps/my05/lib" + , "deps/my06/lib" + , "deps/my07/lib" + , "deps/my08/lib" + , "deps/my09/lib" + , "deps/my10/lib" + , "deps/my-dep01/lib" + , "deps/my-dep02/lib" + , "deps/my-dep03/lib" + , "deps/my-dep04/lib" + , "deps/my-dep05/lib" + , "deps/my-dep06/lib" + , "deps/my-dep07/lib" + , "deps/my-dep08/lib" + , "deps/my-dep09/lib" + , "deps/my-dep10/lib" + , "deps/my-dep-dep01/lib" + , "deps/my-dep-dep02/lib" + , "deps/my-dep-dep03/lib" + , "deps/my-dep-dep04/lib" + , "deps/my-dep-dep05/lib" + , "deps/my-dep-dep06/lib" + , "deps/my-dep-dep07/lib" + , "deps/my-dep-dep08/lib" + , "deps/my-dep-dep09/lib" + , "deps/my-dep-dep10/lib" + ] + + +main :: IO () +main = cabalTest $ do + cwd <- testSourceDir <$> getTestEnv + + -- The intention is to pass these flags via cabal.project or cabal.config, + -- but these directories must be absolute paths so we cannot commit + -- necessary cabal.project in the repository and have to resort to + -- the command-line arguments instead. + let includeFlags = + concatMap (\x -> ["--extra-include-dirs", cwd x]) includeDirs + libFlags = + concatMap (\x -> ["--extra-lib-dirs", cwd x]) libDirs + + let customCC = cwd "custom-cc" + + -- Parallel flag means output of this test is nondeterministic + _<- recordMode DoNotRecord $ + cabal "v2-build" $ + ["-j", "my-toplevel:exe:my-executable"] + -- Don’t validate absence of duplicates on Windows because + -- it’s too inconvenient to do in bat files. Let’s just + -- assume that deduplication will happen on Windows but + -- still try to run the test to see whether command-line + -- argument length limit is not hit. + ++ ["--with-gcc=" ++ customCC | not isWindows] + ++ includeFlags + ++ libFlags + r <- withPlan $ runPlanExe' "my-toplevel" "my-executable" [] + assertOutputContains + ("Result = " ++ show (42 + 55 + 10 * (55 + 10 * 55) + 3 * 55)) + r diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index b59e8dbf8da..50ea756fcdf 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -75,6 +75,7 @@ library , network-uri >= 2.6.0.2 && < 2.7 , 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 || ^>= 0.18.1.0 + , os-release ^>= 1.0.2.1 , 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 diff --git a/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs b/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs index 2ba8f93f41e..b77c43ff48f 100644 --- a/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs +++ b/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs @@ -145,7 +145,7 @@ data TxFwdBwd = txFwdBwdId :: TxFwdBwd txFwdBwdId = TxFwdBwd id id --- | Conversions of the needle and haystack strings, the seach string and the +-- | Conversions of the needle and haystack strings, the search string and the -- text to search in. data NeedleHaystack = NeedleHaystack diff --git a/cabal-testsuite/src/Test/Cabal/Prelude.hs b/cabal-testsuite/src/Test/Cabal/Prelude.hs index 3a12298608c..c85f1205fc7 100644 --- a/cabal-testsuite/src/Test/Cabal/Prelude.hs +++ b/cabal-testsuite/src/Test/Cabal/Prelude.hs @@ -75,6 +75,7 @@ import Control.Retry (exponentialBackoff, limitRetriesByCumulativeDelay) import Network.Wait (waitTcpVerbose) import System.Environment import qualified System.FilePath.Glob as Glob (globDir1, compile) +import qualified System.OsRelease as OSR import System.Process import System.IO import qualified System.FilePath.Posix as Posix @@ -1079,6 +1080,15 @@ isJavaScript = buildArch == JavaScript skipIfWindows :: String -> IO () skipIfWindows why = skipIfIO ("Windows " <> why) isWindows +skipIfAlpine :: String -> IO () +skipIfAlpine why = do + mres <- OSR.parseOsRelease + let b = case mres of + Just (OSR.OsReleaseResult { OSR.osRelease = OSR.OsRelease { OSR.id = osId } }) + | isLinux -> osId == "alpine" + _ -> False + skipIfIO ("Alpine " <> why) b + skipUnlessWindows :: IO () skipUnlessWindows = skipIfIO "Only interesting in Windows" (not isWindows) diff --git a/cabal.release.project b/cabal.release.project index db9c4f305e2..8fd3d83a188 100644 --- a/cabal.release.project +++ b/cabal.release.project @@ -7,7 +7,26 @@ index-state: hackage.haskell.org 2025-06-27T20:43:14Z -- never include this or its TH dependency in a release! package cabal-install - flags: -git-rev + flags: -git-rev -lukko package Cabal flags: -git-rev + +constraints: + -- don't use `-march=native` (for portability) + hashable -arch-native, + -- fixes unicode issues + tar >= 0.6.2.0, + -- https://github.com/haskell/directory/issues/170 + directory >= 1.3.8.3, + -- avoid deprecated versions + filepath == 1.4.101.0 || == 1.4.300.1 || == 1.4.300.2 || == 1.4.301.0 || >= 1.5.2.0 + +-- https://github.com/haskell/ghcup-hs/issues/1107 +-- https://github.com/haskell/unix/pull/318 +if arch(arm) || arch(i386) + constraints: unix >= 2.8.6.0 + +-- static linking +package zlib + flags: -pkg-config +bundled-c-zlib diff --git a/changelog.d/pr-11005.md b/changelog.d/pr-11005.md new file mode 100644 index 00000000000..42bcd334c78 --- /dev/null +++ b/changelog.d/pr-11005.md @@ -0,0 +1,9 @@ +--- +synopsis: Deduplicate hsc2hs command-line arguments +packages: [Cabal] +prs: 11005 +--- + +Fix a problem where `hsc2hs` becomes non-operational on packages with +lots of dependencies and projects that specify lots of +`extra-include-dirs` or `extra-lib-dirs`. diff --git a/doc/cabaldomain.py b/doc/cabaldomain.py index 9e16aefa6d6..8646c7453c9 100644 --- a/doc/cabaldomain.py +++ b/doc/cabaldomain.py @@ -384,7 +384,7 @@ def run(self): else: return result - # find exsting field list and add to it + # find existing field list and add to it # or create new one for item in contents: if isinstance(item, nodes.field_list): diff --git a/scripts/release/create-release-metadata-for-ghcup.sh b/scripts/release/create-release-metadata-for-ghcup.sh index 6cf3415ce75..210afade4be 100755 --- a/scripts/release/create-release-metadata-for-ghcup.sh +++ b/scripts/release/create-release-metadata-for-ghcup.sh @@ -1,114 +1,95 @@ -#!/usr/bin/env bash +#!/bin/sh -# This script, when passed the cabal release number as the first and only argument -# generates the metadata in the correct format to be useable as is by GHCup -# for eg:- -# $ create-release-metadata-for-ghcup.sh 3.10.2.0 or "3.10.2.0" - -# Note:- Please run ./download-cabal-install-release-binaries.sh before running this script. set -eu set -o pipefail RELEASE=$1 -## FixMe:// What dir to use here? +VERSION=${RELEASE#cabal-install-v} +YV=$(echo "$VERSION" | sed 's/\.//g') + +cd "gh-release-artifacts/cabal-${VERSION}" + +BASE_URL=https://downloads.haskell.org/~cabal/cabal-install-$VERSION -if [ -d "binary-downloads/cabal-install-${RELEASE}-binaries" ]; then - echo "binary downloads folder for release ${RELEASE} found, starting generating GHCup metadata..." -else - echo "The binary downloads for release ${RELEASE} not found." - echo "Please run the script to download them first." -fi +get_sha() { + sha256sum "$1" | awk '{ print $1 }' +} -cd "binary-downloads/cabal-install-${RELEASE}-binaries" +print_uri_hash() { +cat < /dev/stdout + dlUri: ${BASE_URL}/$1 + dlHash: $(get_sha "$1") +EOF_INNER +} cat < /dev/stdout - $RELEASE: + $VERSION: viTags: - Latest viChangeLog: https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-$RELEASE.md # uncomment viPostInstall if the release needs a post-install message - # viPostInstall: &cabal-${RELEASE//./}-post-install | + # viPostInstall: &cabal-${YV}-post-install | viArch: A_64: - Linux_UnknownLinux: - unknown_versioning: &cabal-${RELEASE//./}-64 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-alpine3_12.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-alpine3_12.tar.xz" | awk '{ print $1 }') Linux_Alpine: - unknown_versioning: *cabal-${RELEASE//./}-64 - Linux_CentOS: - unknown_versioning: &cabal-${RELEASE//./}-64-centos7 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-centos7.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-centos7.tar.xz" | awk '{ print $1 }') + '( >= 3.12 && < 3.20)': &cabal-${YV}-alpine312-64 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-alpine312.tar.xz") + '>= 3.20': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-alpine320.tar.xz") + unknown_versioning: *cabal-${YV}-alpine312-64 + Linux_UnknownLinux: + unknown_versioning: +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-unknown.tar.xz") Linux_Debian: - '( >= 9 && < 10)': &cabal-${RELEASE//./}-64-debian - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb9.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb9.tar.xz" | awk '{ print $1 }') - '( == 10 && < 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb10.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb10.tar.xz" | awk '{ print $1 }') - '( >= 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb11.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb11.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-debian + '( >= 11 && < 12)': &cabal-${YV}-64-debian11 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-deb11.tar.xz") + '( >= 12 && < 13)': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-deb12.tar.xz") + unknown_versioning: *cabal-${YV}-64-debian11 Linux_Fedora: - '>= 33': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-fedora33.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-fedora33.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-centos7 + '( >= 33 && < 36 )': &cabal-${YV}-64-fedora33 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora33.tar.xz") + '( >= 36 && < 38 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora36.tar.xz") + '>= 38': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora38.tar.xz") + unknown_versioning: *cabal-${YV}-64-fedora33 Linux_Ubuntu: - '< 20': &cabal-${RELEASE//./}-64-ubuntu18 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-ubuntu18_04.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-ubuntu18_04.tar.xz" | awk '{ print $1 }') - '>= 20': &cabal-${RELEASE//./}-64-ubuntu20 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-ubuntu20_04.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-ubuntu20_04.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-ubuntu18 + '(>= 20 && < 22 )': &cabal-${YV}-64-ubuntu20 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu20.04.tar.xz") + '(>= 22 && < 24 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu22.04.tar.xz") + '(>= 24 && < 26 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu24.04.tar.xz") + unknown_versioning: *cabal-${YV}-64-ubuntu20 Linux_Mint: - '< 20': *cabal-${RELEASE//./}-64-ubuntu18 - '>= 20': *cabal-${RELEASE//./}-64-ubuntu20 - unknown_versioning: *cabal-${RELEASE//./}-64-ubuntu18 + unknown_versioning: *cabal-${YV}-64-ubuntu20 Darwin: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-darwin.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-darwin.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-darwin.tar.xz") Windows: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-windows.zip - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-windows.zip" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-mingw64.zip") FreeBSD: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-freebsd-14.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-freebsd-14.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-portbld-freebsd.tar.xz") A_32: Linux_UnknownLinux: - unknown_versioning: &cabal-${RELEASE//./}-32 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-i386-linux-alpine3_12.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-i386-linux-alpine3_12.tar.xz" | awk '{ print $1 }') + unknown_versioning: &cabal-${YV}-32 +$(print_uri_hash "cabal-install-$VERSION-i386-linux-unknown.tar.xz") Linux_Alpine: - unknown_versioning: *cabal-${RELEASE//./}-32 - Linux_Debian: - '( >= 9 )': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-i386-linux-deb9.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-i386-linux-deb9.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-32 + unknown_versioning: *cabal-${YV}-32 A_ARM64: Darwin: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-darwin.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-darwin.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-aarch64-darwin.tar.xz") Linux_Debian: - '( >= 10 && < 11)': &cabal-${RELEASE//./}-arm64 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-deb10.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-deb10.tar.xz" | awk '{ print $1 }') - '( >= 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-deb11.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-deb11.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-arm64 - Linux_Alpine: - unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-alpine3_18.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-alpine3_18.tar.xz" | awk '{ print $1 }') + '( >= 11)': &cabal-${YV}-arm64-deb +$(print_uri_hash "cabal-install-$VERSION-aarch64-linux-deb11.tar.xz") + unknown_versioning: *cabal-${YV}-arm64-deb Linux_UnknownLinux: - unknown_versioning: *cabal-${RELEASE//./}-arm64 + unknown_versioning: &cabal-${YV}-arm64 +$(print_uri_hash "cabal-install-$VERSION-aarch64-linux-unknown.tar.xz") + Linux_Alpine: + unknown_versioning: *cabal-${YV}-arm64 EOF diff --git a/scripts/release/download-cabal-install-release-binaries.sh b/scripts/release/download-cabal-install-release-binaries.sh deleted file mode 100755 index 4547fd910e8..00000000000 --- a/scripts/release/download-cabal-install-release-binaries.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# A script to download the release binary files for a given cabal release -# from upstream "downlods.haskell.org". -# It accepts the first and only argument as the release number. -# -# useage:- -# $ download-cabal-install-release-binaries.sh "3.10.1.0" -# -# This was initally made to be used with ./create-release-metadata-for-ghcup.sh - -set -eu -set -o pipefail - -RELEASE=$1 - -echo "RELEASE: $RELEASE" - -for com in wget sha256sum ; do - command -V ${com} >/dev/null 2>&1 -done - -[ ! -d "binary-downloads/cabal-install-${RELEASE}-binaries" ] - -mkdir -p "binary-downloads/cabal-install-${RELEASE}-binaries" - -cd "binary-downloads/cabal-install-${RELEASE}-binaries" - -## Download release files -echo "Downloading form: \"https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/\"" -wget --no-parent -r --reject "index.html*" --no-directories "https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/" - -## Verify that sha256 sums of downloaded files match the ones mentioned in the upstream SHA256SUMS file -echo "verifying checksums for downloaded files..." - -if sha256sum --check ./SHA256SUMS; then - echo "All checksums match!" - echo "Successfully downloaded binaries for release: ${RELEASE}" -else - echo "checksums of downloaded files do no match the ones listed in upstream SHA256SUMS file." - echo "please try deleting \"binary-downloads/cabal-install-${RELEASE}-binaries\" folder and downloading again." -fi diff --git a/scripts/release/download-gh-artifacts.sh b/scripts/release/download-gh-artifacts.sh new file mode 100755 index 00000000000..462840603b8 --- /dev/null +++ b/scripts/release/download-gh-artifacts.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +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 + +echo +echo "Now run the following:" +echo " ( cd gh-release-artifacts/cabal-${VERSION} && gh release upload $RELEASE cabal-${VERSION}-src.tar.gz SHA256SUMS SHA256SUMS.sig )" +echo +echo "And afterwards to upload to downloads.haskell.org:" +echo " ./scripts/release/sftp-upload-artifacts.sh cabal-install-v${VERSION}" +echo +echo "And don't forget to finalize the release at https://github.com/stable-haskell/cabal/releases/tag/cabal-install-v${VERSION}" +echo +echo "Also create a PR at https://github.com/haskell/ghcup-metadata/pulls for the vanilla-channel from the output of the following script:" +echo " ./scripts/release/create-yaml-snippet.sh cabal-install-v${VERSION}" + diff --git a/scripts/release/sftp-upload-artifacts.sh b/scripts/release/sftp-upload-artifacts.sh new file mode 100755 index 00000000000..f4b1b20eaf1 --- /dev/null +++ b/scripts/release/sftp-upload-artifacts.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -eu +set -o pipefail + +RELEASE=$1 +VERSION=${RELEASE#cabal-install-v} +URL=https://downloads.haskell.org + +cd "gh-release-artifacts/cabal-${VERSION}" + +sftp $URL <