-
Notifications
You must be signed in to change notification settings - Fork 104
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
Improve per-platform feature selection. #478
Conversation
I've looked around the examples and the impl/ directory, and I'm not sure where to add this crate: https://github.com/lambda-fairy/rust-errno/blob/main/Cargo.toml This patch should consolidate the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm not thrilled by the idea of having to invoke and parse cargo-tree for every platform, but cargo isn't giving good alternatives.
I'm generally supportive of the approach. Are there any other tactics for this in the wild?
I'm also generally supportive of the approach given the state of cargo, but sad that there don't seem to be viable alternatives - thanks so much for putting this together and upstreaming it 👍 |
It looks like this patch will not fix As for approaches to this problem, I only found two choices: Import cargo as a crate directly, and use its internal resolver implementation (which is I chose to use |
Very much looking forward to this landing! |
Sorry, missed that you had also responded to review comments as well. I'm good with this as long as the new code can be covered by unit tests where reasonable. The copyright/license notice probably needs to be updated, but I'm not entirely sure what needs to happen given the CLA. @hlopko do you have any familiarity with that? |
I have some better tests coming, and I still need to go through the |
Sounds good. Thanks for the update! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handful of comments. Generally looks good to me. Thanks for putting all of this together.
Can you rebase to HEAD as well just to make sure no issues have cropped up?
Will address these, but I think the Dependabot stuff and #482 should go in first. Not in a rush over the weekend. |
OK, I think this is all set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, one question.
Great. Thanks. Can you merge with main and rerun bootstrap? Then I think this is good to go. Thanks for all the work on this. |
Merged main, running bootstrap had no effect vs the commit with the Tera fix. |
Released in v0.16.0 |
I'm not sure if this is intentional or not, but rules for crates with
(e.g. third_party/cargo/remote/BUILD.blake2b_simd-0.5.11.bazel in this PR), which brakes crates that verify that they were built with |
Regenerating the examples with this PR makes many of them fail to build because no crates have any features enabled. I'm looking at fixing it, FYI for anybody else encountering random build failures. |
Currently many things fail to build due to google#478 stripping out all the features.
It works properly with no explicit targets set (aka "use all the targets"), and it also works properly with some of the examples that set `default-members = []`. I think there's still something wrong, because it dropped features from some Windows-specific crates relative to before google#478, but I'm not sure what's supposed to happen. At least all the tests in this repository pass on Linux again...
It works properly with no explicit targets set (aka "use all the targets"), and it also works properly with some of the examples that set `default-members = []`. I think there's still something wrong, because it dropped features from some Windows-specific crates relative to before #478, but I'm not sure what's supposed to happen. At least all the tests in this repository pass on Linux again...
This patch should fix #451.
The patch runs
cargo-tree
to determine which features are enabled on each platform, and then groups them by using vectors of platforms as map keys. It's a lot of code, and there are no tests yet. But I wanted to post this initial effort and get some feedback from the code owners. @illicitonion has already seen this code, but I believe it will be new to @dfreese and @PiotrSikora (who filed the linked issue).The new file is copyright AgileBits, as this was work for hire for them. They are fine with contributing, and my repo has been public for months.