Skip to content

chore(build): honor pinned toolchain, drop dead UPX install#1275

Draft
duncanista wants to merge 2 commits into
jordan.gonzalez/cold-start-instrumentation/featurefrom
jordan.gonzalez/build-hygiene/feature
Draft

chore(build): honor pinned toolchain, drop dead UPX install#1275
duncanista wants to merge 2 commits into
jordan.gonzalez/cold-start-instrumentation/featurefrom
jordan.gonzalez/build-hygiene/feature

Conversation

@duncanista

Copy link
Copy Markdown
Contributor

DRAFT — stacked on #1271 (jordan.gonzalez/cold-start-instrumentation/feature). Base it against main once #1271 merges.

Jira: none yet — add before marking ready.

Overview

Build-hygiene cleanup (Confluence H10). Dockerfile-only; no Rust source changes.

1. Honor the pinned toolchain. rust-toolchain.toml pins channel = "1.93.1", but the compile Dockerfiles built with cargo +stable, which overrides the pin and silently builds with whatever stable currently resolves to. This change makes rust-toolchain.toml the single source of truth:

  • Drop the +stable override: cargo +stable build ...cargo build ... in both images/Dockerfile.bottlecap.compile and images/Dockerfile.bottlecap.alpine.compile.
  • Change the rustup install from --default-toolchain "stable-${PLATFORM}-unknown-linux-{gnu,musl}" to --default-toolchain none. With no default installed, the first cargo invocation inside the bind-mounted source tree reads rust-toolchain.toml and auto-installs the pinned 1.93.1 (plus its declared minimal profile / rustfmt / clippy). The --component rust-src flag is retained.

Net effect: builds are reproducible against the pinned 1.93.1 instead of a moving stable.

Why --default-toolchain none over pinning the install to 1.93.1-${PLATFORM}-...: it is the smaller, lower-maintenance change. The version lives in exactly one place (rust-toolchain.toml); bumping the pin later requires no Dockerfile edits, and there is no risk of the Dockerfile and the toml drifting apart.

2. Remove dead UPX install. images/Dockerfile.build_layer installed UPX (ENV UPX_VERSION + the download/extract RUN), but nothing compresses the binary anymore — it ships uncompressed and no step invokes upx. Only the install block is removed; everything else (deps install, zip packaging, layout) is untouched.

Note on intent: UPX compression is deliberately not reintroduced — decompressing a UPX-packed binary at process start would add cold-start latency, so shipping uncompressed is the correct behavior. This PR only removes the leftover dead install.

Testing

  • git diff reviewed: the change is exactly the four toolchain lines (two per compile Dockerfile) plus removal of the 13-line UPX block. No other lines touched; no Rust/Cargo files changed.
  • Grep confirms no remaining references to +stable / --default-toolchain "stable-..." in images/ or scripts/, and no remaining upx references in any Dockerfile, shell script, workflow, or Makefile.
  • Not built via Docker locally (no local Docker build of these images was run). The Docker image builds in CI should be checked before this is marked ready for review.

The compile Dockerfiles built with 'cargo +stable', overriding the
channel = "1.93.1" pin in rust-toolchain.toml. Drop the '+stable'
override and install rustup with --default-toolchain none so
rust-toolchain.toml auto-installs and drives the toolchain, making
builds reproducible against the pinned version.

Also remove the dead UPX install from Dockerfile.build_layer: the
binary ships uncompressed, so nothing invokes upx anymore.
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 24, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

DataDog/datadog-lambda-extension | e2e-test-status (amd64)   View in Datadog   GitLab

DataDog/datadog-lambda-extension | e2e-test-status (amd64, fips)   View in Datadog   GitLab

DataDog/datadog-lambda-extension | integration-suite: [lmi]   View in Datadog   GitLab

View all 5 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ee1bd39 | Docs | Datadog PR Page | Give us feedback!

With --default-toolchain none, rust-src had nothing to attach to; the toml-pinned toolchain installs only rustfmt/clippy and nothing consumes rust-src.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant