Skip to content

Commit 20b8a65

Browse files
authored
Merge pull request #2258 from tweag/cb/fix-ghc-update
Fix Update GHC workflow
2 parents 2d5301f + 82a5e74 commit 20b8a65

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/update-ghc.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Update GHC
22
on:
33
schedule:
44
# run weekly on Thursday
5-
- cron: '0 15 * * THU'
5+
- cron: '0 15 * * THU'
66
workflow_dispatch: # allows manual triggering
7-
87
jobs:
98
update_ghc:
109
name: GHC ${{ matrix.ghc }} Update
@@ -27,7 +26,9 @@ jobs:
2726
nix_path: nixpkgs=nixpkgs/default.nix
2827
- name: Fetch updates
2928
id: ghc_update
30-
run: nix shell 'nixpkgs#bazel-buildtools' 'nixpkgs#python3' --command python .github/update-ghc.py ${{ matrix.ghc }}
29+
run: |-
30+
nix-shell -p 'bazel-buildtools' 'python3.withPackages (ps: [ps.packaging])' --run \
31+
'python .github/update-ghc.py ${{ matrix.ghc }}'
3132
- name: Create Pull Request
3233
if: steps.ghc_update.outputs.latest != ''
3334
uses: peter-evans/create-pull-request@v7

haskell/gen_ghc_bindist.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import json
99
import sys
1010
from urllib.request import urlopen
11-
from distutils.version import StrictVersion
11+
from packaging.version import Version
1212

1313
# Sometimes bindists have errors and are updated by new bindists.
1414
# This dict is used to keep a version -> corrected_version mapping.
@@ -158,7 +158,7 @@ def fetch_bindists(grab):
158158

159159
ghc_versions = {
160160
version: ghc_bindists[version]
161-
for version in sorted(ghc_bindists.keys(), key=StrictVersion)
161+
for version in sorted(ghc_bindists.keys(), key=Version)
162162
}
163163

164164
json_file.truncate(0)

0 commit comments

Comments
 (0)