Skip to content

Instantly share code, notes, and snippets.

@wchargin
Last active February 25, 2025 16:12
Show Gist options
  • Save wchargin/ae49e838b5537eb391af306d8a42c03c to your computer and use it in GitHub Desktop.
Save wchargin/ae49e838b5537eb391af306d8a42c03c to your computer and use it in GitHub Desktop.
protobuf.dart#952 reproducer #2
syntax = "proto3";
message Anomaly {
}
syntax = "proto3";
import "element_a.proto";
message Anomaly {
ElementA a = 1;
}
FROM dart:3.7.0-sdk
RUN apt-get update
RUN apt-get install -y protobuf-compiler libprotobuf-dev
RUN dart pub global activate protoc_plugin
syntax = "proto3";
message ElementA {}
syntax = "proto3";
message ElementB {}
syntax = "proto3";
message ElementC {}
syntax = "proto3";
import "element_b.proto";
import "element_c.proto";
message HasBC {
ElementB b = 1;
ElementC c = 2;
}
#!/bin/sh
set -eu
dart --version
dart pub global list
protoc --version
printf '\n'
rm -rf out1 out2
mkdir out1 out2
protoc -I/src --dart_out=out1 /src/anomaly1.proto /src/has_bc.proto
protoc -I/src --dart_out=out2 /src/anomaly2.proto /src/has_bc.proto
diff -u out1/has_bc.pb.dart out2/has_bc.pb.dart
#!/bin/sh
set -eu
image=dart-protobuf-952
docker build -t "${image}" .
docker run --rm -v "$PWD:/src:ro" "${image}" /src/repro.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment