-
Notifications
You must be signed in to change notification settings - Fork 1k
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
freebsd: move net/if_mib.h contents to submodule #3367
base: main
Are you sure you want to change the base?
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
2e82a35
to
f75539f
Compare
Even if only |
New revision completely drops the semver part -- will gladly use any hint to get it working and add it back. |
To avoid the semver issue, the only way I see is to reexport items from the submodule by default. |
That would avoid the breaking change, but that would not work for |
Indeed. Let's see if libc's maintainers have another way to do it. But otherwise, I'm very fine with the breaking change. I'll just update |
I'm baffled by the tests still trying to look at |
f75539f
to
5b87cab
Compare
OK I realize they come from the generated tests. This part is essentially dedicated to |
e999399
to
fe5a9ff
Compare
Note also that private code might use these items. The libs-maintainers team has been considering making a new major release (0.3? 1.0? I'm not sure though) and I think it'd be better to include this change there. Let's wait for that release. |
How can we track that here, when the symbols moved were not included in semver to start with? Is there a "list of breaking changes" somewhere to add this PR to for consideration? |
☔ The latest upstream changes (presumably #3341) made this pull request unmergeable. Please resolve the merge conflicts. |
fe5a9ff
to
58f3ce4
Compare
See #3248, I've added this to the task list. |
58f3ce4
to
987dc97
Compare
Rebased onto 0.2.151 |
What about adding a feature flag to libc? An off-by-default "ifmib" feature would let crates like @ydirson's use the constants in their correct namespace, not conflicting with the new constant introduced by #3201 , while other crates won't see a change. And libc could remove the feature flag when it does next make a major release. |
As I understand it, such a flag would enable either |
Whatever it's named, the default option should be the status quo, and the alternative would be to put ifmib into a submodule. BTW, I've seen other crates that call this "unstable". |
That would seem a bit too generic here, we could just name it |
987dc97
to
d60a20b
Compare
rebased |
☔ The latest upstream changes (presumably #3587) made this pull request unmergeable. Please resolve the merge conflicts. |
d60a20b
to
476635a
Compare
There is a conflict of NETLINK_GENERIC definitions between net/if_mib.h and netlink/netlink.h. netlink.h is already exported in the crate root for Linux (and those definitions are already used by at least crates neli and netlink-packet-route), and if_mib is not much used yet, so this moves if_mib contents into its own namespace to leave place for netlink support on FreeBSD (rust-lang#3194). Module definition moved to the end of file to avoid cryptic style.rs error "constant found after module when it belongs before". ctest as of 0.22 cannot be told a given header's symbols live in a submodule, so let the tests ignore all of them. Signed-off-by: Yann Dirson <[email protected]>
Could we just add a single |
All software using the But I would not object to a simpler change without namespacing if other parties more in contact with that API feel it's OK. @GuillaumeGomez do you think about any FreeBSD devs who would have informed opinion? Note I just stumbled by chance (digging into |
I don't know of any FreeBSD devs so I have no idea. |
If the intent is that both netlink and if_mib are available and the user has to select one, then it makes sense to move either everything from if_mib to a separate module, possibly everything from netlink to its own module as well. If instead it is only a couple of variables that conflict then I don't think we need to move everything. @asomers what is planned here? Based on your above comment
this makes it sound a bit like |
No. If anything, more stuff is moving toward netlink. But I definitely expect both to be used for a long time. I don't see any solution that doesn't involve moving one thing or the other into a submodule. Perhaps both. |
There is a conflict of NETLINK_GENERIC definitions between net/if_mib.h and netlink/netlink.h. netlink.h is already exported in the crate root for Linux (and those definitions are already used by at least crates neli and netlink-packet-route), and if_mib is not much used yet, so this moves if_mib contents into its own namespace to leave place for netlink support on FreeBSD (#3201).
Looks like it is the first time namespacing is used in the libc crate, so I had to guess a few things, being quite new to this project.
The moved symbols did not appear in semver, so I just added the new ones.
sysinfo
from @GuillaumeGomez seems to be the only impacted public crate.