Skip to content

Commit 83ea33a

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 cee9ea4 commit 83ea33a

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/check-sdist.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ 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
48+
ls dist-newstyle/sdist
4749
4850
- name: Install from sdist
4951
run: |
@@ -58,10 +60,21 @@ jobs:
5860
# dunno if this will ever be extended to freebsd, but grep -q is a gnu-ism
5961
if ghc-pkg --global --simple-output list Cabal | grep "^Cabal-$ver\\." >/dev/null; then
6062
# sigh, someone broke installing from tarballs
61-
rm -rf cabal*.project Cabal Cabal-syntax cabal-install-solver cabal-install
63+
rm -rf cabal*.project Cabal-syntax Cabal Cabal-hooks cabal-install-solver cabal-install
6264
tar xfz "$sdist"
63-
cd "cabal-install-$cbl"*
64-
cabal install
65+
cd "cabal-install-"*
66+
# note: we have all the sdists in a `package-env` because sometimes we need
67+
# to allow newer versions of Cabal (for example, we're using something that
68+
# was added to Cabal, which isn't a PVP violation as long as the old API is
69+
# still there). This _shouldn't_ affect how the solver picks versions, so it
70+
# should be safe.
71+
here="$(pwd)"
72+
for pkg in Cabal-syntax Cabal Cabal-hooks cabal-install-solver; do
73+
# need ver suffix here so e.g. Cabal-* doesn't match Cabal-syntax-*
74+
tar xfz "$here/dist-newstyle/sdist/$pkg-$ver"*".tar.gz"
75+
(cd "$pkg-$ver"*; cabal install --lib --package-env="$here")
76+
done
77+
cabal install --package-env="$here"
6578
else
6679
echo No matching bootlib Cabal version to test against.
6780
exit 0

0 commit comments

Comments
 (0)