Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bgamari/cabal-build-test
  • samuela/cabal-build-test
  • emilypi/cabal-build-test
3 results
Show changes
Showing
with 1 addition and 4339 deletions
# This file is auto-generated
#
# To regenerate it run
#
# make github-actions
#
name: MacOS
on:
push:
branches:
- master
- "3.2"
pull_request:
branches:
- master
release:
types:
- created
jobs:
validate-macos-8_8_3:
name: validate.sh macos ghc-8.8.3
runs-on: macos-latest
steps:
- name: Install Autotools
run: |
brew install automake
- name: Install GHC
run: |
cd $(mktemp -d)
curl -sLO https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-apple-darwin.tar.xz
tar -xJf ghc-*.tar.xz
cd ghc-*
./configure --prefix=/opt/ghc/8.8.3
sudo make install
- name: Install Cabal
run: |
cd $(mktemp -d)
curl -sLO https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz
tar -xJf cabal-install-*.tar.xz
sudo mkdir -p /opt/cabal/3.0/bin
sudo cp cabal /opt/cabal/3.0/bin/cabal
sudo chmod 755 /opt/cabal/3.0/bin/cabal
- name: Set PATH
run: |
echo "::add-path::/opt/ghc/8.8.3/bin"
echo "::add-path::/opt/cabal/3.0/bin"
echo "::add-path::$HOME/.cabal/bin"
- name: Update Hackage index
run: cabal v2-update
- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast'
- uses: actions/checkout@v2
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s print-tool-versions
- name: Validate make-cabal-install-dev
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s make-cabal-install-dev
- name: Validate build
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s lib-suite
- name: Validate cli-tests
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s cli-tests
- name: Validate cli-suite
run: sh validate.sh -j 2 -w ghc-8.8.3 -v -s cli-suite
validate-macos-8_6_5:
name: validate.sh macos ghc-8.6.5
runs-on: macos-latest
needs: validate-macos-8_8_3
steps:
- name: Install Autotools
run: |
brew install automake
- name: Install GHC
run: |
cd $(mktemp -d)
curl -sLO https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz
tar -xJf ghc-*.tar.xz
cd ghc-*
./configure --prefix=/opt/ghc/8.6.5
sudo make install
- name: Install Cabal
run: |
cd $(mktemp -d)
curl -sLO https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz
tar -xJf cabal-install-*.tar.xz
sudo mkdir -p /opt/cabal/3.0/bin
sudo cp cabal /opt/cabal/3.0/bin/cabal
sudo chmod 755 /opt/cabal/3.0/bin/cabal
- name: Set PATH
run: |
echo "::add-path::/opt/ghc/8.6.5/bin"
echo "::add-path::/opt/cabal/3.0/bin"
echo "::add-path::$HOME/.cabal/bin"
- name: Update Hackage index
run: cabal v2-update
- name: Install cabal-plan
run: |
cd $(mktemp -d)
cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast'
- uses: actions/checkout@v2
- name: Validate print-config
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s print-config
- name: Validate print-tool-versions
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s print-tool-versions
- name: Validate make-cabal-install-dev
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s make-cabal-install-dev
- name: Validate build
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s build
- name: Validate lib-tests
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s lib-tests
- name: Validate lib-suite
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s lib-suite
- name: Validate cli-tests
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s cli-tests
- name: Validate cli-suite
run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s cli-suite
# This file is auto-generated
#
# To regenerate it run
#
# make github-actions
#
name: Quick jobs
on:
push:
branches:
- master
- "3.2"
pull_request:
branches:
- master
release:
types:
- created
jobs:
meta:
name: Meta checks
runs-on: ubuntu-18.04
# This job is not run in a container, any recent GHC should be fine
steps:
- name: Set PATH
run: |
echo "::add-path::$HOME/.cabal/bin"
echo "::add-path::/opt/cabal/3.0/bin"
echo "::add-path::/opt/ghc/8.6.5/bin"
- uses: actions/cache@v1
with:
path: ~/.cabal/store
key: linux-store-meta
- name: Update Hackage index
run: cabal v2-update
- name: Install alex
run: cabal v2-install alex
- uses: actions/checkout@v2
- name: Regenerate files
run: |
make lexer
make gen-extra-source-files
make spdx
make templates
make github-actions
- name: Check that diff is clean
run: |
git status > /dev/null
git diff-files -p --exit-code
doctest:
name: Doctest Cabal
runs-on: ubuntu-18.04
steps:
- name: Set PATH
run: |
echo "::add-path::$HOME/.cabal/bin"
echo "::add-path::/opt/cabal/3.0/bin"
echo "::add-path::/opt/ghc/8.6.5/bin"
- name: Install cabal-env
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/preview-20191225/cabal-env-snapshot-20191225-x86_64-linux.xz > cabal-env.xz
echo "1b567d529c5f627fd8c956e57ae8f0d9f11ee66d6db34b7fb0cb1c370b4edf01 cabal-env.xz" | sha256sum -c -
xz -d < cabal-env.xz > $HOME/.cabal/bin/cabal-env
rm -f cabal-env.xz
chmod a+x $HOME/.cabal/bin/cabal-env
- uses: actions/cache@v1
with:
path: ~/.cabal/store
key: linux-store-doctest
- name: Update Hackage index
run: cabal v2-update
- name: Install doctest
run: cabal v2-install doctest
- name: Install libraries
run: |
cabal-env --transitive QuickCheck
cabal-env array bytestring containers deepseq directory filepath pretty process time binary unix text parsec mtl
cat $HOME/.ghc/*/environments/default
- uses: actions/checkout@v2
- name: Doctest
run: make doctest
# This file is auto-generated
#
# To regenerate it run
#
# make github-actions
#
name: Windows
on:
push:
branches:
- master
- "3.2"
pull_request:
branches:
- master
release:
types:
- created
jobs:
test-windows-8_6_5:
name: test ghc-8.6.5
runs-on: windows-latest
steps:
- name: Configure Chocolatey
run: choco source add -n mistuke -s https://www.myget.org/F/mistuke/api/v2
- name: Install msys2
run: choco install -y msys2
- name: Install Cabal
run: choco install -y cabal --version 3.0.0.0
- name: Install GHC
run: choco install -y ghc --version 8.6.5
- name: Set PATH
run: |
[Environment]::GetEnvironmentVariable("Path")
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\cabal\tools\cabal-3.0.0.0"
Write-Host "::add-path::C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.6.5\bin"
- name: Print versions
run: |
ghc --version
cabal --version
cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3
- uses: actions/cache@v1
with:
path: C:\SR
key: linux-store-meta
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v2
- name: make cabal-install-dev
run: runghc cabal-dev-scripts/src/Preprocessor.hs -o cabal-install/cabal-install.cabal -f CABAL_FLAG_LIB cabal-install/cabal-install.cabal.pp
# We cannot ask for all dependencies, but we can for Cabal.
- name: cabal v2-build Cabal --only-dependencies
run: cabal v2-build Cabal --only-dependencies
- name: cabal v2-build
run: cabal v2-build all
- name: cabal-install memory-usage-tests
run: |
cd cabal-install
cabal v2-run cabal-install:memory-usage-tests
- name: cabal-install solver-quickcheck
run: |
cd cabal-install
cabal v2-run cabal-install:solver-quickcheck
- name: cabal-install integration-tests2
run: |
cd cabal-install
cabal v2-run cabal-install:integration-tests2
- name: cabal-install unit-tests
run: |
cd cabal-install
cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)"
- name: cabal-tests
# Using only one job, -j1, to fail less.
run: cabal v2-run cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.3.0.0\x\cabal\build\cabal\cabal.exe
# trivial gitignore file
.cabal-sandbox/
cabal.sandbox.config
cabal.project.local
.ghc.environment.*
cabal-dev/
.hpc/
*.hi
*.o
*.p_hi
*.prof
*.tix
dist
dist-*
register.sh
./cabal.config
cabal-tests.log
/Cabal/dist/
/Cabal/.python-sphinx-virtualenv/
/Cabal/tests/Setup
/Cabal/Setup
/Cabal/source-file-list
/cabal-install/dist/
/cabal-install/Setup
/cabal-install/source-file-list
# editor temp files
*#
.#*
*~
.*.swp
*.bak
# GHC build
Cabal/GNUmakefile
Cabal/dist-boot/
Cabal/dist-install/
Cabal/ghc.mk
# TAGS files
TAGS
tags
ctags
# stack artifacts
/.stack-work/
# Shake artifacts
.shake*
progress.txt
# test files
register.sh
# python artifacts from documentation builds
*.pyc
......@@ -8,7 +8,7 @@ variables:
.build:
script:
- cabal update
- cabal v2-install cabal-install --installdir=$(pwd)/out --install-method=copy --overwrite-policy=always
- cabal v2-install cabal-install --installdir=$(pwd)/out --install-method=copy --overwrite-policy=always --enable-split-sections
artifacts:
expire_in: 2 week
paths:
......
# See 'git help shortlog' for more details.
# Formats: Proper Name [<proper@email.xx> [Commit Name]] <commit@email.xx>
#
# Show result: 'git shortlog -se'.
# Should be empty list: 'git shortlog -se | cut -f2 | cut -d'<' -f1 | uniq -d'.
Adam Langley <agl@imperialviolet.org>
Alex Biehl <alexbiehl@gmail.com>
Alex Biehl <alexbiehl@gmail.com> <alex.biehl@target.com>
Alex Biehl <alexbiehl@gmail.com> Alexander Biehl <abiehl@novomind.com>
Alex Biehl <alexbiehl@gmail.com> alexbiehl <alex.biehl@gmail.com>
Alex Washburn <github@recursion.ninja>
Alex Washburn <github@recursion.ninja> recursion-ninja <github@recursion.ninja>
Alistair Bailey <alistair@abayley.org> alistair <alistair@abayley.org>
Alson Kemp <alson@alsonkemp.com> alson <alson@alsonkemp.com>
Andreas Klebinger <klebinger.andreas@gmx.at> klebinger.andreas@gmx.at <klebinger.andreas@gmx.at>
Andres Löh <andres.loeh@gmail.com>
Andres Löh <andres.loeh@gmail.com> <andres@cs.uu.nl>
Andres Löh <andres.loeh@gmail.com> <andres@well-typed.com>
Andres Löh <andres.loeh@gmail.com> <ksgithub@andres-loeh.de>
Andres Löh <andres.loeh@gmail.com> <mail@andres-loeh.de>
Andy Craze <accraze@gmail.com>
Arian van Putten <arian.vanputten@gmail.com> <aeroboy94@gmail.com>
Audrey Tang <audreyt@audreyt.org> audreyt <audreyt@audreyt.org>
Austin Seipp <aseipp@pobox.com>
Austin Seipp <aseipp@pobox.com> <aseipp@well-typed.com>
Austin Seipp <aseipp@pobox.com> austin seipp <as@0xff.ath.cx>
Ben Gamari <ben@smart-cactus.org>
Ben Gamari <ben@smart-cactus.org> <ben@well-typed.com>
Ben Gamari <ben@smart-cactus.org> <bgamari.foss@gmail.com>
Ben Millwood <thebenmachine+git@gmail.com> <haskell@benmachine.co.uk>
Benedikt Huber <benedikt.huber@gmail.com> benedikt.huber <benedikt.huber@gmail.com>
Benno Fünfstück <benno.fuenfstueck@gmail.com> <bneno.fuenfstueck@gmail.com>
Björn Bringert <bjorn@bringert.net>
Björn Bringert <bjorn@bringert.net> bjorn <bjorn@maggie>
Björn Bringert <bjorn@bringert.net> bringert <bringert@cs.chalmers.se>
Bram Schuur <bramschuur@gmail.com>
Brendan Hay <brendan.g.hay@gmail.com> <brendanhay@users.noreply.github.com>
Brent Yorgey <byorgey@gmail.com> <byorgey@cis.upenn.edu>
Brian Smith <brianlsmith@gmail.com> brianlsmith <brianlsmith@gmail.com>
Daniel Díaz Carrete <daniel@bogusemailserver.com>
Daniel Gröber <dxld@darkboxed.org> <daniel@dps.uibk.ac.at>
Daniel Wagner <daniel@wagner-home.com> <dmwit@galois.com>
David Himmelstrup <lemmih@gmail.com>
David Luposchainsky <dluposchainsky@gmail.com> <quchen@users.noreply.github.com>
David Waern <davve@dtek.chalmers.se> David Waern <unknown>
Dennis Gosnell <cdep.illabout@gmail.com>
Dmitry Kovanikov <kovanikov@gmail.com> ChShersh <dmitrii@holmusk.com>
Domen Kožar <domen@dev.si> <domen@enlambda.com>
Don Stewart <dons00@gmail.com> <dons@galois.com>
Duncan Coutts <duncan@community.haskell.org>
Duncan Coutts <duncan@community.haskell.org> <Duncan Coutts duncan@community.haskell.org>
Duncan Coutts <duncan@community.haskell.org> <duncan.coutts@worc.ox.ac.uk>
Duncan Coutts <duncan@community.haskell.org> <duncan@community.haskell.org>
Duncan Coutts <duncan@community.haskell.org> <duncan@haskell.org>
Duncan Coutts <duncan@community.haskell.org> <duncan@well-typed.com>
Duncan Coutts <duncan@community.haskell.org> unknown <unknown> # 04e9fcc80bc68b72126e33b20f08050df28e727d
Edward Z. Yang <ezyang@cs.stanford.edu> <ezyang@fb.com>
Edward Z. Yang <ezyang@cs.stanford.edu> <ezyang@mit.edu>
Einar Karttunen <ekarttun@cs.helsinki.fi>
Emily Pillmore <emilypi@cohomolo.gy> <emily@kadena.io>
Federico Mastellone <fmaste@users.noreply.github.com>
Felix Yan <felixonmars@archlinux.org> Felix Yan <felixonmars@gmail.com>
Francesco Gazzetta <fgaz@fgaz.me> <fgaz@users.noreply.github.com>
Francesco Gazzetta <fgaz@fgaz.me> <francygazz@gmail.com>
Ganesh Sittampalam <ganesh.sittampalam@credit-suisse.com> <ganesh@earth.li>
Geoff Nixon <geoff-codes@users.noreply.github.com> <geoff.nixon@aol.com>
Gershom Bazerman <gershomb@gmail.com>
Gershom Bazerman <gershomb@gmail.com> Gershom <gershom@mbp.local>
Gershom Bazerman <gershomb@gmail.com> U-CIQDEV\gbazerman <gbazerman@GBAZERMAN-T35.ciqdev.com>
Gershom Bazerman <gershomb@gmail.com> gbaz <gershomb@gmail.com>
Gleb Alexeev <gleb.alexeev@gmail.com>
Gleb Alexeev <gleb.alexeev@gmail.com> gleb.alexeev <gleb.alexeev@gmail.com>
Gleb Popov <6yearold@gmail.com>
Gleb Popov <6yearold@gmail.com> arrowd <6yearold@gmail.com>
Gwern Branwen <gwern0@gmail.com> gwern0 <gwern0@gmail.com>
Heather <heather@live.ru> <Heather@cynede.net>
Heather <heather@live.ru> <Heather@users.noreply.github.com>
Henning Günther <der_eq@freenet.de>
Henning Thielemann <lemming@henning-thielemann.de> <haskell@henning-thielemann.de>
Henning Thielemann <lemming@henning-thielemann.de> cabal <cabal@henning-thielemann.de>
Ian Lynagh <igloo@earth.li> <ian@well-typed.com>
Isaac Potoczny-Jones <ijones@syntaxpolice.org>
JP Moresmau <jp@moresmau.fr>
Jacco Krijnen <jaccokrijnen@gmail.com>
Jake Wheat <jakewheatmail@gmail.com>
Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> jeanphilippe.bernardy <jeanphilippe.bernardy@gmail.com>
Jens Petersen <juhpetersen@gmail.com> <juhp@community.haskell.org>
Jens Petersen <juhpetersen@gmail.com> <petersen@haskell.org>
Jens Petersen <juhpetersen@gmail.com> <petersen@redhat.com>
Jeremy Shaw <jeremy.shaw@linspireinc.com>
Jeremy Shaw <jeremy.shaw@linspireinc.com> <jeremy@n-heptane.com>
Jim Burton <jim@sdf-eu.org>
Joe Quinn <headprogrammingczar@gmail.com>
Joel Bitrauser <jo.da@posteo.de> <bitrauser@users.noreply.github.com>
Joel Bitrauser <jo.da@posteo.de> Bitrauser <jo.da@posteo.de>
Joel Stanley <intractable@gmail.com>
Joeri van Eekelen <tchakkazulu@gmail.com>
John D. Ramsdell <ramsdell@mitre.org>
John Dias <dias@eecs.harvard.edu> dias <dias@eecs.harvard.edu>
John Ericson <Ericson2314@yahoo.com>
John Ericson <Ericson2314@yahoo.com> <John.Ericson@Obsidian.Systems>
John Ericson <Ericson2314@yahoo.com> <jericson@galois.com>
John Ericson <Ericson2314@yahoo.com> John Ericson <Ericson2314@Yahoo.com>
Josh Hoyt <josh.hoyt@galois.com>
Judah Jacobson <judah.jacobson@gmail.com>
Jürgen Nicklisch-Franken <jnf@arcor.de>
Keegan McAllister <mcallister.keegan@gmail.com> mcallister.keegan <mcallister.keegan@gmail.com>
Ken Bateman <novadenizen@gmail.com>
Kido Takahiro <shelarcy@gmail.com>
Krasimir Angelov <kr.angelov@gmail.com>
Krasimir Angelov <kr.angelov@gmail.com> ka2_mail <ka2_mail@yahoo.com>
Lennart Kolmodin <kolmodin@gmail.com> <kolmodin@dtek.chalmers.se>
Lennart Kolmodin <kolmodin@gmail.com> <kolmodin@gentoo.org>
Lennart Kolmodin <kolmodin@gmail.com> <kolmodin@google.com>
Lennart Spitzner <hexagoxel@hexagoxel.de>
Lennart Spitzner <hexagoxel@hexagoxel.de> <lsp@informatik.uni-kiel.de>
Li-yao Xia <lysxia@gmail.com>
Malcolm Wallace <Malcolm.Wallace@me.com> Malcolm.Wallace <Malcolm.Wallace@cs.york.ac.uk>
Mark Weber <marco-oweber@gmx.de> marco-oweber <marco-oweber@gmx.de>
Martin Sjögren <msjogren@gmail.com> md9ms <md9ms@mdstud.chalmers.se>
Matt Renaud <matt@m-renaud.com> <mrenaud@google.com>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <c05mgv@cs.umu.se>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <mikhail@scrive.com>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <the.dead.shall.rise@gmail.com>
Nathan Conroy <nathanconroydev@gmail.com>
Neil Mitchell <ndmitchell@gmail.com> Neil Mitchell <unknown>
Niklas Broberg <niklas.broberg@gmail.com> <d00nibro@chalmers.se>
Niklas Broberg <niklas.broberg@gmail.com> <git@nand.wakku.to>
Nikolai Obedin <dev@nkly.me> <github@nkly.me>
Nikolai Obedin <dev@nkly.me> <no@idagio.com> # 3c1502bb633b61ae4d24d40898fca66d7f169679
Peter Higley <phigley@gmail.com>
Peter Simons <simons@cryp.to>
Peter Trško <peter.trsko@gmail.com> Peter Trsko <peter.trsko@ixperta.com>
Philipp Schumann <philipp.schumann@gmail.com> metaleap <philipp.schumann@gmail.com>
Philipp Schuster <pschuster@uni-koblenz.de>
Randy Polen <randen@users.noreply.github.com>
Robert Henderson <rob@robjhen.com> <rob at robjhen dot com>
Robert Henderson <rob@robjhen.com> <robjhen@users.noreply.github.com>
Ryan Scott <ryan.gl.scott@gmail.com> <ryan.gl.scott@ku.edu>
Samuel Gélineau <gelisam+github@gmail.com>
Sergei Trofimovich <slyfox@community.haskell.org> <slyfox@gentoo.org>
Sigbjorn Finne <sof@galois.com>
Simon Marlow <marlowsd@gmail.com> <simonmar@microsoft.com>
Simon Marlow <marlowsd@gmail.com> <smarlow@fb.com>
Simon Peyton Jones <simonpj@microsoft.com>
Simon Peyton Jones <simonpj@microsoft.com> simonpj <simonpj@microsoft/com>
Stephen Blackheath <stephen.blackheath@ipwnstudios.com> <grossly.sensitive.stephen@blacksapphire.com>
Stephen Blackheath <stephen.blackheath@ipwnstudios.com> <oversensitive.pastors.stephen@blacksapphire.com>
Stephen Blackheath <stephen.blackheath@ipwnstudios.com> rubbernecking.trumpet.stephen <rubbernecking.trumpet.stephen@blacksapphire.com>
Suzumiya <suzumiyasmith@gmail.com> # Goes by that name online
Sven Panne <sven.panne@aedion.de>
Tamar Christina <tamar@zhox.com>
Tamar Christina <tamar@zhox.com> <Mistuke@users.noreply.github.com>
Thomas M. DuBuisson <thomas.dubuisson@gmail.com>
Thomas M. DuBuisson <thomas.dubuisson@gmail.com> Thomas M. DuBuisson <tommd@galois.com>
Thomas Schilling <nominolo@gmail.com> <nominolo@googlemail.com>
Thomas Tuegel <ttuegel@gmail.com>
Thomas Tuegel <ttuegel@gmail.com> <ttuegel@mailbox.org>
Thomas Tuegel <ttuegel@gmail.com> <ttuegel@secure.mailbox.org>
Veronika Romashkina <vrom911@gmail.com>
Zejun Wu <zejun.wu@gmail.com> <watashi@watashi.ws>
capsjac <capsjac@gmail.com> # Goes by that name online
ghthrowaway7 <41365123+ghthrowaway7@users.noreply.github.com> # Goes by that name online
quasicomputational <quasicomputational@gmail.com> # Goes by that name online
vedksah <31156362+vedksah@users.noreply.github.com> # Goes by that name online
{
"userBlacklist": [
"BardurArantsson"
, "SyntaxPolice"
]
}
version: 2
sphinx:
configuration: Cabal/doc/conf.py
python:
version: 2.7
Abhinav Gupta <mail@abhinavg.net>
Adam Bergmark <adam@bergmark.nl>
Adam C. Foltzer <acfoltzer@galois.com>
Adam Gundry <adam@well-typed.com>
Adam Langley <agl@imperialviolet.org>
Adam Sandberg Eriksson <adam@sandbergericsson.se>
Alan Zimmerman <alan.zimm@gmail.com>
Albert Krewinkel <tarleb@moltkeplatz.de>
Alec Theriault <alec.theriault@gmail.com>
Alex Biehl <alexbiehl@gmail.com>
Alex Hirsch <w4rh4wk@bluephoenix.at>
Alex Lang <me@alang.ca>
Alex Washburn <github@recursion.ninja>
Alexander Kjeldaas <alexander.kjeldaas@gmail.com>
Alexander Vershilov <alexander.vershilov@gmail.com>
Alexei Pastuchov <alexei.pastuchov@telecolumbus.de>
Alexis Williams <alexis@typedr.at>
Alistair Bailey <alistair@abayley.org>
Alp Mestanogullari <alpmestan@gmail.com>
Alson Kemp <alson@alsonkemp.com>
Amir Mohammad Saied <amirsaied@gmail.com>
Anders Kaseorg <andersk@mit.edu>
Andrea Vezzosi <sanzhiyan@gmail.com>
Andreas Klebinger <klebinger.andreas@gmx.at>
Andres Löh <andres.loeh@gmail.com>
Andrzej Rybczak <electricityispower@gmail.com>
Andrés Sicard-Ramírez <andres.sicard.ramirez@gmail.com>
Andy Craze <accraze@gmail.com>
Angus Lepper <angus.lepper@gmail.com>
Antoine Latter <aslatter@gmail.com>
Anton Dessiatov <anton.dessiatov@gmail.com>
Antonio Nikishaev <a@lelf.me>
Arian van Putten <arian.vanputten@gmail.com>
Arun Tejasvi Chaganty <arunchaganty@gmail.com>
Atze Dijkstra <atze@cs.uu.nl>
Audrey Tang <audreyt@audreyt.org>
Auke Booij <auke@tulcod.com>
Austin Seipp <aseipp@pobox.com>
Bardur Arantsson <bardur@scientician.net>
Bartosz Nitka <bnitka@fb.com>
Bas van Dijk <v.dijk.bas@gmail.com>
Ben Armston <ben.armston@googlemail.com>
Ben Doyle <benjamin.peter.doyle@gmail.com>
Ben Gamari <ben@smart-cactus.org>
Ben Millwood <thebenmachine+git@gmail.com>
Benedikt Huber <benedikt.huber@gmail.com>
Benjamin Herr <ben@0x539.de>
Benno Fünfstück <benno.fuenfstueck@gmail.com>
Bertram Felgenhauer <int-e@gmx.de>
Björn Bringert <bjorn@bringert.net>
Björn Peemöller <bjp@informatik.uni-kiel.de>
Bob Ippolito <bob@redivi.com>
Bram Schuur <bramschuur@gmail.com>
Brendan Hay <brendan.g.hay@gmail.com>
Brent Yorgey <byorgey@gmail.com>
Brian Smith <brianlsmith@gmail.com>
Bryan O'Sullivan <bos@serpentine.com>
Bryan Richter <bryan.richter@gmail.com>
Carter Tazio Schonwald <carter.schonwald@gmail.com>
Chaitanya Koparkar <ckoparkar@gmail.com>
Chang Yang Jiao <jiaochangyang@gmail.com>
Chris Allen <cma@bitemyapp.com>
Chris Wong <lambda.fairy@gmail.com>
Christiaan Baaij <christiaan.baaij@gmail.com>
Clemens Fruhwirth <clemens@endorphin.org>
Clint Adams <clint@debian.org>
Colin Wahl <colin.t.wahl@gmail.com>
Conal Elliott <conal@conal.net>
Curtis Gagliardi <curtis@curtis.io>
Dale Wijnand <344610+dwijnand@users.noreply.github.com>
Dan Burton <danburton.email@gmail.com>
Daniel Buckmaster <dan.buckmaster@gmail.com>
Daniel Díaz Carrete <daniel@bogusemailserver.com>
Daniel Gröber <dxld@darkboxed.org>
Daniel Trstenjak <daniel.trstenjak@gmail.com>
Daniel Velkov <norcobg@gmail.com>
Daniel Wagner <daniel@wagner-home.com>
Danny Navarro <j@dannynavarro.net>
Dave Laing <dave.laing.80@gmail.com>
David Eichmann <EichmannD@gmail.com>
David Feuer <David.Feuer@gmail.com>
David Fox <dsf@seereason.com>
David Himmelstrup <lemmih@gmail.com>
David Lazar <lazar6@illinois.edu>
David Luposchainsky <dluposchainsky@gmail.com>
David McFarland <corngood@gmail.com>
David Terei <davidterei@gmail.com>
David Waern <davve@dtek.chalmers.se>
Dennis Gosnell <cdep.illabout@gmail.com>
Dino Morelli <dino@ui3.info>
Dmitry Astapov <dastapov@gmail.com>
Dmitry Kovanikov <kovanikov@gmail.com>
Domen Kožar <domen@dev.si>
Dominic Steinitz <dominic@steinitz.org>
Don Stewart <dons00@gmail.com>
Doug Beardsley <mightybyte@gmail.com>
Douglas Wilson <douglas.wilson@gmail.com>
Duncan Coutts <duncan@community.haskell.org>
Echo Nolan <echo@echonolan.net>
Edsko de Vries <edsko@well-typed.com>
Edward Z. Yang <ezyang@cs.stanford.edu>
Einar Karttunen <ekarttun@cs.helsinki.fi>
Emily Pillmore <emilypi@cohomolo.gy>
Eric Kow <eric.kow@gmail.com>
Eric Seidel <gridaphobe@gmail.com>
Erik Hesselink <hesselink@gmail.com>
Erik Rantapaa <erantapaa@gmail.com>
Erik de Castro Lopo <erikd@mega-nerd.com>
Esa Ilari Vuokko <ei@vuokko.info>
Eugene Sukhodolin <eugene@sukhodolin.com>
Eyal Lotem <eyal.lotem@gmail.com>
Fabián Orccón <fabian.orccon@pucp.pe>
Fangyi Zhou <fangyi.zhou15@imperial.ac.uk>
Federico Mastellone <fmaste@users.noreply.github.com>
Felix Yan <felixonmars@archlinux.org>
Florian Hartwig <florian.j.hartwig@gmail.com>
Francesco Ariis <fa-ml@ariis.it>
Francesco Gazzetta <fgaz@fgaz.me>
Franz Thoma <franz.thoma@tngtech.com>
Fujimura Daisuke <me@fujimuradaisuke.com>
Gabor Greif <ggreif@gmail.com>
Gabor Pali <pali.gabor@gmail.com>
Ganesh Sittampalam <ganesh.sittampalam@credit-suisse.com>
Geoff Nixon <geoff-codes@users.noreply.github.com>
George Wilson <george@wils.online>
Gershom Bazerman <gershomb@gmail.com>
Getty Ritter <gdritter@galois.com>
Gleb Alexeev <gleb.alexeev@gmail.com>
Gleb Popov <6yearold@gmail.com>
Gregory Collins <greg@gregorycollins.net>
Gwern Branwen <gwern0@gmail.com>
Haisheng.Wu <freizl@gmail.com>
Harrison Houghton <haro@constant.gripe>
Harry Garrood <harry@garrood.me>
Heather <heather@live.ru>
Henk-Jan van Tuyl <hjgtuyl@chello.nl>
Henning Günther <der_eq@freenet.de>
Henning Thielemann <lemming@henning-thielemann.de>
Herbert Valerio Riedel <hvr@gnu.org>
Iain Nicol <iain@iainnicol.com>
Ian D. Bollinger <ian.bollinger@gmail.com>
Ian Lynagh <igloo@earth.li>
Ian Ross <ian@skybluetrades.net>
Ilya Smelkov <triplepointfive@gmail.com>
Isaac Potoczny-Jones <ijones@syntaxpolice.org>
Isamu Mogi <saturday6c@gmail.com>
Iustin Pop <iusty@k1024.org>
Ivan Lazar Miljenovic <Ivan.Miljenovic@gmail.com>
Iñaki García Etxebarria <garetxe@gmail.com>
JP Moresmau <jp@moresmau.fr>
Jacco Krijnen <jaccokrijnen@gmail.com>
Jack Henahan <jhenahan@uvm.edu>
Jake Wheat <jakewheatmail@gmail.com>
James Earl Douglas <james@earldouglas.com>
Jan Path <jan@jpath.de>
Jason Dagit <dagitj@gmail.com>
Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>
Jens Petersen <juhpetersen@gmail.com>
Jeremy Shaw <jeremy.shaw@linspireinc.com>
Jim Burton <jim@sdf-eu.org>
Joachim Breitner <mail@joachim-breitner.de>
Joe Quinn <headprogrammingczar@gmail.com>
Joel Bitrauser <jo.da@posteo.de>
Joel Stanley <intractable@gmail.com>
Joeri van Eekelen <tchakkazulu@gmail.com>
Johan Tibell <johan.tibell@gmail.com>
John Chee <cheecheeo@gmail.com>
John D. Ramsdell <ramsdell@mitre.org>
John Dias <dias@eecs.harvard.edu>
John Ericson <Ericson2314@yahoo.com>
John Lato <jwlato@tsurucapital.com>
John Wiegley <johnw@fpcomplete.com>
Jonathan Daugherty <jtd@galois.com>
Jookia <166291@gmail.com>
Josef Svenningsson <josef.svenningsson@gmail.com>
Josh Hoyt <josh.hoyt@galois.com>
Josh Kalderimis <josh.kalderimis@gmail.com>
Josh Meredith <joshmeredith2008@gmail.com>
Judah Jacobson <judah.jacobson@gmail.com>
Jürgen Nicklisch-Franken <jnf@arcor.de>
Karel Gardas <karel.gardas@centrum.cz>
Keegan McAllister <mcallister.keegan@gmail.com>
Ken Bateman <novadenizen@gmail.com>
Ken Micklas <kmicklas@gmail.com>
Keshav Kini <kkini@galois.com>
Kido Takahiro <shelarcy@gmail.com>
Krasimir Angelov <kr.angelov@gmail.com>
Kristen Kozak <grayjay@wordroute.com>
Lennart Kolmodin <kolmodin@gmail.com>
Lennart Spitzner <hexagoxel@hexagoxel.de>
Leon Isenberg <ljli@users.noreply.github.com>
Leon Schoorl <l.m.schoorl@student.utwente.nl>
Leonid Onokhov <sopvop@gmail.com>
Li-yao Xia <lysxia@gmail.com>
Liyang HU <git@liyang.hu>
Luite Stegeman <stegeman@gmail.com>
Luke Iannini <lukexi@me.com>
M Farkas-Dyck <strake888@gmail.com>
Maciej Bielecki <maciej.bielecki@skubacz.pl>
Maciek Makowski <maciek.makowski@gmail.com>
Magnus Jonsson <magnus@smartelectronix.com>
Malcolm Wallace <Malcolm.Wallace@me.com>
Mark Lentczner <markl@glyphic.com>
Mark Weber <marco-oweber@gmx.de>
Markus Pfeiffer <markusp@mcs.st-andrews.ac.uk>
Martin Sjögren <msjogren@gmail.com>
Martin Vlk <martin@vlkk.cz>
Masahiro Yamauchi <sgt.yamauchi@gmail.com>
Mathieu Boespflug <mboes@tweag.net>
Matt Renaud <matt@m-renaud.com>
Matthew Pickering <matthewtpickering@gmail.com>
Matthew William Cox <matt@mattcox.ca>
Matthias Fischmann <mf@zerobuzz.net>
Matthias Kilian <kili@outback.escape.de>
Matthias Pronk <git@masida.nl>
Max Amanshauser <max@lambdalifting.org>
Max Bolingbroke <batterseapower@hotmail.com>
Maximilian Tagher <feedback.tagher@gmail.com>
Maxwell Swadling <maxwellswadling@gmail.com>
Merijn Verstraaten <merijn@inconsistent.nl>
Michael Sloan <mgsloan@gmail.com>
Michael Snoyman <michael@snoyman.com>
Michael Thompson <what_is_it_to_do_anything@yahoo.com>
Michael Tolly <miketolly@gmail.com>
Mike Craig <mcraig@groupon.com>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com>
Misty De Meo <mistydemeo@gmail.com>
Miëtek Bak <mietek@bak.io>
Mohit Agarwal <mohit@sdf.org>
Moritz Angermann <moritz.angermann@gmail.com>
Moritz Drexl <mdrexl@fastmail.fm>
Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Nathan Conroy <nathanconroydev@gmail.com>
Nathan Howell <nhowell@alphaheavy.com>
Neil Mitchell <ndmitchell@gmail.com>
Neil Vice <sardonicpresence@gmail.com>
Nick Alexander <ncalexan@uci.edu>
Nick Smallbone <nick.smallbone@gmail.com>
Nikita Karetnikov <nikita@karetnikov.org>
Niklas Broberg <niklas.broberg@gmail.com>
Niklas Hambüchen <mail@nh2.me>
Nikolai Obedin <dev@nkly.me>
Oleg Grenrus <oleg.grenrus@iki.fi>
Oleksandr Manzyuk <manzyuk@gmail.com>
Omar Mefire <omefire@gmail.com>
Owen Stephens <owen@owenstephens.co.uk>
Paolo Capriotti <p.capriotti@gmail.com>
Paolo G. Giarrusso <p.giarrusso@gmail.com>
Paolo Losi <paolo.losi@gmail.com>
Paolo Martini <paolo@nemail.it>
Patrick Chilton <chpatrick@gmail.com>
Patrick Premont <ppremont@cognimeta.com>
Patryk Zadarnowski <pat@jantar.org>
Pepe Iborra <mnislaih@gmail.com>
Peter Higley <phigley@gmail.com>
Peter Robinson <thaldyron@gmail.com>
Peter Selinger <selinger@mathstat.dal.ca>
Peter Simons <simons@cryp.to>
Peter Siska <siska.pe@gmail.com>
Peter Trommler <ptrommler@acm.org>
Peter Trško <peter.trsko@gmail.com>
Phil Ruffwind <rf@rufflewind.com>
Philipp Schumann <philipp.schumann@gmail.com>
Philipp Schuster <pschuster@uni-koblenz.de>
Piyush P Kurur <ppk@cse.iitk.ac.in>
Pranit Bauva <pranit.bauva@gmail.com>
Prayag Verma <prayag.verma@gmail.com>
Randy Polen <randen@users.noreply.github.com>
Reid Barton <rwbarton@gmail.com>
Richard Eisenberg <eir@cis.upenn.edu>
Ricky Elrod <ricky@elrod.me>
Robert Collins <robertc@robertcollins.net>
Robert Henderson <rob@robjhen.com>
Roberto Zunino <zunrob@users.sf.net>
Robin Green <greenrd@greenrd.org>
Robin KAY <komadori@gekkou.co.uk>
Roman Cheplyaka <roma@ro-che.info>
Roman Kashitcyn <rkashitsyn@rkashitsyn.zrh.corp.google.com>
Ross Paterson <ross@soi.city.ac.uk>
Rudy Matela <rudy@matela.com.br>
Ryan Desfosses <ryan@desfo.org>
Ryan Mulligan <ryan@ryantm.com>
Ryan Newton <rrnewton@gmail.com>
Ryan Scott <ryan.gl.scott@gmail.com>
Ryan Trinkle <ryan.trinkle@gmail.com>
RyanGlScott <ryan.gl.scott@gmail.com>
Sam Boosalis <SamBoosalis@gmail.com>
Sam Halliday <sam.halliday@gmail.com>
Samuel Bronson <naesten@gmail.com>
Samuel Gélineau <gelisam+github@gmail.com>
Sergei Trofimovich <slyfox@community.haskell.org>
Sergey Vinokurov <serg.foo@gmail.com>
Sigbjorn Finne <sof@galois.com>
Simon Hengel <sol@typeful.net>
Simon Jakobi <simon.jakobi@gmail.com>
Simon Marlow <marlowsd@gmail.com>
Simon Meier <iridcode@gmail.com>
Simon Peyton Jones <simonpj@microsoft.com>
Spencer Janssen <sjanssen@cse.unl.edu>
Stephen Blackheath <stephen.blackheath@ipwnstudios.com>
Stuart Popejoy <spopejoy@panix.com>
Suzumiya <suzumiyasmith@gmail.com>
Sven Panne <sven.panne@aedion.de>
Sönke Hahn <shahn@joyridelabs.de>
Takano Akio <tak@anoak.io>
Takenobu Tani <takenobu.hs@gmail.com>
Tamar Christina <tamar@zhox.com>
Taru Karttunen <taruti@taruti.net>
Taylor Fausak <taylor.fausak@verizonwireless.com>
Thomas Dziedzic <gostrc@gmail.com>
Thomas M. DuBuisson <thomas.dubuisson@gmail.com>
Thomas Miedema <thomasmiedema@gmail.com>
Thomas Schilling <nominolo@gmail.com>
Thomas Tuegel <ttuegel@gmail.com>
Tillmann Rendel <rendel@informatik.uni-marburg.de>
Tim Chevalier <chevalier@alum.wellesley.edu>
Tim Humphries <tim.humphries@ambiata.com>
Tim McGilchrist <timmcgil@gmail.com>
Tomas Vestelind <tomas.vestelind@gmail.com>
Toon Nolten <toonn@toonn.io>
Toshio Ito <debug.ito@gmail.com>
Travis Cardwell <travis.cardwell@extellisys.com>
Travis Whitaker <pi.boy.travis@gmail.com>
Tseen She <ts33n.sh3@gmail.com>
Tuncer Ayaz <tuncer.ayaz@gmail.com>
Vaibhav Sagar <vaibhavsagar@gmail.com>
Vanessa McHale <vanessa.mchale@iohk.io>
Veronika Romashkina <vrom911@gmail.com>
Vincent Hanquez <vincent@snarc.org>
Vladislav Zavialov <vlad.z.4096@gmail.com>
Vo Minh Thu <noteed@gmail.com>
Wasif Hasan Baig <pr.wasif@gmail.com>
Wojciech Danilo <wojtek.danilo@gmail.com>
Yitzchak Gale <gale@sefer.org>
Yuras Shumovich <shumovichy@gmail.com>
Yuriy Syrovetskiy <cblp@cblp.su>
Zejun Wu <zejun.wu@gmail.com>
capsjac <capsjac@gmail.com>
codetriage-readme-bot <schneemanbuys@gmail.com>
fendor <power.walross@gmail.com>
ghthrowaway7 <41365123+ghthrowaway7@users.noreply.github.com>
quasicomputational <quasicomputational@gmail.com>
vedksah <31156362+vedksah@users.noreply.github.com>
Łukasz Dąbek <sznurek@gmail.com>
# Contributing to Cabal
Building Cabal for hacking
--------------------------
The current recommended way of developing Cabal is to use the
`new-build` feature which [shipped in cabal-install-1.24](http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/). Assuming
that you have a sufficiently recent cabal-install (see above),
it is sufficient to run:
~~~~
cabal new-build cabal
~~~~
To build a local, development copy of cabal-install. The location
of your build products will vary depending on which version of
cabal-install you use to build; see the documentation section
[Where are my build products?](http://cabal.readthedocs.io/en/latest/nix-local-build.html#where-are-my-build-products)
to find the binary (or just run `find -type f -executable -name cabal`).
Here are some other useful variations on the commands:
~~~~
cabal new-build Cabal # build library only
cabal new-build Cabal:unit-tests # build Cabal's unit test suite
cabal new-build cabal-tests # etc...
~~~~
**Dogfooding HEAD.**
Many of the core developers of Cabal dogfood `cabal-install` HEAD
when doing development on Cabal. This helps us identify bugs
which were missed by the test suite and easily experiment with new
features.
The recommended workflow in this case is slightly different: you will
maintain two Cabal source trees: your production tree (built with a
released version of Cabal) which always tracks `master` and which you
update only when you want to move to a new version of Cabal to dogfood,
and your development tree (built with your production Cabal) that you
actually do development on.
In more detail, suppose you have checkouts of Cabal at `~/cabal-prod`
and `~/cabal-dev`, and you have a release copy of cabal installed at
`/opt/cabal/2.4/bin/cabal`. First, build your production tree:
~~~~
cd ~/cabal-prod
/opt/cabal/2.4/bin/cabal new-build cabal
~~~~
This will produce a cabal binary (see also: [Where are my build products?](http://cabal.readthedocs.io/en/latest/nix-local-build.html#where-are-my-build-products)
). Add this binary to your PATH,
and then use it to build your development copy:
~~~~
cd ~/cabal-dev
cabal new-build cabal
~~~~
Running tests
-------------
**Using Travis and AppVeyor.**
If you are not in a hurry, the most convenient way to run tests on Cabal
is to make a branch on GitHub and then open a pull request; our
continuous integration service on Travis and AppVeyor will build and
test your code. Title your PR with WIP so we know that it does not need
code review.
Some tips for using Travis effectively:
* Travis builds take a long time. Use them when you are pretty
sure everything is OK; otherwise, try to run relevant tests locally
first.
* Watch over your jobs on the [Travis website](http://travis-ci.org).
If you know a build of yours is going to fail (because one job has
already failed), be nice to others and cancel the rest of the jobs,
so that other commits on the build queue can be processed.
**How to debug a failing CI test.**
One of the annoying things about running tests on CI is when they
fail, there is often no easy way to further troubleshoot the broken
build. Here are some guidelines for debugging continuous integration
failures:
1. Can you tell what the problem is by looking at the logs? The
`cabal-testsuite` tests run with `-v` logging by default, which
is dumped to the log upon failure; you may be able to figure out
what the problem is directly this way.
2. Can you reproduce the problem by running the test locally?
See the next section for how to run the various test suites
on your local machine.
3. Is the test failing only for a specific version of GHC, or
a specific operating system? If so, try reproducing the
problem on the specific configuration.
4. Is the test failing on a Travis per-GHC build
([for example](https://travis-ci.org/haskell-pushbot/cabal-binaries/builds/208128401))?
In this case, if you click on "Branch", you can get access to
the precise binaries that were built by Travis that are being
tested. If you have an Ubuntu system, you can download
the binaries and run them directly.
5. Is the test failing on AppVeyor? Consider logging in via
Remote Desktop to the build VM:
https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
If none of these let you reproduce, there might be some race condition
or continuous integration breakage; please file a bug.
**Running tests locally.**
To run tests locally with `new-build`, you will need to know the
name of the test suite you want. Cabal and cabal-install have
several. Also, you'll want to read [Where are my build products?](http://cabal.readthedocs.io/en/latest/nix-local-build.html#where-are-my-build-products)
The most important test suite is `cabal-testsuite`: most user-visible
changes to Cabal should come with a test in this framework. See
[cabal-testsuite/README.md](cabal-testsuite/README.md) for more
information about how to run tests and write new ones. Quick
start: use `cabal-tests` to run `Cabal` tests, and `cabal-tests
--with-cabal=/path/to/cabal` to run `cabal-install` tests
(don't forget `--with-cabal`! Your cabal-install tests won't
run without it).
There are also other test suites:
* `Cabal:unit-tests` are small, quick-running unit tests
on small pieces of functionality in Cabal. If you are working
on some utility functions in the Cabal library you should run this
test suite.
* `cabal-install:unit-tests` are small, quick-running unit tests on
small pieces of functionality in cabal-install. If you are working
on some utility functions in cabal-install you should run this test
suite.
* `cabal-install:solver-quickcheck` are QuickCheck tests on
cabal-install's dependency solver. If you are working
on the solver you should run this test suite.
* `cabal-install:integration-tests2` are integration tests on some
top-level API functions inside the `cabal-install` source code.
For these test executables, `-p` which applies a regex filter to the test
names.
Conventions
-----------
* Spaces, not tabs.
* Try to follow style conventions of a file you are modifying, and
avoid gratuitous reformatting (it makes merges harder!)
* Format your commit messages [in the standard way](https://chris.beams.io/posts/git-commit/#seven-rules).
* A lot of Cabal does not have top-level comments. We are trying to
fix this. If you add new top-level definitions, please Haddock them;
and if you spend some time understanding what a function does, help
us out and add a comment. We'll try to remind you during code review.
* If you do something tricky or non-obvious, add a comment.
* If your commit only touches comments, you can use `[ci skip]`
anywhere in the body of the commit message to avoid needlessly
triggering the build bots.
* For local imports (Cabal module importing Cabal module), import lists
are NOT required (although you may use them at your discretion.) For
third-party and standard library imports, please use either qualified imports
or explicit import lists.
* You can use basically any GHC extension supported by a GHC in our
support window, except Template Haskell, which would cause
bootstrapping problems in the GHC compilation process.
* Our GHC support window is five years for the Cabal library and three
years for cabal-install: that is, the Cabal library must be
buildable out-of-the-box with the dependencies that shipped with GHC
for at least five years. The Travis CI checks this, so most
developers submit a PR to see if their code works on all these
versions of GHC. `cabal-install` must also be buildable on all
supported GHCs, although it does not have to be buildable
out-of-the-box. Instead, the `cabal-install/bootstrap.sh` script
must be able to download and install all of the dependencies (this
is also checked by CI). Also, self-upgrade to the latest version
(i.e. `cabal install cabal-install`) must work with all versions of
`cabal-install` released during the last three years.
* `Cabal` has its own Prelude, in `Distribution.Compat.Prelude`,
that provides a compatibility layer and exports some commonly
used additional functions. Use it in all new modules.
* As far as possible, please do not use CPP. If you must use it,
try to put it in a `Compat` module, and minimize the amount of code
that is enclosed by CPP. For example, prefer:
```
f :: Int -> Int
#ifdef mingw32_HOST_OS
f = (+1)
#else
f = (+2)
#endif
```
over:
```
#ifdef mingw32_HOST_OS
f :: Int -> Int
f = (+1)
#else
f :: Int -> Int
f = (+2)
#endif
```
We like [this style guide][guide].
[guide]: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
Communicating
-------------
There are a few main venues of communication:
* Most developers subscribe to receive messages from [all issues](https://github.com/haskell/cabal/issues); issues can be used to [open discussion](https://github.com/haskell/cabal/issues?q=is%3Aissue+is%3Aopen+custom+label%3A%22type%3A+discussion%22). If you know someone who should hear about a message, CC them explicitly using the @username GitHub syntax.
* For more organizational concerns, the [mailing
list](http://www.haskell.org/mailman/listinfo/cabal-devel) is used.
* Many developers idle on `#hackage` on `irc.freenode.net` ([archives](http://ircbrowse.net/browse/hackage)). `#ghc` ([archives](http://ircbrowse.net/browse/ghc)) is also a decently good bet.
Releases
--------
Notes for how to make a release are at the
wiki page ["Making a release"](https://github.com/haskell/cabal/wiki/Making-a-release).
Currently, @23Skidoo, @rthomas, @tibbe and @dcoutts have access to
`haskell.org/cabal`, and @davean is the point of contact for getting
permissions.
API Documentation
-----------------
Auto-generated API documentation for the `master` branch of Cabal is automatically uploaded here: http://haskell.github.io/cabal-website/doc/html/Cabal/.
## Issue triage [![Open Source Helpers](https://www.codetriage.com/haskell/cabal/badges/users.svg)](https://www.codetriage.com/haskell/cabal)
You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to cabal on CodeTriage](https://www.codetriage.com/haskell/cabal).
cabal-version: 2.2
name: Cabal-quickcheck
version: 3.3.0.0
synopsis: QuickCheck instances for types in Cabal
category: Testing
description:
Provides QuickCheck Arbitrary instances for some types in Cabal
library
default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall
build-depends:
, base
, Cabal ^>=3.3.0.0
, QuickCheck ^>=2.13.2
exposed-modules: Test.QuickCheck.Instances.Cabal
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.QuickCheck.Instances.Cabal () where
import Control.Applicative (liftA2)
import Data.Char (isAlphaNum, isDigit)
import Data.List (intercalate)
import Distribution.Utils.Generic (lowercase)
import Test.QuickCheck
import Distribution.CabalSpecVersion
import Distribution.Simple.Flag (Flag (..))
import Distribution.SPDX
import Distribution.System
import Distribution.Types.Dependency
import Distribution.Types.Flag (FlagAssignment, FlagName, mkFlagName, mkFlagAssignment)
import Distribution.Types.LibraryName
import Distribution.Types.PackageName
import Distribution.Types.SourceRepo
import Distribution.Types.UnqualComponentName
import Distribution.ModuleName
import Distribution.Types.VersionRange.Internal
import Distribution.Verbosity
import Distribution.Version
import Distribution.Parsec.Newtypes
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative (pure, (<$>), (<*>))
#endif
-------------------------------------------------------------------------------
-- CabalSpecVersion
-------------------------------------------------------------------------------
instance Arbitrary CabalSpecVersion where
arbitrary = arbitraryBoundedEnum
instance Arbitrary SpecVersion where
arbitrary = fmap SpecVersion arbitrary
-------------------------------------------------------------------------------
-- PackageName
-------------------------------------------------------------------------------
instance Arbitrary PackageName where
arbitrary = mkPackageName . intercalate "-" <$> shortListOf1 2 nameComponent
where
nameComponent = shortListOf1 5 (elements packageChars)
`suchThat` (not . all isDigit)
packageChars = filter isAlphaNum ['\0'..'\127']
-------------------------------------------------------------------------------
-- Version
-------------------------------------------------------------------------------
instance Arbitrary Version where
arbitrary = do
branch <- smallListOf1 $
frequency [(3, return 0)
,(3, return 1)
,(2, return 2)
,(2, return 3)
,(1, return 0xfffd)
,(1, return 0xfffe) -- max fitting into packed W64
,(1, return 0xffff)
,(1, return 999999999)
,(1, return 0x10000)]
return (mkVersion branch)
where
smallListOf1 = scale (\n -> min 6 (n `div` 3)) . listOf1
shrink ver = [ mkVersion ns | ns <- shrink (versionNumbers ver)
, not (null ns) ]
instance Arbitrary VersionRange where
arbitrary = sized verRangeExp
where
verRangeExp n = frequency $
[ (2, return anyVersion)
, (1, fmap thisVersion arbitrary)
, (1, fmap laterVersion arbitrary)
, (1, fmap orLaterVersion arbitrary)
, (1, fmap orLaterVersion' arbitrary)
, (1, fmap earlierVersion arbitrary)
, (1, fmap orEarlierVersion arbitrary)
, (1, fmap orEarlierVersion' arbitrary)
, (1, fmap withinVersion arbitrary)
, (1, fmap majorBoundVersion arbitrary)
] ++ if n == 0 then [] else
[ (2, liftA2 unionVersionRanges verRangeExp2 verRangeExp2)
, (2, liftA2 intersectVersionRanges verRangeExp2 verRangeExp2)
]
where
verRangeExp2 = verRangeExp (n `div` 2)
orLaterVersion' v =
unionVersionRanges (LaterVersion v) (ThisVersion v)
orEarlierVersion' v =
unionVersionRanges (EarlierVersion v) (ThisVersion v)
shrink AnyVersion = []
shrink (ThisVersion v) = map ThisVersion (shrink v)
shrink (LaterVersion v) = map LaterVersion (shrink v)
shrink (EarlierVersion v) = map EarlierVersion (shrink v)
shrink (OrLaterVersion v) = LaterVersion v : map OrLaterVersion (shrink v)
shrink (OrEarlierVersion v) = EarlierVersion v : map OrEarlierVersion (shrink v)
shrink (WildcardVersion v) = map WildcardVersion ( shrink v)
shrink (MajorBoundVersion v) = map MajorBoundVersion (shrink v)
shrink (UnionVersionRanges a b) = a : b : map (uncurry UnionVersionRanges) (shrink (a, b))
shrink (IntersectVersionRanges a b) = a : b : map (uncurry IntersectVersionRanges) (shrink (a, b))
-- | Generating VersionIntervals
--
-- This is a tad tricky as VersionIntervals is an abstract type, so we first
-- make a local type for generating the internal representation. Then we check
-- that this lets us construct valid 'VersionIntervals'.
--
instance Arbitrary VersionIntervals where
arbitrary = fmap mkVersionIntervals' arbitrary
where
mkVersionIntervals' :: [(Version, Bound)] -> VersionIntervals
mkVersionIntervals' = mkVersionIntervals . go version0
where
go :: Version -> [(Version, Bound)] -> [VersionInterval]
go _ [] = []
go v [(lv, lb)] =
[(LowerBound (addVersion lv v) lb, NoUpperBound)]
go v ((lv, lb) : (uv, ub) : rest) =
(LowerBound lv' lb, UpperBound uv' ub) : go uv' rest
where
lv' = addVersion v lv
uv' = addVersion lv' uv
addVersion :: Version -> Version -> Version
addVersion xs ys = mkVersion $ z (versionNumbers xs) (versionNumbers ys)
where
z [] ys' = ys'
z xs' [] = xs'
z (x : xs') (y : ys') = x + y : z xs' ys'
instance Arbitrary Bound where
arbitrary = elements [ExclusiveBound, InclusiveBound]
-------------------------------------------------------------------------------
-- ModuleName
-------------------------------------------------------------------------------
instance Arbitrary ModuleName where
arbitrary = fromString . intercalate "." <$> shortListOf1 4 comp where
comp = (:) <$> elements upper <*> shortListOf1 10 (elements moduleChar)
upper = ['A'..'Z']
moduleChar = [ c | c <- ['\0' .. '\255'], isAlphaNum c || c `elem` "_'" ]
-------------------------------------------------------------------------------
-- Dependency
-------------------------------------------------------------------------------
instance Arbitrary Dependency where
arbitrary = mkDependency
<$> arbitrary
<*> arbitrary
<*> (arbitrary `suchThat` const True) -- should be (not . null)
shrink (Dependency pn vr lb) =
[ mkDependency pn' vr' lb'
| (pn', vr', lb') <- shrink (pn, vr, lb)
]
-------------------------------------------------------------------------------
-- System
-------------------------------------------------------------------------------
instance Arbitrary OS where
arbitrary = elements knownOSs
instance Arbitrary Arch where
arbitrary = elements knownArches
instance Arbitrary Platform where
arbitrary = Platform <$> arbitrary <*> arbitrary
-------------------------------------------------------------------------------
-- Various names
-------------------------------------------------------------------------------
instance Arbitrary UnqualComponentName where
-- same rules as package names
arbitrary = packageNameToUnqualComponentName <$> arbitrary
instance Arbitrary LibraryName where
arbitrary = oneof
[ LSubLibName <$> arbitrary
, pure LMainLibName
]
shrink (LSubLibName _) = [LMainLibName]
shrink _ = []
-------------------------------------------------------------------------------
-- option flags
-------------------------------------------------------------------------------
instance Arbitrary a => Arbitrary (Flag a) where
arbitrary = arbitrary1
shrink NoFlag = []
shrink (Flag x) = NoFlag : [ Flag x' | x' <- shrink x ]
instance Arbitrary1 Flag where
liftArbitrary genA = sized $ \sz ->
if sz <= 0
then pure NoFlag
else frequency [ (1, pure NoFlag)
, (3, Flag <$> genA) ]
-------------------------------------------------------------------------------
-- GPD flags
-------------------------------------------------------------------------------
instance Arbitrary FlagName where
arbitrary = mkFlagName <$> flagident
where
flagident = lowercase <$> shortListOf1 5 (elements flagChars)
`suchThat` (("-" /=) . take 1)
flagChars = "-_" ++ ['a'..'z']
instance Arbitrary FlagAssignment where
arbitrary = mkFlagAssignment <$> arbitrary
-------------------------------------------------------------------------------
-- Verbosity
-------------------------------------------------------------------------------
instance Arbitrary Verbosity where
arbitrary = elements [minBound..maxBound]
-------------------------------------------------------------------------------
-- SourceRepo
-------------------------------------------------------------------------------
instance Arbitrary RepoType where
arbitrary = elements (KnownRepoType <$> knownRepoTypes)
instance Arbitrary RepoKind where
arbitrary = elements [RepoHead, RepoThis]
-------------------------------------------------------------------------------
-- SPDX
-------------------------------------------------------------------------------
instance Arbitrary LicenseId where
arbitrary = elements $ licenseIdList LicenseListVersion_3_6
instance Arbitrary LicenseExceptionId where
arbitrary = elements $ licenseExceptionIdList LicenseListVersion_3_6
instance Arbitrary LicenseRef where
arbitrary = mkLicenseRef' <$> ids' <*> ids
where
ids = listOf1 $ elements $ ['a'..'z'] ++ ['A' .. 'Z'] ++ ['0'..'9'] ++ "_-"
ids' = oneof [ pure Nothing, Just <$> ids ]
instance Arbitrary SimpleLicenseExpression where
arbitrary = oneof
[ ELicenseId <$> arbitrary
, ELicenseIdPlus <$> arbitrary
, ELicenseRef <$> arbitrary
]
instance Arbitrary LicenseExpression where
arbitrary = sized arb
where
arb n
| n <= 0 = ELicense <$> arbitrary <*> pure Nothing
| otherwise = oneof
[ ELicense <$> arbitrary <*> arbitrary
, EAnd <$> arbA <*> arbB
, EOr <$> arbA <*> arbB
]
where
m = n `div` 2
arbA = arb m
arbB = arb (n - m)
shrink (EAnd a b) = a : b : map (uncurry EAnd) (shrink (a, b))
shrink (EOr a b) = a : b : map (uncurry EOr) (shrink (a, b))
shrink _ = []
-------------------------------------------------------------------------------
-- Helpers
-------------------------------------------------------------------------------
shortListOf1 :: Int -> Gen a -> Gen [a]
shortListOf1 bound gen = sized $ \n -> do
k <- choose (1, 1 `max` ((n `div` 2) `min` bound))
vectorOf k gen
cabal-version: >=1.10
name: Cabal
version: 3.3.0.0
copyright: 2003-2020, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
author: Cabal Development Team <cabal-devel@haskell.org>
maintainer: cabal-devel@haskell.org
homepage: http://www.haskell.org/cabal/
bug-reports: https://github.com/haskell/cabal/issues
synopsis: A framework for packaging Haskell software
description:
The Haskell Common Architecture for Building Applications and
Libraries: a framework defining a common interface for authors to more
easily build their Haskell applications in a portable way.
.
The Haskell Cabal is part of a larger infrastructure for distributing,
organizing, and cataloging Haskell libraries and tools.
category: Distribution
build-type: Simple
-- If we use a new Cabal feature, this needs to be changed to Custom so
-- we can bootstrap.
extra-source-files:
README.md tests/README.md ChangeLog.md
doc/bugs-and-stability.rst doc/concepts-and-development.rst
doc/conf.py doc/config-and-install.rst doc/developing-packages.rst
doc/images/Cabal-dark.png doc/index.rst doc/installing-packages.rst
doc/intro.rst doc/misc.rst doc/nix-local-build-overview.rst
doc/nix-local-build.rst doc/file-format-changelog.rst doc/README.md
doc/references.inc
-- Generated with 'make gen-extra-source-files'
-- Do NOT edit this section manually; instead, run the script.
-- BEGIN gen-extra-source-files
tests/ParserTests/errors/MiniAgda.cabal
tests/ParserTests/errors/MiniAgda.errors
tests/ParserTests/errors/big-version.cabal
tests/ParserTests/errors/big-version.errors
tests/ParserTests/errors/common1.cabal
tests/ParserTests/errors/common1.errors
tests/ParserTests/errors/common2.cabal
tests/ParserTests/errors/common2.errors
tests/ParserTests/errors/common3.cabal
tests/ParserTests/errors/common3.errors
tests/ParserTests/errors/forward-compat.cabal
tests/ParserTests/errors/forward-compat.errors
tests/ParserTests/errors/forward-compat2.cabal
tests/ParserTests/errors/forward-compat2.errors
tests/ParserTests/errors/forward-compat3.cabal
tests/ParserTests/errors/forward-compat3.errors
tests/ParserTests/errors/issue-5055-2.cabal
tests/ParserTests/errors/issue-5055-2.errors
tests/ParserTests/errors/issue-5055.cabal
tests/ParserTests/errors/issue-5055.errors
tests/ParserTests/errors/leading-comma-2.cabal
tests/ParserTests/errors/leading-comma-2.errors
tests/ParserTests/errors/leading-comma-2b.cabal
tests/ParserTests/errors/leading-comma-2b.errors
tests/ParserTests/errors/leading-comma-2c.cabal
tests/ParserTests/errors/leading-comma-2c.errors
tests/ParserTests/errors/leading-comma.cabal
tests/ParserTests/errors/leading-comma.errors
tests/ParserTests/errors/libpq1.cabal
tests/ParserTests/errors/libpq1.errors
tests/ParserTests/errors/libpq2.cabal
tests/ParserTests/errors/libpq2.errors
tests/ParserTests/errors/mixin-1.cabal
tests/ParserTests/errors/mixin-1.errors
tests/ParserTests/errors/mixin-2.cabal
tests/ParserTests/errors/mixin-2.errors
tests/ParserTests/errors/multiple-libs.cabal
tests/ParserTests/errors/multiple-libs.errors
tests/ParserTests/errors/noVersion.cabal
tests/ParserTests/errors/noVersion.errors
tests/ParserTests/errors/noVersion2.cabal
tests/ParserTests/errors/noVersion2.errors
tests/ParserTests/errors/range-ge-wild.cabal
tests/ParserTests/errors/range-ge-wild.errors
tests/ParserTests/errors/removed-fields.cabal
tests/ParserTests/errors/removed-fields.errors
tests/ParserTests/errors/spdx-1.cabal
tests/ParserTests/errors/spdx-1.errors
tests/ParserTests/errors/spdx-2.cabal
tests/ParserTests/errors/spdx-2.errors
tests/ParserTests/errors/spdx-3.cabal
tests/ParserTests/errors/spdx-3.errors
tests/ParserTests/errors/undefined-flag.cabal
tests/ParserTests/errors/undefined-flag.errors
tests/ParserTests/errors/version-sets-1.cabal
tests/ParserTests/errors/version-sets-1.errors
tests/ParserTests/errors/version-sets-2.cabal
tests/ParserTests/errors/version-sets-2.errors
tests/ParserTests/errors/version-sets-3.cabal
tests/ParserTests/errors/version-sets-3.errors
tests/ParserTests/errors/version-sets-4.cabal
tests/ParserTests/errors/version-sets-4.errors
tests/ParserTests/ipi/Includes2.cabal
tests/ParserTests/ipi/Includes2.expr
tests/ParserTests/ipi/Includes2.format
tests/ParserTests/ipi/internal-preprocessor-test.cabal
tests/ParserTests/ipi/internal-preprocessor-test.expr
tests/ParserTests/ipi/internal-preprocessor-test.format
tests/ParserTests/ipi/issue-2276-ghc-9885.cabal
tests/ParserTests/ipi/issue-2276-ghc-9885.expr
tests/ParserTests/ipi/issue-2276-ghc-9885.format
tests/ParserTests/ipi/transformers.cabal
tests/ParserTests/ipi/transformers.expr
tests/ParserTests/ipi/transformers.format
tests/ParserTests/regressions/Octree-0.5.cabal
tests/ParserTests/regressions/Octree-0.5.expr
tests/ParserTests/regressions/Octree-0.5.format
tests/ParserTests/regressions/assoc-cpp-options.cabal
tests/ParserTests/regressions/assoc-cpp-options.check
tests/ParserTests/regressions/bad-glob-syntax.cabal
tests/ParserTests/regressions/bad-glob-syntax.check
tests/ParserTests/regressions/big-version.cabal
tests/ParserTests/regressions/big-version.expr
tests/ParserTests/regressions/big-version.format
tests/ParserTests/regressions/cc-options-with-optimization.cabal
tests/ParserTests/regressions/cc-options-with-optimization.check
tests/ParserTests/regressions/common-conditional.cabal
tests/ParserTests/regressions/common-conditional.expr
tests/ParserTests/regressions/common-conditional.format
tests/ParserTests/regressions/common.cabal
tests/ParserTests/regressions/common.expr
tests/ParserTests/regressions/common.format
tests/ParserTests/regressions/common2.cabal
tests/ParserTests/regressions/common2.expr
tests/ParserTests/regressions/common2.format
tests/ParserTests/regressions/common3.cabal
tests/ParserTests/regressions/common3.expr
tests/ParserTests/regressions/common3.format
tests/ParserTests/regressions/cxx-options-with-optimization.cabal
tests/ParserTests/regressions/cxx-options-with-optimization.check
tests/ParserTests/regressions/elif.cabal
tests/ParserTests/regressions/elif.expr
tests/ParserTests/regressions/elif.format
tests/ParserTests/regressions/elif2.cabal
tests/ParserTests/regressions/elif2.expr
tests/ParserTests/regressions/elif2.format
tests/ParserTests/regressions/encoding-0.8.cabal
tests/ParserTests/regressions/encoding-0.8.expr
tests/ParserTests/regressions/encoding-0.8.format
tests/ParserTests/regressions/extensions-paths-5054.cabal
tests/ParserTests/regressions/extensions-paths-5054.check
tests/ParserTests/regressions/generics-sop.cabal
tests/ParserTests/regressions/generics-sop.expr
tests/ParserTests/regressions/generics-sop.format
tests/ParserTests/regressions/ghc-option-j.cabal
tests/ParserTests/regressions/ghc-option-j.check
tests/ParserTests/regressions/haddock-api-2.18.1-check.cabal
tests/ParserTests/regressions/haddock-api-2.18.1-check.check
tests/ParserTests/regressions/hidden-main-lib.cabal
tests/ParserTests/regressions/hidden-main-lib.expr
tests/ParserTests/regressions/hidden-main-lib.format
tests/ParserTests/regressions/indentation.cabal
tests/ParserTests/regressions/indentation.expr
tests/ParserTests/regressions/indentation.format
tests/ParserTests/regressions/indentation2.cabal
tests/ParserTests/regressions/indentation2.expr
tests/ParserTests/regressions/indentation2.format
tests/ParserTests/regressions/indentation3.cabal
tests/ParserTests/regressions/indentation3.expr
tests/ParserTests/regressions/indentation3.format
tests/ParserTests/regressions/issue-5055.cabal
tests/ParserTests/regressions/issue-5055.expr
tests/ParserTests/regressions/issue-5055.format
tests/ParserTests/regressions/issue-5846.cabal
tests/ParserTests/regressions/issue-5846.expr
tests/ParserTests/regressions/issue-5846.format
tests/ParserTests/regressions/issue-6083-pkg-pkg.cabal
tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
tests/ParserTests/regressions/issue-6083-pkg-pkg.format
tests/ParserTests/regressions/issue-774.cabal
tests/ParserTests/regressions/issue-774.check
tests/ParserTests/regressions/issue-774.expr
tests/ParserTests/regressions/issue-774.format
tests/ParserTests/regressions/jaeger-flamegraph.cabal
tests/ParserTests/regressions/jaeger-flamegraph.expr
tests/ParserTests/regressions/jaeger-flamegraph.format
tests/ParserTests/regressions/leading-comma-2.cabal
tests/ParserTests/regressions/leading-comma-2.expr
tests/ParserTests/regressions/leading-comma-2.format
tests/ParserTests/regressions/leading-comma.cabal
tests/ParserTests/regressions/leading-comma.expr
tests/ParserTests/regressions/leading-comma.format
tests/ParserTests/regressions/libpq1.cabal
tests/ParserTests/regressions/libpq1.expr
tests/ParserTests/regressions/libpq1.format
tests/ParserTests/regressions/libpq2.cabal
tests/ParserTests/regressions/libpq2.expr
tests/ParserTests/regressions/libpq2.format
tests/ParserTests/regressions/mixin-1.cabal
tests/ParserTests/regressions/mixin-1.expr
tests/ParserTests/regressions/mixin-1.format
tests/ParserTests/regressions/mixin-2.cabal
tests/ParserTests/regressions/mixin-2.expr
tests/ParserTests/regressions/mixin-2.format
tests/ParserTests/regressions/mixin-3.cabal
tests/ParserTests/regressions/mixin-3.expr
tests/ParserTests/regressions/mixin-3.format
tests/ParserTests/regressions/multiple-libs-2.cabal
tests/ParserTests/regressions/multiple-libs-2.check
tests/ParserTests/regressions/multiple-libs-2.expr
tests/ParserTests/regressions/multiple-libs-2.format
tests/ParserTests/regressions/noVersion.cabal
tests/ParserTests/regressions/noVersion.expr
tests/ParserTests/regressions/noVersion.format
tests/ParserTests/regressions/nothing-unicode.cabal
tests/ParserTests/regressions/nothing-unicode.check
tests/ParserTests/regressions/nothing-unicode.expr
tests/ParserTests/regressions/nothing-unicode.format
tests/ParserTests/regressions/pre-1.6-glob.cabal
tests/ParserTests/regressions/pre-1.6-glob.check
tests/ParserTests/regressions/pre-2.4-globstar.cabal
tests/ParserTests/regressions/pre-2.4-globstar.check
tests/ParserTests/regressions/public-multilib-1.cabal
tests/ParserTests/regressions/public-multilib-1.check
tests/ParserTests/regressions/public-multilib-2.cabal
tests/ParserTests/regressions/public-multilib-2.check
tests/ParserTests/regressions/shake.cabal
tests/ParserTests/regressions/shake.expr
tests/ParserTests/regressions/shake.format
tests/ParserTests/regressions/spdx-1.cabal
tests/ParserTests/regressions/spdx-1.expr
tests/ParserTests/regressions/spdx-1.format
tests/ParserTests/regressions/spdx-2.cabal
tests/ParserTests/regressions/spdx-2.expr
tests/ParserTests/regressions/spdx-2.format
tests/ParserTests/regressions/spdx-3.cabal
tests/ParserTests/regressions/spdx-3.expr
tests/ParserTests/regressions/spdx-3.format
tests/ParserTests/regressions/th-lift-instances.cabal
tests/ParserTests/regressions/th-lift-instances.expr
tests/ParserTests/regressions/th-lift-instances.format
tests/ParserTests/regressions/version-sets.cabal
tests/ParserTests/regressions/version-sets.expr
tests/ParserTests/regressions/version-sets.format
tests/ParserTests/regressions/wl-pprint-indef.cabal
tests/ParserTests/regressions/wl-pprint-indef.expr
tests/ParserTests/regressions/wl-pprint-indef.format
tests/ParserTests/warnings/bom.cabal
tests/ParserTests/warnings/bool.cabal
tests/ParserTests/warnings/deprecatedfield.cabal
tests/ParserTests/warnings/doubledash.cabal
tests/ParserTests/warnings/extratestmodule.cabal
tests/ParserTests/warnings/gluedop.cabal
tests/ParserTests/warnings/multiplesingular.cabal
tests/ParserTests/warnings/nbsp.cabal
tests/ParserTests/warnings/newsyntax.cabal
tests/ParserTests/warnings/oldsyntax.cabal
tests/ParserTests/warnings/operator.cabal
tests/ParserTests/warnings/specversion-a.cabal
tests/ParserTests/warnings/specversion-b.cabal
tests/ParserTests/warnings/specversion-c.cabal
tests/ParserTests/warnings/subsection.cabal
tests/ParserTests/warnings/tab.cabal
tests/ParserTests/warnings/trailingfield.cabal
tests/ParserTests/warnings/unknownfield.cabal
tests/ParserTests/warnings/unknownsection.cabal
tests/ParserTests/warnings/utf8.cabal
tests/ParserTests/warnings/versiontag.cabal
tests/ParserTests/warnings/wildcard.cabal
tests/cbits/rpmvercmp.c
tests/hackage/check.sh
tests/hackage/download.sh
tests/hackage/unpack.sh
tests/misc/ghc-supported-languages.hs
-- END gen-extra-source-files
source-repository head
type: git
location: https://github.com/haskell/cabal/
subdir: Cabal
flag bundled-binary-generic
default: False
library
build-depends:
array >= 0.4.0.1 && < 0.6,
base >= 4.6 && < 5,
bytestring >= 0.10.0.0 && < 0.11,
containers >= 0.5.0.0 && < 0.7,
deepseq >= 1.3.0.1 && < 1.5,
directory >= 1.2 && < 1.4,
filepath >= 1.3.0.1 && < 1.5,
pretty >= 1.1.1 && < 1.2,
process >= 1.1.0.2 && < 1.7,
time >= 1.4.0.1 && < 1.10
if flag(bundled-binary-generic)
build-depends: binary >= 0.5.1.1 && < 0.7
else
build-depends: binary >= 0.7 && < 0.9
if os(windows)
build-depends: Win32 >= 2.3.0.0 && < 2.9
else
build-depends: unix >= 2.6.0.0 && < 2.8
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances
if impl(ghc <8.8)
ghc-options: -Wnoncanonical-monadfail-instances
if !impl(ghc >= 8.0)
-- at least one of lib:Cabal's dependency (i.e. `parsec`)
-- already depends on `fail` and `semigroups` transitively
build-depends: fail == 4.9.*, semigroups >= 0.18.3 && < 0.20
if !impl(ghc >= 7.10)
build-depends: void >= 0.7.3 && < 0.8
if !impl(ghc >= 7.8)
-- semigroups depends on tagged.
build-depends: tagged >=0.8.6 && <0.9
exposed-modules:
Distribution.Backpack
Distribution.Backpack.Configure
Distribution.Backpack.ComponentsGraph
Distribution.Backpack.ConfiguredComponent
Distribution.Backpack.DescribeUnitId
Distribution.Backpack.FullUnitId
Distribution.Backpack.LinkedComponent
Distribution.Backpack.ModSubst
Distribution.Backpack.ModuleShape
Distribution.Backpack.PreModuleShape
Distribution.CabalSpecVersion
Distribution.Utils.IOData
Distribution.Utils.LogProgress
Distribution.Utils.MapAccum
Distribution.Utils.MD5
Distribution.Utils.Structured
Distribution.Compat.CreatePipe
Distribution.Compat.Directory
Distribution.Compat.Environment
Distribution.Compat.Exception
Distribution.Compat.FilePath
Distribution.Compat.Graph
Distribution.Compat.Internal.TempFile
Distribution.Compat.Newtype
Distribution.Compat.ResponseFile
Distribution.Compat.Prelude.Internal
Distribution.Compat.Process
Distribution.Compat.Semigroup
Distribution.Compat.Stack
Distribution.Compat.Time
Distribution.Compat.Typeable
Distribution.Compat.DList
Distribution.Compiler
Distribution.InstalledPackageInfo
Distribution.Types.AbiDependency
Distribution.Types.ExposedModule
Distribution.Types.InstalledPackageInfo
Distribution.Types.InstalledPackageInfo.FieldGrammar
Distribution.License
Distribution.Make
Distribution.ModuleName
Distribution.Package
Distribution.PackageDescription
Distribution.PackageDescription.Check
Distribution.PackageDescription.Configuration
Distribution.PackageDescription.PrettyPrint
Distribution.PackageDescription.Utils
Distribution.ReadE
Distribution.Simple
Distribution.Simple.Bench
Distribution.Simple.Build
Distribution.Simple.Build.Macros
Distribution.Simple.Build.PathsModule
Distribution.Simple.BuildPaths
Distribution.Simple.BuildTarget
Distribution.Simple.BuildToolDepends
Distribution.Simple.CCompiler
Distribution.Simple.Command
Distribution.Simple.Compiler
Distribution.Simple.Configure
Distribution.Simple.Flag
Distribution.Simple.GHC
Distribution.Simple.GHCJS
Distribution.Simple.Haddock
Distribution.Simple.Doctest
Distribution.Simple.Glob
Distribution.Simple.HaskellSuite
Distribution.Simple.Hpc
Distribution.Simple.Install
Distribution.Simple.InstallDirs
Distribution.Simple.InstallDirs.Internal
Distribution.Simple.LocalBuildInfo
Distribution.Simple.PackageIndex
Distribution.Simple.PreProcess
Distribution.Simple.PreProcess.Unlit
Distribution.Simple.Program
Distribution.Simple.Program.Ar
Distribution.Simple.Program.Builtin
Distribution.Simple.Program.Db
Distribution.Simple.Program.Find
Distribution.Simple.Program.GHC
Distribution.Simple.Program.HcPkg
Distribution.Simple.Program.Hpc
Distribution.Simple.Program.Internal
Distribution.Simple.Program.Ld
Distribution.Simple.Program.ResponseFile
Distribution.Simple.Program.Run
Distribution.Simple.Program.Script
Distribution.Simple.Program.Strip
Distribution.Simple.Program.Types
Distribution.Simple.Register
Distribution.Simple.Setup
Distribution.Simple.ShowBuildInfo
Distribution.Simple.SrcDist
Distribution.Simple.Test
Distribution.Simple.Test.ExeV10
Distribution.Simple.Test.LibV09
Distribution.Simple.Test.Log
Distribution.Simple.UHC
Distribution.Simple.UserHooks
Distribution.Simple.Utils
Distribution.SPDX
Distribution.SPDX.License
Distribution.SPDX.LicenseId
Distribution.SPDX.LicenseExceptionId
Distribution.SPDX.LicenseExpression
Distribution.SPDX.LicenseListVersion
Distribution.SPDX.LicenseReference
Distribution.System
Distribution.TestSuite
Distribution.Text
Distribution.Pretty
Distribution.Types.AbiHash
Distribution.Types.AnnotatedId
Distribution.Types.Benchmark
Distribution.Types.BenchmarkInterface
Distribution.Types.BenchmarkType
Distribution.Types.BuildInfo
Distribution.Types.BuildType
Distribution.Types.ComponentInclude
Distribution.Types.ConfVar
Distribution.Types.Dependency
Distribution.Types.ExeDependency
Distribution.Types.LegacyExeDependency
Distribution.Types.PkgconfigDependency
Distribution.Types.DependencyMap
Distribution.Types.ComponentId
Distribution.Types.MungedPackageId
Distribution.Types.PackageId
Distribution.Types.UnitId
Distribution.Types.Executable
Distribution.Types.ExecutableScope
Distribution.Types.Library
Distribution.Types.LibraryVisibility
Distribution.Types.Flag
Distribution.Types.ForeignLib
Distribution.Types.ForeignLibType
Distribution.Types.ForeignLibOption
Distribution.Types.Module
Distribution.Types.ModuleReexport
Distribution.Types.ModuleRenaming
Distribution.Types.ComponentName
Distribution.Types.LibraryName
Distribution.Types.MungedPackageName
Distribution.Types.PackageName
Distribution.Types.PackageName.Magic
Distribution.Types.PkgconfigName
Distribution.Types.PkgconfigVersion
Distribution.Types.PkgconfigVersionRange
Distribution.Types.UnqualComponentName
Distribution.Types.IncludeRenaming
Distribution.Types.Mixin
Distribution.Types.SetupBuildInfo
Distribution.Types.TestSuite
Distribution.Types.TestSuiteInterface
Distribution.Types.TestType
Distribution.Types.GenericPackageDescription
Distribution.Types.Condition
Distribution.Types.CondTree
Distribution.Types.HookedBuildInfo
Distribution.Types.PackageDescription
Distribution.Types.SourceRepo
Distribution.Types.Component
Distribution.Types.ComponentLocalBuildInfo
Distribution.Types.LocalBuildInfo
Distribution.Types.ComponentRequestedSpec
Distribution.Types.TargetInfo
Distribution.Types.Version
Distribution.Types.VersionRange
Distribution.Types.VersionRange.Internal
Distribution.Types.VersionInterval
Distribution.Types.GivenComponent
Distribution.Types.PackageVersionConstraint
Distribution.Utils.CharSet
Distribution.Utils.Generic
Distribution.Utils.GrammarRegex
Distribution.Utils.NubList
Distribution.Utils.ShortText
Distribution.Utils.Progress
Distribution.Verbosity
Distribution.Verbosity.Internal
Distribution.Version
Language.Haskell.Extension
Distribution.Compat.Binary
-- Parsec parser-related modules
build-depends:
-- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity
-- See also https://github.com/ekmett/transformers-compat/issues/35
transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.6),
mtl >= 2.1 && < 2.3,
text >= 1.2.3.0 && < 1.3,
parsec >= 3.1.13.0 && < 3.2
exposed-modules:
Distribution.Compat.Parsing
Distribution.Compat.CharParsing
Distribution.FieldGrammar
Distribution.FieldGrammar.Class
Distribution.FieldGrammar.Described
Distribution.FieldGrammar.FieldDescrs
Distribution.FieldGrammar.Parsec
Distribution.FieldGrammar.Pretty
Distribution.PackageDescription.FieldGrammar
Distribution.PackageDescription.Parsec
Distribution.PackageDescription.Quirks
Distribution.Parsec
Distribution.Parsec.Error
Distribution.Parsec.Newtypes
Distribution.Parsec.Position
Distribution.Parsec.Warning
Distribution.Parsec.FieldLineStream
Distribution.Fields
Distribution.Fields.ConfVar
Distribution.Fields.Field
Distribution.Fields.Lexer
Distribution.Fields.LexerMonad
Distribution.Fields.ParseResult
Distribution.Fields.Parser
Distribution.Fields.Pretty
-- Lens functionality
exposed-modules:
Distribution.Compat.Lens
Distribution.Types.Lens
Distribution.Types.Benchmark.Lens
Distribution.Types.BuildInfo.Lens
Distribution.Types.Executable.Lens
Distribution.Types.ForeignLib.Lens
Distribution.Types.GenericPackageDescription.Lens
Distribution.Types.InstalledPackageInfo.Lens
Distribution.Types.Library.Lens
Distribution.Types.PackageDescription.Lens
Distribution.Types.PackageId.Lens
Distribution.Types.SetupBuildInfo.Lens
Distribution.Types.SourceRepo.Lens
Distribution.Types.TestSuite.Lens
other-modules:
Distribution.Backpack.PreExistingComponent
Distribution.Backpack.ReadyComponent
Distribution.Backpack.MixLink
Distribution.Backpack.ModuleScope
Distribution.Backpack.UnifyM
Distribution.Backpack.Id
Distribution.Utils.UnionFind
Distribution.Utils.Base62
Distribution.Compat.Async
Distribution.Compat.CopyFile
Distribution.Compat.GetShortPathName
Distribution.Compat.MonadFail
Distribution.Compat.Prelude
Distribution.Compat.SnocList
Distribution.GetOpt
Distribution.Lex
Distribution.Utils.String
Distribution.Simple.Build.Macros.Z
Distribution.Simple.GHC.EnvironmentParser
Distribution.Simple.GHC.Internal
Distribution.Simple.GHC.ImplInfo
Distribution.Simple.Utils.Json
Distribution.ZinzaPrelude
Paths_Cabal
if flag(bundled-binary-generic)
other-modules:
Distribution.Compat.Binary.Class
Distribution.Compat.Binary.Generic
default-language: Haskell2010
other-extensions:
BangPatterns
CPP
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
ExistentialQuantification
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
NondecreasingIndentation
OverloadedStrings
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
Trustworthy
TypeFamilies
TypeOperators
TypeSynonymInstances
UndecidableInstances
if impl(ghc >= 7.11)
other-extensions: PatternSynonyms
-- Small, fast running tests.
test-suite unit-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
other-modules:
Test.Laws
Test.QuickCheck.Utils
UnitTests.Distribution.CabalSpecVersion
UnitTests.Distribution.Compat.CreatePipe
UnitTests.Distribution.Compat.Graph
UnitTests.Distribution.Compat.Time
UnitTests.Distribution.Described
UnitTests.Distribution.Simple.Glob
UnitTests.Distribution.Simple.Program.GHC
UnitTests.Distribution.Simple.Program.Internal
UnitTests.Distribution.Simple.Utils
UnitTests.Distribution.SPDX
UnitTests.Distribution.System
UnitTests.Distribution.Types.GenericPackageDescription
UnitTests.Distribution.Utils.CharSet
UnitTests.Distribution.Utils.Generic
UnitTests.Distribution.Utils.NubList
UnitTests.Distribution.Utils.ShortText
UnitTests.Distribution.Utils.Structured
UnitTests.Distribution.Version
UnitTests.Distribution.PkgconfigVersion
UnitTests.Orphans
-- Cabal-quickcheck
hs-source-dirs: Cabal-quickcheck/src
other-modules:
Test.QuickCheck.Instances.Cabal
main-is: UnitTests.hs
build-depends:
array,
base,
binary,
bytestring,
containers,
directory,
filepath,
integer-logarithms >= 1.0.2 && <1.1,
rere >=0.1 && <0.2,
tasty >= 1.2.3 && < 1.3,
tasty-hunit,
tasty-quickcheck,
tagged,
temporary,
text,
pretty,
Diff >=0.4 && <0.5,
QuickCheck >= 2.13.2 && < 2.14,
Cabal
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >= 7.10)
build-depends: void
-- Cabal-quickcheck
hs-source-dirs: Cabal-quickcheck/src
other-modules:
Test.QuickCheck.Instances.Cabal
test-suite parser-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: ParserTests.hs
build-depends:
base,
base-compat >=0.11.0 && <0.12,
bytestring,
directory,
filepath,
tasty >= 1.2.3 && < 1.3,
tasty-hunit,
tasty-quickcheck,
tasty-golden >=2.3.1.1 && <2.4,
Diff >=0.4 && <0.5,
Cabal
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >= 8.0)
build-depends: semigroups
if impl(ghc >= 7.8)
build-depends:
tree-diff >= 0.1 && <0.2
other-modules:
Instances.TreeDiff
Instances.TreeDiff.Language
Instances.TreeDiff.SPDX
Instances.TreeDiff.Version
test-suite check-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: CheckTests.hs
build-depends:
base,
bytestring,
directory,
filepath,
tasty >= 1.2.3 && < 1.3,
tasty-golden >=2.3.1.1 && <2.4,
Diff >=0.4 && <0.5,
Cabal
ghc-options: -Wall
default-language: Haskell2010
if !impl(ghc >= 8.0)
build-depends: semigroups
test-suite custom-setup-tests
type: exitcode-stdio-1.0
hs-source-dirs: tests/custom-setup
main-is: CustomSetupTests.hs
other-modules:
CabalDoctestSetup
IdrisSetup
build-depends:
Cabal,
base,
directory,
filepath,
process
default-language: Haskell2010
test-suite hackage-tests
type: exitcode-stdio-1.0
main-is: HackageTests.hs
-- TODO: need to get 01-index.tar on appveyor
if os(windows)
buildable: False
hs-source-dirs: tests
build-depends:
base,
Cabal,
bytestring,
deepseq,
containers,
directory,
filepath
build-depends:
base-compat >=0.11.0 && <0.12,
base-orphans >=0.6 && <0.9,
clock >=0.8 && <0.9,
optparse-applicative >=0.13.2.0 && <0.16,
stm >=2.4.5.0 && <2.6,
tar >=0.5.0.3 && <0.6
if impl(ghc >= 7.8)
build-depends:
tree-diff >= 0.1 && <0.2
other-modules:
Instances.TreeDiff
Instances.TreeDiff.Language
Instances.TreeDiff.SPDX
Instances.TreeDiff.Version
ghc-options: -Wall -rtsopts -threaded
default-extensions: CPP
default-language: Haskell2010
test-suite rpmvercmp
type: exitcode-stdio-1.0
main-is: RPMVerCmp.hs
hs-source-dirs: tests
build-depends:
base,
Cabal,
bytestring
build-depends:
tasty >= 1.2.3 && < 1.3,
tasty-hunit,
tasty-quickcheck,
QuickCheck
c-sources: tests/cbits/rpmvercmp.c
cc-options: -Wall
ghc-options: -Wall
default-language: Haskell2010
# 3.2.0.0 [Herbert Valerio Riedel](mailto:hvr@gnu.org) April 2020
* Change free text `String` fields to use `ShortText` in package description
and installed packge info.
* Split `Distribution.Types.Flag` and `Distribution.Types.ConfVar`
`Distribution.Types.GenericPackageDescription`.
* Add GHC-8.10 support, including new extensions to
`Language.Haskell.Extension`.
* Use more `NonEmpty` instead of ordinary lists.
* Add `Distribution.Utils.Structured` for fingeprinting `Binary` blobs.
* Add `null`, `length` and `unsafeFromUTF8BS` to `Distribution.Utils.ShortText`.
* Refactor `Distribution.Utils.IOData` module.
* Rename `Distribution.Compat.MD5` to `Distribution.Utils.MD5`.
* Add `safeHead`, `safeTail`, `safeLast` to `Distribution.Utils.Generic`.
* Add `unsnoc` and `unsnocNE` to `Distribution.Utils.Generic`.
* Add `Set'` modifier to `Distribution.Parsec.Newtypes`.
* Add `Distribution.Compat.Async`.
# 3.0.2.0 [Herbert Valerio Riedel](mailto:hvr@gnu.org) April 2020
* Disallow spaces around colon `:` in Dependency `build-depends` syntax
([#6538](https://github.com/haskell/cabal/pull/6538)).
* Make `configure` accept any `pkg-config --modversion` output
([#6541](https://github.com/haskell/cabal/pull/6541)).
# 3.0.1.0 [Herbert Valerio Riedel](mailto:hvr@gnu.org) April 2020
* Add GHC-8.8 flags to `normaliseGhcFlags`
([#6379](https://github.com/haskell/cabal/pull/6379)).
* Typo fixes
([#6372](https://github.com/haskell/cabal/pull/6372)).
* Limit version number parts to contain at most 9 digits
([#6386](https://github.com/haskell/cabal/pull/6386)).
* Fix boundless sublibrary depedency parse failure
([#5846](https://github.com/haskell/cabal/issues/5846)).
* `cabal check` verifies `cpp-options` more pedantically, allowing only
options starting with `-D` and `-U`.
* Don’t rebuild world when new ghc flags that affect how error
messages are presented is specified.
* Fix dropExeExtension behaviour on Windows
([#6287](https://github.com/haskell/cabal/pull/6287)).
# 3.0.0.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) August 2019
* The 3.0 migration guide gives advice on adapting Custom setup
scripts to backwards-incompatible changes in this release:
https://github.com/haskell/cabal/wiki/3.0-migration-guide.
* Due to [#5119](https://github.com/haskell/cabal/issues/5119), the
`cabal check` warning for bounds on internal libraries has been
disabled.
* Introduce set notation for `^>=` and `==` operators
([#5906](https://github.com/haskell/cabal/pull/5906)).
* 'check' reports warnings for various ghc-\*-options fields separately
([#5342](https://github.com/haskell/cabal/issues/5432)).
* `KnownExtension`: added new extensions `DerivingVia` and
`EmptyDataDeriving`.
* Add `extra-dynamic-library-flavours`, to specify extra dynamic library
flavours to build and install from a .cabal file.
* `autoconfUserHooks` now passes `--host=$HOST` when cross-compiling
* Introduce multiple public libraries feature
([#5526](https://github.com/haskell/cabal/pull/5526)).
* New build-depends syntax
* Add a set of library components to the `Dependency` datatype
* New `visibility` field in the `library` stanza
* New `LibraryVisibility` field in `InstalledPackageInfo`
* New syntax for the `--dependency` Cabal flag
* Static linking
* Add `--enable-executable-static` flag for building fully
static executables (GHC's normal "statish" linking links
Haskell libraries statically, but libc and system dependencies
dynamically). This new flag links everything statically.
* Note you likely want to link against `musl` or another libc that
supports fully static linking;
[`glibc` has some issues](https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F)
with fully static linking.
* Fix corrupted config file header for non-ASCII package names
([2557](https://github.com/haskell/cabal/issues/2557)).
* Extend `Distribution.Simple.Utils.rewriteFileEx` from ASCII to UTF-8 encoding.
* Change the arguments of `Newtype` class to better suit @DeriveAnyClass@ usage,
add default implementation in terms of `coerce` / `unsafeCoerce`.
* Implement support for response file arguments to defaultMain* and cabal-install.
* Uniformly provide 'Semigroup' instances for `base < 4.9` via `semigroups` package
* Implement `{cmm,asm}-{sources,options} buildinfo fields for
separate compilation of C-- and ASM source files (#6033).
* Setting `debug-info` now implies `library-stripping: False` and
`executable-stripping: False) ([#2702](https://github.com/haskell/cabal/issues/2702))
* `Setup.hs copy` and `install` now work in the presence of
`data-files` that use `**` syntax
([#6125](https://github.com/haskell/cabal/issues/6125)).
----
### 2.4.1.1 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) December 2018
* Fix `--with-compiler` failing to locate compiler on Windows
([#5753](https://github.com/haskell/cabal/pull/5753)).
* Cabal can once again be built with GHC 7.8 and 7.6
([#5730](https://github.com/haskell/cabal/pull/5730)).
### 2.4.1.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) November 2018
* Warnings in autogenerated files are now silenced
([#5678](https://github.com/haskell/cabal/pull/5678)).
* Improved recompilation avoidance, especially when using GHC 8.6
([#5589](https://github.com/haskell/cabal/pull/5589)).
* Do not error on empty packagedbs in `getInstalledPackages`
([#5516](https://github.com/haskell/cabal/issues/5516)).
### 2.4.0.1 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) September 2018
* Allow arguments to be passed to `Setup.hs haddock` for `build-type:configure`
([#5503](https://github.com/haskell/cabal/issues/5503)).
# 2.4.0.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) September 2018
* Due to [#5119](https://github.com/haskell/cabal/issues/5119), the
`cabal check` warning for bounds on internal libraries has been
disabled.
* `Distribution.Simple.Haddock` now checks to ensure that it
does not erroneously call Haddock with no target modules.
([#5232](https://github.com/haskell/cabal/issues/5232),
[#5459](https://github.com/haskell/cabal/issues/5459)).
* Add `getting` (less general than `to`) Lens combinator,
`non`) and an optics to access the modules in a component
of a `PackageDescription` by the `ComponentName`:
`componentBuildInfo` and `componentModules`
* Linker `ld-options` are now passed to GHC as `-optl` options
([#4925](https://github.com/haskell/cabal/pull/4925)).
* Add `readGhcEnvironmentFile` to parse GHC environment files.
* Drop support for GHC 7.4, since it is out of our support window
(and has been for over a year!)
* Deprecate `preSDist`, `sDistHook`, and `postSDist` in service of
`new-sdist`, since they violate key invariants of the new-build
ecosystem. Use `autogen-modules` and `build-tool-depends` instead.
([#5389](https://github.com/haskell/cabal/pull/5389)).
* Added `--repl-options` flag to `Setup repl` used to pass flags to the
underlying repl without affecting the `LocalBuildInfo`
([#4247](https://github.com/haskell/cabal/issues/4247),
[#5287](https://github.com/haskell/cabal/pull/5287))
* `KnownExtension`: added new extensions `BlockArguments`
([#5101](https://github.com/haskell/cabal/issues/5101)),
`NumericUnderscores`
([#5130]((https://github.com/haskell/cabal/issues/5130)),
`QuantifiedConstraints`, and `StarIsType`.
* `buildDepends` is removed from `PackageDescription`. It had long been
uselessly hanging about as top-level build-depends already got put
into per-component condition trees anyway. Now it's finally been put
out of its misery
([#4383](https://github.com/haskell/cabal/issues/4283)).
* Added `Eta` to `CompilerFlavor` and to known compilers.
* `cabal haddock` now generates per-component documentation
([#5226](https://github.com/haskell/cabal/issues/5226)).
* Wildcard improvements:
* Allow `**` wildcards in `data-files`, `extra-source-files` and
`extra-doc-files`. These allow a limited form of recursive
matching, and require `cabal-version: 2.4`.
([#5284](https://github.com/haskell/cabal/issues/5284),
[#3178](https://github.com/haskell/cabal/issues/3178), et al.)
* With `cabal-version: 2.4`, when matching a wildcard, the
requirement for the full extension to match exactly has been
loosened. Instead, if the wildcard's extension is a suffix of the
file's extension, the file will be selected. For example,
previously `foo.en.html` would not match `*.html`, and
`foo.solaris.tar.gz` would not match `*.tar.gz`, but now both
do. This may lead to files unexpectedly being included by `sdist`;
please audit your package descriptions if you rely on this
behaviour to keep sensitive data out of distributed packages
([#5372](https://github.com/haskell/cabal/pull/5372),
[#784](https://github.com/haskell/cabal/issues/784),
[#5057](https://github.com/haskell/cabal/issues/5057)).
* Wildcard syntax errors (misplaced `*`, etc), wildcards that
refer to missing directoies, and wildcards that do not match
anything are now all detected by `cabal check`.
* Wildcard ('globbing') functions have been moved from
`Distribution.Simple.Utils` to `Distribution.Simple.Glob` and
have been refactored.
* Fixed `cxx-options` and `cxx-sources` buildinfo fields for
separate compilation of C++ source files to correctly build and link
non-library components ([#5309](https://github.com/haskell/cabal/issues/5309)).
* Reduced warnings generated by hsc2hs and c2hs when `cxx-options` field
is present in a component.
* `cabal check` now warns if `-j` is used in `ghc-options` in a Cabal
file. ([#5277](https://github.com/haskell/cabal/issues/5277))
* `install-includes` now works as expected with foreign libraries
([#5302](https://github.com/haskell/cabal/issues/5299)).
* Removed support for JHC.
* Options listed in `ghc-options`, `cc-options`, `ld-options`,
`cxx-options`, `cpp-options` are not deduplicated anymore
([#4449](https://github.com/haskell/cabal/issues/4449)).
* Deprecated `cabal hscolour` in favour of `cabal haddock --hyperlink-source` ([#5236](https://github.com/haskell/cabal/pull/5236/)).
* Recognize `powerpc64le` as architecture PPC64.
* Cabal now deduplicates more `-I` and `-L` and flags to avoid `E2BIG`
([#5356](https://github.com/haskell/cabal/issues/5356)).
* With `build-type: configure`, avoid using backslashes to delimit
path components on Windows and warn about other unsafe characters
in the path to the source directory on all platforms
([#5386](https://github.com/haskell/cabal/issues/5386)).
* `Distribution.PackageDescription.Check.checkPackageFiles` now
accepts a `Verbosity` argument.
* Added a parameter to
`Distribution.Backpack.ConfiguredComponent.toConfiguredComponent` in order to fix
[#5409](https://github.com/haskell/cabal/issues/5409).
* Partially silence `abi-depends` warnings
([#5465](https://github.com/haskell/cabal/issues/5465)).
* Foreign libraries are now linked against the threaded RTS when the
'ghc-options: -threaded' flag is used
([#5431](https://github.com/haskell/cabal/pull/5431)).
* Pass command line arguments to `hsc2hs` using response files when possible
([#3122](https://github.com/haskell/cabal/issues/3122)).
----
## 2.2.0.1 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) March 2018
* Fix `checkPackageFiles` for relative directories ([#5206](https://github.com/haskell/cabal/issues/5206))
# 2.2.0.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) March 2018
* The 2.2 migration guide gives advice on adapting Custom setup
scripts to backwards-incompatible changes in this release:
https://github.com/haskell/cabal/wiki/2.2-migration-guide.
* New Parsec-based parser for `.cabal` files is now the
default. This brings memory consumption and speed improvements, as
well as making new syntax extensions easier to implement.
* Support for common stanzas (#4751).
* Added elif-conditionals to `.cabal` syntax (#4750).
* The package license information can now be specified using the
SPDX syntax. This requires setting `cabal-version` to 2.2+ (#2547,
#5050).
* Support for GHC's numeric -g debug levels (#4673).
* Compilation with section splitting is now supported via the
`--enable-split-sections` flag (#4819)
* Fields with mandatory commas (e.g. build-depends) may now have a
leading or a trailing comma (either one, not both) (#4953)
* Added `virtual-modules` field, to allow modules that are not built
but registered (#4875).
* Use better defaulting for `build-type`; rename `PackageDescription`'s
`buildType` field to `buildTypeRaw` and introduce new `buildType`
function (#4958)
* `D.T.PackageDescription.allBuildInfo` now returns all build infos, not
only for buildable components (#5087).
* Removed `UnknownBuildType` constructor from `BuildType` (#5003).
* Added `HexFloatLiterals` to `KnownExtension`.
* Cabal will no longer try to build an empty set of `inputModules`
(#4890).
* `copyComponent` and `installIncludeFiles` will now look for
include headers in the build directory (`dist/build/...` by
default) as well (#4866).
* Added `cxx-options` and `cxx-sources` buildinfo fields for
separate compilation of C++ source files (#3700).
* Removed unused `--allow-newer`/`--allow-older` support from
`Setup configure` (#4527).
* Changed `FlagAssignment` to be an opaque `newtype` (#4849).
* Changed `rawSystemStdInOut` to use proper type to represent
binary and textual data; new `Distribution.Utils.IOData` module;
removed obsolete `startsWithBOM`, `fileHasBOM`, `fromUTF8`,
and `toUTF8` functions; add new `toUTF8BS`/`toUTF8LBS`
encoding functions. (#4666)
* Added a `cabal check` warning when the `.cabal` file name does
not match package name (#4592).
* The `ar` program now receives its arguments via a response file
(`@file`). Old behaviour can be restored with
`--disable-response-files` argument to `configure` or
`install` (#4596).
* Added `.Lens` modules, with optics for package description data
types (#4701).
* Support for building with Win32 version 2.6 (#4835).
* Change `compilerExtensions` and `ghcOptExtensionMap` to contain
`Maybe Flag`s, since a supported extension can lack a flag (#4443).
* Pretty-printing of `.cabal` files is slightly different due to
parser changes. For an example, see
https://mail.haskell.org/pipermail/cabal-devel/2017-December/010414.html.
* `--hyperlink-source` now uses Haddock's hyperlinker backend when
Haddock is new enough, falling back to HsColour otherwise.
* `D.S.defaultHookedPackageDesc` has been deprecated in favour of
`D.S.findHookedPackageDesc` (#4874).
* `D.S.getHookedBuildInfo` now takes an additional parameter
specifying the build directory path (#4874).
* Emit warning when encountering unknown GHC versions (#415).
### 2.0.1.1 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) December 2017
* Don't pass `other-modules` to stub executable for detailed-0.9
(#4918).
* Hpc: Use relative .mix search paths (#4917).
## 2.0.1.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) November 2017
* Support for GHC's numeric -g debug levels (#4673).
* Added a new `Distribution.Verbosity.modifyVerbosity` combinator
(#4724).
* Added a new `cabal check` warning about unused, undeclared or
non-Unicode flags. Also, it warns about leading dash, which is
unusable but accepted if it's unused in conditionals. (#4687)
* Modify `allBuildInfo` to include foreign library info (#4763).
* Documentation fixes.
### 2.0.0.2 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) July 2017
* See http://coldwa.st/e/blog/2017-09-09-Cabal-2-0.html
for more detailed release notes.
* The 2.0 migration guide gives advice on adapting Custom setup
scripts to backwards-incompatible changes in this release:
https://github.com/haskell/cabal/wiki/2.0-migration-guide
* Add CURRENT_PACKAGE_VERSION to cabal_macros.h (#4319)
* Dropped support for versions of GHC earlier than 6.12 (#3111).
* GHC compatibility window for the Cabal library has been extended
to five years (#3838).
* Convenience/internal libraries are now supported (#269).
An internal library is declared using the stanza `library
'libname'`. Packages which use internal libraries can
result in multiple registrations; thus `--gen-pkg-config`
can now output a directory of registration scripts rather than
a single file.
* Backwards incompatible change to preprocessor interface:
the function in `PPSuffixHandler` now takes an additional
`ComponentLocalBuildInfo` specifying the build information
of the component being preprocessed.
* Backwards incompatible change to `cabal_macros.h` (#1893): we now
generate a macro file for each component which contains only
information about the direct dependencies of that component.
Consequently, `dist/build/autogen/cabal_macros.h` contains
only the macros for the library, and is not generated if a
package has no library; to find the macros for an executable
named `foobar`, look in `dist/build/foobar/autogen/cabal_macros.h`.
Similarly, if you used `autogenModulesDir` you should now
use `autogenComponentModulesDir`, which now requires a
`ComponentLocalBuildInfo` argument as well in order to
disambiguate which component the autogenerated files are for.
* Backwards incompatible change to `Component`: `TestSuite` and
`Benchmark` no longer have `testEnabled` and
`benchmarkEnabled`. If you used
`enabledTests` or `enabledBenchmarks`, please instead use
`enabledTestLBIs` and `enabledBenchLBIs`
(you will need a `LocalBuildInfo` for these functions.)
Additionally, the semantics of `withTest` and `withBench`
have changed: they now iterate over all buildable
such components, regardless of whether or not they have
been enabled; if you only want enabled components,
use `withTestLBI` and `withBenchLBI`.
`finalizePackageDescription` is deprecated:
its replacement `finalizePD` now takes an extra argument
`ComponentRequestedSpec` which specifies what components
are to be enabled: use this instead of modifying the
`Component` in a `GenericPackageDescription`. (As
it's not possible now, `finalizePackageDescription`
will assume tests/benchmarks are disabled.)
If you only need to test if a component is buildable
(i.e., it is marked buildable in the Cabal file)
use the new function `componentBuildable`.
* Backwards incompatible change to `PackageName` (#3896):
`PackageName` is now opaque; conversion to/from `String` now works
via (old) `unPackageName` and (new) `mkPackageName` functions.
* Backwards incompatible change to `ComponentId` (#3917):
`ComponentId` is now opaque; conversion to/from `String` now works
via `unComponentId` and `mkComponentId` functions.
* Backwards incompatible change to `AbiHash` (#3921):
`AbiHash` is now opaque; conversion to/from `String` now works
via `unAbiHash` and `mkAbiHash` functions.
* Backwards incompatible change to `FlagName` (#4062):
`FlagName` is now opaque; conversion to/from `String` now works
via `unFlagName` and `mkFlagName` functions.
* Backwards incompatible change to `Version` (#3905):
Version is now opaque; conversion to/from `[Int]` now works
via `versionNumbers` and `mkVersion` functions.
* Add support for `--allow-older` (dual to `--allow-newer`) (#3466)
* Improved an error message for process output decoding errors
(#3408).
* `getComponentLocalBuildInfo`, `withComponentsInBuildOrder`
and `componentsInBuildOrder` are deprecated in favor of a
new interface in `Distribution.Types.LocalBuildInfo`.
* New `autogen-modules` field. Modules that are built automatically at
setup, like Paths_PACKAGENAME or others created with a build-type
custom, appear on `other-modules` for the Library, Executable,
Test-Suite or Benchmark stanzas or also on `exposed-modules` for
libraries but are not really on the package when distributed. This
makes commands like sdist fail because the file is not found, so with
this new field modules that appear there are treated the same way as
Paths_PACKAGENAME was and there is no need to create complex build
hooks. Just add the module names on `other-modules` and
`exposed-modules` as always and on the new `autogen-modules` besides.
(#3656).
* New `./Setup configure` flag `--cabal-file`, allowing multiple
`.cabal` files in a single directory (#3553). Primarily intended for
internal use.
* Macros in `cabal_macros.h` are now ifndef'd, so that they
don't cause an error if the macro is already defined. (#3041)
* `./Setup configure` now accepts a single argument specifying
the component to be configured. The semantics of this mode
of operation are described in
<https://github.com/ghc-proposals/ghc-proposals/pull/4>
* Internal `build-tools` dependencies are now added to PATH
upon invocation of GHC, so that they can be conveniently
used via `-pgmF`. (#1541)
* Add support for new caret-style version range operator `^>=` (#3705)
* Verbosity `-v` now takes an extended format which allows
specifying exactly what you want to be logged. The format is
`[silent|normal|verbose|debug] flags`, where flags is a space
separated list of flags. At the moment, only the flags
+callsite and +callstack are supported; these report the
call site/stack of a logging output respectively (these
are only supported if Cabal is built with GHC 8.0/7.10.2
or greater, respectively).
* New `Distribution.Utils.ShortText.ShortText` type for representing
short text strings compactly (#3898)
* Cabal no longer supports using a version bound to disambiguate
between an internal and external package (#4020). This should
not affect many people, as this mode of use already did not
work with the dependency solver.
* Support for "foreign libraries" (#2540), which are Haskell
libraries intended to be used by foreign languages like C.
Foreign libraries only work with GHC 7.8 and later.
* Added a technical preview version of integrated doctest support (#4480).
* Added a new `scope` field to the executable stanza. Executables
with `scope: private` get installed into
$libexecdir/$libexecsubdir. Additionally $libexecdir now has a
subdir structure similar to $lib(sub)dir to allow installing
private executables of different packages and package versions
alongside one another. Private executables are those that are
expected to be run by other programs rather than users. (#3461)
## 1.24.2.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) December 2016
* Fixed a bug in the handling of non-buildable components (#4094).
* Reverted a PVP-noncompliant API change in 1.24.1.0 (#4123).
* Bumped the directory upper bound to < 1.4 (#4158).
## 1.24.1.0 [Ryan Thomas](mailto:ryan@ryant.org) October 2016
* API addition: `differenceVersionRanges` (#3519).
* Fixed reexported-modules display mangling (#3928).
* Check that the correct cabal-version is specified when the
extra-doc-files field is present (#3825).
* Fixed an incorrect invocation of GetShortPathName that was
causing build failures on Windows (#3649).
* Linker flags are now set correctly on GHC >= 7.8 (#3443).
# 1.24.0.0 [Ryan Thomas](mailto:ryan@ryant.org) March 2016
* Support GHC 8.
* Deal with extra C sources from preprocessors (#238).
* Include cabal_macros.h when running c2hs (#2600).
* Don't recompile C sources unless needed (#2601).
* Read `builddir` option from `CABAL_BUILDDIR` environment variable.
* Add `--profiling-detail=$level` flag with a default for libraries
and executables of `exported-functions` and `toplevel-functions`
respectively (GHC's `-fprof-auto-{exported,top}` flags) (#193).
* New `custom-setup` stanza to specify setup deps. Setup is also built
with the cabal_macros.h style macros, for conditional compilation.
* Support Haddock response files (#2746).
* Fixed a bug in the Text instance for Platform (#2862).
* New `setup haddock` option: `--for-hackage` (#2852).
* New `--show-detail=direct`; like streaming, but allows the test
program to detect that is connected to a terminal, and works
reliable with a non-threaded runtime (#2911, and serves as a
work-around for #2398)
* Library support for multi-instance package DBs (#2948).
* Improved the `./Setup configure` solver (#3082, #3076).
* The `--allow-newer` option can be now used with `./Setup
configure` (#3163).
* Added a way to specify extra locations to find OS X frameworks
in (`extra-framework-dirs`). Can be used both in `.cabal` files and
as an argument to `./Setup configure` (#3158).
* Macros `VERSION_$pkgname` and `MIN_VERSION_$pkgname` are now
also generated for the current package. (#3235).
* Backpack is supported! Two new fields supported in Cabal
files: signatures and mixins; and a new flag
to setup scripts, `--instantiate-with`. See
https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst
for more details.
----
## 1.22.8.0 [Ryan Thomas](mailto:ryan@ryant.org) March 2016
* Distribution.Simple.Setup: remove job cap. Fixes #3191.
* Check all object file suffixes for recompilation. Fixes #3128.
* Move source files under `src/`. Fixes #3003.
## 1.22.7.0 [Ryan Thomas](mailto:ryan@ryant.org) January 2016
* Backport #3012 to the 1.22 branch
* Cabal.cabal: change build-type to Simple
* Add foldl' import
* The Cabal part for fully gcc-like response files
## 1.22.6.0 [Ryan Thomas](mailto:ryan@ryant.org) December 2015
* Relax upper bound to allow upcoming binary-0.8
## 1.22.5.0 [Ryan Thomas](mailto:ryan@ryant.org) November 2015
* Don't recompile C sources unless needed (#2601). (Luke Iannini)
* Support Haddock response files.
* Add frameworks when linking a dynamic library.
## 1.22.4.0 [Ryan Thomas](mailto:ryan@ryant.org) June 2015
* Add libname install-dirs variable, use it by default. Fixes #2437. (Edward Z. Yang)
* Reduce temporary directory name length, fixes #2502. (Edward Z. Yang)
* Workaround for #2527. (Mikhail Glushenkov)
## 1.22.3.0 [Ryan Thomas](mailto:ryan@ryant.org) April 2015
* Fix for the ghcjs-pkg version number handling (Luite Stegeman)
* filterConfigureFlags: filter more flags (Mikhail Glushenkov)
* Cabal check will fail on -fprof-auto passed as a ghc-option - Fixes #2479 (John Chee)
## 1.22.2.0 [Ryan Thomas](mailto:ryan@ryant.org) March 2015
* Don't pass `--{en,dis}able-profiling` to old setup.
* Add -Wall police
* Fix dependencies on `old-time`
* Fix test interface detailed-0.9 with GHC 7.10
* Fix HPC tests with GHC 7.10
* Make sure to pass the package key to ghc
* Use `--package-{name|version}` when available for Haddock when available
* Put full package name and version in library names
* Fully specify package key format, so external tools can generate it.
# 1.22.0.0 [Johan Tibell](mailto:johan.tibell@gmail.com) January 2015
* Support GHC 7.10.
* Experimental support for emitting DWARF debug info.
* Preliminary support for relocatable packages.
* Allow cabal to be used inside cabal exec environments.
* hpc: support multiple "ways" (e.g. profiling and vanilla).
* Support GHCJS.
* Improved command line documentation.
* Add `-none` constraint syntax for version ranges (#2093).
* Make the default doc index file path compiler/arch/os-dependent
(#2136).
* Warn instead of dying when generating documentation and hscolour
isn't installed (455f51622fa38347db62197a04bb0fa5b928ff17).
* Support the new BinaryLiterals extension
(1f25ab3c5eff311ada73c6c987061b80e9bbebd9).
* Warn about `ghc-prof-options: -auto-all` in `cabal check` (#2162).
* Add preliminary support for multiple instances of the same package
version installed side-by-side (#2002).
* New binary build config format - faster build times (#2076).
* Support module thinning and renaming (#2038).
* Add a new license type: UnspecifiedLicense (#2141).
* Remove support for Hugs and nhc98 (#2168).
* Invoke `tar` with `--formar ustar` if possible in `sdist` (#1903).
* Replace `--enable-library-coverage` with `--enable-coverage`, which
enables program coverage for all components (#1945).
* Suggest that `ExitFailure 9` is probably due to memory
exhaustion (#1522).
* Drop support for Haddock < 2.0 (#1808, #1718).
* Make `cabal test`/`cabal bench` build only what's needed for
running tests/benchmarks (#1821).
* Build shared libraries by default when linking executables dynamically.
* Build profiled libraries by default when profiling executables.
----
### 1.20.0.4 [Ryan Thomas](mailto:ryan@ryant.org) January 2016
* Cabal.cabal: change build-type to Simple.
### 1.20.0.1 [Johan Tibell](mailto:johan.tibell@gmail.com) May 2014
* Fix streaming test output.
# 1.20.0.0 [Johan Tibell](mailto:johan.tibell@gmail.com) April 2014
* Rewrite user guide
* Fix repl Ctrl+C handling
* Add haskell-suite compiler support
* Add __HADDOCK_VERSION__ define
* Allow specifying exact dependency version using hash
* Rename extra-html-files to extra-doc-files
* Add parallel build support for GHC 7.8 and later
* Don't call ranlib on OS X
* Avoid re-linking executables, test suites, and benchmarks
unnecessarily, shortening build times
* Add `--allow-newer` which allows upper version bounds to be
ignored
* Add `--enable-library-stripping`
* Add command for freezing dependencies
* Allow repl to be used outside Cabal packages
* Add `--require-sandbox`
* Don't use `--strip-unneeded` on OS X or iOS
* Add new license-files field got additional licenses
* Fix if(solaris) on some Solaris versions
* Don't use -dylib-install-name on OS X with GHC > 7.8
* Add DragonFly as a known OS
* Improve pretty-printing of Cabal files
* Add test flag `--show-details=streaming` for real-time test output
* Add exec command
----
## 1.10.2.0 [Duncan Coutts](mailto:duncan@community.haskell.org) June 2011
* Include test suites in cabal sdist
* Fix for conditionals in test suite stanzas in `.cabal` files
* Fix permissions of directories created during install
* Fix for global builds when $HOME env var is not set
## 1.10.1.0 [Duncan Coutts](mailto:duncan@community.haskell.org) February 2011
* Improved error messages when test suites are not enabled
* Template parameters allowed in test `--test-option(s)` flag
* Improved documentation of the test feature
* Relaxed QA check on cabal-version when using test-suite sections
* `haddock` command now allows both `--hoogle` and `--html` at the same time
* Find ghc-version-specific instances of the hsc2hs program
* Preserve file executable permissions in sdist tarballs
* Pass gcc location and flags to ./configure scripts
* Get default gcc flags from ghc
# 1.10.0.0 [Duncan Coutts](mailto:duncan@haskell.org) November 2010
* New cabal test feature
* Initial support for UHC
* New default-language and other-languages fields (e.g. Haskell98/2010)
* New default-extensions and other-extensions fields
* Deprecated extensions field (for packages using cabal-version >=1.10)
* Cabal-version field must now only be of the form `>= x.y`
* Removed deprecated `--copy-prefix=` feature
* Auto-reconfigure when `.cabal` file changes
* Workaround for haddock overwriting .hi and .o files when using TH
* Extra cpp flags used with hsc2hs and c2hs (-D${os}_BUILD_OS etc)
* New cpp define VERSION_<package> gives string version of dependencies
* User guide source now in markdown format for easier editing
* Improved checks and error messages for C libraries and headers
* Removed BSD4 from the list of suggested licenses
* Updated list of known language extensions
* Fix for include paths to allow C code to import FFI stub.h files
* Fix for intra-package dependencies on OSX
* Stricter checks on various bits of `.cabal` file syntax
* Minor fixes for c2hs
----
### 1.8.0.6 [Duncan Coutts](mailto:duncan@haskell.org) June 2010
* Fix `register --global/--user`
### 1.8.0.4 [Duncan Coutts](mailto:duncan@haskell.org) March 2010
* Set dylib-install-name for dynalic libs on OSX
* Stricter configure check that compiler supports a package's extensions
* More configure-time warnings
* Hugs can compile Cabal lib again
* Default datadir now follows prefix on Windows
* Support for finding installed packages for hugs
* Cabal version macros now have proper parenthesis
* Reverted change to filter out deps of non-buildable components
* Fix for registering implace when using a specific package db
* Fix mismatch between $os and $arch path template variables
* Fix for finding ar.exe on Windows, always pick ghc's version
* Fix for intra-package dependencies with ghc-6.12
# 1.8.0.2 [Duncan Coutts](mailto:duncan@haskell.org) December 2009
* Support for GHC-6.12
* New unique installed package IDs which use a package hash
* Allow executables to depend on the lib within the same package
* Dependencies for each component apply only to that component
(previously applied to all the other components too)
* Added new known license MIT and versioned GPL and LGPL
* More liberal package version range syntax
* Package registration files are now UTF8
* Support for LHC and JHC-0.7.2
* Deprecated RecordPuns extension in favour of NamedFieldPuns
* Deprecated PatternSignatures extension in favor of ScopedTypeVariables
* New VersionRange semantic view as a sequence of intervals
* Improved package quality checks
* Minor simplification in a couple `Setup.hs` hooks
* Beginnings of a unit level testsuite using QuickCheck
* Various bug fixes
* Various internal cleanups
----
### 1.6.0.2 [Duncan Coutts](mailto:duncan@haskell.org) February 2009
* New configure-time check for C headers and libraries
* Added language extensions present in ghc-6.10
* Added support for NamedFieldPuns extension in ghc-6.8
* Fix in configure step for ghc-6.6 on Windows
* Fix warnings in `Path_pkgname.hs` module on Windows
* Fix for exotic flags in ld-options field
* Fix for using pkg-config in a package with a lib and an executable
* Fix for building haddock docs for exes that use the Paths module
* Fix for installing header files in subdirectories
* Fix for the case of building profiling libs but not ordinary libs
* Fix read-only attribute of installed files on Windows
* Ignore ghc -threaded flag when profiling in ghc-6.8 and older
### 1.6.0.1 [Duncan Coutts](mailto:duncan@haskell.org) October 2008
* Export a compat function to help alex and happy
# 1.6.0.0 [Duncan Coutts](mailto:duncan@haskell.org) October 2008
* Support for ghc-6.10
* Source control repositories can now be specified in `.cabal` files
* Bug report URLs can be now specified in `.cabal` files
* Wildcards now allowed in data-files and extra-source-files fields
* New syntactic sugar for dependencies `build-depends: foo ==1.2.*`
* New cabal_macros.h provides macros to test versions of dependencies
* Relocatable bindists now possible on unix via env vars
* New `exposed` field allows packages to be not exposed by default
* Install dir flags can now use $os and $arch variables
* New `--builddir` flag allows multiple builds from a single sources dir
* cc-options now only apply to .c files, not for -fvia-C
* cc-options are not longer propagated to dependent packages
* The cpp/cc/ld-options fields no longer use `,` as a separator
* hsc2hs is now called using gcc instead of using ghc as gcc
* New api for manipulating sets and graphs of packages
* Internal api improvements and code cleanups
* Minor improvements to the user guide
* Miscellaneous minor bug fixes
----
### 1.4.0.2 [Duncan Coutts](mailto:duncan@haskell.org) August 2008
* Fix executable stripping default
* Fix striping exes on OSX that export dynamic symbols (like ghc)
* Correct the order of arguments given by `--prog-options=`
* Fix corner case with overlapping user and global packages
* Fix for modules that use pre-processing and `.hs-boot` files
* Clarify some points in the user guide and readme text
* Fix verbosity flags passed to sub-command like haddock
* Fix `sdist --snapshot`
* Allow meta-packages that contain no modules or C code
* Make the generated Paths module -Wall clean on Windows
### 1.4.0.1 [Duncan Coutts](mailto:duncan@haskell.org) June 2008
* Fix a bug which caused `.` to always be in the sources search path
* Haddock-2.2 and later do now support the `--hoogle` flag
# 1.4.0.0 [Duncan Coutts](mailto:duncan@haskell.org) June 2008
* Rewritten command line handling support
* Command line completion with bash
* Better support for Haddock 2
* Improved support for nhc98
* Removed support for ghc-6.2
* Haddock markup in `.lhs` files now supported
* Default colour scheme for highlighted source code
* Default prefix for `--user` installs is now `$HOME/.cabal`
* All `.cabal` files are treaded as UTF-8 and must be valid
* Many checks added for common mistakes
* New `--package-db=` option for specific package databases
* Many internal changes to support cabal-install
* Stricter parsing for version strings, eg dissalows "1.05"
* Improved user guide introduction
* Programatica support removed
* New options `--program-prefix/suffix` allows eg versioned programs
* Support packages that use `.hs-boot` files
* Fix sdist for Main modules that require preprocessing
* New configure -O flag with optimisation level 0--2
* Provide access to "`x-`" extension fields through the Cabal api
* Added check for broken installed packages
* Added warning about using inconsistent versions of dependencies
* Strip binary executable files by default with an option to disable
* New options to add site-specific include and library search paths
* Lift the restriction that libraries must have exposed-modules
* Many bugs fixed.
* Many internal structural improvements and code cleanups
----
## 1.2.4.0 [Duncan Coutts](mailto:duncan@haskell.org) June 2008
* Released with GHC 6.8.3
* Backported several fixes and minor improvements from Cabal-1.4
* Use a default colour scheme for sources with hscolour >=1.9
* Support `--hyperlink-source` for Haddock >= 2.0
* Fix for running in a non-writable directory
* Add OSX -framework arguments when linking executables
* Updates to the user guide
* Allow build-tools names to include + and _
* Export autoconfUserHooks and simpleUserHooks
* Export ccLdOptionsBuildInfo for `Setup.hs` scripts
* Export unionBuildInfo and make BuildInfo an instance of Monoid
* Fix to allow the `main-is` module to use a pre-processor
## 1.2.3.0 [Duncan Coutts](mailto:duncan@haskell.org) Nov 2007
* Released with GHC 6.8.2
* Includes full list of GHC language extensions
* Fix infamous `dist/conftest.c` bug
* Fix `configure --interfacedir=`
* Find ld.exe on Windows correctly
* Export PreProcessor constructor and mkSimplePreProcessor
* Fix minor bug in unlit code
* Fix some markup in the haddock docs
## 1.2.2.0 [Duncan Coutts](mailto:duncan@haskell.org) Nov 2007
* Released with GHC 6.8.1
* Support haddock-2.0
* Support building DSOs with GHC
* Require reconfiguring if the `.cabal` file has changed
* Fix os(windows) configuration test
* Fix building documentation
* Fix building packages on Solaris
* Other minor bug fixes
## 1.2.1 [Duncan Coutts](mailto:duncan@haskell.org) Oct 2007
* To be included in GHC 6.8.1
* New field `cpp-options` used when preprocessing Haskell modules
* Fixes for hsc2hs when using ghc
* C source code gets compiled with -O2 by default
* OS aliases, to allow os(windows) rather than requiring os(mingw32)
* Fix cleaning of `stub` files
* Fix cabal-setup, command line ui that replaces `runhaskell Setup.hs`
* Build docs even when dependent packages docs are missing
* Allow the `--html-dir` to be specified at configure time
* Fix building with ghc-6.2
* Other minor bug fixes and build fixes
# 1.2.0 [Duncan Coutts](mailto:duncan.coutts@worc.ox.ac.uk) Sept 2007
* To be included in GHC 6.8.x
* New configurations feature
* Can make haddock docs link to hilighted sources (with hscolour)
* New flag to allow linking to haddock docs on the web
* Supports pkg-config
* New field `build-tools` for tool dependencies
* Improved c2hs support
* Preprocessor output no longer clutters source dirs
* Separate `includes` and `install-includes` fields
* Makefile command to generate makefiles for building libs with GHC
* New `--docdir` configure flag
* Generic `--with-prog` `--prog-args` configure flags
* Better default installation paths on Windows
* Install paths can be specified relative to each other
* License files now installed
* Initial support for NHC (incomplete)
* Consistent treatment of verbosity
* Reduced verbosity of configure step by default
* Improved helpfulness of output messages
* Help output now clearer and fits in 80 columns
* New setup register `--gen-pkg-config` flag for distros
* Major internal refactoring, hooks api has changed
* Dozens of bug fixes
----
### 1.1.6.2 [Duncan Coutts](mailto:duncan.coutts@worc.ox.ac.uk) May 2007
* Released with GHC 6.6.1
* Handle windows text file encoding for `.cabal` files
* Fix compiling a executable for profiling that uses Template Haskell
* Other minor bug fixes and user guide clarifications
### 1.1.6.1 [Duncan Coutts](mailto:duncan.coutts@worc.ox.ac.uk) Oct 2006
* fix unlit code
* fix escaping in register.sh
## 1.1.6 [Duncan Coutts](mailto:duncan.coutts@worc.ox.ac.uk) Oct 2006
* Released with GHC 6.6
* Added support for hoogle
* Allow profiling and normal builds of libs to be chosen indepentantly
* Default installation directories on Win32 changed
* Register haddock docs with ghc-pkg
* Get haddock to make hyperlinks to dependent package docs
* Added BangPatterns language extension
* Various bug fixes
## 1.1.4 [Duncan Coutts](mailto:duncan.coutts@worc.ox.ac.uk) May 2006
* Released with GHC 6.4.2
* Better support for packages that need to install header files
* cabal-setup added, but not installed by default yet
* Implemented `setup register --inplace`
* Have packages exposed by default with ghc-6.2
* It is no longer necessary to run `configure` before `clean` or `sdist`
* Added support for ghc's `-split-objs`
* Initial support for JHC
* Ignore extension fields in `.cabal` files (fields beginning with "`x-`")
* Some changes to command hooks API to improve consistency
* Hugs support improvements
* Added GeneralisedNewtypeDeriving language extension
* Added cabal-version field
* Support hidden modules with haddock
* Internal code refactoring
* More bug fixes
## 1.1.3 [Isaac Jones](mailto:ijones@syntaxpolice.org) Sept 2005
* WARNING: Interfaces not documented in the user's guide may
change in future releases.
* Move building of GHCi .o libs to the build phase rather than
register phase. (from Duncan Coutts)
* Use .tar.gz for source package extension
* Uses GHC instead of cpphs if the latter is not available
* Added experimental "command hooks" which completely override the
default behavior of a command.
* Some bugfixes
# 1.1.1 [Isaac Jones](mailto:ijones@syntaxpolice.org) July 2005
* WARNING: Interfaces not documented in the user's guide may
change in future releases.
* Handles recursive modules for GHC 6.2 and GHC 6.4.
* Added `setup test` command (Used with UserHook)
* implemented handling of _stub.{c,h,o} files
* Added support for profiling
* Changed install prefix of libraries (pref/pkgname-version
to prefix/pkgname-version/compname-version)
* Added pattern guards as a language extension
* Moved some functionality to Language.Haskell.Extension
* Register / unregister .bat files for windows
* Exposed more of the API
* Added support for the hide-all-packages flag in GHC > 6.4
* Several bug fixes
----
# 1.0 [Isaac Jones](mailto:ijones@syntaxpolice.org) March 11 2005
* Released with GHC 6.4, Hugs March 2005, and nhc98 1.18
* Some sanity checking
----
# 0.5 [Isaac Jones](mailto:ijones@syntaxpolice.org) Wed Feb 19 2005
* __WARNING__: this is a pre-release and the interfaces are
still likely to change until we reach a 1.0 release.
* Hooks interfaces changed
* Added preprocessors to user hooks
* No more executable-modules or hidden-modules. Use
`other-modules` instead.
* Certain fields moved into BuildInfo, much refactoring
* `extra-libs` -> `extra-libraries`
* Added `--gen-script` to configure and unconfigure.
* `modules-ghc` (etc) now `ghc-modules` (etc)
* added new fields including `synopsis`
* Lots of bug fixes
* spaces can sometimes be used instead of commas
* A user manual has appeared (Thanks, ross!)
* for ghc 6.4, configures versionsed depends properly
* more features to `./setup haddock`
----
# 0.4 [Isaac Jones](mailto:ijones@syntaxpolice.org) Sun Jan 16 2005
* Much thanks to all the awesome fptools hackers who have been
working hard to build the Haskell Cabal!
* __Interface Changes__:
* __WARNING__: this is a pre-release and the interfaces are still
likely to change until we reach a 1.0 release.
* Instead of Package.description, you should name your
description files <something>.cabal. In particular, we suggest
that you name it <packagename>.cabal, but this is not enforced
(yet). Multiple `.cabal` files in the same directory is an error,
at least for now.
* `./setup install --install-prefix` is gone. Use `./setup copy`
`--copy-prefix` instead.
* The `Modules` field is gone. Use `hidden-modules`,
`exposed-modules`, and `executable-modules`.
* `Build-depends` is now a package-only field, and can't go into
executable stanzas. Build-depends is a package-to-package
relationship.
* Some new fields. Use the Source.
* __New Features__
* Cabal is now included as a package in the CVS version of
fptools. That means it'll be released as `-package Cabal` in
future versions of the compilers, and if you are a bleeding-edge
user, you can grab it from the CVS repository with the compilers.
* Hugs compatibility and NHC98 compatibility should both be
improved.
* Hooks Interface / Autoconf compatibility: Most of the hooks
interface is hidden for now, because it's not finalized. I have
exposed only `defaultMainWithHooks` and `defaultUserHooks`. This
allows you to use a ./configure script to preprocess
`foo.buildinfo`, which gets merged with `foo.cabal`. In future
releases, we'll expose UserHooks, but we're definitely going to
change the interface to those. The interface to the two functions
I've exposed should stay the same, though.
* ./setup haddock is a baby feature which pre-processes the
source code with hscpp and runs haddock on it. This is brand new
and hardly tested, so you get to knock it around and see what you
think.
* Some commands now actually implement verbosity.
* The preprocessors have been tested a bit more, and seem to work
OK. Please give feedback if you use these.
----
# 0.3 [Isaac Jones](mailto:ijones@syntaxpolice.org) Sun Jan 16 2005
* Unstable snapshot release
* From now on, stable releases are even.
----
# 0.2 [Isaac Jones](mailto:ijones@syntaxpolice.org)
* Adds more HUGS support and preprocessor support.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RankNTypes #-}
-- | This module defines the core data types for Backpack. For more
-- details, see:
--
-- <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack (
-- * OpenUnitId
OpenUnitId(..),
openUnitIdFreeHoles,
mkOpenUnitId,
-- * DefUnitId
DefUnitId,
unDefUnitId,
mkDefUnitId,
-- * OpenModule
OpenModule(..),
openModuleFreeHoles,
-- * OpenModuleSubst
OpenModuleSubst,
dispOpenModuleSubst,
dispOpenModuleSubstEntry,
parsecOpenModuleSubst,
parsecOpenModuleSubstEntry,
openModuleSubstFreeHoles,
-- * Conversions to 'UnitId'
abstractUnitId,
hashModuleSubst,
) where
import Distribution.Compat.Prelude hiding (mod)
import Distribution.Parsec
import Distribution.Pretty
import Prelude ()
import Text.PrettyPrint (hcat)
import qualified Distribution.Compat.CharParsing as P
import qualified Text.PrettyPrint as Disp
import Distribution.ModuleName
import Distribution.Types.ComponentId
import Distribution.Types.Module
import Distribution.Types.UnitId
import Distribution.Utils.Base62
import qualified Data.Map as Map
import qualified Data.Set as Set
-----------------------------------------------------------------------
-- OpenUnitId
-- | An 'OpenUnitId' describes a (possibly partially) instantiated
-- Backpack component, with a description of how the holes are filled
-- in. Unlike 'OpenUnitId', the 'ModuleSubst' is kept in a structured
-- form that allows for substitution (which fills in holes.) This form
-- of unit cannot be installed. It must first be converted to a
-- 'UnitId'.
--
-- In the absence of Backpack, there are no holes to fill, so any such
-- component always has an empty module substitution; thus we can lossly
-- represent it as an 'OpenUnitId uid'.
--
-- For a source component using Backpack, however, there is more
-- structure as components may be parametrized over some signatures, and
-- these \"holes\" may be partially or wholly filled.
--
-- OpenUnitId plays an important role when we are mix-in linking,
-- and is recorded to the installed packaged database for indefinite
-- packages; however, for compiled packages that are fully instantiated,
-- we instantiate 'OpenUnitId' into 'UnitId'.
--
-- For more details see the Backpack spec
-- <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
--
data OpenUnitId
-- | Identifies a component which may have some unfilled holes;
-- specifying its 'ComponentId' and its 'OpenModuleSubst'.
-- TODO: Invariant that 'OpenModuleSubst' is non-empty?
-- See also the Text instance.
= IndefFullUnitId ComponentId OpenModuleSubst
-- | Identifies a fully instantiated component, which has
-- been compiled and abbreviated as a hash. The embedded 'UnitId'
-- MUST NOT be for an indefinite component; an 'OpenUnitId'
-- is guaranteed not to have any holes.
| DefiniteUnitId DefUnitId
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
-- TODO: cache holes?
instance Binary OpenUnitId
instance Structured OpenUnitId
instance NFData OpenUnitId where
rnf (IndefFullUnitId cid subst) = rnf cid `seq` rnf subst
rnf (DefiniteUnitId uid) = rnf uid
instance Pretty OpenUnitId where
pretty (IndefFullUnitId cid insts)
-- TODO: arguably a smart constructor to enforce invariant would be
-- better
| Map.null insts = pretty cid
| otherwise = pretty cid <<>> Disp.brackets (dispOpenModuleSubst insts)
pretty (DefiniteUnitId uid) = pretty uid
-- |
--
-- >>> eitherParsec "foobar" :: Either String OpenUnitId
--Right (DefiniteUnitId (DefUnitId {unDefUnitId = UnitId "foobar"}))
--
-- >>> eitherParsec "foo[Str=text-1.2.3:Data.Text.Text]" :: Either String OpenUnitId
-- Right (IndefFullUnitId (ComponentId "foo") (fromList [(ModuleName "Str",OpenModule (DefiniteUnitId (DefUnitId {unDefUnitId = UnitId "text-1.2.3"})) (ModuleName "Data.Text.Text"))]))
--
instance Parsec OpenUnitId where
parsec = P.try parseOpenUnitId <|> fmap DefiniteUnitId parsec
where
parseOpenUnitId = do
cid <- parsec
insts <- P.between (P.char '[') (P.char ']')
parsecOpenModuleSubst
return (IndefFullUnitId cid insts)
-- | Get the set of holes ('ModuleVar') embedded in a 'UnitId'.
openUnitIdFreeHoles :: OpenUnitId -> Set ModuleName
openUnitIdFreeHoles (IndefFullUnitId _ insts) = openModuleSubstFreeHoles insts
openUnitIdFreeHoles _ = Set.empty
-- | Safe constructor from a UnitId. The only way to do this safely
-- is if the instantiation is provided.
mkOpenUnitId :: UnitId -> ComponentId -> OpenModuleSubst -> OpenUnitId
mkOpenUnitId uid cid insts =
if Set.null (openModuleSubstFreeHoles insts)
then DefiniteUnitId (unsafeMkDefUnitId uid) -- invariant holds!
else IndefFullUnitId cid insts
-----------------------------------------------------------------------
-- DefUnitId
-- | Create a 'DefUnitId' from a 'ComponentId' and an instantiation
-- with no holes.
mkDefUnitId :: ComponentId -> Map ModuleName Module -> DefUnitId
mkDefUnitId cid insts =
unsafeMkDefUnitId (mkUnitId
(unComponentId cid ++ maybe "" ("+"++) (hashModuleSubst insts)))
-- impose invariant!
-----------------------------------------------------------------------
-- OpenModule
-- | Unlike a 'Module', an 'OpenModule' is either an ordinary
-- module from some unit, OR an 'OpenModuleVar', representing a
-- hole that needs to be filled in. Substitutions are over
-- module variables.
data OpenModule
= OpenModule OpenUnitId ModuleName
| OpenModuleVar ModuleName
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
instance Binary OpenModule
instance Structured OpenModule
instance NFData OpenModule where
rnf (OpenModule uid mod_name) = rnf uid `seq` rnf mod_name
rnf (OpenModuleVar mod_name) = rnf mod_name
instance Pretty OpenModule where
pretty (OpenModule uid mod_name) =
hcat [pretty uid, Disp.text ":", pretty mod_name]
pretty (OpenModuleVar mod_name) =
hcat [Disp.char '<', pretty mod_name, Disp.char '>']
-- |
--
-- >>> eitherParsec "Includes2-0.1.0.0-inplace-mysql:Database.MySQL" :: Either String OpenModule
-- Right (OpenModule (DefiniteUnitId (DefUnitId {unDefUnitId = UnitId "Includes2-0.1.0.0-inplace-mysql"})) (ModuleName "Database.MySQL"))
--
instance Parsec OpenModule where
parsec = parsecModuleVar <|> parsecOpenModule
where
parsecOpenModule = do
uid <- parsec
_ <- P.char ':'
mod_name <- parsec
return (OpenModule uid mod_name)
parsecModuleVar = do
_ <- P.char '<'
mod_name <- parsec
_ <- P.char '>'
return (OpenModuleVar mod_name)
-- | Get the set of holes ('ModuleVar') embedded in a 'Module'.
openModuleFreeHoles :: OpenModule -> Set ModuleName
openModuleFreeHoles (OpenModuleVar mod_name) = Set.singleton mod_name
openModuleFreeHoles (OpenModule uid _n) = openUnitIdFreeHoles uid
-----------------------------------------------------------------------
-- OpenModuleSubst
-- | An explicit substitution on modules.
--
-- NB: These substitutions are NOT idempotent, for example, a
-- valid substitution is (A -> B, B -> A).
type OpenModuleSubst = Map ModuleName OpenModule
-- | Pretty-print the entries of a module substitution, suitable
-- for embedding into a 'OpenUnitId' or passing to GHC via @--instantiate-with@.
dispOpenModuleSubst :: OpenModuleSubst -> Disp.Doc
dispOpenModuleSubst subst
= Disp.hcat
. Disp.punctuate Disp.comma
$ map dispOpenModuleSubstEntry (Map.toAscList subst)
-- | Pretty-print a single entry of a module substitution.
dispOpenModuleSubstEntry :: (ModuleName, OpenModule) -> Disp.Doc
dispOpenModuleSubstEntry (k, v) = pretty k <<>> Disp.char '=' <<>> pretty v
-- | Inverse to 'dispModSubst'.
--
-- @since 2.2
parsecOpenModuleSubst :: CabalParsing m => m OpenModuleSubst
parsecOpenModuleSubst = fmap Map.fromList
. flip P.sepBy (P.char ',')
$ parsecOpenModuleSubstEntry
-- | Inverse to 'dispModSubstEntry'.
--
-- @since 2.2
parsecOpenModuleSubstEntry :: CabalParsing m => m (ModuleName, OpenModule)
parsecOpenModuleSubstEntry =
do k <- parsec
_ <- P.char '='
v <- parsec
return (k, v)
-- | Get the set of holes ('ModuleVar') embedded in a 'OpenModuleSubst'.
-- This is NOT the domain of the substitution.
openModuleSubstFreeHoles :: OpenModuleSubst -> Set ModuleName
openModuleSubstFreeHoles insts = Set.unions (map openModuleFreeHoles (Map.elems insts))
-----------------------------------------------------------------------
-- Conversions to UnitId
-- | When typechecking, we don't demand that a freshly instantiated
-- 'IndefFullUnitId' be compiled; instead, we just depend on the
-- installed indefinite unit installed at the 'ComponentId'.
abstractUnitId :: OpenUnitId -> UnitId
abstractUnitId (DefiniteUnitId def_uid) = unDefUnitId def_uid
abstractUnitId (IndefFullUnitId cid _) = newSimpleUnitId cid
-- | Take a module substitution and hash it into a string suitable for
-- 'UnitId'. Note that since this takes 'Module', not 'OpenModule',
-- you are responsible for recursively converting 'OpenModule'
-- into 'Module'. See also "Distribution.Backpack.ReadyComponent".
hashModuleSubst :: Map ModuleName Module -> Maybe String
hashModuleSubst subst
| Map.null subst = Nothing
| otherwise =
Just . hashToBase62 $
concat [ prettyShow mod_name ++ "=" ++ prettyShow m ++ "\n"
| (mod_name, m) <- Map.toList subst]
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.ComponentsGraph (
ComponentsGraph,
ComponentsWithDeps,
mkComponentsGraph,
componentsGraphToList,
dispComponentsWithDeps,
componentCycleMsg
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.Simple.BuildToolDepends
import Distribution.Simple.LocalBuildInfo
import Distribution.Types.ComponentRequestedSpec
import Distribution.Types.UnqualComponentName
import Distribution.Compat.Graph (Graph, Node(..))
import qualified Distribution.Compat.Graph as Graph
import Distribution.Utils.Generic
import Distribution.Pretty (pretty)
import Text.PrettyPrint
------------------------------------------------------------------------------
-- Components graph
------------------------------------------------------------------------------
-- | A graph of source-level components by their source-level
-- dependencies
--
type ComponentsGraph = Graph (Node ComponentName Component)
-- | A list of components associated with the source level
-- dependencies between them.
--
type ComponentsWithDeps = [(Component, [ComponentName])]
-- | Pretty-print 'ComponentsWithDeps'.
--
dispComponentsWithDeps :: ComponentsWithDeps -> Doc
dispComponentsWithDeps graph =
vcat [ hang (text "component" <+> pretty (componentName c)) 4
(vcat [ text "dependency" <+> pretty cdep | cdep <- cdeps ])
| (c, cdeps) <- graph ]
-- | Create a 'Graph' of 'Component', or report a cycle if there is a
-- problem.
--
mkComponentsGraph :: ComponentRequestedSpec
-> PackageDescription
-> Either [ComponentName] ComponentsGraph
mkComponentsGraph enabled pkg_descr =
let g = Graph.fromDistinctList
[ N c (componentName c) (componentDeps c)
| c <- pkgBuildableComponents pkg_descr
, componentEnabled enabled c ]
in case Graph.cycles g of
[] -> Right g
ccycles -> Left [ componentName c | N c _ _ <- concat ccycles ]
where
-- The dependencies for the given component
componentDeps component =
(CExeName <$> getAllInternalToolDependencies pkg_descr bi)
++ [ if pkgname == packageName pkg_descr
then CLibName LMainLibName
else CLibName (LSubLibName toolname)
| Dependency pkgname _ _ <- targetBuildDepends bi
, let toolname = packageNameToUnqualComponentName pkgname
, toolname `elem` internalPkgDeps ]
where
bi = componentBuildInfo component
internalPkgDeps = map (conv . libName) (allLibraries pkg_descr)
conv LMainLibName = packageNameToUnqualComponentName $ packageName pkg_descr
conv (LSubLibName s) = s
-- | Given the package description and a 'PackageDescription' (used
-- to determine if a package name is internal or not), sort the
-- components in dependency order (fewest dependencies first). This is
-- NOT necessarily the build order (although it is in the absence of
-- Backpack.)
--
componentsGraphToList :: ComponentsGraph
-> ComponentsWithDeps
componentsGraphToList =
map (\(N c _ cs) -> (c, cs)) . Graph.revTopSort
-- | Error message when there is a cycle; takes the SCC of components.
componentCycleMsg :: [ComponentName] -> Doc
componentCycleMsg cnames =
text $ "Components in the package depend on each other in a cyclic way:\n "
++ intercalate " depends on "
[ "'" ++ showComponentName cname ++ "'"
| cname <- cnames ++ maybeToList (safeHead cnames) ]
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoMonoLocalBinds #-}
{-# LANGUAGE NondecreasingIndentation #-}
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
--
-- WARNING: The contents of this module are HIGHLY experimental.
-- We may refactor it under you.
module Distribution.Backpack.Configure (
configureComponentLocalBuildInfos,
) where
import Prelude ()
import Distribution.Compat.Prelude hiding ((<>))
import Distribution.Backpack
import Distribution.Backpack.FullUnitId
import Distribution.Backpack.PreExistingComponent
import Distribution.Backpack.ConfiguredComponent
import Distribution.Backpack.LinkedComponent
import Distribution.Backpack.ReadyComponent
import Distribution.Backpack.ComponentsGraph
import Distribution.Backpack.Id
import Distribution.Simple.Compiler hiding (Flag)
import Distribution.Package
import qualified Distribution.InstalledPackageInfo as Installed
import Distribution.InstalledPackageInfo (InstalledPackageInfo
,emptyInstalledPackageInfo)
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.PackageIndex (InstalledPackageIndex)
import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.ModuleName
import Distribution.Simple.Setup as Setup
import Distribution.Simple.LocalBuildInfo
import Distribution.Types.AnnotatedId
import Distribution.Types.ComponentRequestedSpec
import Distribution.Types.ComponentInclude
import Distribution.Types.MungedPackageName
import Distribution.Verbosity
import qualified Distribution.Compat.Graph as Graph
import Distribution.Compat.Graph (Graph, IsNode(..))
import Distribution.Utils.LogProgress
import Data.Either
( lefts )
import qualified Data.Set as Set
import qualified Data.Map as Map
import Distribution.Pretty
import Text.PrettyPrint
------------------------------------------------------------------------------
-- Pipeline
------------------------------------------------------------------------------
configureComponentLocalBuildInfos
:: Verbosity
-> Bool -- use_external_internal_deps
-> ComponentRequestedSpec
-> Bool -- deterministic
-> Flag String -- configIPID
-> Flag ComponentId -- configCID
-> PackageDescription
-> [PreExistingComponent]
-> FlagAssignment -- configConfigurationsFlags
-> [(ModuleName, Module)] -- configInstantiateWith
-> InstalledPackageIndex
-> Compiler
-> LogProgress ([ComponentLocalBuildInfo], InstalledPackageIndex)
configureComponentLocalBuildInfos
verbosity use_external_internal_deps enabled deterministic ipid_flag cid_flag pkg_descr
prePkgDeps flagAssignment instantiate_with installedPackageSet comp = do
-- NB: In single component mode, this returns a *single* component.
-- In this graph, the graph is NOT closed.
graph0 <- case mkComponentsGraph enabled pkg_descr of
Left ccycle -> dieProgress (componentCycleMsg ccycle)
Right g -> return (componentsGraphToList g)
infoProgress $ hang (text "Source component graph:") 4
(dispComponentsWithDeps graph0)
let conf_pkg_map = Map.fromListWith Map.union
[(pc_pkgname pkg,
Map.singleton (pc_compname pkg)
(AnnotatedId {
ann_id = pc_cid pkg,
ann_pid = packageId pkg,
ann_cname = pc_compname pkg
}))
| pkg <- prePkgDeps]
graph1 <- toConfiguredComponents use_external_internal_deps
flagAssignment
deterministic ipid_flag cid_flag pkg_descr
conf_pkg_map (map fst graph0)
infoProgress $ hang (text "Configured component graph:") 4
(vcat (map dispConfiguredComponent graph1))
let shape_pkg_map = Map.fromList
[ (pc_cid pkg, (pc_open_uid pkg, pc_shape pkg))
| pkg <- prePkgDeps]
uid_lookup def_uid
| Just pkg <- PackageIndex.lookupUnitId installedPackageSet uid
= FullUnitId (Installed.installedComponentId pkg)
(Map.fromList (Installed.instantiatedWith pkg))
| otherwise = error ("uid_lookup: " ++ prettyShow uid)
where uid = unDefUnitId def_uid
graph2 <- toLinkedComponents verbosity uid_lookup
(package pkg_descr) shape_pkg_map graph1
infoProgress $
hang (text "Linked component graph:") 4
(vcat (map dispLinkedComponent graph2))
let pid_map = Map.fromList $
[ (pc_uid pkg, pc_munged_id pkg)
| pkg <- prePkgDeps] ++
[ (Installed.installedUnitId pkg, mungedId pkg)
| (_, Module uid _) <- instantiate_with
, Just pkg <- [PackageIndex.lookupUnitId
installedPackageSet (unDefUnitId uid)] ]
subst = Map.fromList instantiate_with
graph3 = toReadyComponents pid_map subst graph2
graph4 = Graph.revTopSort (Graph.fromDistinctList graph3)
infoProgress $ hang (text "Ready component graph:") 4
(vcat (map dispReadyComponent graph4))
toComponentLocalBuildInfos comp installedPackageSet pkg_descr prePkgDeps graph4
------------------------------------------------------------------------------
-- ComponentLocalBuildInfo
------------------------------------------------------------------------------
toComponentLocalBuildInfos
:: Compiler
-> InstalledPackageIndex -- FULL set
-> PackageDescription
-> [PreExistingComponent] -- external package deps
-> [ReadyComponent]
-> LogProgress ([ComponentLocalBuildInfo],
InstalledPackageIndex) -- only relevant packages
toComponentLocalBuildInfos
comp installedPackageSet pkg_descr externalPkgDeps graph = do
-- Check and make sure that every instantiated component exists.
-- We have to do this now, because prior to linking/instantiating
-- we don't actually know what the full set of 'UnitId's we need
-- are.
let -- TODO: This is actually a bit questionable performance-wise,
-- since we will pay for the ALL installed packages even if
-- they are not related to what we are building. This was true
-- in the old configure code.
external_graph :: Graph (Either InstalledPackageInfo ReadyComponent)
external_graph = Graph.fromDistinctList
. map Left
$ PackageIndex.allPackages installedPackageSet
internal_graph :: Graph (Either InstalledPackageInfo ReadyComponent)
internal_graph = Graph.fromDistinctList
. map Right
$ graph
combined_graph = Graph.unionRight external_graph internal_graph
local_graph = fromMaybe (error "toComponentLocalBuildInfos: closure returned Nothing")
$ Graph.closure combined_graph (map nodeKey graph)
-- The database of transitively reachable installed packages that the
-- external components the package (as a whole) depends on. This will be
-- used in several ways:
--
-- * We'll use it to do a consistency check so we're not depending
-- on multiple versions of the same package (TODO: someday relax
-- this for private dependencies.) See right below.
--
-- * We'll pass it on in the LocalBuildInfo, where preprocessors
-- and other things will incorrectly use it to determine what
-- the include paths and everything should be.
--
packageDependsIndex = PackageIndex.fromList (lefts local_graph)
fullIndex = Graph.fromDistinctList local_graph
case Graph.broken fullIndex of
[] -> return ()
broken ->
-- TODO: ppr this
dieProgress . text $
"The following packages are broken because other"
++ " packages they depend on are missing. These broken "
++ "packages must be rebuilt before they can be used.\n"
-- TODO: Undupe.
++ unlines [ "installed package "
++ prettyShow (packageId pkg)
++ " is broken due to missing package "
++ intercalate ", " (map prettyShow deps)
| (Left pkg, deps) <- broken ]
++ unlines [ "planned package "
++ prettyShow (packageId pkg)
++ " is broken due to missing package "
++ intercalate ", " (map prettyShow deps)
| (Right pkg, deps) <- broken ]
-- In this section, we'd like to look at the 'packageDependsIndex'
-- and see if we've picked multiple versions of the same
-- installed package (this is bad, because it means you might
-- get an error could not match foo-0.1:Type with foo-0.2:Type).
--
-- What is pseudoTopPkg for? I have no idea. It was used
-- in the very original commit which introduced checking for
-- inconsistencies 5115bb2be4e13841ea07dc9166b9d9afa5f0d012,
-- and then moved out of PackageIndex and put here later.
-- TODO: Try this code without it...
--
-- TODO: Move this into a helper function
--
-- TODO: This is probably wrong for Backpack
let pseudoTopPkg :: InstalledPackageInfo
pseudoTopPkg = emptyInstalledPackageInfo {
Installed.installedUnitId = mkLegacyUnitId (packageId pkg_descr),
Installed.sourcePackageId = packageId pkg_descr,
Installed.depends = map pc_uid externalPkgDeps
}
case PackageIndex.dependencyInconsistencies
. PackageIndex.insert pseudoTopPkg
$ packageDependsIndex of
[] -> return ()
inconsistencies ->
warnProgress $
hang (text "This package indirectly depends on multiple versions of the same" <+>
text "package. This is very likely to cause a compile failure.") 2
(vcat [ text "package" <+> pretty (packageName user) <+>
parens (pretty (installedUnitId user)) <+> text "requires" <+>
pretty inst
| (_dep_key, insts) <- inconsistencies
, (inst, users) <- insts
, user <- users ])
let clbis = mkLinkedComponentsLocalBuildInfo comp graph
-- forM clbis $ \(clbi,deps) -> info verbosity $ "UNIT" ++ hashUnitId (componentUnitId clbi) ++ "\n" ++ intercalate "\n" (map hashUnitId deps)
return (clbis, packageDependsIndex)
-- Build ComponentLocalBuildInfo for each component we are going
-- to build.
--
-- This conversion is lossy; we lose some invariants from ReadyComponent
mkLinkedComponentsLocalBuildInfo
:: Compiler
-> [ReadyComponent]
-> [ComponentLocalBuildInfo]
mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
where
internalUnits = Set.fromList (map rc_uid rcs)
isInternal x = Set.member x internalUnits
go rc =
case rc_component rc of
CLib lib ->
let convModuleExport (modname', (Module uid modname))
| this_uid == unDefUnitId uid
, modname' == modname
= Installed.ExposedModule modname' Nothing
| otherwise
= Installed.ExposedModule modname'
(Just (OpenModule (DefiniteUnitId uid) modname))
convOpenModuleExport (modname', modu@(OpenModule uid modname))
| uid == this_open_uid
, modname' == modname
= Installed.ExposedModule modname' Nothing
| otherwise
= Installed.ExposedModule modname' (Just modu)
convOpenModuleExport (_, OpenModuleVar _)
= error "convOpenModuleExport: top-level modvar"
exports =
-- Loses invariants
case rc_i rc of
Left indefc -> map convOpenModuleExport
$ Map.toList (indefc_provides indefc)
Right instc -> map convModuleExport
$ Map.toList (instc_provides instc)
insts =
case rc_i rc of
Left indefc -> [ (m, OpenModuleVar m) | m <- indefc_requires indefc ]
Right instc -> [ (m, OpenModule (DefiniteUnitId uid') m')
| (m, Module uid' m') <- instc_insts instc ]
compat_name = MungedPackageName (packageName rc) (libName lib)
compat_key = computeCompatPackageKey comp compat_name (packageVersion rc) this_uid
in LibComponentLocalBuildInfo {
componentPackageDeps = cpds,
componentUnitId = this_uid,
componentComponentId = this_cid,
componentInstantiatedWith = insts,
componentIsIndefinite_ = is_indefinite,
componentLocalName = cname,
componentInternalDeps = internal_deps,
componentExeDeps = exe_deps,
componentIncludes = includes,
componentExposedModules = exports,
componentIsPublic = rc_public rc,
componentCompatPackageKey = compat_key,
componentCompatPackageName = compat_name
}
CFLib _ ->
FLibComponentLocalBuildInfo {
componentUnitId = this_uid,
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
CExe _ ->
ExeComponentLocalBuildInfo {
componentUnitId = this_uid,
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
CTest _ ->
TestComponentLocalBuildInfo {
componentUnitId = this_uid,
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
CBench _ ->
BenchComponentLocalBuildInfo {
componentUnitId = this_uid,
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
where
this_uid = rc_uid rc
this_open_uid = rc_open_uid rc
this_cid = rc_cid rc
cname = componentName (rc_component rc)
cpds = rc_depends rc
exe_deps = map ann_id $ rc_exe_deps rc
is_indefinite =
case rc_i rc of
Left _ -> True
Right _ -> False
includes =
map (\ci -> (ci_id ci, ci_renaming ci)) $
case rc_i rc of
Left indefc ->
indefc_includes indefc
Right instc ->
map (\ci -> ci { ci_ann_id = fmap DefiniteUnitId (ci_ann_id ci) })
(instc_includes instc)
internal_deps = filter isInternal (nodeNeighbors rc)
{-# LANGUAGE PatternGuards #-}
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.ConfiguredComponent (
ConfiguredComponent(..),
cc_name,
cc_cid,
cc_pkgid,
toConfiguredComponent,
toConfiguredComponents,
dispConfiguredComponent,
ConfiguredComponentMap,
extendConfiguredComponentMap,
-- TODO: Should go somewhere else
newPackageDepsBehaviour
) where
import Prelude ()
import Distribution.Compat.Prelude hiding ((<>))
import Distribution.Backpack.Id
import Distribution.CabalSpecVersion
import Distribution.Types.AnnotatedId
import Distribution.Types.Dependency
import Distribution.Types.ExeDependency
import Distribution.Types.IncludeRenaming
import Distribution.Types.ComponentId
import Distribution.Types.PackageId
import Distribution.Types.PackageName
import Distribution.Types.Mixin
import Distribution.Types.ComponentName
import Distribution.Types.LibraryName
import Distribution.Types.UnqualComponentName
import Distribution.Types.ComponentInclude
import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.Simple.BuildToolDepends
import Distribution.Simple.Setup as Setup
import Distribution.Simple.LocalBuildInfo
import Distribution.Utils.LogProgress
import Distribution.Utils.MapAccum
import Distribution.Utils.Generic
import Control.Monad
import qualified Data.Set as Set
import qualified Data.Map as Map
import Distribution.Pretty
import Text.PrettyPrint
-- | A configured component, we know exactly what its 'ComponentId' is,
-- and the 'ComponentId's of the things it depends on.
data ConfiguredComponent
= ConfiguredComponent {
-- | Unique identifier of component, plus extra useful info.
cc_ann_id :: AnnotatedId ComponentId,
-- | The fragment of syntax from the Cabal file describing this
-- component.
cc_component :: Component,
-- | Is this the public library component of the package?
-- (If we invoke Setup with an instantiation, this is the
-- component the instantiation applies to.)
-- Note that in one-component configure mode, this is
-- always True, because any component is the "public" one.)
cc_public :: Bool,
-- | Dependencies on executables from @build-tools@ and
-- @build-tool-depends@.
cc_exe_deps :: [AnnotatedId ComponentId],
-- | The mixins of this package, including both explicit (from
-- the @mixins@ field) and implicit (from @build-depends@). Not
-- mix-in linked yet; component configuration only looks at
-- 'ComponentId's.
cc_includes :: [ComponentInclude ComponentId IncludeRenaming]
}
-- | Uniquely identifies a configured component.
cc_cid :: ConfiguredComponent -> ComponentId
cc_cid = ann_id . cc_ann_id
-- | The package this component came from.
cc_pkgid :: ConfiguredComponent -> PackageId
cc_pkgid = ann_pid . cc_ann_id
-- | The 'ComponentName' of a component; this uniquely identifies
-- a fragment of syntax within a specified Cabal file describing the
-- component.
cc_name :: ConfiguredComponent -> ComponentName
cc_name = ann_cname . cc_ann_id
-- | Pretty-print a 'ConfiguredComponent'.
dispConfiguredComponent :: ConfiguredComponent -> Doc
dispConfiguredComponent cc =
hang (text "component" <+> pretty (cc_cid cc)) 4
(vcat [ hsep $ [ text "include"
, pretty (ci_id incl), pretty (ci_renaming incl) ]
| incl <- cc_includes cc
])
-- | Construct a 'ConfiguredComponent', given that the 'ComponentId'
-- and library/executable dependencies are known. The primary
-- work this does is handling implicit @backpack-include@ fields.
mkConfiguredComponent
:: PackageDescription
-> ComponentId
-> [AnnotatedId ComponentId] -- lib deps
-> [AnnotatedId ComponentId] -- exe deps
-> Component
-> LogProgress ConfiguredComponent
mkConfiguredComponent pkg_descr this_cid lib_deps exe_deps component = do
-- Resolve each @mixins@ into the actual dependency
-- from @lib_deps@.
explicit_includes <- forM (mixins bi) $ \(Mixin name rns) -> do
let keys = fixFakePkgName pkg_descr name
aid <- case Map.lookup keys deps_map of
Nothing ->
dieProgress $
text "Mix-in refers to non-existent package" <+>
quotes (pretty name) $$
text "(did you forget to add the package to build-depends?)"
Just r -> return r
return ComponentInclude {
ci_ann_id = aid,
ci_renaming = rns,
ci_implicit = False
}
-- Any @build-depends@ which is not explicitly mentioned in
-- @backpack-include@ is converted into an "implicit" include.
let used_explicitly = Set.fromList (map ci_id explicit_includes)
implicit_includes
= map (\aid -> ComponentInclude {
ci_ann_id = aid,
ci_renaming = defaultIncludeRenaming,
ci_implicit = True
})
$ filter (flip Set.notMember used_explicitly . ann_id) lib_deps
return ConfiguredComponent {
cc_ann_id = AnnotatedId {
ann_id = this_cid,
ann_pid = package pkg_descr,
ann_cname = componentName component
},
cc_component = component,
cc_public = is_public,
cc_exe_deps = exe_deps,
cc_includes = explicit_includes ++ implicit_includes
}
where
bi = componentBuildInfo component
deps_map = Map.fromList [ ((packageName dep, ann_cname dep), dep)
| dep <- lib_deps ]
is_public = componentName component == CLibName LMainLibName
type ConfiguredComponentMap =
Map PackageName (Map ComponentName (AnnotatedId ComponentId))
toConfiguredComponent
:: PackageDescription
-> ComponentId
-> ConfiguredComponentMap
-> ConfiguredComponentMap
-> Component
-> LogProgress ConfiguredComponent
toConfiguredComponent pkg_descr this_cid lib_dep_map exe_dep_map component = do
lib_deps <-
if newPackageDepsBehaviour pkg_descr
then fmap concat $ forM (targetBuildDepends bi) $
\(Dependency name _ sublibs) -> do
-- The package name still needs fixing in case of legacy
-- sublibrary dependency syntax
let (pn, _) = fixFakePkgName pkg_descr name
pkg <- case Map.lookup pn lib_dep_map of
Nothing ->
dieProgress $
text "Dependency on unbuildable" <+>
text "package" <+> pretty pn
Just p -> return p
-- Return all library components
forM (Set.toList sublibs) $ \lib ->
let comp = CLibName lib in
case Map.lookup (CLibName $ LSubLibName $
packageNameToUnqualComponentName name) pkg
<|> Map.lookup comp pkg
of
Nothing ->
dieProgress $
text "Dependency on unbuildable" <+>
text (showLibraryName lib) <+>
text "from" <+> pretty pn
Just v -> return v
else return old_style_lib_deps
mkConfiguredComponent
pkg_descr this_cid
lib_deps exe_deps component
where
bi = componentBuildInfo component
-- lib_dep_map contains a mix of internal and external deps.
-- We want all the public libraries (dep_cn == CLibName)
-- of all external deps (dep /= pn). Note that this
-- excludes the public library of the current package:
-- this is not supported by old-style deps behavior
-- because it would imply a cyclic dependency for the
-- library itself.
old_style_lib_deps = [ e
| (pn, comp_map) <- Map.toList lib_dep_map
, pn /= packageName pkg_descr
, (cn, e) <- Map.toList comp_map
, cn == CLibName LMainLibName ]
-- We have to nub here, because 'getAllToolDependencies' may return
-- duplicates (see #4986). (NB: This is not needed for lib_deps,
-- since those elaborate into includes, for which there explicitly
-- may be multiple instances of a package)
exe_deps = ordNub $
[ exe
| ExeDependency pn cn _ <- getAllToolDependencies pkg_descr bi
-- The error suppression here is important, because in general
-- we won't know about external dependencies (e.g., 'happy')
-- which the package is attempting to use (those deps are only
-- fed in when cabal-install uses this codepath.)
-- TODO: Let cabal-install request errors here
, Just exe <- [Map.lookup (CExeName cn) =<< Map.lookup pn exe_dep_map]
]
-- | Also computes the 'ComponentId', and sets cc_public if necessary.
-- This is Cabal-only; cabal-install won't use this.
toConfiguredComponent'
:: Bool -- use_external_internal_deps
-> FlagAssignment
-> PackageDescription
-> Bool -- deterministic
-> Flag String -- configIPID (todo: remove me)
-> Flag ComponentId -- configCID
-> ConfiguredComponentMap
-> Component
-> LogProgress ConfiguredComponent
toConfiguredComponent' use_external_internal_deps flags
pkg_descr deterministic ipid_flag cid_flag
dep_map component = do
cc <- toConfiguredComponent
pkg_descr this_cid
dep_map dep_map component
return $ if use_external_internal_deps
then cc { cc_public = True }
else cc
where
-- TODO: pass component names to it too!
this_cid = computeComponentId deterministic ipid_flag cid_flag
(package pkg_descr) (componentName component) (Just (deps, flags))
deps = [ ann_id aid | m <- Map.elems dep_map
, aid <- Map.elems m ]
extendConfiguredComponentMap
:: ConfiguredComponent
-> ConfiguredComponentMap
-> ConfiguredComponentMap
extendConfiguredComponentMap cc =
Map.insertWith Map.union
(pkgName (cc_pkgid cc))
(Map.singleton (cc_name cc) (cc_ann_id cc))
-- Compute the 'ComponentId's for a graph of 'Component's. The
-- list of internal components must be topologically sorted
-- based on internal package dependencies, so that any internal
-- dependency points to an entry earlier in the list.
--
-- TODO: This function currently restricts the input configured components to
-- one version per package, by using the type ConfiguredComponentMap. It cannot
-- be used to configure a component that depends on one version of a package for
-- a library and another version for a build-tool.
toConfiguredComponents
:: Bool -- use_external_internal_deps
-> FlagAssignment
-> Bool -- deterministic
-> Flag String -- configIPID
-> Flag ComponentId -- configCID
-> PackageDescription
-> ConfiguredComponentMap
-> [Component]
-> LogProgress [ConfiguredComponent]
toConfiguredComponents
use_external_internal_deps flags deterministic ipid_flag cid_flag pkg_descr
dep_map comps
= fmap snd (mapAccumM go dep_map comps)
where
go m component = do
cc <- toConfiguredComponent'
use_external_internal_deps flags pkg_descr
deterministic ipid_flag cid_flag
m component
return (extendConfiguredComponentMap cc m, cc)
newPackageDepsBehaviourMinVersion :: CabalSpecVersion
newPackageDepsBehaviourMinVersion = CabalSpecV1_8
-- In older cabal versions, there was only one set of package dependencies for
-- the whole package. In this version, we can have separate dependencies per
-- target, but we only enable this behaviour if the minimum cabal version
-- specified is >= a certain minimum. Otherwise, for compatibility we use the
-- old behaviour.
newPackageDepsBehaviour :: PackageDescription -> Bool
newPackageDepsBehaviour pkg =
specVersion pkg >= newPackageDepsBehaviourMinVersion
-- | 'build-depends:' stanzas are currently ambiguous as the external packages
-- and internal libraries are specified the same. For now, we assume internal
-- libraries shadow, and this function disambiguates accordingly, but soon the
-- underlying ambiguity will be addressed.
-- Multiple public libraries (cabal 3.0) added an unambiguous way of specifying
-- sublibraries, but we still have to support the old syntax for bc reasons.
fixFakePkgName :: PackageDescription -> PackageName -> (PackageName, ComponentName)
fixFakePkgName pkg_descr pn =
if subLibName `elem` internalLibraries
then (packageName pkg_descr, CLibName (LSubLibName subLibName))
else (pn, CLibName LMainLibName )
where
subLibName = packageNameToUnqualComponentName pn
internalLibraries = mapMaybe (libraryNameString . libName)
(allLibraries pkg_descr)
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-}
module Distribution.Backpack.DescribeUnitId where
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Compat.Stack
import Distribution.ModuleName
import Distribution.Pretty
import Distribution.Simple.Utils
import Distribution.Types.ComponentName
import Distribution.Types.PackageId
import Distribution.Verbosity
import Text.PrettyPrint
-- Unit identifiers have a well defined, machine-readable format,
-- but this format isn't very user-friendly for users. This
-- module defines some functions for solving common rendering
-- problems one has for displaying these.
--
-- There are three basic problems we tackle:
--
-- - Users don't want to see pkg-0.5-inplace-libname,
-- they want to see "library 'libname' from 'pkg-0.5'"
--
-- - Users don't want to see the raw component identifier, which
-- usually contains a wordy hash that doesn't matter.
--
-- - Users don't want to see a hash of the instantiation: they
-- want to see the actual instantiation, and they want it in
-- interpretable form.
--
-- | Print a Setup message stating (1) what operation we are doing,
-- for (2) which component (with enough details to uniquely identify
-- the build in question.)
--
setupMessage' :: Pretty a => Verbosity
-> String -- ^ Operation being done (capitalized), on:
-> PackageIdentifier -- ^ Package
-> ComponentName -- ^ Component name
-> Maybe [(ModuleName, a)] -- ^ Instantiation, if available.
-- Polymorphic to take
-- 'OpenModule' or 'Module'
-> IO ()
setupMessage' verbosity msg pkgid cname mb_insts = withFrozenCallStack $ do
noticeDoc verbosity $
case mb_insts of
Just insts | not (null insts) ->
hang (msg_doc <+> text "instantiated with") 2
(vcat [ pretty k <+> text "=" <+> pretty v
| (k,v) <- insts ]) $$
for_doc
_ ->
msg_doc <+> for_doc
where
msg_doc = text msg <+> text (showComponentName cname)
for_doc = text "for" <+> pretty pkgid <<>> text ".."