From e93e5f99f70e8689c99290fb372c87a5258ae597 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Wed, 23 Sep 2026 16:52:56 +0200 Subject: [PATCH] chore(haskell): bump toolchain and dependency bounds of the utxorpc package gen/haskell: - Raise build-depends to the versions in Stackage LTS 24 and the only ones that build on GHC 9.10+: base >= 4.18, proto-lens >= 0.7.1.7, proto-lens-protobuf-types >= 0.7.2.3, proto-lens-runtime >= 0.7.0.8 (now with an upper bound < 0.8). - Move stack.yaml from lts-22.7 to lts-24.60 (GHC 9.10.3). All previous extra-deps are in the snapshot, so the list is gone; lock regenerated. CI: - Rename setup-protoc-hololens to setup-proto-lens-protoc. - Build the plugin with GHC 9.12.4 and install proto-lens-protoc 0.9.0.1 (was 9.6.4 / 0.8.0.0). Both are action inputs. GHC 9.14 does not solve yet: proto-lens-protoc pins lens-family < 2.2, which needs containers < 0.8. - Key the cabal store cache on the GHC and plugin versions instead of a constant, and key the stack cache on gen/haskell/stack.yaml.lock; the old path hashed nothing. --- .github/actions/publish-haskell/action.yml | 4 +- .../setup-proto-lens-protoc/action.yml | 39 +++++++++++++++ .../actions/setup-protoc-hololens/action.yml | 29 ------------ .github/workflows/generate.yml | 2 +- gen/haskell/stack.yaml | 9 +--- gen/haskell/stack.yaml.lock | 47 +++---------------- gen/haskell/utxorpc.cabal | 9 ++-- 7 files changed, 54 insertions(+), 85 deletions(-) create mode 100644 .github/actions/setup-proto-lens-protoc/action.yml delete mode 100644 .github/actions/setup-protoc-hololens/action.yml diff --git a/.github/actions/publish-haskell/action.yml b/.github/actions/publish-haskell/action.yml index 882804e..7a0e344 100644 --- a/.github/actions/publish-haskell/action.yml +++ b/.github/actions/publish-haskell/action.yml @@ -26,7 +26,7 @@ runs: path: | ${{ steps.setup-hs.outputs.stack-root }} codegen/haskell/.stack-work - key: stack-${{ hashFiles('stack.yaml.lock') }} + key: stack-${{ hashFiles('gen/haskell/stack.yaml.lock') }} restore-keys: stack- - name: Install protoc @@ -107,4 +107,4 @@ runs: path: | ${{ steps.setup-hs.outputs.stack-root }} codegen/haskell/.stack-work - key: stack-${{ hashFiles('stack.yaml.lock') }} + key: stack-${{ hashFiles('gen/haskell/stack.yaml.lock') }} diff --git a/.github/actions/setup-proto-lens-protoc/action.yml b/.github/actions/setup-proto-lens-protoc/action.yml new file mode 100644 index 0000000..a4ebd50 --- /dev/null +++ b/.github/actions/setup-proto-lens-protoc/action.yml @@ -0,0 +1,39 @@ +name: "setup proto-lens-protoc" +description: "setup proto-lens-protoc plugin (Haskell codegen)" + +inputs: + ghc-version: + description: GHC used to build the plugin (9.14 does not solve yet, lens-family needs containers < 0.8) + required: false + default: 9.12.4 + proto-lens-protoc-version: + description: proto-lens-protoc version installed from Hackage + required: false + default: 0.9.0.1 + +runs: + using: "composite" + steps: + - name: Setup Haskell + id: setup-hs + uses: haskell-actions/setup@v2 + with: + ghc-version: ${{ inputs.ghc-version }} + + - name: Restore Cabal cache + uses: actions/cache/restore@v4 + id: restore-cabal-store + with: + path: ${{ steps.setup-hs.outputs.cabal-store }} + key: cabal-store-ghc-${{ inputs.ghc-version }}-proto-lens-protoc-${{ inputs.proto-lens-protoc-version }} + + - name: Install Haskell plugin from Hackage + shell: bash + run: cabal install proto-lens-protoc-${{ inputs.proto-lens-protoc-version }} + + - name: Save Cabal cache + if: steps.restore-cabal-store.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: ${{ steps.setup-hs.outputs.cabal-store }} + key: cabal-store-ghc-${{ inputs.ghc-version }}-proto-lens-protoc-${{ inputs.proto-lens-protoc-version }} diff --git a/.github/actions/setup-protoc-hololens/action.yml b/.github/actions/setup-protoc-hololens/action.yml deleted file mode 100644 index de1bef0..0000000 --- a/.github/actions/setup-protoc-hololens/action.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "setup protoc hololens" -description: "setup protoc hololens plugin (Haskell)" - -runs: - using: "composite" - steps: - - name: Setup Haskell - id: setup-hs - uses: haskell-actions/setup@v2 - with: - ghc-version: 9.6.4 - - - name: Restore Cabal cache - uses: actions/cache/restore@v4 - id: restore-cabal-store - with: - path: ${{ steps.setup-hs.outputs.cabal-store }} - key: cabal-store - - - name: Install Haskell plugin from Hackage - shell: bash - run: cabal install proto-lens-protoc-0.8.0.0 - - - name: Save Cabal cache - if: steps.restore-cabal-store.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: ${{ steps.setup-hs.outputs.cabal-store }} - key: cabal-store diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index a9b975c..bbd8e0f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -56,7 +56,7 @@ jobs: version: 0.4.0 - name: Setup Haskell - uses: ./.github/actions/setup-protoc-hololens + uses: ./.github/actions/setup-proto-lens-protoc - name: Install Buf from npm run: npm install -g @bufbuild/buf diff --git a/gen/haskell/stack.yaml b/gen/haskell/stack.yaml index 9f71939..b50955a 100644 --- a/gen/haskell/stack.yaml +++ b/gen/haskell/stack.yaml @@ -1,9 +1,2 @@ -resolver: lts-22.7 +resolver: lts-24.60 packages: [.] - -extra-deps: - - proto-lens-protobuf-types-0.7.2.0 - - proto-lens-protoc-0.8.0.0 - - proto-lens-setup-0.4.0.7 - - ghc-source-gen-0.4.4.1 - - proto-lens-runtime-0.7.0.6 diff --git a/gen/haskell/stack.yaml.lock b/gen/haskell/stack.yaml.lock index b88fa48..7c6dfbe 100644 --- a/gen/haskell/stack.yaml.lock +++ b/gen/haskell/stack.yaml.lock @@ -1,47 +1,12 @@ # This file was autogenerated by Stack. # You should not edit this file by hand. # For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files +# https://docs.haskellstack.org/en/stable/topics/lock_files -packages: -- completed: - hackage: proto-lens-protobuf-types-0.7.2.0@sha256:78f9d686aca30f1b569145b6c0d7a20f8398b5f5de601ec1c3d07ac644ea1e66,3814 - pantry-tree: - sha256: dff5f67b3a437cf18a2901942be472364f7a64b8cac071f1467b227b3cc878ff - size: 1333 - original: - hackage: proto-lens-protobuf-types-0.7.2.0 -- completed: - hackage: proto-lens-protoc-0.8.0.0@sha256:a146ee8c9af9e445ab05651e688deb0ff849357d320657d6cea5be33cb54b960,2235 - pantry-tree: - sha256: 1921e9b8f86658c8c0e73a73ee91c69e0c35d3051a241a1a06cb822ecd2f0347 - size: 1218 - original: - hackage: proto-lens-protoc-0.8.0.0 -- completed: - hackage: proto-lens-setup-0.4.0.7@sha256:acca0b04e033ea0a017f809d91a7dbc942e025ec6bc275fa21647352722c74cc,3122 - pantry-tree: - sha256: 1f3d343a5c132bb7bfe9dd15a2092ed5bc1673bf321647defdac797bdb8d8280 - size: 235 - original: - hackage: proto-lens-setup-0.4.0.7 -- completed: - hackage: ghc-source-gen-0.4.4.1@sha256:6029be9ea2fae3ddb3a7a7e132df9b09aa32dc0cf3e31a5cd3d420d220823078,4236 - pantry-tree: - sha256: e807f86b86f66bbadf1d930487e4dfe40d121fd39b66e0fce16f9374992f31b4 - size: 3250 - original: - hackage: ghc-source-gen-0.4.4.1 -- completed: - hackage: proto-lens-runtime-0.7.0.6@sha256:b12a2731424121ea337c5705088dd4c83db461c280c962749298503f2643ca24,3057 - pantry-tree: - sha256: f70c8ec121f62902b4ce98f41dbb54126c81a2ff07c85df313782ae334463d00 - size: 168 - original: - hackage: proto-lens-runtime-0.7.0.6 +packages: [] snapshots: - completed: - sha256: 7b975b104cb3dbf0c297dfd01f936a4d2ee523241dd0b1ae960522b833fe3027 - size: 714096 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/7.yaml - original: lts-22.7 + sha256: 5851c9fcb30f350a167916d8873bdd53c149ce73ceb9637f4caba0cd554c2af6 + size: 732465 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/60.yaml + original: lts-24.60 diff --git a/gen/haskell/utxorpc.cabal b/gen/haskell/utxorpc.cabal index befcefc..10faaef 100644 --- a/gen/haskell/utxorpc.cabal +++ b/gen/haskell/utxorpc.cabal @@ -21,6 +21,7 @@ build-type: Simple author: TxPipe maintainer: TxPipe Dominic Mayhew + Mateusz Galazyn extra-source-files: README.md @@ -69,9 +70,9 @@ library hs-source-dirs: . build-depends: - base >=4.7 && <5 - , proto-lens >= 0.7.1 && < 0.8 + base >= 4.18 && < 5 + , proto-lens >= 0.7.1.7 && < 0.8 -- >= 0.7.2 required as it contains support for `FieldMask` - , proto-lens-protobuf-types >= 0.7.2 && < 0.8 - , proto-lens-runtime >= 0.7.0.6 + , proto-lens-protobuf-types >= 0.7.2.3 && < 0.8 + , proto-lens-runtime >= 0.7.0.8 && < 0.8 default-language: Haskell2010