app: patch Loop proto import for local proto build

Rewrite Loop's lnd proto import during proto generation so make protos
continues to work with this repo's local proto layout.

This became necessary when Loop v0.32.0-beta started shipping the
looprpc/client.proto change from upstream commit
f47b6115571f6072fe68057cb4eff30cc4fc47df
("looprpc: extend client.proto with lnrpc.OutPoint and
lnrpc.OpenChannelRequest"). That update made the downloaded Loop proto
import lnrpc/lightning.proto, while LiT stores the downloaded lnd proto
locally as proto/lnd.proto and invokes protoc with ../proto as the
import root. As a result, the downloaded Loop proto overwrote the local
compatibility fix and make protos failed with
"lnrpc/lightning.proto: File not found".

Patch the downloaded proto in build-protos.js to import lnd.proto
instead, and keep proto/loop.proto aligned with the same import path.
This is needed because changing only the checked-in proto file is not
enough: the build script re-fetches and replaces it on every run.
This commit is contained in:
Viktor Torstensson 2026-06-16 00:13:57 +02:00
parent 1903010be5
commit 650fd92259
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4

View file

@ -124,6 +124,10 @@ const sanitize = async () => {
'import "reservation.proto"',
'import "swapserverrpc/reservation.proto"',
);
content = content.replace(
'import "lnrpc/lightning.proto"',
'import "lnd.proto"',
);
await fs.writeFile(path, content);
}
};