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

Always generate + override [lib] for filtered crates #114

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

cgwalters
Copy link
Member

The core way this project works for filtered crates is to replace them with a "stub" that only has an empty src/lib.rs. When processing the manifest previously, we didn't override the lib section that might have been present. Usually this worked because of autodiscovery.

But in the corner case that arose recently in cxx where there was a bin-only crate as a build dependency, things broke because we dropped the bin section but didn't add a lib.

Now arguably, there's a bug in cargo here because it dropped the dependency in cargo metadata but still checks it in cargo build.

But anyways it's clearly correct here for us to have a canonical lib section always (whether it was present or not in the filtered crate) so do that.

Closes: #111

@cgwalters
Copy link
Member Author

Right of course our CI somehow bitrotted in the last few months even though nothing changed here, but I put up a fix in #115

The core way this project works for filtered crates is to replace
them with a "stub" that only has an empty `src/lib.rs`. When
processing the manifest previously, we didn't override the `lib`
section that might have been present. Usually this worked because
of autodiscovery.

But in the corner case that arose recently in cxx where there
was a `bin`-only crate as a build dependency, things broke
because we dropped the `bin` section but didn't add a `lib`.

Now arguably, there's a bug in `cargo` here because it dropped
the dependency in `cargo metadata` but still checks it in
`cargo build`.

But anyways it's clearly correct here for us to have a canonical
`lib` section always (whether it was present or not in the filtered
crate) so do that.

Closes: coreos#111
Copy link
Collaborator

@jeckersb jeckersb left a comment

Choose a reason for hiding this comment

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

that branch name tho 💀 😆

@cgwalters cgwalters merged commit 0e5b84b into coreos:main Jan 16, 2025
6 checks passed
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.

cxx has invalid cxxbridge-cmd dependency
2 participants