-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Description
I noticed that the PHP xds tests (https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Agrpc%2Fcore%2Fmaster%2Flinux%2Fgrpc_xds_php) start failing after #21941 is merged.
Here's the error if I run the PHP extension build on master now:
g++ -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0
-DNOMINMAX -DGRPC_ARES=0 -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -I. -I/tmp/pear/temp/grpc
-DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserW60hNa/grpc-1.31.0dev/include
-I/tmp/pear/temp/pear-build-defaultuserW60hNa/grpc-1.31.0dev/main -I/tmp/pear/temp/grpc -I/usr/local/include/php
-I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext
-I/usr/local/include/php/ext/date/lib -I/tmp/pear/temp/grpc/include -I/tmp/pear/temp/grpc/src/core/ext/upb-generated
-I/tmp/pear/temp/grpc/src/php/ext/grpc -I/tmp/pear/temp/grpc/third_party/abseil-cpp
-I/tmp/pear/temp/grpc/third_party/address_sorting/include -I/tmp/pear/temp/grpc/third_party/boringssl-with-bazel/src/include
-I/tmp/pear/temp/grpc/third_party/upb -DHAVE_CONFIG_H -std=c++11 -fno-exceptions -fno-rtti -g -O2
-c /tmp/pear/temp/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc -fPIC -DPIC
-o src/core/ext/filters/client_channel/lb_policy/xds/.libs/cds.o
In file included from /tmp/pear/temp/grpc/src/core/ext/filters/client_channel/xds/xds_client.h:28:0,
from /tmp/pear/temp/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc:27:
/tmp/pear/temp/grpc/src/core/ext/filters/client_channel/xds/xds_api.h:31:23: fatal error: upb/def.hpp: No such file or directory
#include "upb/def.hpp"
^
compilation terminated.
Makefile:246: recipe for target 'src/core/ext/filters/client_channel/lb_policy/xds/cds.lo' failed
make: *** [src/core/ext/filters/client_channel/lb_policy/xds/cds.lo] Error 1
make: *** Waiting for unfinished jobs....
ERROR: `make' failed
I noticed that def.hpp is not part of upb public headers, so it was never pulled into this PHP package.xml file (which is the source list for all the files PHP needs to build its extension): https://github.com/grpc/grpc/blob/master/package.xml#L1716-L1735.
So I tried to manually add that def.hpp file into my package.xml file, but then I got these errors now:
src/core/ext/upb-generated/envoy/annotations/.libs/deprecation.o:(.data.rel.local+0x0): multiple definition of `envoy_annotations_deprecation_proto_upbdefinit'
src/core/ext/upb-generated/envoy/annotations/.libs/deprecation.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/annotations/.libs/resource.o:(.data.rel.local+0x0): multiple definition of `envoy_annotations_resource_proto_upbdefinit'
src/core/ext/upb-generated/envoy/annotations/.libs/resource.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/cert.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_auth_cert_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/cert.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/common.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_auth_common_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/common.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/secret.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_auth_secret_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/secret.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/tls.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_auth_tls_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/tls.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/.libs/cds.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_cds_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/.libs/cds.o:(.data.rel.local+0x0): first defined here
src/core/ext/upb-generated/envoy/api/v2/.libs/cluster.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_cluster_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/.libs/cluster.o:(.data.rel.local+0x0): first defined here
Any idea? I am not sure if we should tackle the first error first, or the second error (I am not sure if it's right to add def.hpp).
This def.hpp file comes from this PR protocolbuffers/upb#265, so it sounds like it's a right thing to do to manually include that file.
Taking one of these to dive into:
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/cert.o:(.data.rel.local+0x0): multiple definition of `envoy_api_v2_auth_cert_proto_upbdefinit'
src/core/ext/upb-generated/envoy/api/v2/auth/.libs/cert.o:(.data.rel.local+0x0): first defined here
envoy_api_v2_auth_cert_proto_upbdefinit is only found in these 2 places:
https://github.com/grpc/grpc/blob/master/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upbdefs.c#L42 and https://github.com/grpc/grpc/blob/master/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upbdefs.h#L22, and nobody else is trying to #include src/core/ext/upb-generated/envoy/api/v2/auth/cert.upbdefs.c directly. So why did it complain envoy_api_v2_auth_cert_proto_upbdefinit is defined in multiple places?
The PHP extension was built slightly differently in the regular PR tests vs here in the xds tests so maybe that's why this isn't caught when running PR tests in #21941. I can certainly look into adding that. As it stands, the xds tests for PHP is only running on master.