bsd: Annotate ELAST constants as unstable#5118
Conversation
This comment has been minimized.
This comment has been minimized.
53d55bf to
cd01c4c
Compare
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
I don't quite understand what you mean. You mention deprecating for the 0.2 release, and removal for Also, I left some comments, especially in #5122, that I would like to get external feedback on, if @rustbot ready |
This comment has been minimized.
This comment has been minimized.
No in this PR, let's do that in a PR actually removing them. |
There was a problem hiding this comment.
LGTM, but this would make a lot of warnings in the world so cc @tgross35 to be seconded if we're ready to go ahead or not.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
This comment has been minimized.
This comment has been minimized.
|
CI actually passes. There seems to be an issue with a glob import that is not used, but this has not |
This is a follow up from rust-lang#5118. That PR aimed for deprecation such the proposed changes were included in the next stable release. This patch completely removes the symbols for the 1.0 release.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
206303b to
5e6c6d6
Compare
This comment has been minimized.
This comment has been minimized.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
This follows from rust-lang#5118, where all these symbols were deprecated. @JohnTitor then advised for their removal in a separate PR that was not on track to a stable release. There have been a few more symbols that had to be altogether removed because they relied on the now non-existent constants. See the accompanying PR for details.
|
I've been mulling this over a lot the past couple of weeks and have been tending to agree with Amanieu's comment in #3131 (comment). That is, I don't think deprecating to remove is the right path here: there are completely valid cases for these constants, e.g. allocating an array that can then be indexed by all possible values of an enum or looping through possible values of a flag. (I've actually needed both of these in the past couple of weeks.) Would it be possible to find+replace the deprecation notices with a doc comment indicating that these constant values are subject to change? It can just be a terse comment linking to usage guidelines, which I'm adding in #5179 to help address this case. @JohnTitor I'd like your thoughts here of course, given your concern in #3040 (comment). My thinking is that the failure modes here likely aren't any worse than any other constant like unsupported syscalls or flags -
That is quite a cool tool! You may want to rename/reframe it as something like "API reviewer" because I assume it is useful beyond |
5e6c6d6 to
e70bebb
Compare
This comment has been minimized.
This comment has been minimized.
|
Done. From reading what may become the new usage guidelines in #5179, I decided to instead add a new macro for declaring these types of constants that automatically adds the doc comment. I've opened another PR that solely defines the macro. Should I close the analogous PRs that remove the symbols? |
| /// This constant, among others often used in C for the purposes of denoting the | ||
| /// latest value or limit in a set of constants, is likely to change upstream. | ||
| /// For correct usage, see the [crate-level documentation][docs]. | ||
| /// | ||
| /// [docs]: index.html#usage-recommendations |
There was a problem hiding this comment.
If we had rust-lang/rust#143549 then that would be one thing, but I'd like to avoid more functionlike macros then necessary because they tend to make things pretty messy. I think the comment can be made to fit on 1-2 lines so it's easier to copy around to all relevant values, something like:
/// This is an end marker constant, its value is likely to change across releases. See
/// [Best Practices](crate::#best-practices) for details.
There was a problem hiding this comment.
Done on this PR. Will be updating the rest soon.
I think so. My concern is that removing them will break valid code where the only alternatives are going to be strictly worse. |
e70bebb to
8594165
Compare
this patch annotates symbols that are known to have been the source of semver-breaking issues by using a macro for which another pr has been opened. these issues have been tracked thus far in rust-lang#3131.
8594165 to
2415e63
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
ELAST constantsELAST constants as unstable
Description
This set of constants had already been discussed to cause some issues in #3131. This patch deprecates such bug-prone and latest-error symbols such that the interface to the
libccrate is not prone to SemVer-breakage as often as the values change upstream.Note the NetBSD constant was left unmodified as it already had been annotated with a deprecation attribute.
If you yourself want to help out in the deprecation effort for this type of constants across the
libccrate, maybe try out thelibc-constant-deprecatorcrate. It's been the tool used to perform the changes that have been submitted in this PR, and it very much welcomes bug reports.Sources
Upstream source code for the FreeBSD
ELASTmacro declaration, mentioning its use as a "limit" value for othererrnovalues.Upstream source code for the OpenBSD equivalent macro declaration.
Upstream source code for the XNU kernel equivalent macro declaration.
Upstream source code for the DragonFlyBSD equivalent macro declaration.
Checklist
libc-test/semverhave been updated*LASTor*MAXare included (see #3131)cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI