daml/sdk/daml-lf/archive/proto_breaking_changes.sh
Remy c31940581e
Decode package type signature for LF1 (#18940)
We pick the proto for LF1 and the Decoder from main-2.x
We drop withing the decoder the expression decoding and and fill the AST with EUnit where an expression is needed.

Test will be done in a subsequent PR.
2024-04-05 09:27:47 +02:00

25 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -e
readonly arch_dir="daml-lf/archive"
readonly buf_exe="$1"
readonly version="$2"
readonly config_file="${arch_dir}/buf.yaml"
readonly stable_dir="${arch_dir}/src/stable/protobuf"
readonly main_dir="${arch_dir}/src/main/protobuf"
# We check the stable directory contains exactly 2 proto files
find "${stable_dir}/" -follow -name '*.proto' | wc -l | grep -x 2
# We check the main directory contains exactly 2 proto files
find "${main_dir}/" -follow -name '*.proto' | wc -l | grep -x 3
# This is kind of broken, it only checks daml_lf_2.proto for wire compatibility between main and
# stable. The daml_lf.proto files are ignored because main/.../daml_lf.proto and
# sable/.../daml_lf.proto declare different proto packages. This is not too bad because
# daml_lf.proto is mostly empty while daml_lf_2.proto contains most of the definitions, but it
# is not ideal.
"${buf_exe}" breaking --config "${config_file}" --against "${stable_dir}" "${main_dir}"