Skip to content

Commit

Permalink
build: shrink profiling artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonlevi committed Mar 28, 2024
1 parent 8e98f4d commit af69395
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 7 additions & 4 deletions .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ commands:
parameters:
prefix:
type: string
triplet:
type: string
steps:
- run:
name: Build Profiler NTS
Expand All @@ -574,9 +576,9 @@ commands:
command -v switch-php && switch-php "${PHP_VERSION}"
cd profiling
echo "${CARGO_TARGET_DIR}"
cargo build --release
RUSTC_BOOTSTRAP=1 cargo rustc -p datadog-php-profiling --release --target "$triplet" -Z build-std=panic_abort,core,std,alloc
cd -
cp -v "${CARGO_TARGET_DIR}/release/libdatadog_php_profiling.so" "${prefix}/datadog-profiling.so"
cp -v "${CARGO_TARGET_DIR}/${triplet}/release/libdatadog_php_profiling.so" "${prefix}/datadog-profiling.so"
objcopy --compress-debug-sections "${prefix}/datadog-profiling.so"
- run:
name: Build Profiler ZTS
Expand All @@ -593,9 +595,9 @@ commands:
cd profiling
echo "${CARGO_TARGET_DIR}"
touch build.rs #make sure `build.rs` gets executed after `switch-php` call
cargo build --release
RUSTC_BOOTSTRAP=1 cargo rustc -p datadog-php-profiling --release --target "$triplet" -Z build-std=panic_abort,core,std,alloc
cd -
cp -v "${CARGO_TARGET_DIR}/release/libdatadog_php_profiling.so" "${prefix}/datadog-profiling-zts.so"
cp -v "${CARGO_TARGET_DIR}/{$triplet}/release/libdatadog_php_profiling.so" "${prefix}/datadog-profiling-zts.so"
objcopy --compress-debug-sections "${prefix}/datadog-profiling-zts.so"
executors:
Expand Down Expand Up @@ -2883,6 +2885,7 @@ jobs:
- <<: *STEP_APPEND_BUILD_ID
- build_profiler:
prefix: datadog-profiling/<< parameters.triplet >>/lib/php/<< parameters.abi_no >>
triplet: << parameters.triplet >>
- persist_to_workspace:
root: .
paths:
Expand Down
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ license = "Apache-2.0"
debug = 2 # full debug info

[profile.release]
debug = 1
lto = "thin"
codegen-units = 1
debug = "line-tables-only"
incremental = false
lto = "fat"
panic = "abort"

[profile.tracer-release]
debug = 1 # line tables only
lto = true
codegen-units = 1
panic = "abort"
inherits = "release"

0 comments on commit af69395

Please sign in to comment.