Skip to content

fix(dev): vanila cargo build should run on windows#24991

Merged
pront merged 3 commits intomasterfrom
fix/windows-default-build
Mar 27, 2026
Merged

fix(dev): vanila cargo build should run on windows#24991
pront merged 3 commits intomasterfrom
fix/windows-default-build

Conversation

@pront
Copy link
Copy Markdown
Member

@pront pront commented Mar 23, 2026

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:

  1. tikv-jemallocator — uses autoconf/configure, which is unavailable with MSVC. Moved to [target.'cfg(unix)'.dependencies].
  2. rdkafka — without the cmake_build feature, rdkafka-sys falls back to Unix autotools on Windows. Added cmake_build via [target.'cfg(windows)'.dependencies] without changing the default or default-cmake features.
  3. sources-dnstap — depends on framestream which was already gated on cfg(unix). The module declarations in src/sources/mod.rs and src/internal_events/mod.rs are now consistently gated on Unix too.

The default feature retains rdkafka?/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 have libsasl2 available.

Vector configuration

N/A — no behavior change, build-only fix.

How did you test this PR?

Verified cargo build succeeds on Windows with MSVC toolchain (x86_64-pc-windows-msvc) with Cyrus SASL installed via MSYS2.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@github-actions github-actions Bot added the domain: sources Anything related to the Vector's sources label Mar 23, 2026
@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Mar 23, 2026
@github-actions github-actions Bot added domain: ci Anything related to Vector's CI environment and removed domain: ci Anything related to Vector's CI environment labels Mar 23, 2026
@pront pront force-pushed the fix/windows-default-build branch 5 times, most recently from 6e7d530 to 09d34c5 Compare March 23, 2026 20:41
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>
@pront pront changed the title fix(windows): enable plain cargo build on Windows MSVC fix(deps): gate Unix-only dependencies to enable Windows MSVC builds Mar 23, 2026
@pront pront force-pushed the fix/windows-default-build branch from 09d34c5 to eb53a82 Compare March 23, 2026 20:51
@pront pront changed the title fix(deps): gate Unix-only dependencies to enable Windows MSVC builds fix(dev): vanila cargo build should run on windows Mar 23, 2026
@pront pront marked this pull request as ready for review March 23, 2026 20:52
@pront pront requested a review from a team as a code owner March 23, 2026 20:52
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pront pront enabled auto-merge March 23, 2026 20:57
@pront pront disabled auto-merge March 23, 2026 20:58
Comment thread Cargo.toml Outdated
Avoids version string duplication across dependency sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pront pront enabled auto-merge March 24, 2026 13:05
@pront pront requested a review from thomasqueirozb March 24, 2026 21:16
@pront pront added this pull request to the merge queue Mar 27, 2026
Merged via the queue into master with commit af15a5a Mar 27, 2026
86 checks passed
@pront pront deleted the fix/windows-default-build branch March 27, 2026 02:02
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: sources Anything related to the Vector's sources no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants