Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ compile_rust.sh @Datadog/libdatadog-apm
# Release files
Cargo.lock @DataDog/apm-php @DataDog/profiling-php @Datadog/libdatadog-apm
package.xml @DataDog/apm-php @DataDog/profiling-php @Datadog/asm-php
VERSION @DataDog/apm-php @DataDog/profiling-php @Datadog/asm-php
VERSION.txt @DataDog/apm-php @DataDog/profiling-php @Datadog/asm-php
4 changes: 2 additions & 2 deletions .gitlab/append-build-id.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
if [[ "$CI_COMMIT_BRANCH" =~ "ddtrace-" ]] ; then
echo "Release branch detected; not adding git sha1 to version number."
else
version=$(cat VERSION)
version=$(cat VERSION.txt)
# if we have e.g. a beta suffix, just strip it
if [[ $version == *-* ]]; then
version=${version%-*}
Expand All @@ -26,6 +26,6 @@ else
version=$(export IFS=.; (echo "${parts[*]}"))
fi
version="$version+$githash"
echo -n "$version" > VERSION
echo -n "$version" > VERSION.txt
echo "Set version number to $version."
fi
2 changes: 1 addition & 1 deletion .gitlab/build-loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ cd loader
phpize
./configure
make clean
make -j "${MAKE_JOBS}" all ECHO_ARG="-e" CFLAGS="-std=gnu11 -O2 -g -Wall -Wextra -Werror -DPHP_DD_LIBRARY_LOADER_VERSION='\"$(cat ../VERSION)\"'"
make -j "${MAKE_JOBS}" all ECHO_ARG="-e" CFLAGS="-std=gnu11 -O2 -g -Wall -Wextra -Werror -DPHP_DD_LIBRARY_LOADER_VERSION='\"$(cat ../VERSION.txt)\"'"
cp modules/dd_library_loader.so "../dd_library_loader-$(uname -m)-${HOST_OS}.so"
2 changes: 1 addition & 1 deletion .gitlab/compile_extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target}
EXTENSION_DIR=${EXTENSION_DIR:-tmp/build_extension}
MODULES_DIR=${MODULES_DIR:-${EXTENSION_DIR}/modules}

# Generate VERSION with build id
# Generate VERSION.txt with build id
./.gitlab/append-build-id.sh

# Change PHP versions if needed
Expand Down
16 changes: 8 additions & 8 deletions .gitlab/generate-package.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
- ls -al ${CI_PROJECT_DIR:-.}/src/bridge
artifacts:
paths:
- VERSION
- VERSION.txt
- ./src/bridge/_generated*.php

<?php
Expand Down Expand Up @@ -575,7 +575,7 @@
script:
- make -j 4 <?= implode(' ', $platform['targets']) ?>

