From 5adb71fb9add555ac161ebf745e5ac104fe3f847 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Sat, 13 Feb 2016 00:03:02 -0800 Subject: [PATCH] php: simplify installation --- build.yaml | 28 + config.m4 | 533 ++++++++++ package.xml | 984 ++++++++++++++++++ templates/config.m4.template | 30 + templates/package.xml.template | 159 +++ test/distrib/php/distribtest.php | 13 + test/distrib/php/run_distrib_test.sh | 39 + .../distribtest/php_jessie_x64/Dockerfile | 32 + .../grpc_artifact_linux_x64/Dockerfile | 7 + tools/run_tests/artifact_targets.py | 21 +- tools/run_tests/build_artifact_php.sh | 40 + tools/run_tests/build_package_php.sh | 36 + tools/run_tests/distribtest_targets.py | 31 +- tools/run_tests/package_targets.py | 20 +- 14 files changed, 1970 insertions(+), 3 deletions(-) create mode 100644 config.m4 create mode 100644 package.xml create mode 100644 templates/config.m4.template create mode 100644 templates/package.xml.template create mode 100644 test/distrib/php/distribtest.php create mode 100755 test/distrib/php/run_distrib_test.sh create mode 100644 tools/dockerfile/distribtest/php_jessie_x64/Dockerfile create mode 100755 tools/run_tests/build_artifact_php.sh create mode 100755 tools/run_tests/build_package_php.sh diff --git a/build.yaml b/build.yaml index 625c7ab46f1..b16cb162d4d 100644 --- a/build.yaml +++ b/build.yaml @@ -2815,6 +2815,34 @@ node_modules: - src/node/ext/server.cc - src/node/ext/server_credentials.cc - src/node/ext/timeval.cc +php_config_m4: + deps: + - grpc + - gpr + - boringssl + - z + headers: + - src/php/ext/grpc/byte_buffer.h + - src/php/ext/grpc/call.h + - src/php/ext/grpc/call_credentials.h + - src/php/ext/grpc/channel.h + - src/php/ext/grpc/channel_credentials.h + - src/php/ext/grpc/completion_queue.h + - src/php/ext/grpc/php_grpc.h + - src/php/ext/grpc/server.h + - src/php/ext/grpc/server_credentials.h + - src/php/ext/grpc/timeval.h + src: + - src/php/ext/grpc/byte_buffer.c + - src/php/ext/grpc/call.c + - src/php/ext/grpc/call_credentials.c + - src/php/ext/grpc/channel.c + - src/php/ext/grpc/channel_credentials.c + - src/php/ext/grpc/completion_queue.c + - src/php/ext/grpc/php_grpc.c + - src/php/ext/grpc/server.c + - src/php/ext/grpc/server_credentials.c + - src/php/ext/grpc/timeval.c python_dependencies: deps: - grpc diff --git a/config.m4 b/config.m4 new file mode 100644 index 00000000000..6d04add8e94 --- /dev/null +++ b/config.m4 @@ -0,0 +1,533 @@ +PHP_ARG_ENABLE(grpc, whether to enable grpc support, +[ --enable-grpc Enable grpc support]) + +if test "$PHP_GRPC" != "no"; then + dnl Write more examples of tests here... + + dnl # --with-grpc -> add include path + PHP_ADD_INCLUDE(../../grpc/include) + PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc) + PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include) + + PHP_ADD_LIBRARY(pthread) + + PHP_NEW_EXTENSION(grpc, + src/php/ext/grpc/byte_buffer.c \ + src/php/ext/grpc/call.c \ + src/php/ext/grpc/call_credentials.c \ + src/php/ext/grpc/channel.c \ + src/php/ext/grpc/channel_credentials.c \ + src/php/ext/grpc/completion_queue.c \ + src/php/ext/grpc/php_grpc.c \ + src/php/ext/grpc/server.c \ + src/php/ext/grpc/server_credentials.c \ + src/php/ext/grpc/timeval.c \ + src/core/profiling/basic_timers.c \ + src/core/profiling/stap_timers.c \ + src/core/support/alloc.c \ + src/core/support/avl.c \ + src/core/support/cmdline.c \ + src/core/support/cpu_iphone.c \ + src/core/support/cpu_linux.c \ + src/core/support/cpu_posix.c \ + src/core/support/cpu_windows.c \ + src/core/support/env_linux.c \ + src/core/support/env_posix.c \ + src/core/support/env_win32.c \ + src/core/support/file.c \ + src/core/support/file_posix.c \ + src/core/support/file_win32.c \ + src/core/support/histogram.c \ + src/core/support/host_port.c \ + src/core/support/log.c \ + src/core/support/log_android.c \ + src/core/support/log_linux.c \ + src/core/support/log_posix.c \ + src/core/support/log_win32.c \ + src/core/support/murmur_hash.c \ + src/core/support/slice.c \ + src/core/support/slice_buffer.c \ + src/core/support/stack_lockfree.c \ + src/core/support/string.c \ + src/core/support/string_posix.c \ + src/core/support/string_win32.c \ + src/core/support/subprocess_posix.c \ + src/core/support/subprocess_windows.c \ + src/core/support/sync.c \ + src/core/support/sync_posix.c \ + src/core/support/sync_win32.c \ + src/core/support/thd.c \ + src/core/support/thd_posix.c \ + src/core/support/thd_win32.c \ + src/core/support/time.c \ + src/core/support/time_posix.c \ + src/core/support/time_precise.c \ + src/core/support/time_win32.c \ + src/core/support/tls_pthread.c \ + src/core/support/wrap_memcpy.c \ + src/core/httpcli/httpcli_security_connector.c \ + src/core/security/base64.c \ + src/core/security/client_auth_filter.c \ + src/core/security/credentials.c \ + src/core/security/credentials_metadata.c \ + src/core/security/credentials_posix.c \ + src/core/security/credentials_win32.c \ + src/core/security/google_default_credentials.c \ + src/core/security/handshake.c \ + src/core/security/json_token.c \ + src/core/security/jwt_verifier.c \ + src/core/security/secure_endpoint.c \ + src/core/security/security_connector.c \ + src/core/security/security_context.c \ + src/core/security/server_auth_filter.c \ + src/core/security/server_secure_chttp2.c \ + src/core/surface/init_secure.c \ + src/core/surface/secure_channel_create.c \ + src/core/tsi/fake_transport_security.c \ + src/core/tsi/ssl_transport_security.c \ + src/core/tsi/transport_security.c \ + src/core/census/grpc_context.c \ + src/core/census/grpc_filter.c \ + src/core/channel/channel_args.c \ + src/core/channel/channel_stack.c \ + src/core/channel/client_channel.c \ + src/core/channel/client_uchannel.c \ + src/core/channel/compress_filter.c \ + src/core/channel/connected_channel.c \ + src/core/channel/http_client_filter.c \ + src/core/channel/http_server_filter.c \ + src/core/channel/subchannel_call_holder.c \ + src/core/client_config/client_config.c \ + src/core/client_config/connector.c \ + src/core/client_config/default_initial_connect_string.c \ + src/core/client_config/initial_connect_string.c \ + src/core/client_config/lb_policies/pick_first.c \ + src/core/client_config/lb_policies/round_robin.c \ + src/core/client_config/lb_policy.c \ + src/core/client_config/lb_policy_factory.c \ + src/core/client_config/lb_policy_registry.c \ + src/core/client_config/resolver.c \ + src/core/client_config/resolver_factory.c \ + src/core/client_config/resolver_registry.c \ + src/core/client_config/resolvers/dns_resolver.c \ + src/core/client_config/resolvers/sockaddr_resolver.c \ + src/core/client_config/subchannel.c \ + src/core/client_config/subchannel_factory.c \ + src/core/client_config/uri_parser.c \ + src/core/compression/algorithm.c \ + src/core/compression/message_compress.c \ + src/core/debug/trace.c \ + src/core/httpcli/format_request.c \ + src/core/httpcli/httpcli.c \ + src/core/httpcli/parser.c \ + src/core/iomgr/closure.c \ + src/core/iomgr/endpoint.c \ + src/core/iomgr/endpoint_pair_posix.c \ + src/core/iomgr/endpoint_pair_windows.c \ + src/core/iomgr/exec_ctx.c \ + src/core/iomgr/executor.c \ + src/core/iomgr/fd_posix.c \ + src/core/iomgr/iocp_windows.c \ + src/core/iomgr/iomgr.c \ + src/core/iomgr/iomgr_posix.c \ + src/core/iomgr/iomgr_windows.c \ + src/core/iomgr/pollset_multipoller_with_epoll.c \ + src/core/iomgr/pollset_multipoller_with_poll_posix.c \ + src/core/iomgr/pollset_posix.c \ + src/core/iomgr/pollset_set_posix.c \ + src/core/iomgr/pollset_set_windows.c \ + src/core/iomgr/pollset_windows.c \ + src/core/iomgr/resolve_address_posix.c \ + src/core/iomgr/resolve_address_windows.c \ + src/core/iomgr/sockaddr_utils.c \ + src/core/iomgr/socket_utils_common_posix.c \ + src/core/iomgr/socket_utils_linux.c \ + src/core/iomgr/socket_utils_posix.c \ + src/core/iomgr/socket_windows.c \ + src/core/iomgr/tcp_client_posix.c \ + src/core/iomgr/tcp_client_windows.c \ + src/core/iomgr/tcp_posix.c \ + src/core/iomgr/tcp_server_posix.c \ + src/core/iomgr/tcp_server_windows.c \ + src/core/iomgr/tcp_windows.c \ + src/core/iomgr/time_averaged_stats.c \ + src/core/iomgr/timer.c \ + src/core/iomgr/timer_heap.c \ + src/core/iomgr/udp_server.c \ + src/core/iomgr/wakeup_fd_eventfd.c \ + src/core/iomgr/wakeup_fd_nospecial.c \ + src/core/iomgr/wakeup_fd_pipe.c \ + src/core/iomgr/wakeup_fd_posix.c \ + src/core/iomgr/workqueue_posix.c \ + src/core/iomgr/workqueue_windows.c \ + src/core/json/json.c \ + src/core/json/json_reader.c \ + src/core/json/json_string.c \ + src/core/json/json_writer.c \ + src/core/surface/alarm.c \ + src/core/surface/api_trace.c \ + src/core/surface/byte_buffer.c \ + src/core/surface/byte_buffer_reader.c \ + src/core/surface/call.c \ + src/core/surface/call_details.c \ + src/core/surface/call_log_batch.c \ + src/core/surface/channel.c \ + src/core/surface/channel_connectivity.c \ + src/core/surface/channel_create.c \ + src/core/surface/channel_ping.c \ + src/core/surface/completion_queue.c \ + src/core/surface/event_string.c \ + src/core/surface/init.c \ + src/core/surface/lame_client.c \ + src/core/surface/metadata_array.c \ + src/core/surface/server.c \ + src/core/surface/server_chttp2.c \ + src/core/surface/server_create.c \ + src/core/surface/validate_metadata.c \ + src/core/surface/version.c \ + src/core/transport/byte_stream.c \ + src/core/transport/chttp2/alpn.c \ + src/core/transport/chttp2/bin_encoder.c \ + src/core/transport/chttp2/frame_data.c \ + src/core/transport/chttp2/frame_goaway.c \ + src/core/transport/chttp2/frame_ping.c \ + src/core/transport/chttp2/frame_rst_stream.c \ + src/core/transport/chttp2/frame_settings.c \ + src/core/transport/chttp2/frame_window_update.c \ + src/core/transport/chttp2/hpack_encoder.c \ + src/core/transport/chttp2/hpack_parser.c \ + src/core/transport/chttp2/hpack_table.c \ + src/core/transport/chttp2/huffsyms.c \ + src/core/transport/chttp2/incoming_metadata.c \ + src/core/transport/chttp2/parsing.c \ + src/core/transport/chttp2/status_conversion.c \ + src/core/transport/chttp2/stream_lists.c \ + src/core/transport/chttp2/stream_map.c \ + src/core/transport/chttp2/timeout_encoding.c \ + src/core/transport/chttp2/varint.c \ + src/core/transport/chttp2/writing.c \ + src/core/transport/chttp2_transport.c \ + src/core/transport/connectivity_state.c \ + src/core/transport/metadata.c \ + src/core/transport/metadata_batch.c \ + src/core/transport/static_metadata.c \ + src/core/transport/transport.c \ + src/core/transport/transport_op_string.c \ + src/core/census/context.c \ + src/core/census/initialize.c \ + src/core/census/operation.c \ + src/core/census/placeholders.c \ + src/core/census/tracing.c \ + src/boringssl/err_data.c \ + third_party/boringssl/crypto/aes/aes.c \ + third_party/boringssl/crypto/aes/mode_wrappers.c \ + third_party/boringssl/crypto/asn1/a_bitstr.c \ + third_party/boringssl/crypto/asn1/a_bool.c \ + third_party/boringssl/crypto/asn1/a_bytes.c \ + third_party/boringssl/crypto/asn1/a_d2i_fp.c \ + third_party/boringssl/crypto/asn1/a_dup.c \ + third_party/boringssl/crypto/asn1/a_enum.c \ + third_party/boringssl/crypto/asn1/a_gentm.c \ + third_party/boringssl/crypto/asn1/a_i2d_fp.c \ + third_party/boringssl/crypto/asn1/a_int.c \ + third_party/boringssl/crypto/asn1/a_mbstr.c \ + third_party/boringssl/crypto/asn1/a_object.c \ + third_party/boringssl/crypto/asn1/a_octet.c \ + third_party/boringssl/crypto/asn1/a_print.c \ + third_party/boringssl/crypto/asn1/a_strnid.c \ + third_party/boringssl/crypto/asn1/a_time.c \ + third_party/boringssl/crypto/asn1/a_type.c \ + third_party/boringssl/crypto/asn1/a_utctm.c \ + third_party/boringssl/crypto/asn1/a_utf8.c \ + third_party/boringssl/crypto/asn1/asn1_lib.c \ + third_party/boringssl/crypto/asn1/asn1_par.c \ + third_party/boringssl/crypto/asn1/asn_pack.c \ + third_party/boringssl/crypto/asn1/bio_asn1.c \ + third_party/boringssl/crypto/asn1/bio_ndef.c \ + third_party/boringssl/crypto/asn1/f_enum.c \ + third_party/boringssl/crypto/asn1/f_int.c \ + third_party/boringssl/crypto/asn1/f_string.c \ + third_party/boringssl/crypto/asn1/t_bitst.c \ + third_party/boringssl/crypto/asn1/t_pkey.c \ + third_party/boringssl/crypto/asn1/tasn_dec.c \ + third_party/boringssl/crypto/asn1/tasn_enc.c \ + third_party/boringssl/crypto/asn1/tasn_fre.c \ + third_party/boringssl/crypto/asn1/tasn_new.c \ + third_party/boringssl/crypto/asn1/tasn_prn.c \ + third_party/boringssl/crypto/asn1/tasn_typ.c \ + third_party/boringssl/crypto/asn1/tasn_utl.c \ + third_party/boringssl/crypto/asn1/x_bignum.c \ + third_party/boringssl/crypto/asn1/x_long.c \ + third_party/boringssl/crypto/base64/base64.c \ + third_party/boringssl/crypto/bio/bio.c \ + third_party/boringssl/crypto/bio/bio_mem.c \ + third_party/boringssl/crypto/bio/buffer.c \ + third_party/boringssl/crypto/bio/connect.c \ + third_party/boringssl/crypto/bio/fd.c \ + third_party/boringssl/crypto/bio/file.c \ + third_party/boringssl/crypto/bio/hexdump.c \ + third_party/boringssl/crypto/bio/pair.c \ + third_party/boringssl/crypto/bio/printf.c \ + third_party/boringssl/crypto/bio/socket.c \ + third_party/boringssl/crypto/bio/socket_helper.c \ + third_party/boringssl/crypto/bn/add.c \ + third_party/boringssl/crypto/bn/asm/x86_64-gcc.c \ + third_party/boringssl/crypto/bn/bn.c \ + third_party/boringssl/crypto/bn/bn_asn1.c \ + third_party/boringssl/crypto/bn/cmp.c \ + third_party/boringssl/crypto/bn/convert.c \ + third_party/boringssl/crypto/bn/ctx.c \ + third_party/boringssl/crypto/bn/div.c \ + third_party/boringssl/crypto/bn/exponentiation.c \ + third_party/boringssl/crypto/bn/gcd.c \ + third_party/boringssl/crypto/bn/generic.c \ + third_party/boringssl/crypto/bn/kronecker.c \ + third_party/boringssl/crypto/bn/montgomery.c \ + third_party/boringssl/crypto/bn/mul.c \ + third_party/boringssl/crypto/bn/prime.c \ + third_party/boringssl/crypto/bn/random.c \ + third_party/boringssl/crypto/bn/rsaz_exp.c \ + third_party/boringssl/crypto/bn/shift.c \ + third_party/boringssl/crypto/bn/sqrt.c \ + third_party/boringssl/crypto/buf/buf.c \ + third_party/boringssl/crypto/bytestring/ber.c \ + third_party/boringssl/crypto/bytestring/cbb.c \ + third_party/boringssl/crypto/bytestring/cbs.c \ + third_party/boringssl/crypto/chacha/chacha_generic.c \ + third_party/boringssl/crypto/chacha/chacha_vec.c \ + third_party/boringssl/crypto/cipher/aead.c \ + third_party/boringssl/crypto/cipher/cipher.c \ + third_party/boringssl/crypto/cipher/derive_key.c \ + third_party/boringssl/crypto/cipher/e_aes.c \ + third_party/boringssl/crypto/cipher/e_chacha20poly1305.c \ + third_party/boringssl/crypto/cipher/e_des.c \ + third_party/boringssl/crypto/cipher/e_null.c \ + third_party/boringssl/crypto/cipher/e_rc2.c \ + third_party/boringssl/crypto/cipher/e_rc4.c \ + third_party/boringssl/crypto/cipher/e_ssl3.c \ + third_party/boringssl/crypto/cipher/e_tls.c \ + third_party/boringssl/crypto/cipher/tls_cbc.c \ + third_party/boringssl/crypto/cmac/cmac.c \ + third_party/boringssl/crypto/conf/conf.c \ + third_party/boringssl/crypto/cpu-arm.c \ + third_party/boringssl/crypto/cpu-intel.c \ + third_party/boringssl/crypto/crypto.c \ + third_party/boringssl/crypto/curve25519/curve25519.c \ + third_party/boringssl/crypto/des/des.c \ + third_party/boringssl/crypto/dh/check.c \ + third_party/boringssl/crypto/dh/dh.c \ + third_party/boringssl/crypto/dh/dh_asn1.c \ + third_party/boringssl/crypto/dh/params.c \ + third_party/boringssl/crypto/digest/digest.c \ + third_party/boringssl/crypto/digest/digests.c \ + third_party/boringssl/crypto/directory_posix.c \ + third_party/boringssl/crypto/directory_win.c \ + third_party/boringssl/crypto/dsa/dsa.c \ + third_party/boringssl/crypto/dsa/dsa_asn1.c \ + third_party/boringssl/crypto/ec/ec.c \ + third_party/boringssl/crypto/ec/ec_asn1.c \ + third_party/boringssl/crypto/ec/ec_key.c \ + third_party/boringssl/crypto/ec/ec_montgomery.c \ + third_party/boringssl/crypto/ec/oct.c \ + third_party/boringssl/crypto/ec/p224-64.c \ + third_party/boringssl/crypto/ec/p256-64.c \ + third_party/boringssl/crypto/ec/p256-x86_64.c \ + third_party/boringssl/crypto/ec/simple.c \ + third_party/boringssl/crypto/ec/util-64.c \ + third_party/boringssl/crypto/ec/wnaf.c \ + third_party/boringssl/crypto/ecdh/ecdh.c \ + third_party/boringssl/crypto/ecdsa/ecdsa.c \ + third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c \ + third_party/boringssl/crypto/engine/engine.c \ + third_party/boringssl/crypto/err/err.c \ + third_party/boringssl/crypto/evp/algorithm.c \ + third_party/boringssl/crypto/evp/digestsign.c \ + third_party/boringssl/crypto/evp/evp.c \ + third_party/boringssl/crypto/evp/evp_asn1.c \ + third_party/boringssl/crypto/evp/evp_ctx.c \ + third_party/boringssl/crypto/evp/p_dsa_asn1.c \ + third_party/boringssl/crypto/evp/p_ec.c \ + third_party/boringssl/crypto/evp/p_ec_asn1.c \ + third_party/boringssl/crypto/evp/p_rsa.c \ + third_party/boringssl/crypto/evp/p_rsa_asn1.c \ + third_party/boringssl/crypto/evp/pbkdf.c \ + third_party/boringssl/crypto/evp/sign.c \ + third_party/boringssl/crypto/ex_data.c \ + third_party/boringssl/crypto/hkdf/hkdf.c \ + third_party/boringssl/crypto/hmac/hmac.c \ + third_party/boringssl/crypto/lhash/lhash.c \ + third_party/boringssl/crypto/md4/md4.c \ + third_party/boringssl/crypto/md5/md5.c \ + third_party/boringssl/crypto/mem.c \ + third_party/boringssl/crypto/modes/cbc.c \ + third_party/boringssl/crypto/modes/cfb.c \ + third_party/boringssl/crypto/modes/ctr.c \ + third_party/boringssl/crypto/modes/gcm.c \ + third_party/boringssl/crypto/modes/ofb.c \ + third_party/boringssl/crypto/obj/obj.c \ + third_party/boringssl/crypto/obj/obj_xref.c \ + third_party/boringssl/crypto/pem/pem_all.c \ + third_party/boringssl/crypto/pem/pem_info.c \ + third_party/boringssl/crypto/pem/pem_lib.c \ + third_party/boringssl/crypto/pem/pem_oth.c \ + third_party/boringssl/crypto/pem/pem_pk8.c \ + third_party/boringssl/crypto/pem/pem_pkey.c \ + third_party/boringssl/crypto/pem/pem_x509.c \ + third_party/boringssl/crypto/pem/pem_xaux.c \ + third_party/boringssl/crypto/pkcs8/p5_pbe.c \ + third_party/boringssl/crypto/pkcs8/p5_pbev2.c \ + third_party/boringssl/crypto/pkcs8/p8_pkey.c \ + third_party/boringssl/crypto/pkcs8/pkcs8.c \ + third_party/boringssl/crypto/poly1305/poly1305.c \ + third_party/boringssl/crypto/poly1305/poly1305_arm.c \ + third_party/boringssl/crypto/poly1305/poly1305_vec.c \ + third_party/boringssl/crypto/rand/rand.c \ + third_party/boringssl/crypto/rand/urandom.c \ + third_party/boringssl/crypto/rand/windows.c \ + third_party/boringssl/crypto/rc4/rc4.c \ + third_party/boringssl/crypto/refcount_c11.c \ + third_party/boringssl/crypto/refcount_lock.c \ + third_party/boringssl/crypto/rsa/blinding.c \ + third_party/boringssl/crypto/rsa/padding.c \ + third_party/boringssl/crypto/rsa/rsa.c \ + third_party/boringssl/crypto/rsa/rsa_asn1.c \ + third_party/boringssl/crypto/rsa/rsa_impl.c \ + third_party/boringssl/crypto/sha/sha1.c \ + third_party/boringssl/crypto/sha/sha256.c \ + third_party/boringssl/crypto/sha/sha512.c \ + third_party/boringssl/crypto/stack/stack.c \ + third_party/boringssl/crypto/thread.c \ + third_party/boringssl/crypto/thread_none.c \ + third_party/boringssl/crypto/thread_pthread.c \ + third_party/boringssl/crypto/thread_win.c \ + third_party/boringssl/crypto/time_support.c \ + third_party/boringssl/crypto/x509/a_digest.c \ + third_party/boringssl/crypto/x509/a_sign.c \ + third_party/boringssl/crypto/x509/a_strex.c \ + third_party/boringssl/crypto/x509/a_verify.c \ + third_party/boringssl/crypto/x509/asn1_gen.c \ + third_party/boringssl/crypto/x509/by_dir.c \ + third_party/boringssl/crypto/x509/by_file.c \ + third_party/boringssl/crypto/x509/i2d_pr.c \ + third_party/boringssl/crypto/x509/pkcs7.c \ + third_party/boringssl/crypto/x509/t_crl.c \ + third_party/boringssl/crypto/x509/t_req.c \ + third_party/boringssl/crypto/x509/t_x509.c \ + third_party/boringssl/crypto/x509/t_x509a.c \ + third_party/boringssl/crypto/x509/x509.c \ + third_party/boringssl/crypto/x509/x509_att.c \ + third_party/boringssl/crypto/x509/x509_cmp.c \ + third_party/boringssl/crypto/x509/x509_d2.c \ + third_party/boringssl/crypto/x509/x509_def.c \ + third_party/boringssl/crypto/x509/x509_ext.c \ + third_party/boringssl/crypto/x509/x509_lu.c \ + third_party/boringssl/crypto/x509/x509_obj.c \ + third_party/boringssl/crypto/x509/x509_r2x.c \ + third_party/boringssl/crypto/x509/x509_req.c \ + third_party/boringssl/crypto/x509/x509_set.c \ + third_party/boringssl/crypto/x509/x509_trs.c \ + third_party/boringssl/crypto/x509/x509_txt.c \ + third_party/boringssl/crypto/x509/x509_v3.c \ + third_party/boringssl/crypto/x509/x509_vfy.c \ + third_party/boringssl/crypto/x509/x509_vpm.c \ + third_party/boringssl/crypto/x509/x509cset.c \ + third_party/boringssl/crypto/x509/x509name.c \ + third_party/boringssl/crypto/x509/x509rset.c \ + third_party/boringssl/crypto/x509/x509spki.c \ + third_party/boringssl/crypto/x509/x509type.c \ + third_party/boringssl/crypto/x509/x_algor.c \ + third_party/boringssl/crypto/x509/x_all.c \ + third_party/boringssl/crypto/x509/x_attrib.c \ + third_party/boringssl/crypto/x509/x_crl.c \ + third_party/boringssl/crypto/x509/x_exten.c \ + third_party/boringssl/crypto/x509/x_info.c \ + third_party/boringssl/crypto/x509/x_name.c \ + third_party/boringssl/crypto/x509/x_pkey.c \ + third_party/boringssl/crypto/x509/x_pubkey.c \ + third_party/boringssl/crypto/x509/x_req.c \ + third_party/boringssl/crypto/x509/x_sig.c \ + third_party/boringssl/crypto/x509/x_spki.c \ + third_party/boringssl/crypto/x509/x_val.c \ + third_party/boringssl/crypto/x509/x_x509.c \ + third_party/boringssl/crypto/x509/x_x509a.c \ + third_party/boringssl/crypto/x509v3/pcy_cache.c \ + third_party/boringssl/crypto/x509v3/pcy_data.c \ + third_party/boringssl/crypto/x509v3/pcy_lib.c \ + third_party/boringssl/crypto/x509v3/pcy_map.c \ + third_party/boringssl/crypto/x509v3/pcy_node.c \ + third_party/boringssl/crypto/x509v3/pcy_tree.c \ + third_party/boringssl/crypto/x509v3/v3_akey.c \ + third_party/boringssl/crypto/x509v3/v3_akeya.c \ + third_party/boringssl/crypto/x509v3/v3_alt.c \ + third_party/boringssl/crypto/x509v3/v3_bcons.c \ + third_party/boringssl/crypto/x509v3/v3_bitst.c \ + third_party/boringssl/crypto/x509v3/v3_conf.c \ + third_party/boringssl/crypto/x509v3/v3_cpols.c \ + third_party/boringssl/crypto/x509v3/v3_crld.c \ + third_party/boringssl/crypto/x509v3/v3_enum.c \ + third_party/boringssl/crypto/x509v3/v3_extku.c \ + third_party/boringssl/crypto/x509v3/v3_genn.c \ + third_party/boringssl/crypto/x509v3/v3_ia5.c \ + third_party/boringssl/crypto/x509v3/v3_info.c \ + third_party/boringssl/crypto/x509v3/v3_int.c \ + third_party/boringssl/crypto/x509v3/v3_lib.c \ + third_party/boringssl/crypto/x509v3/v3_ncons.c \ + third_party/boringssl/crypto/x509v3/v3_pci.c \ + third_party/boringssl/crypto/x509v3/v3_pcia.c \ + third_party/boringssl/crypto/x509v3/v3_pcons.c \ + third_party/boringssl/crypto/x509v3/v3_pku.c \ + third_party/boringssl/crypto/x509v3/v3_pmaps.c \ + third_party/boringssl/crypto/x509v3/v3_prn.c \ + third_party/boringssl/crypto/x509v3/v3_purp.c \ + third_party/boringssl/crypto/x509v3/v3_skey.c \ + third_party/boringssl/crypto/x509v3/v3_sxnet.c \ + third_party/boringssl/crypto/x509v3/v3_utl.c \ + third_party/boringssl/ssl/custom_extensions.c \ + third_party/boringssl/ssl/d1_both.c \ + third_party/boringssl/ssl/d1_clnt.c \ + third_party/boringssl/ssl/d1_lib.c \ + third_party/boringssl/ssl/d1_meth.c \ + third_party/boringssl/ssl/d1_pkt.c \ + third_party/boringssl/ssl/d1_srtp.c \ + third_party/boringssl/ssl/d1_srvr.c \ + third_party/boringssl/ssl/dtls_record.c \ + third_party/boringssl/ssl/pqueue/pqueue.c \ + third_party/boringssl/ssl/s3_both.c \ + third_party/boringssl/ssl/s3_clnt.c \ + third_party/boringssl/ssl/s3_enc.c \ + third_party/boringssl/ssl/s3_lib.c \ + third_party/boringssl/ssl/s3_meth.c \ + third_party/boringssl/ssl/s3_pkt.c \ + third_party/boringssl/ssl/s3_srvr.c \ + third_party/boringssl/ssl/ssl_aead_ctx.c \ + third_party/boringssl/ssl/ssl_asn1.c \ + third_party/boringssl/ssl/ssl_buffer.c \ + third_party/boringssl/ssl/ssl_cert.c \ + third_party/boringssl/ssl/ssl_cipher.c \ + third_party/boringssl/ssl/ssl_file.c \ + third_party/boringssl/ssl/ssl_lib.c \ + third_party/boringssl/ssl/ssl_rsa.c \ + third_party/boringssl/ssl/ssl_session.c \ + third_party/boringssl/ssl/ssl_stat.c \ + third_party/boringssl/ssl/t1_enc.c \ + third_party/boringssl/ssl/t1_lib.c \ + third_party/boringssl/ssl/tls_record.c \ + third_party/zlib/adler32.c \ + third_party/zlib/compress.c \ + third_party/zlib/crc32.c \ + third_party/zlib/deflate.c \ + third_party/zlib/gzclose.c \ + third_party/zlib/gzlib.c \ + third_party/zlib/gzread.c \ + third_party/zlib/gzwrite.c \ + third_party/zlib/infback.c \ + third_party/zlib/inffast.c \ + third_party/zlib/inflate.c \ + third_party/zlib/inftrees.c \ + third_party/zlib/trees.c \ + third_party/zlib/uncompr.c \ + third_party/zlib/zutil.c \ + , $ext_shared, , -Wall -Werror -std=c11 \ + -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \ + -D_HAS_EXCEPTIONS=0 -DNOMINMAX) +fi diff --git a/package.xml b/package.xml new file mode 100644 index 00000000000..0d672512e5c --- /dev/null +++ b/package.xml @@ -0,0 +1,984 @@ + + + grpc + pecl.php.net + A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. + Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages. + + Stanley Cheung + stanleycheung + grpc-packages@google.com + yes + + 2016-02-12 + + + 0.8.0 + 0.8.0 + + + beta + beta + + BSD + +- Simplify gRPC PHP installation #4517 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.5.0 + + + 1.4.0 + + + + grpc + + + + + 0.5.0 + 0.5.0 + + + alpha + alpha + + 2015-06-16 + BSD + +First alpha release + + + + + 0.5.1 + 0.5.1 + + + alpha + alpha + + 2015-07-09 + BSD + +Update to wrap gRPC C Core version 0.10.0 + + + + + 0.6.0 + 0.6.0 + + + beta + beta + + 2015-09-24 + BSD + +- support per message compression disable +- expose per-call host override option +- expose connectivity API +- expose channel target and call peer +- add user-agent +- update to wrap gRPC C core library beta version 0.11.0 + + + + + 0.6.1 + 0.6.0 + + + beta + beta + + 2015-10-21 + BSD + +- fixed undefined constant fatal error when run with apache/nginx #2275 + + + + + 0.7.0 + 0.7.0 + + + beta + beta + + 2016-01-13 + BSD + +- Breaking change to Credentials class (removed) #3765 +- Replaced by ChannelCredentials and CallCredentials class #3765 +- New plugin based metadata auth API #4394 +- Explicit ChannelCredentials::createInsecure() call + + + + + 0.8.0 + 0.8.0 + + + beta + beta + + 2016-02-12 + BSD + +- Simplify gRPC PHP installation #4517 + + + + diff --git a/templates/config.m4.template b/templates/config.m4.template new file mode 100644 index 00000000000..1f8c1d9ca49 --- /dev/null +++ b/templates/config.m4.template @@ -0,0 +1,30 @@ +%YAML 1.2 +--- | + PHP_ARG_ENABLE(grpc, whether to enable grpc support, + [ --enable-grpc Enable grpc support]) + + if test "$PHP_GRPC" != "no"; then + dnl Write more examples of tests here... + + dnl # --with-grpc -> add include path + PHP_ADD_INCLUDE(../../grpc/include) + PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc) + PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include) + + PHP_ADD_LIBRARY(pthread) + + PHP_NEW_EXTENSION(grpc, + % for source in php_config_m4.src: + ${source} ${"\\"} + % endfor + % for lib in libs: + % if lib.name in php_config_m4.get('deps', []): + % for source in lib.src: + ${source} ${"\\"} + % endfor + % endif + % endfor + , $ext_shared, , -Wall -Werror -std=c11 ${"\\"} + -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN ${"\\"} + -D_HAS_EXCEPTIONS=0 -DNOMINMAX) + fi diff --git a/templates/package.xml.template b/templates/package.xml.template new file mode 100644 index 00000000000..455b002e64a --- /dev/null +++ b/templates/package.xml.template @@ -0,0 +1,159 @@ +%YAML 1.2 +--- | + + + grpc + pecl.php.net + A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. + Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages. + + Stanley Cheung + stanleycheung + grpc-packages@google.com + yes + + <%! from time import strftime %>${"%Y-%m-%d" | strftime} + + + 0.8.0 + 0.8.0 + + + beta + beta + + BSD + + - Simplify gRPC PHP installation #4517 + + + + + + + + % for source in php_config_m4.src + php_config_m4.headers: + + % endfor + % for lib in libs: + % if lib.name in php_config_m4.get('deps', []): + % for source in lib.get('public_headers', []) + lib.headers + lib.src: + + % endfor + % endif + % endfor + + + + + + 5.5.0 + + + 1.4.0 + + + + grpc + + + + + 0.5.0 + 0.5.0 + + + alpha + alpha + + 2015-06-16 + BSD + + First alpha release + + + + + 0.5.1 + 0.5.1 + + + alpha + alpha + + 2015-07-09 + BSD + + Update to wrap gRPC C Core version 0.10.0 + + + + + 0.6.0 + 0.6.0 + + + beta + beta + + 2015-09-24 + BSD + + - support per message compression disable + - expose per-call host override option + - expose connectivity API + - expose channel target and call peer + - add user-agent + - update to wrap gRPC C core library beta version 0.11.0 + + + + + 0.6.1 + 0.6.0 + + + beta + beta + + 2015-10-21 + BSD + + - fixed undefined constant fatal error when run with apache/nginx #2275 + + + + + 0.7.0 + 0.7.0 + + + beta + beta + + 2016-01-13 + BSD + + - Breaking change to Credentials class (removed) #3765 + - Replaced by ChannelCredentials and CallCredentials class #3765 + - New plugin based metadata auth API #4394 + - Explicit ChannelCredentials::createInsecure() call + + + + + 0.8.0 + 0.8.0 + + + beta + beta + + ${"%Y-%m-%d" | strftime} + BSD + + - Simplify gRPC PHP installation #4517 + + + + diff --git a/test/distrib/php/distribtest.php b/test/distrib/php/distribtest.php new file mode 100644 index 00000000000..318c6f9cf08 --- /dev/null +++ b/test/distrib/php/distribtest.php @@ -0,0 +1,13 @@ + Grpc\ChannelCredentials::createInsecure() +]); + +$deadline = Grpc\Timeval::infFuture(); +$call = new Grpc\Call($channel, + 'dummy_method', + $deadline); + +$call->cancel(); +$channel->close(); diff --git a/test/distrib/php/run_distrib_test.sh b/test/distrib/php/run_distrib_test.sh new file mode 100755 index 00000000000..43b28d84290 --- /dev/null +++ b/test/distrib/php/run_distrib_test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +cd $(dirname $0) + +cp -r $EXTERNAL_GIT_ROOT/input_artifacts/grpc-php.tgz . + +pecl install grpc-php.tgz + +php -d extension=grpc.so -d max_execution_time=300 distribtest.php diff --git a/tools/dockerfile/distribtest/php_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/php_jessie_x64/Dockerfile new file mode 100644 index 00000000000..d5d3fd626ff --- /dev/null +++ b/tools/dockerfile/distribtest/php_jessie_x64/Dockerfile @@ -0,0 +1,32 @@ +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FROM debian:jessie + +RUN apt-get update && apt-get install -y php5 php5-dev php-pear phpunit diff --git a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile index 41dc4274541..d048b725c85 100644 --- a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile @@ -91,6 +91,13 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +################## +# PHP dependencies + +RUN apt-get update && apt-get install -y \ + php5 php5-dev php-pear phpunit + RUN mkdir /var/local/jenkins # Define the default command. diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index f84d35580bb..15a1e2a681f 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -241,6 +241,23 @@ class NodeExtArtifact: ['tools/run_tests/build_artifact_node.sh', self.gyp_arch]) +class PHPExtArtifact: + """Builds PHP native extension""" + + def __init__(self, platform, arch): + self.name = 'php_ext_{0}_{1}'.format(platform, arch) + self.platform = platform + self.arch = arch + self.labels = ['artifact', 'php', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), + 'tools/run_tests/build_artifact_php.sh') class ProtocArtifact: """Builds protoc and protoc-plugin artifacts""" @@ -299,4 +316,6 @@ def targets(): PythonArtifact('windows', 'x64'), RubyArtifact('linux', 'x86'), RubyArtifact('linux', 'x64'), - RubyArtifact('macos', 'x64')]) + RubyArtifact('macos', 'x64'), + PHPExtArtifact('linux', 'x64'), + PHPExtArtifact('macos', 'x64')]) diff --git a/tools/run_tests/build_artifact_php.sh b/tools/run_tests/build_artifact_php.sh new file mode 100755 index 00000000000..50bf0ea8215 --- /dev/null +++ b/tools/run_tests/build_artifact_php.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PHP_TARGET_ARCH=$1 +set -ex + +cd $(dirname $0)/../.. + +mkdir -p artifacts + +pear package + +cp -r grpc-*.tgz artifacts/grpc-php.tgz diff --git a/tools/run_tests/build_package_php.sh b/tools/run_tests/build_package_php.sh new file mode 100755 index 00000000000..56e3319ed9b --- /dev/null +++ b/tools/run_tests/build_package_php.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +cd $(dirname $0)/../.. + +mkdir -p artifacts/ +cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=php,platform={windows,linux,macos}/artifacts/* artifacts/ || true diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index 261f44bc6d9..0c02344d90d 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -198,6 +198,33 @@ class RubyDistribTest(object): return self.name +class PHPDistribTest(object): + """Tests PHP package""" + + def __init__(self, platform, arch, docker_suffix): + self.name = 'php_%s_%s_%s' % (platform, arch, docker_suffix) + self.platform = platform + self.arch = arch + self.docker_suffix = docker_suffix + self.labels = ['distribtest', 'php', platform, arch, docker_suffix] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if not self.platform == 'linux': + raise Exception("Not supported yet.") + + return create_docker_jobspec(self.name, + 'tools/dockerfile/distribtest/php_%s_%s' % ( + self.docker_suffix, + self.arch), + 'test/distrib/php/run_distrib_test.sh') + + def __str__(self): + return self.name + + def targets(): """Gets list of supported targets""" return [CSharpDistribTest('linux', 'x64', 'wheezy'), @@ -241,7 +268,9 @@ def targets(): RubyDistribTest('linux', 'x64', 'ubuntu1510'), RubyDistribTest('linux', 'x64', 'ubuntu1604'), NodeDistribTest('macos', 'x64', None, '4'), - NodeDistribTest('linux', 'x86', 'jessie', '4') + NodeDistribTest('macos', 'x64', None, '5'), + NodeDistribTest('linux', 'x86', 'jessie', '4'), + PHPDistribTest('linux', 'x64', 'jessie'), ] + [ NodeDistribTest('linux', 'x64', os, version) for os in ('wheezy', 'jessie', 'ubuntu1204', 'ubuntu1404', diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/package_targets.py index 4ca8279f1bf..8aee1f86dec 100644 --- a/tools/run_tests/package_targets.py +++ b/tools/run_tests/package_targets.py @@ -139,9 +139,27 @@ class PythonPackage: 'tools/run_tests/build_package_python.sh') +class PHPPackage: + """Builds PHP PECL package and collects precompiled package""" + + def __init__(self): + self.name = 'php_package' + self.labels = ['package', 'php', 'linux'] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_x64', + 'tools/run_tests/build_package_php.sh') + + def targets(): """Gets list of supported targets""" return [CSharpPackage(), NodePackage(), RubyPackage(), - PythonPackage()] + PythonPackage(), + PHPPackage()]