Skip to content

Commit 73da39d

Browse files
committed
Remove proto-lens SRP
1 parent 779f539 commit 73da39d

9 files changed

Lines changed: 37 additions & 82 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
project: cardano-api
2+
pr: 1185
3+
kind:
4+
- breaking
5+
description: |
6+
Bump `cardano-ledger-core` lower bound to `>=1.20` (required by `ouroboros-consensus-3.0.x`).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project: cardano-api
2+
pr: 1185
3+
kind:
4+
- maintenance
5+
description: |
6+
Remove `proto-lens` source-repository-package now that `proto-lens >=0.7.1.7` is on Hackage.
7+
Pin `buf` to `v1.66.1` in the dev shell and CI workflow.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project: cardano-rpc
2+
pr: 1185
3+
kind:
4+
- maintenance
5+
description: |
6+
Bump `proto-lens` lower bound to `>=0.7.1.7`.
7+
Regenerate `gen/**` with `buf v1.66.1`.

.github/workflows/haskell.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ jobs:
9797

9898
- name: '[Linux] [cardano-rpc] Install buf tool'
9999
if: runner.os == 'Linux'
100+
# buf version must match the one in flake.nix dev shell (buf is not
101+
# backwards-compatible across minor versions for `buf generate` output).
100102
run: |
101-
curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-Linux-x86_64" -o "/usr/local/bin/buf"
103+
curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.66.1/buf-Linux-x86_64" -o "/usr/local/bin/buf"
102104
chmod +x /usr/local/bin/buf
103105
104106
- name: '[Linux] [cardano-rpc] Install proto-lens-protoc tool'

cabal.project

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ repository cardano-haskell-packages
1313
-- See CONTRIBUTING for information about these, including some Nix commands
1414
-- you need to run if you change them
1515
index-state:
16-
, hackage.haskell.org 2026-03-22T23:17:32Z
17-
, cardano-haskell-packages 2026-04-09T12:05:18Z
16+
, hackage.haskell.org 2026-04-17T09:20:55Z
17+
, cardano-haskell-packages 2026-04-15T11:20:53Z
1818

1919
active-repositories:
2020
, :rest
@@ -144,27 +144,6 @@ if arch(wasm32)
144144
package digest
145145
flags: -pkg-config
146146

147-
-- GHC 9.12 and later support in master
148-
if impl(ghc >= 9.12)
149-
source-repository-package
150-
type: git
151-
location: https://github.com/google/proto-lens
152-
tag: 9b41fe0e10e8fe12ec508a3b361d0f0c2217c491
153-
--sha256: sha256-ruTbbUKVJBPANnm6puigtp26mmiVDd0jMpLfJLOuUpU=
154-
subdir:
155-
discrimination-ieee754
156-
proto-lens-arbitrary
157-
proto-lens-benchmarks
158-
proto-lens-discrimination
159-
proto-lens-optparse
160-
proto-lens-protobuf-types
161-
proto-lens-protoc
162-
proto-lens-runtime
163-
proto-lens-setup
164-
proto-lens-tests-dep
165-
proto-lens-tests
166-
proto-lens
167-
168147
-- IMPORTANT
169148
-- Do NOT add more source-repository-package stanzas here unless they are strictly
170149
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

cardano-api/cardano-api.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ library
146146
cardano-ledger-binary >=1.6,
147147
cardano-ledger-byron >=1.2,
148148
cardano-ledger-conway >=1.19,
149-
cardano-ledger-core >=1.17 && <1.20,
149+
cardano-ledger-core >=1.20,
150150
cardano-ledger-dijkstra >=0.1,
151151
cardano-ledger-mary >=1.8,
152152
cardano-ledger-shelley >=1.16,

cardano-rpc/cardano-rpc.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ library
8787
generic-data,
8888
grapesy,
8989
grpc-spec,
90-
proto-lens >=0.7.1.6,
90+
proto-lens >=0.7.1.7,
9191
proto-lens-protobuf-types,
9292
random,
9393
rio,

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,6 @@
123123

