chore(agent-data-plane): add AIX build helper - #2084
Conversation
Binary Size Analysis (Agent Data Plane)Baseline: 33d6ac6 · Comparison: 96e35a2 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
Add a Makefile target and helper script for native AIX ADP builds. The helper records the IBM Rust SDK, AIX Toolbox GCC, system ar/ranlib, Cargo cache, and target directory settings needed on the AIX builder, with a dry-run test target for local validation.
3d1c153 to
1f9d343
Compare
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
| if [[ "${ADP_AIX_BUILD_DRY_RUN}" == "true" ]]; then | ||
| print_environment | ||
| exit 0 | ||
| fi |
There was a problem hiding this comment.
This is definitely a nit, but I think a --dry-run arg is a little bit more canonical and visible, i.e. in the Makefile.
There was a problem hiding this comment.
Since this is mainly intended for use via make the CLI flag ends up being less ergonomic than env vars since it'd require a separate Make target or a way to forward around arguments. I don't expect anyone will be running this directly, should be via Make.
Add lightweight version prefix checks for the AIX ADP build helper's Rust and GCC toolchain. The defaults pin the known-good IBM Rust SDK 1.92 and AIX Toolbox GCC 13 paths while allowing intentional toolchain updates through environment overrides.
Add an AIX-specific optimized release profile that keeps release optimization settings while disabling LTO, which is not currently supported by the IBM Rust SDK on AIX. Keep the AIX build helper focused on producing the release binary with plain cargo and the same embedded metadata inputs as other release builds.
Explain why the AIX optimized release profile disables LTO while the IBM Rust SDK does not support the existing release LTO settings on AIX.
| @@ -0,0 +1,102 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
This script doesn't seem like it's actually giving us much, can you remove it and its reference in the Makefile?
There was a problem hiding this comment.
[GPT-5.6 Sol] Fixed in a3156d3. Removed ci/tooling/test-build-adp-aix.sh and the test-build-adp-aix-script Makefile target; the dry-run path remains available manually with ADP_AIX_BUILD_DRY_RUN=true make build-adp-aix.
| cargo fetch | ||
|
|
||
| echo "[*] Building agent-data-plane for AIX..." | ||
| cargo build --profile "${BUILD_PROFILE}" --bin agent-data-plane --features "${BUILD_FEATURES}" |
There was a problem hiding this comment.
Add an explanatory comment above this line explaining why we aren't using cargo auditable the way the other builds are (doesn't support XCOFF)
There was a problem hiding this comment.
[GPT-5.6 Sol] Fixed in a3156d3. Added the XCOFF/cargo-auditable comment above the AIX cargo build invocation to explain why this path uses plain cargo build.
| inherits = "release" | ||
| debug-assertions = false | ||
| overflow-checks = false | ||
| # IBM Open SDK for Rust 1.92 on AIX fails LTO during final linking with `Can't find section .ipa`. |
There was a problem hiding this comment.
Add a bit more information in this comment based on our investigation into these build failures
There was a problem hiding this comment.
[GPT-5.6 Sol] Fixed in a3156d3. Expanded the LTO comment to include the IBM Rust SDK 1.92 failure mode and the minimal hello-world repro result (Can't find section .ipa).
Remove the dry-run helper test target and document the AIX-specific reasons for disabling cargo-auditable and LTO in the native AIX build path.
| codegen-units = 1 | ||
|
|
||
| [profile.aix-optimized-release] | ||
| inherits = "release" |
There was a problem hiding this comment.
Make this inherit from optimized-release and then just keep the LTO override to false, if that works
There was a problem hiding this comment.
[GPT-5.6 Sol] Updated in 96e35a2. The AIX profile now inherits from optimized-release and only overrides lto = false, which keeps the shared optimized-release settings centralized while preserving the AIX LTO workaround. I validated the profile parses with cargo metadata --no-deps --format-version 1, and the pre-commit checks passed.
Make the AIX-specific release profile inherit from the shared optimized-release profile and override only LTO. This keeps the optimized release settings centralized while preserving the AIX workaround for IBM Rust SDK LTO failures.
Human Summary
Adds a script and Makefile target to build a release ADP binary on AIX. This comes with two intentional divergences from how we build on the other platforms:
cargo auditablebecause it does not support XCOFF. Clanker tried to get it to work with some manual patching but wasn't able to. Seems like this will be a more significant contribution to upstream if we want this to work.Neither of these should be showstoppers, but please comment if they are. The plan will be to call this script from within the Agent's
packaging/aixmachinery when we do AIX builds. Working on that follow-up now.Summary
make build-adp-aixfor native AIX ADP builds using the IBM Rust SDK and AIX Toolbox GCC toolchain.ci/tooling/build-adp-aix.shto record the AIX build environment and run the native Cargo build.aix-optimized-releaseCargo profile that keeps the optimized-release binary settings that work on AIX while disabling LTO.Notes
MetaString#2032, fix(datadog-agent-commons): add AIX platform settings #2034, fix(agent-data-plane): preserve DNS for hostname IPC endpoints #2060, and chore(deps): bump aws-lc #2082 are now onmain; this PR is rebased on top of them and only carries the build helper/profile changes.aws-lc-sysis built from the bumped dependency without patching Cargo's registry cache.gcc-8fails in an AWS-LC compiler feature probe;/opt/freeware/bin/gcc(gcc 13.3) succeeds, so the helper defaults to that compiler.cargo auditable: cargo-auditable emits ELF/generic Unix linker inputs and flags that AIX's XCOFF linker rejects.aix-optimized-releaseinstead ofoptimized-release: the IBM Rust SDK 1.92 fails LTO even for a tiny hello-world crate withfailed to get bitcode from object file for LTO (Can't find section .ipa).APP_FULL_NAME,APP_SHORT_NAME,APP_IDENTIFIER,APP_VERSION,APP_GIT_HASH,APP_BUILD_TIME,APP_DEV_BUILD) and passesBUILD_FEATURESthrough to Cargo.ADP_AIX_EXPECTED_*_PREFIXvariables when an intentional toolchain update occurs.Test Plan
bash -n ci/tooling/build-adp-aix.shADP_AIX_BUILD_DRY_RUN=true make build-adp-aixcargo metadata --no-deps --format-version 1CARGO_HOME=/opt/cargo-home-aix-adp-pr-stack CARGO_TARGET_DIR=/opt/saluki-aix-adp-pr-stack-target make build-adp-aix/opt/saluki-aix-adp-pr-stack-target/aix-optimized-release/agent-data-plane --help/opt/saluki-aix-adp-pr-stack-target/aix-optimized-release/agent-data-plane versionfmt,check-clippy,check-licenses,check-deny,check-docs,generate-api-docsAIX toolchain observed:
cargo 1.92.0 (IBM Open SDK for Rust on AIX 1.92.0.0)rustc 1.92.0 (IBM Open SDK for Rust on AIX 1.92.0.0)gcc (GCC) 13.3.0g++ (GCC) 13.3.0AIX build result:
Finished aix-optimized-release profile [optimized + debuginfo] target(s) in 26m 22s64-bit XCOFF executable or object module not stripped