Skip to content

Commit 7496c1c

Browse files
authored
Some fixes to diff-plans script (#1097)
Minor fixes. - GHC version was hard-coded - some values were repeated because of missing `uniq` (and some `sort`s)
2 parents 07ac087 + 2688dbb commit 7496c1c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
id: setup-haskell
9090
with:
9191
cabal-version: "3.10.1.0"
92-
ghc-version: "9.2.8"
92+
ghc-version: "9.6.5"
9393

9494
- name: Install base libraries
9595
uses: input-output-hk/actions/base@latest

scripts/release/cabal-plan-diff.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@ version for packages. It is fine if dependencies disappear.
2727
... running cabal-plan-diff.sh ...
2828
"
2929

30+
3031
if [[ -d "./tmp" ]]; then
3132
rm -r tmp
3233
fi
3334
mkdir tmp
34-
trap rm -r ./tmp EXIT
35+
trap 'rm -r ./tmp' EXIT
3536

3637
cabal update &>/dev/null
3738

3839
cabal build all --dry-run --minimize-conflict-set
3940
cp ./dist-newstyle/cache/plan.json ./tmp/plan-full.json
4041

42+
GHC_BIN=$(readlink $(which ghc) | rev | cut -d'/' -f1 | rev)
43+
4144
touch ./tmp/cabal.project
4245
echo -e "
4346
repository cardano-haskell-packages
@@ -55,7 +58,7 @@ index-state:
5558
, hackage.haskell.org HEAD
5659
, cardano-haskell-packages HEAD
5760
58-
with-compiler: ghc-9.2.8
61+
with-compiler: $GHC_BIN
5962
6063
tests: False
6164
benchmarks: False
@@ -86,20 +89,20 @@ else
8689

8790
awk '/^$/{f=!f} f' ./tmp/the-diff-1 > ./tmp/the-diff
8891

89-
grep "^\-" ./tmp/the-diff | cut -d'-' -f2- | cut -d' ' -f1 > ./tmp/only-in-full
90-
grep "^\+" ./tmp/the-diff | cut -d'+' -f2- | cut -d' ' -f1 > ./tmp/only-in-libs
92+
grep "^\-" ./tmp/the-diff | cut -d'-' -f2- | cut -d' ' -f1 | sort -u > ./tmp/only-in-full
93+
grep "^\+" ./tmp/the-diff | cut -d'+' -f2- | cut -d' ' -f1 | sort -u > ./tmp/only-in-libs
9194

9295
echo -e "\n=== TEST ONLY DEPENDENCIES"
9396

94-
comm -2 -3 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | uniq) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | uniq)
97+
comm -2 -3 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | sort -u) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | sort -u)
9598

9699
echo -e "\n=== FULL-BUILD ONLY DEPENDENCIES"
97100

98-
comm -1 -3 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | uniq) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | uniq)
101+
comm -1 -3 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | sort -u) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | sort -u)
99102

100103
echo -e "\n=== VERSION BUMPS FROM TESTS ONLY TO FULL-BUILD"
101104

102-
common=$(comm -1 -2 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | uniq) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | uniq))
105+
common=$(comm -1 -2 <(rev ./tmp/only-in-full | cut -d'-' -f2- | rev | sort -u) <(rev ./tmp/only-in-libs | cut -d'-' -f2- | rev | sort -u))
103106

104107
major=()
105108
minor=()

0 commit comments

Comments
 (0)