Skip to content

Commit 624cf54

Browse files
committed
make sdists for other components available
It sometimes happens that we have API updates that don't violate PVP (e.g. adding things). In those cases, we need the newer version available and cabal-install's dependencies must be updated to require it instead of the bootlib. We stash these in an environment file, since that's the most convenient way to get them into cabal-install's build environment.
1 parent ed46e24 commit 624cf54

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/check-sdist.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ jobs:
4242

4343
- uses: actions/checkout@v4
4444

45-
- name: Make sdist
46-
run: cabal sdist cabal-install
45+
- name: Make sdists
46+
run: |
47+
cabal sdist Cabal-syntax Cabal Cabal-hooks cabal-install-solver cabal-install
4748
4849
- name: Install from sdist
4950
run: |
@@ -58,10 +59,21 @@ jobs:
5859
# dunno if this will ever be extended to freebsd, but grep -q is a gnu-ism
5960
if ghc-pkg --global --simple-output list Cabal | grep "^Cabal-$ver\\." >/dev/null; then
6061
# sigh, someone broke installing from tarballs
61-
rm -rf cabal*.project Cabal Cabal-syntax cabal-install-solver cabal-install
62+
rm -rf cabal*.project Cabal-syntax Cabal Cabal-hooks cabal-install-solver cabal-install
6263
tar xfz "$sdist"
63-
cd "cabal-install-$cbl"*
64-
cabal install
64+
cd "cabal-install-"*
65+
# note: we have all the sdists in a `package-env` because sometimes we need
66+
# to allow newer versions of Cabal (for example, we're using something that
67+
# was added to Cabal, which isn't a PVP violation as long as the old API is
68+
# still there). This _shouldn't_ affect how the solver picks versions, so it
69+
# should be safe.
70+
here="$(pwd)"
71+
for pkg in Cabal-syntax Cabal Cabal-hooks cabal-install-solver; do
72+
# need ver suffix here so e.g. Cabal-* doesn't match Cabal-syntax-*
73+
tar xfz "$here/../dist-newstyle/sdist/$pkg-$ver"*".tar.gz"
74+
(cd "$pkg-$ver"*; cabal install --lib --package-env="$here")
75+
done
76+
cabal install --package-env="$here"
6577
else
6678
echo No matching bootlib Cabal version to test against.
6779
exit 0

0 commit comments

Comments
 (0)