Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace maybenot submodule with direct ffi re-export wrapper crate #22

Open
wants to merge 2 commits into
base: mullvad
Choose a base branch
from

Conversation

faern
Copy link
Member

@faern faern commented Jan 24, 2025

This PR removes maybenot as a submodule. And instead adds a local simple wrapper (re-export?) crate named maybenot-ffi. All this crate does is to depend on the real maybenot-ffi crate and re-exports the entire API of it.

This change allows us to depend on maybenot-ffi from crates.io instead of having it as a git dependency (submodule). This in turn allows us to to track maybenot-ffi and all its dependencies in the parent repository and workspace lockfile, simplifying dependency management and verification.

This force us to commit the maybenot.h header to this repository. This is explained in the readme. It should no longer be automagically generated. This removes the build time dependency on cbindgen and helps with reproducible builds also.


This change is Reviewable

Copy link
Member Author

@faern faern left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 9 files reviewed, all discussions resolved (waiting on @MarkusPettersson98)


maybenot-ffi/Cargo.toml line 3 at r1 (raw file):

[package]
name = "maybenot-ffi"
edition = "2021"

This crate is part of our upstream cargo workspace. But we still can't and should not inherit package fields and linting rules here. We can't do that, since this fork of wireguard-go should be buildable without being part of a parent workspace, so this crate can't assume it is. Secondly, many of the package fields are not relevant/correct, such as repository url. Linting etc is not interesting since there is no code in this library really.

@faern faern force-pushed the replace-maybenot-ffi-build branch from b0148ce to 030c470 Compare January 24, 2025 10:43
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 8 of 9 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faern)

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.

2 participants