Skip to content

feat(dev): add Windows cross-build support#1790

Open
thieman wants to merge 8 commits into
mainfrom
thieman/windows-platform-settings
Open

feat(dev): add Windows cross-build support#1790
thieman wants to merge 8 commits into
mainfrom
thieman/windows-platform-settings

Conversation

@thieman
Copy link
Copy Markdown
Contributor

@thieman thieman commented Jun 1, 2026

pls look toby

With this PR it's now possible to cross-compile ADP-for-Windows on a Mac. Nothing is actually runnable but I wanted to get this sorted before I started working on Windows CI.

I scoped this to only saluki and agent-data-plane, testing tools like correctness are not in scope and probably still don't build on Windows. I'm not planning on running correctness but if any of those have problems I'll get to them as part of the CI PR.

Summary

  • Add Windows platform settings with Core Agent-compatible ConfigRoot registry lookup and ProgramData fallback paths.
  • Add local macOS Windows cross-build setup/build targets using cargo-xwin and Homebrew LLVM.
  • Fix Windows cfg/build blockers across networking, workload helpers, correctness tools, and ADP so the workspace cross-builds for x86_64-pc-windows-msvc.

Notes

  • This does not add Windows runtime support for ADP service management, named pipes, or Windows-specific DogStatsD ingestion.
  • Unix socket address types remain available for config/type handling, but Unix socket listener construction returns an unsupported-platform error on non-Unix platforms.

Test plan

  • make fmt
  • cargo check --workspace
  • cargo check --workspace --tests
  • make build-windows-cross
  • PATH="/opt/homebrew/opt/llvm/bin:$PATH" cargo xwin check --target x86_64-pc-windows-msvc --workspace --tests
  • pre-commit checks run by git commit

@dd-octo-sts dd-octo-sts Bot added area/io General I/O and networking. area/config Configuration. area/components Sources, transforms, and destinations. area/memory Memory bounds and memory management. source/dogstatsd DogStatsD source. area/observability Internal observability of ADP and Saluki. labels Jun 1, 2026
@datadog-datadog-prod-us1-2

This comment has been minimized.

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Jun 1, 2026

Binary Size Analysis (Agent Data Plane)

