fix(dev): vanila cargo build should run on windows#24991
Merged
Conversation
6e7d530 to
09d34c5
Compare
Move `tikv-jemallocator` to a Unix-only target dependency (it requires autoconf which is unavailable with MSVC). Enable `rdkafka/cmake_build` on Windows via a target-specific dependency entry so rdkafka builds using cmake instead of the Unix autotools path. Gate `sources-dnstap` module declarations on Unix to match the Unix-only `framestream` crate it depends on. Add `#[cfg(unix)]` to jemalloc allocator blocks in `src/lib.rs`. Tested on Windows with Cyrus SASL installed via MSYS2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cargo build on Windows MSVC09d34c5 to
eb53a82
Compare
cargo build should run on windows
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids version string duplication across dependency sections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
thomasqueirozb
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo build(plain, no feature flags) was broken on Windows with the MSVC toolchain due to three platform-incompatible dependencies in the default feature set:tikv-jemallocator— uses autoconf/configure, which is unavailable with MSVC. Moved to[target.'cfg(unix)'.dependencies].rdkafka— without thecmake_buildfeature, rdkafka-sys falls back to Unix autotools on Windows. Addedcmake_buildvia[target.'cfg(windows)'.dependencies]without changing thedefaultordefault-cmakefeatures.sources-dnstap— depends onframestreamwhich was already gated oncfg(unix). The module declarations insrc/sources/mod.rsandsrc/internal_events/mod.rsare now consistently gated on Unix too.The
defaultfeature retainsrdkafka?/gssapi(SASL authentication support). On Windows this requires Cyrus SASL to be installed (e.g. via MSYS2:pacman -S mingw-w64-x86_64-cyrus-sasl), consistent with how Linux users are expected to havelibsasl2available.Vector configuration
N/A — no behavior change, build-only fix.
How did you test this PR?
Verified
cargo buildsucceeds on Windows with MSVC toolchain (x86_64-pc-windows-msvc) with Cyrus SASL installed via MSYS2.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References