From 4c5454b86db0aa9e97d06e39d969edf5d9ac7c1f Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Thu, 11 Aug 2022 20:53:29 -0700 Subject: [PATCH] Fixing php proto generation script to work properly during sync (#10395) --- php/generate_descriptor_protos.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/php/generate_descriptor_protos.sh b/php/generate_descriptor_protos.sh index 2239312ab5d54..1a600abc63925 100755 --- a/php/generate_descriptor_protos.sh +++ b/php/generate_descriptor_protos.sh @@ -5,10 +5,10 @@ set -e -PROTOC=protoc +PROTOC=$(realpath protoc) if [ ! -f $PROTOC ]; then bazel build -c opt //:protoc - PROTOC=bazel-bin/protoc + PROTOC=$(realpath bazel-bin/protoc) fi if test ! -e src/google/protobuf/stubs/common.h; then @@ -19,16 +19,17 @@ __EOF__ exit 1 fi -$PROTOC --php_out=internal:php/src google/protobuf/descriptor.proto -$PROTOC --php_out=internal_generate_c_wkt:php/src \ - src/google/protobuf/any.proto \ - src/google/protobuf/api.proto \ - src/google/protobuf/duration.proto \ - src/google/protobuf/empty.proto \ - src/google/protobuf/field_mask.proto \ - src/google/protobuf/source_context.proto \ - src/google/protobuf/struct.proto \ - src/google/protobuf/type.proto \ - src/google/protobuf/timestamp.proto \ - src/google/protobuf/wrappers.proto +pushd src +$PROTOC --php_out=internal:../php/src google/protobuf/descriptor.proto +$PROTOC --php_out=internal_generate_c_wkt:../php/src \ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/type.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/wrappers.proto popd