Skip to content

Commit bf97671

Browse files
committed
Document the policy about breaking change
1 parent 70962e3 commit bf97671

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ With that in mind, the steps for adding a new API are:
3636
4. Wait for CI to pass, fixing errors.
3737
5. Wait for a merge!
3838

39-
### Test before you commit
39+
## Test before you commit
4040

4141
We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
4242

@@ -46,7 +46,23 @@ We have two automated tests running on [GitHub Actions](https://github.com/rust-
4646
2. Style checker
4747
- `rustc ci/style.rs && ./style src`
4848

49-
### Releasing your change to crates.io
49+
## Breaking change policy
50+
51+
Sometimes an upstream adds a breaking change to their API e.g. removing outdated items,
52+
changing the type signature, etc. And we probably should follow that change to build the
53+
`libc` crate successfully. It's annoying to do the equivalent of semver-major versioning
54+
for each such change. Instead, we mark the item as deprecated and do the actual change
55+
after a certain period. The steps are:
56+
57+
1. Add `#[deprecated(since = "", note="")]` attribute to the item.
58+
- The `since` field should have a next version of `libc`
59+
(e.g., if the current version is `0.2.1`, it should be `0.2.2`).
60+
- The `note` field should have a reason to deprecate and a tracking issue to call for comments
61+
(e.g., "We consider removing this as the upstream removed it.
62+
If you're using it, please comment on #XXX").
63+
2. If we don't see any concerns for a while, do the change actually.
64+
65+
## Releasing your change to crates.io
5066

5167
Now that you've done the amazing job of landing your new API or your new
5268
platform in this crate, the next step is to get that sweet, sweet usage from

0 commit comments

Comments
 (0)