Skip to content

Remove patch dependencies #23329

Open
Open

Description

@pront

Vector is currently patching a few crates, see [patch.crates-io]:

https://github.com/vectordotdev/vector/blob/master/Cargo.toml#L459

Ref: #11257
Ref: #23646

Activity

  1. added
    type: tech debtA code change that does not add user value.
    good first issueAnything that is good for new contributors.
    on Jul 2, 2025
  2. added theissue type on Jul 2, 2025
  3. added
    domain: depsAnything related to Vector's dependencies
    on Jul 2, 2025
  4. Trighap52 commented on Feb 15, 2026

    @Trighap52
    Contributor

    I gave this a shot and opened a PR: #24658

  5. pront commented on Feb 17, 2026

    @pront
    MemberAuthor

    Thanks @Trighap52, we will take a look at your PR.

  6. Captain1653 commented on Oct 12, 2026

    @Captain1653

    Hi.

    I looked into the current [patch.crates-io] to see what remains to be unpatched.

    Right now, the only entry left in Cargo.toml is ntapi:

    [patch.crates-io]
    # The `heim` crates depend on `ntapi` 0.3.7 on Windows, but that version has an
    # unaligned access bug fixed in the following revision.
    ntapi = { git = "https://github.com/MSxDOS/ntapi.git", rev = "24fc1e47677fc9f6e38e5f154e6011dc9b270da6" }

    Context & Root Cause

    • Transitive dependency: ntapi is pulled transitively via heim. Since the upstream heim crate hasn't had a release in ~6 years, Vector maintains its own fork.

    • The bug: The patch exists to fix an unaligned memory access crash on Windows present in ntapi 0.3.7 (used by heim).

    • Upstream status: As discussed in the ntapi issue, this was fixed in ntapi 0.4.x, but since 0.4 introduces breaking API changes, Cargo resolves versions independently and won't automatically upgrade 0.3.x.

    Two Alternatives

    • Bump ntapi in the heim fork: Technically, we could bump ntapi to 0.4.x directly inside Vector's heim fork, which would allow dropping the [patch.crates-io] entry here. However, this means taking on FFI changes and potential regression risks. It can be hard and painful :(

    • Close this issue in favor of Replace heim metrics collection crate with sysinfo #21861: Vector already tracks replacing heim with sysinfo in Replace heim metrics collection crate with sysinfo #21861 . Once that migration lands, heim and the ntapi patch will naturally be removed together without touching the old fork.

    Recommendation

    Given that the current [patch.crates-io] is stable and working, spending effort modifying the legacy heim fork purely to remove a [patch.crates-io] introduces unnecessary risk.

    It might make sense to close this issue (or at least remove the good first issue label) so it doesn't mislead new contributors into thinking this is a simple standalone cleanup task, and track the remaining work directly in #21861.

    This old PR also can be closed.

  7. Trighap52 commented on Oct 13, 2026

    @Trighap52
    Contributor

    Thanks for your comment. I’ve closed #24674. I’d be happy to help with #21861 by comparing Vector’s current heim usage with sysinfo’s capabilities and documenting any platform-specific gaps. Would that be useful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: depsAnything related to Vector's dependenciesgood first issueAnything that is good for new contributors.type: tech debtA code change that does not add user value.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions