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

Remove unwanted #[doc(hidden)] and deprecated attributes on some FreeBSD constants #2567

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

Based on FreeBSD source code, it is definitely not valid.

@rust-highfive
Copy link

r? @JohnTitor

(rust-highfive has picked a reviewer for you, use r? to override)

@GuillaumeGomez GuillaumeGomez changed the title Remove unwanted #[doc(hidden)] and deprecated attributes Remove unwanted #[doc(hidden)] and deprecated attributes on some FreeBSD constants Nov 23, 2021
@JohnTitor
Copy link
Member

@asomers You're the one that originally approved these deprecations, is this correct?

@asomers-ax
Copy link
Contributor

Yes, and I still think it's appropriate to deprecate them. An academic distinction perhaps, because the two pairs of #defines are identical. But the non-deprecated versions are portable, whereas the deprecated ones aren't. Even within FreeBSD itself, non-kernel code uses IFF_RUNNING and IFF_OACTIVE

@GuillaumeGomez
Copy link
Member Author

The comment very specifically says (for IFF_RUNNING and IFF_OACTIVE):

Old names for driver flags so that user space tools can continue to use the old (portable) names.

So at the minimum, it could be the opposite, but certainly not the current situation.

@asomers-ax
Copy link
Contributor

The new names were only introduced for in-kernel drivers. userland never switched to them. IMHO Rust's libc should never have used the new, non-portable names since for userland code they have no advantage over the portable ones.

@GuillaumeGomez
Copy link
Member Author

They exist, and freebsd source code is saying that they should be preferred, so I think it's definitely not up to us to tell libc's users that they're deprecated when they're obviously not.

@JohnTitor
Copy link
Member

What's the current status of this PR? I haven't used FreeBSD and cannot determine whether it should be used from the libc crate or not... At least the discussion seems to fail to reach an agreement, the point here is if there's a use of these items in a userland, right?

@GuillaumeGomez
Copy link
Member Author

Based on freebsd source code, they shouldn't be marked as deprecated. ^^'

@JohnTitor
Copy link
Member

JohnTitor commented Jun 12, 2022

Re-visiting. Reading freebsd/freebsd-src@292ee7b, I agree with @asomers-ax that they should be deprecated. If I understand correctly, they were renamed only for kernel/device driver development, and any user applications can use the old names without any issues.

and freebsd source code is saying that they should be preferred

@GuillaumeGomez I'm not sure what part is saying that, do you mean "... if you're in kernel"?

I think it's definitely not up to us to tell libc's users that they're deprecated when they're obviously not.

Exposing IFF_DRV_* without any information would cause some misuse, I guess. In light of that, deprecating seems one of the good options to me.

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