- ./tooling/bin/generate-final-artifact.sh $(<VERSION) "build/packages" "${CI_PROJECT_DIR}"
- ./tooling/bin/generate-final-artifact.sh $(<VERSION.txt) "build/packages" "${CI_PROJECT_DIR}"
- mv build/packages/ packages/
needs:
- job: "prepare code"
Expand Down Expand Up @@ -623,7 +623,7 @@
TRIPLET: "x86_64-pc-windows-msvc"
script:
- make -j 4 <?= implode(' ', $windows_build_platforms[0]['targets']), "\n" ?>
- ./tooling/bin/generate-final-artifact.sh $(<VERSION) "build/packages" "${CI_PROJECT_DIR}"
- ./tooling/bin/generate-final-artifact.sh $(<VERSION.txt) "build/packages" "${CI_PROJECT_DIR}"
- mv build/packages/ packages/
needs:
- job: "prepare code"
Expand All @@ -640,7 +640,7 @@
"package extension asan":
extends: .package_extension_base
script:
- ./tooling/bin/generate-final-artifact.sh $(<VERSION) "build/packages" "${CI_PROJECT_DIR}"
- ./tooling/bin/generate-final-artifact.sh $(<VERSION.txt) "build/packages" "${CI_PROJECT_DIR}"
- mv build/packages/ packages/
needs:
- job: "prepare code"
Expand All @@ -666,7 +666,7 @@
ARCHITECTURE: "<?= ($arch == 'amd64') ? 'x86_64' : 'aarch64' ?>"
script:
- mkdir -p build/packages tmp/
- ./tooling/bin/generate-ssi-package.sh $(<VERSION) "build/packages"
- ./tooling/bin/generate-ssi-package.sh $(<VERSION.txt) "build/packages"
- mv build/packages/ packages/
needs:
- job: "prepare code"
Expand Down Expand Up @@ -1366,8 +1366,8 @@
GIT_STRATEGY: none
script: |
set -e
VERSION="$(<VERSION)"
[[ -z "${VERSION}" ]] && echo "VERSION file is empty or not present" && exit 1
VERSION="$(<VERSION.txt)"
[[ -z "${VERSION}" ]] && echo "VERSION.txt file is empty or not present" && exit 1
cd packages/ && aws s3 cp --recursive . "s3://dd-trace-php-builds/${VERSION}/"
aws s3 cp datadog-setup.php "s3://dd-trace-php-builds/latest/"
echo "https://s3.us-east-1.amazonaws.com/dd-trace-php-builds/$(echo $VERSION | sed 's/+/%2B/')/datadog-setup.php"
Expand Down Expand Up @@ -1398,7 +1398,7 @@
if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
echo UPSTREAM_TRACER_VERSION=dev-master > upstream.env
else
echo "UPSTREAM_TRACER_VERSION=$(<VERSION)" > upstream.env
echo "UPSTREAM_TRACER_VERSION=$(<VERSION.txt)" > upstream.env
fi
- mv packages/dd-library-php-*-x86_64-linux-gnu.tar.gz dd-library-php-x86_64-linux-gnu.tar.gz
- tar -cf 'datadog-setup-x86_64-linux-gnu.tar' 'datadog-setup.php' 'dd-library-php-x86_64-linux-gnu.tar.gz'
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/generate-tracer.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function before_script_steps($with_docker_auth = false) {
- /rust/cargo/
artifacts:
paths:
- "VERSION"
- "VERSION.txt"
- "modules/"

"compile extension: debug-zts-asan":
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/package-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ make -d -j "${MAKE_JOBS}" "${TARGET}"
cat package_sha256sums

# Spot-check shape of library name
version=$(cat VERSION)
version=$(cat VERSION.txt)
filename="dd-library-php-${version}-x86_64-linux-gnu.tar.gz"
if ! [[ -f "build/packages/$filename" ]] ; then
echo "Expected file 'build/packages/$filename' to exist!"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ASSUME_COMPILED := ${DD_TRACE_ASSUME_COMPILED}
MAX_TEST_PARALLELISM ?= $(shell nproc)
ALL_TEST_ENV_OVERRIDE := $(shell [ -n "${DD_TRACE_DOCKER_DEBUG}" ] && echo DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=1) DD_TRACE_GIT_METADATA_ENABLED=0 DD_CRASHTRACKER_RECEIVER_TIMEOUT_MS=15000

VERSION := $(shell cat VERSION)
VERSION := $(shell cat VERSION.txt)

INI_DIR := $(shell ASAN_OPTIONS=detect_leaks=0 php -d ddtrace.disable=1 -i | awk -F"=>" '/Scan this dir for additional .ini files/ {print $$2}')
INI_FILE := $(INI_DIR)/ddtrace.ini
Expand Down Expand Up @@ -106,7 +106,7 @@ JUNIT_RESULTS_DIR := $(shell pwd)

all: $(BUILD_DIR)/configure $(SO_FILE)

$(BUILD_DIR)/configure: $(M4_FILES) $(BUILD_DIR)/ddtrace.sym $(BUILD_DIR)/VERSION
$(BUILD_DIR)/configure: $(M4_FILES) $(BUILD_DIR)/ddtrace.sym $(BUILD_DIR)/VERSION.txt
$(Q) (cd $(BUILD_DIR); phpize && $(SED_I) 's/\/FAILED/\/\\bFAILED/' $(BUILD_DIR)/run-tests.php) # Fix PHP 5.4 exit code bug when running selected tests (FAILED vs XFAILED)

$(BUILD_DIR)/run-tests.php: $(if $(ASSUME_COMPILED),, $(BUILD_DIR)/configure)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion appsec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endforeach()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake/Modules")

file(READ "../VERSION" appsec_version)
file(READ "../VERSION.txt" appsec_version)
string(STRIP "${appsec_version}" appsec_version)
set(CMAKE_APPSEC_VERSION ${appsec_version})
string(REGEX MATCH "^[^+a-z]*" appsec_short_version "${appsec_version}")
Expand Down
4 changes: 2 additions & 2 deletions appsec/cmake/ddtrace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ add_custom_target(ddtrace_exports
)
endif()

file(READ "${CMAKE_SOURCE_DIR}/../VERSION" VERSION_CONTENTS)
file(READ "${CMAKE_SOURCE_DIR}/../VERSION.txt" VERSION_CONTENTS)
string(STRIP "${VERSION_CONTENTS}" PHP_DDTRACE_VERSION)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/gen_ddtrace/ext")
set(VERSION_H_PATH "${CMAKE_BINARY_DIR}/gen_ddtrace/ext/version.h")
Expand All @@ -46,7 +46,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E remove -f "${VERSION_H_PATH}"
COMMAND ${CMAKE_COMMAND} -E touch "${VERSION_H_PATH}"
COMMAND printf "\\#ifndef PHP_DDTRACE_VERSION\\\\n\\#define PHP_DDTRACE_VERSION \"%s\"\\\\n\\#endif" "'\"${PHP_DDTRACE_VERSION}\"'" >> "${VERSION_H_PATH}"
DEPENDS "${CMAKE_SOURCE_DIR}/../VERSION"
DEPENDS "${CMAKE_SOURCE_DIR}/../VERSION.txt"
COMMENT "Generating version.h"
)
add_custom_target(update_version_h ALL DEPENDS "${VERSION_H_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion components-rs/remote_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub unsafe extern "C" fn ddog_init_remote_config_state(
Box::new(RemoteConfigState {
manager: RemoteConfigManager::new(ConfigInvariants {
language: "php".to_string(),
tracer_version: include_str!("../VERSION").trim().into(),
tracer_version: include_str!("../VERSION.txt").trim().into(),
endpoint: endpoint.clone(),
}),
live_debugger: LiveDebuggerState::default(),
Expand Down
2 changes: 1 addition & 1 deletion config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ if test "$PHP_DDTRACE" != "no"; then

cat <<EOT >ext/version.h
#ifndef PHP_DDTRACE_VERSION
#define PHP_DDTRACE_VERSION "$(cat "$ext_srcdir/VERSION")"
#define PHP_DDTRACE_VERSION "$(cat "$ext_srcdir/VERSION.txt")"
#endif
EOT

Expand Down
2 changes: 1 addition & 1 deletion config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (PHP_DDTRACE != 'no') {

var versionpath = configure_module_dirname + "/ext/version.h";
var versionfile = FSO.CreateTextFile(versionpath, true);
var versionContent = FSO.OpenTextFile(configure_module_dirname + "/VERSION", 1).ReadAll();
var versionContent = FSO.OpenTextFile(configure_module_dirname + "/VERSION.txt", 1).ReadAll();
versionContent = versionContent.replace(/[\r\n]+$/, '');
versionfile.WriteLine("#ifndef PHP_DDTRACE_VERSION");
versionfile.WriteLine('#define PHP_DDTRACE_VERSION "' + versionContent + '"');
Expand Down
4 changes: 2 additions & 2 deletions profiling/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ fn main() {
}

// Read the version from the VERSION file
let version = fs::read_to_string("../VERSION")
let version = fs::read_to_string("../VERSION.txt")
.expect("Failed to read VERSION file")
.trim()
.to_string();
println!("cargo:rustc-env=PROFILER_VERSION={version}");
println!("cargo:rerun-if-changed=../VERSION");
println!("cargo:rerun-if-changed=../VERSION.txt");

let php_config_includes = std::str::from_utf8(php_config_includes_output.stdout.as_slice())
.expect("`php-config`'s stdout to be valid utf8");
Expand Down
2 changes: 1 addition & 1 deletion tooling/bin/pecl-build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ composer -dtooling/generation verify

# PECL doesn't like the "+$gitsha1" part of the non-release version number.
# Currently these aren't published, so truncating it is fine.
dd_version=$(cat VERSION | grep -Eo '^[^+]*')
dd_version=$(cat VERSION.txt | grep -Eo '^[^+]*')
dd_changelog=$(tail -n +2 CHANGELOG.md)

configuration_placeholder='
Expand Down
2 changes: 1 addition & 1 deletion tooling/ci/create_release.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

$package_directory = $argv[1];
$repository_root = __DIR__ . "/../..";
$version = trim(file_get_contents("$repository_root/VERSION"));
$version = trim(file_get_contents("$repository_root/VERSION.txt"));
$changelog = trim(implode(array_slice(file("$repository_root/CHANGELOG.md"), 2)));

if (!str_contains($target_branch, $version)) {
Expand Down
4 changes: 2 additions & 2 deletions zend_abstract_interface/components_rs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_custom_target(ddtrace_exports
)
endif()

file(READ "${CMAKE_SOURCE_DIR}/../VERSION" VERSION_CONTENTS)
file(READ "${CMAKE_SOURCE_DIR}/../VERSION.txt" VERSION_CONTENTS)
string(STRIP "${VERSION_CONTENTS}" PHP_DDTRACE_VERSION)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/gen_ddtrace/ext")
set(VERSION_H_PATH "${CMAKE_BINARY_DIR}/gen_ddtrace/ext/version.h")
Expand All @@ -47,7 +47,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E remove -f "${VERSION_H_PATH}"
COMMAND ${CMAKE_COMMAND} -E touch "${VERSION_H_PATH}"
COMMAND printf "\\#ifndef PHP_DDTRACE_VERSION\\\\n\\#define PHP_DDTRACE_VERSION \"%s\"\\\\n\\#endif" "'\"${PHP_DDTRACE_VERSION}\"'" >> "${VERSION_H_PATH}"
DEPENDS "${CMAKE_SOURCE_DIR}/../VERSION"
DEPENDS "${CMAKE_SOURCE_DIR}/../VERSION.txt"
COMMENT "Generating version.h"
)
add_custom_target(update_version_h ALL DEPENDS "${VERSION_H_PATH}")
Expand Down
Loading