Skip to content

Commit

Permalink
Support build with disabled zend signals (#2886)
Browse files Browse the repository at this point in the history
I seem to have taken care about the globals, but missed zend_signal_handler_unblock.

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
  • Loading branch information
bwoebi authored Oct 14, 2024
1 parent 6751be9 commit 34bf511
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dockerfiles/verify_packages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ test_alpine_install_no_ext_curl_yes_curl_cli.sh \
@echo "################### $(@) ###################"
docker run --rm -ti -v $(shell pwd)/../../:/app --env-file $(shell pwd)/.env -e CIRCLECI --workdir=/app alpine:3.13 sh dockerfiles/verify_packages/installer/$(@)

test_alpine_zts_no_zend_signals.sh \
: global_test_dependencies
@echo "################### $(@) ###################"
docker run --rm -ti -v $(shell pwd)/../../:/app --env-file $(shell pwd)/.env -e CIRCLECI --workdir=/app dunglas/frankenphp:php8.3.12-alpine sh dockerfiles/verify_packages/installer/$(@)

test_alpine_no_libexecinfo.sh: global_test_dependencies
@echo "################### $(@) ###################"
docker run --rm -ti -v $(shell pwd)/../../:/app --env-file $(shell pwd)/.env -e CIRCLECI --workdir=/app php:7.4-cli-alpine sh dockerfiles/verify_packages/installer/$(@)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

set -e

. "$(dirname ${0})/utils.sh"

apk add libgcc

# Initially no ddtrace
assert_no_ddtrace

# Install using the php installer
version=$(cat VERSION)
php ./build/packages/datadog-setup.php --enable-profiling --php-bin php
assert_ddtrace_version "${version}"
assert_profiler_version "${version}"
assert_appsec_version "${version}"

assert_sources_path_exists
4 changes: 4 additions & 0 deletions ext/threads.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "threads.h"
#define zend_signal_globals_id zend_signal_globals_id_dummy
#define zend_signal_globals_offset zend_signal_globals_offset_dummy
#define zend_signal_handler_unblock zend_signal_handler_unblock_dummy
#include <Zend/zend.h>
#undef zend_signal_globals_id
#undef zend_signal_globals_offset
#undef zend_signal_handler_unblock
#include "ddtrace.h"

#if ZTS
Expand All @@ -18,6 +20,8 @@ extern __attribute__((weak, weak_import)) size_t zend_signal_globals_offset;
__attribute__((weak)) int zend_signal_globals_id;
__attribute__((weak)) size_t zend_signal_globals_offset;
#endif

__attribute__((weak)) void zend_signal_handler_unblock(void);
#endif

HashTable ddtrace_tls_bases; // map thread id to TSRMLS_CACHE
Expand Down

0 comments on commit 34bf511

Please sign in to comment.