124124
# We use cabalProject' to ensure we don't build the plan for
125125
# all systems.
126-
# Fetch proto-lens with submodules and fix symlinks for plan and build phases
127-
protoLensSrc = nixpkgs.fetchgit {
128-
url = "https://github.com/google/proto-lens";
129-
rev = "9b41fe0e10e8fe12ec508a3b361d0f0c2217c491";
130-
sha256 = "sha256-ruTbbUKVJBPANnm6puigtp26mmiVDd0jMpLfJLOuUpU=";
131-
fetchSubmodules = true;
132-
};
133-
fixProtoLensSrc = nixpkgs.runCommand "proto-lens-fixed" {} ''
134-
mkdir -p $out
135-
cp -a ${protoLensSrc}/. $out/
136-
chmod -R +w $out
137-
# Fix proto-lens-imports symlink in proto-lens
138-
rm -rf $out/proto-lens/proto-lens-imports/google
139-
cp -r ${protoLensSrc}/google/protobuf/src/google $out/proto-lens/proto-lens-imports/
140-
# Fix proto-src symlink in proto-lens-protobuf-types
141-
rm -rf $out/proto-lens-protobuf-types/proto-src
142-
cp -r ${protoLensSrc}/google/protobuf/src $out/proto-lens-protobuf-types/proto-src
143-
chmod -R -w $out
144-
'';
145-
146126
cabalProject = nixpkgs.haskell-nix.cabalProject' ({config, ...}: {
147127
src = ./.;
148128
name = "cardano-api";
@@ -160,7 +140,6 @@
160140
#
161141
inputMap = {
162142
"https://chap.intersectmbo.org/" = inputs.CHaP;
163-
"https://github.com/google/proto-lens/9b41fe0e10e8fe12ec508a3b361d0f0c2217c491" = protoLensSrc;
164143
};
165144
# Also currently needed to make `nix flake lock --update-input CHaP` work.
166145
cabalProjectLocal = ''
@@ -209,7 +188,10 @@
209188
shellcheck
210189
snappy
211190
protobuf
212-
buf
191+
# buf version must match `.github/workflows/haskell.yml` (buf is
192+
# not backwards-compatible across minor versions for
193+
# `buf generate` output).
194+
unstable.buf
213195
blst
214196
inputs.cardano-dev.packages.${system}.herald
215197
(writeShellScriptBin "haskell-language-server-wrapper" ''exec haskell-language-server "$@"'')
@@ -228,34 +210,6 @@
228210
# package customizations as needed. Where cabal.project is not
229211
# specific enough, or doesn't allow setting these.
230212
modules = [
231-
# TODO remove this module when removing proto-lens SRP
232-
# Override proto-lens source to use fixed symlinks (inputMap provides the fixed
233-
# source for plan computation; this module provides it for the build phase)
234-
({
235-
lib,
236-
config,
237-
...
238-
}: let
239-
protoLensPackages = [
240-
"proto-lens"
241-
"proto-lens-arbitrary"
242-
"proto-lens-discrimination"
243-
"proto-lens-optparse"
244-
"proto-lens-protobuf-types"
245-
"proto-lens-protoc"
246-
"proto-lens-runtime"
247-
"proto-lens-setup"
248-
"proto-lens-tests-dep"
249-
"proto-lens-tests"
250-
"discrimination-ieee754"
251-
"proto-lens-benchmarks"
252-
];
253-
in {
254-
packages =
255-
lib.genAttrs
256-
(builtins.filter (p: config.packages ? ${p}) protoLensPackages)
257-
(p: {src = lib.mkForce (fixProtoLensSrc + "/${p}");});
258-
})
259213
({...}: {
260214
packages.cardano-api = {
261215
configureFlags = ["--ghc-option=-Werror"];

0 commit comments

Comments
 (0)