Baseline: 08cd4c4 · Comparison: 4aa3ff2 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 37.93 MiB (baseline) vs 37.91 MiB (comparison)
Size Change: -20.49 KiB (-0.05%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
core -18.78 KiB 1790
tokio -16.27 KiB 876
agent_data_plane::main::_{{closure}} +15.63 KiB 1
alloc -10.79 KiB 190
[sections] -5.73 KiB 7
ottl::parser::arena +5.52 KiB 7
std +5.23 KiB 56
serde_yaml -5.04 KiB 17
h2 -4.60 KiB 45
[Unmapped] +4.46 KiB 1
tonic -4.17 KiB 94
agent_data_plane::cli::run -3.39 KiB 8
anon.d79fab06779a07988ddcf6c4bb681b9d.2.llvm.17162878208440994959 +3.06 KiB 1
hashbrown -2.95 KiB 17
anon.acbd287db64895e155c57ba7daeb669a.166.llvm.16512133253778547288 -2.88 KiB 1
anon.36eead261da73468b10600f578de22ed.87.llvm.14046994766694184360 -2.83 KiB 1
anon.aff4687329d0c87eda2031b0ab3e4b27.13.llvm.18013086268746836388 +2.82 KiB 1
http +2.74 KiB 20
agent_data_plane::internal::remote_agent +2.69 KiB 10
tonic_prost -2.60 KiB 16
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
 +20e2% +16.9Ki +24e2% +16.9Ki    agent_data_plane::state::metrics::rules::get_datadog_agent_remappings::hbdc0274dbd81cbc3
   +47% +15.6Ki   +47% +15.5Ki    agent_data_plane::main::_{{closure}}::h91f918e534067526
  [NEW] +12.9Ki  [NEW] +12.8Ki    agent_data_plane::state::metrics::rules::get_compat_remappings::h08bf766045445756
   +83% +4.46Ki  [ = ]       0    [Unmapped]
  [NEW] +3.76Ki  [NEW]    +340    core::ptr::drop_in_place<http_body_util::combinators::map_err::MapErr<http_body_util::combinators::map_frame::MapFrame<tonic::body::Body,tonic::codec::decode::Streaming<datadog_protos::agent_include::datadog::remoteagent::flare::v1::GetFlareFilesRequest>::new<tonic::body::Body,tonic_prost::codec::ProstDecoder<datadog_protos::agent_include::datadog::remoteagent::flare::v1::GetFlareFilesRequest>>::{{closure}}>,tonic::codec::decode::Streaming<datadog_protos::agent_include::datadog::remoteagent::flare::v1::GetFlareFilesRequest>::new<tonic::body::Body,tonic_prost::codec::ProstDecoder<datadog_protos::agent_include::datadog::remoteagent::flare::v1::GetFlareFilesRequest>>::{{closure}}>>::h2fb85ccecc1cb926
  [NEW] +3.44Ki  [NEW]    +456    core::ptr::drop_in_place<core::iter::adapters::map::Map<std::collections::hash::map::IntoIter<axum::routing::RouteId,axum::routing::Endpoint<saluki_components::sources::dogstatsd::replay::replay_control::DogStatsDReplayControl>>,axum::routing::path_router::PathRouter<saluki_components::sources::dogstatsd::replay::replay_control::DogStatsDReplayControl,_>::with_state<$LP$$RP$>::{{closure}}>>::h3735a674b182d336
  [NEW] +3.06Ki  [NEW]     +74    anon.d79fab06779a07988ddcf6c4bb681b9d.2.llvm.17162878208440994959
  [NEW] +2.84Ki  [NEW]     +47    _<http_body_util::combinators::map_err::MapErr<B,F> as http_body::Body>::size_hint::h7a2146171ab2c5b8
  +182% +2.83Ki  +195% +2.83Ki    h2::proto::streams::streams::StreamRef<B>::send_data::hb2e588f364643831
 -62.4% -2.85Ki -64.4% -2.83Ki    serde_yaml::value::ser::_<impl serde_core::ser::Serialize for serde_yaml::value::Value>::serialize::h7e3b3ab711e7b79b
  [DEL] -2.88Ki  [DEL]     -74    anon.acbd287db64895e155c57ba7daeb669a.166.llvm.16512133253778547288
  -2.0% -3.08Ki  -2.0% -3.08Ki    agent_data_plane::cli::run::handle_run_command::_{{closure}}::hdf07f62ba689f516
  -0.3% -3.59Ki  -0.3% -3.59Ki    [section .gcc_except_table]
 -37.9% -3.70Ki -38.3% -3.70Ki    h2::codec::framed_write::Encoder<B>::buffer::h1657e6f3d78b394a
 -81.6% -4.02Ki -32.6%    -333    core::ptr::drop_in_place<tonic::body::Body>::hce9d1d3f74301fef
  [DEL] -4.25Ki  [DEL] -4.12Ki    agent_data_plane::state::metrics::rules::aggregation::get_aggregation_remappings::h8df5781a6f761921
  [DEL] -4.40Ki  [DEL] -4.28Ki    agent_data_plane::state::metrics::rules::transaction::get_transaction_remappings::h7a9643623e71d5ed
  [DEL] -9.38Ki  [DEL] -9.26Ki    agent_data_plane::state::metrics::rules::dogstatsd::get_dogstatsd_remappings::h4c255c759e1d8868
  [DEL] -12.4Ki  [DEL] -12.3Ki    agent_data_plane::state::metrics::rules::compat::get_compat_remappings::ha0b8e71d70c4a783
  [DEL] -17.7Ki  [DEL] -17.6Ki    tokio::runtime::park::CachedParkThread::block_on::hf364174df10d3359
  -0.3% -18.1Ki  -0.1% -4.25Ki    [9379 Others]
  -0.1% -20.5Ki  -0.1% -16.5Ki    TOTAL

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Jun 1, 2026

Regression Detector (Agent Data Plane)

Run ID: da08f783-def0-4b07-8517-47a2bcc816ea
Baseline: 08cd4c40 · Comparison: 4aa3ff26 · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (35)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
dsd_uds_10mb_3k_contexts_cpu (erratic) cpu ⚪ +2.52 metrics profiles logs
dsd_uds_500mb_3k_contexts_throughput throughput ⚪ -2.05 metrics profiles logs
dsd_uds_100mb_3k_contexts_cpu (erratic) cpu ⚪ +1.90 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_cpu (erratic) cpu ⚪ +0.63 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.48 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_cpu (erratic) cpu ⚪ +0.39 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.18 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ +0.09 metrics profiles logs
dsd_uds_100mb_3k_contexts_memory memory ⚪ +0.04 metrics profiles logs
otlp_ingest_traces_5mb_memory memory ⚪ +0.04 metrics profiles logs
dsd_uds_512kb_3k_contexts_memory memory ⚪ +0.04 metrics profiles logs
otlp_ingest_logs_5mb_throughput (ignored) throughput ⚪ -0.02 metrics profiles logs
dsd_uds_10mb_3k_contexts_throughput throughput ⚪ -0.01 metrics profiles logs
dsd_uds_1mb_3k_contexts_throughput throughput ⚪ -0.00 metrics profiles logs
dsd_uds_512kb_3k_contexts_throughput throughput ⚪ +0.00 metrics profiles logs
otlp_ingest_metrics_5mb_cpu (erratic) cpu ⚪ -0.00 metrics profiles logs
dsd_uds_100mb_3k_contexts_throughput throughput ⚪ +0.00 metrics profiles logs
otlp_ingest_logs_5mb_cpu (ignored) cpu ⚪ -0.01 metrics profiles logs
otlp_ingest_metrics_5mb_throughput throughput ⚪ +0.02 metrics profiles logs
otlp_ingest_traces_5mb_throughput throughput ⚪ +0.04 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_throughput throughput ⚪ +0.07 metrics profiles logs
quality_gates_rss_dsd_low memory ⚪ -0.08 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_memory memory ⚪ -0.09 metrics profiles logs
otlp_ingest_traces_ottl_filtering_5mb_throughput throughput ⚪ +0.11 metrics profiles logs
dsd_uds_1mb_3k_contexts_memory memory ⚪ -0.18 metrics profiles logs
otlp_ingest_traces_ottl_transform_5mb_memory memory ⚪ -0.19 metrics profiles logs
dsd_uds_500mb_3k_contexts_memory memory ⚪ -0.26 metrics profiles logs
dsd_uds_10mb_3k_contexts_memory memory ⚪ -0.31 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.48 metrics profiles logs
dsd_uds_1mb_3k_contexts_cpu (erratic) cpu ⚪ -0.53 metrics profiles logs
dsd_uds_500mb_3k_contexts_cpu (erratic) cpu ⚪ -0.89 metrics profiles logs
otlp_ingest_logs_5mb_memory (ignored) memory ⚪ -0.92 metrics profiles logs
otlp_ingest_metrics_5mb_memory memory ⚪ -0.97 metrics profiles logs
otlp_ingest_traces_5mb_cpu (erratic) cpu ⚪ -2.11 metrics profiles logs
dsd_uds_512kb_3k_contexts_cpu (erratic) cpu 🟢 -6.46 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 128 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 39.9 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 61.7 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 183 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 26.7 MiB ≤ 40 MiB metrics profiles logs
Explanation

A 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 (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression.

Comment thread Makefile
(echo "Missing llvm-lib at $(WINDOWS_CROSS_LLVM_BIN)/llvm-lib. Set WINDOWS_CROSS_LLVM_BIN or install Homebrew LLVM." && exit 1)

.PHONY: build-windows-cross
build-windows-cross: install-windows-cross-tools ## Builds ADP for Windows from a local macOS host (override WINDOWS_CROSS_CARGO_ARGS as needed)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this for now as a way to locally test Windows support. May remove this once we have Windows CI working

System::Registry::{RegGetValueW, HKEY, HKEY_LOCAL_MACHINE, RRF_RT_REG_SZ, RRF_SUBKEY_WOW6464KEY},
};

// TODO: Add Windows-specific tests for registry-backed path resolution once we have Windows CI coverage.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is vibed from the core agent impl but untested as we don't actually have tests running yet. Added a TODO to come back and add tests.

@thieman thieman marked this pull request as ready for review June 1, 2026 19:32
@thieman thieman requested a review from a team as a code owner June 1, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. area/config Configuration. area/io General I/O and networking. area/memory Memory bounds and memory management. area/observability Internal observability of ADP and Saluki. source/dogstatsd DogStatsD source.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant