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

[WIP] freebsd: netlink #3070

Closed
wants to merge 6 commits into from
Closed

Conversation

ngortheone
Copy link

@ngortheone ngortheone commented Jan 14, 2023

Netlink support was merged into FreeBSD-14 recently
https://github.com/freebsd/freebsd-quarterly/blob/main/2022q4/netlink.adoc
https://reviews.freebsd.org/D36002
https://reviews.freebsd.org/source/src/browse/main/sys/netlink/netlink.h
https://reviews.freebsd.org/source/src/browse/main/sys/netlink/netlink_route.h
https://reviews.freebsd.org/source/src/browse/main/sys/netlink/netlink_generic.h

This PR aims to add missing libc definitions. This is my first time contributing to rust and this crate and I have a bunch of questions:

  • It is not clear when s! macro is supposed to be used vs s_with_no_extra_traits!, I couldn't decipher macros definitions to figure this out.

  • How to avoid test failures on earlier versions of FreeBSD? This functionality is only available on latest builds of FreeBSD-CURRENT (14)

  • libc-test/semver seems to not care about versions of the OS, is there a way to specify symbols for specific version of the OS?


  • Edit corresponding file(s) under libc-test/semver when you add/remove item(s)
  • rustc ci/style.rs && ./style src
  • cd libc-test && cargo test (This might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure.)
  • Your PR that bumps up the crate version doesn't contain any other changes

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2023

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.

@ngortheone ngortheone changed the title [WIP] freebsd: add basic netlink definitions [WIP] freebsd: netlink Jan 14, 2023
@ngortheone
Copy link
Author

@JohnTitor pls help, not sure what causes CI failures and local libc-test failures

@ngortheone
Copy link
Author

It looks like FreeBSD image on CI needs to be updated

@ngortheone ngortheone force-pushed the freebsd-netlink branch 3 times, most recently from e7c8325 to 6bfbe9e Compare January 21, 2023 05:34
@bors
Copy link
Contributor

bors commented Jan 22, 2023

☔ The latest upstream changes (presumably #3073) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Also, I suggest you add only what you plan to use now, otherwise it will be very difficult to review.

@@ -29,7 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
image: freebsd-14-0-current-amd64-v20220902
image_family: freebsd-14-0-snap
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the merge conflict but I updated it on master, could you rebase?

@@ -1995,6 +2003,7 @@ fn test_freebsd(target: &str) {
"utime.h",
"utmpx.h",
"wchar.h",

Copy link
Member

Choose a reason for hiding this comment

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

This should be unnecessary.

Comment on lines +555 to +557



Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -228,6 +228,7 @@ s! {
/// kthread flag.
pub ki_tdflags: ::c_long,
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

s! {
/// Netlink Message Header
pub struct nlmsghdr {
/// Length of message including header
Copy link
Member

Choose a reason for hiding this comment

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

Tabs are denied in this repo, could you replace them with white spaces?

@@ -0,0 +1,339 @@

Copy link
Member

Choose a reason for hiding this comment

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

Don't separate files, we put all the items into one file unless it needs a cfg or something else.

@bors
Copy link
Contributor

bors commented Apr 17, 2023

☔ The latest upstream changes (presumably #3203) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnTitor
Copy link
Member

Closing for inactivity but feel free to recreate a new one if you're still interested in this and have time to work on. Thanks anyway!

@JohnTitor JohnTitor closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants