This repository can be used to
- Download all repositories of a Stackage snapshot
- Parse all
cabal.project
files in the repositories of the snapshot and see whether it succeeds
- Python3
- A local development version of Cabal, you need to clone the repository and reference it via
cabal.project.local
. You need to reference its packagescabal-install
,cabal-install-solver
,Cabal-syntax
andCabal
Here is the cabal.project.local
I've used:
packages: ./ ../cabal/cabal-install ../cabal/cabal-install-solver ../cabal/Cabal-syntax ../cabal/Cabal
Usage: clone-stackage-snapshot.py <target_dir>
Where target_dir
is the directory to clone the repositories into.
Example: ./clone-stackage-snapshot.py ~/snapshot-stackage
The script will clone all repositories listed in a Stackage snapshot into directory ./snapshot-stackage
and log the results into file ./clone.log
It is currently hardcoded to download snapshot LTS Haskell 22.33 published on 2024-08-12.
Overwrite variable snapshot_url
in the script if you want to clone another snapshot.
Note:
The script may require git config --global url."https://".insteadOf git://
to work as lots of packages have set git://github.com
instead of http://github.com
as their source repo urls.
You can parse the project files of all projects in a directory via
cabal run parse-project-files -- <target_dir>
As printing the results to the console takes much time, pipe the outputs into a file.
Here is an example to parse all project files in directory ~/snapshot-stackage
, piping the output to parse-files.txt
:
cabal run parse-project-files -- ~/snapshot-stackage/ >> parse-files.txt
You can also parse just one project file via
cabal run parse-project-file -- <path-to-dir-containing-the-file>
Example:
cabal run parse-project-file -- ~/snapshot-stackage/aeson