From 9f65f8c1fa462da2dc1444d01df924df637800c9 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Thu, 14 Nov 2024 13:38:00 -0600 Subject: [PATCH] gateway: ensure llb digests are deterministic when sent by frontends This ensures different valid protobuf serializations that are sent by frontends will be rewritten into digests that are normalized for the buildkit solver. The most recent example of this is that older frontends would generate protobuf with gogo and the newer buildkit is using the google protobuf library. These produce different serializations and cause the solver to think that identical operations are actually different. Signed-off-by: Jonathan A. Sternberg --- solver/llbsolver/testdata/gogoproto.data | Bin 0 -> 284 bytes solver/llbsolver/vertex.go | 43 ++++------------ solver/llbsolver/vertex_test.go | 61 +++++++++++++++++++++++ solver/pb/ops.go | 4 +- 4 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 solver/llbsolver/testdata/gogoproto.data diff --git a/solver/llbsolver/testdata/gogoproto.data b/solver/llbsolver/testdata/gogoproto.data new file mode 100644 index 0000000000000000000000000000000000000000..3c93d3626c76f3c25d4b338299f5209e7676b277 GIT binary patch literal 284 zcmb`>Jr2S!3_xM#jEvj?8prvmdjW(vg=5E10jku31h