Skip to content

Commit c9dfad9

Browse files
authored
docs: document that we should use libc from git repo when under dev (#2246)
* docs: document that we should use libc from git repo when under dev * try fix diff * try fix diff * respond to review
1 parent 8708d5b commit c9dfad9

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Please make pull requests against the `master` branch.
6363
If you change the API by way of adding, removing or changing something or if
6464
you fix a bug, please add an appropriate note, every note should be a new markdown
6565
file under the [changelog directory][cl] stating the change made by your pull request,
66-
the filename should be in the following foramt:
66+
the filename should be in the following format:
6767

6868
```
6969
<PULL_REQUEST_ID>.<TYPE>.md
@@ -104,17 +104,17 @@ run once you open a pull request.
104104

105105
### Disabling a test in the CI environment
106106

107-
Sometimes there are features that cannot be tested in the CI environment. To
107+
Sometimes there are features that cannot be tested in the CI environment. To
108108
stop a test from running under CI, add `skip_if_cirrus!()` to it. Please
109109
describe the reason it shouldn't run under CI, and a link to an issue if
110-
possible! Other tests cannot be run under QEMU, which is used for some
111-
architectures. To skip them, add a `#[cfg_attr(qemu, ignore)]` attribute to
110+
possible! Other tests cannot be run under QEMU, which is used for some
111+
architectures. To skip them, add a `#[cfg_attr(qemu, ignore)]` attribute to
112112
the test.
113113

114114
## GitHub Merge Queues
115115

116116
We use GitHub merge queues to ensure that subtle merge conflicts won't result
117-
in failing code. If you add or remove a CI job, remember to adjust the
117+
in failing code. If you add or remove a CI job, remember to adjust the
118118
required status checks in the repository's branch protection rules!
119119

120120
## API conventions

CONVENTIONS.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ We follow the conventions laid out in [Keep A CHANGELOG][kacl].
1717

1818
## libc constants, functions and structs
1919

20-
We do not define integer constants ourselves, but use or reexport them from the
21-
[libc crate][libc].
20+
We do not define ffi functions or their associated constants and types ourselves,
21+
but use or reexport them from the [libc crate][libc], if your PR uses something
22+
that does not exist in the libc crate, you should add it to libc first. Once
23+
your libc PR gets merged, you can adjust our `libc` dependency to include that
24+
libc change. Use a git dependency if necessary.
25+
26+
```toml
27+
libc = { git = "https://github.com/rust-lang/libc", rev = "the commit includes your libc PR", ... }
28+
```
2229

2330
We use the functions exported from [libc][libc] instead of writing our own
2431
`extern` declarations.
@@ -40,7 +47,7 @@ When creating newtypes, we use Rust's `CamelCase` type naming convention.
4047
## cfg gates
4148

4249
When creating operating-system-specific functionality, we gate it by
43-
`#[cfg(target_os = ...)]`. If more than one operating system is affected, we
50+
`#[cfg(target_os = ...)]`. If more than one operating system is affected, we
4451
prefer to use the cfg aliases defined in build.rs, like `#[cfg(bsd)]`.
4552

4653
## Bitflags
@@ -115,5 +122,5 @@ To deprecate an interface, put the following attribute on the top of it:
115122
`<Version>` is the version where this interface will be deprecated, in most
116123
cases, it will be the version of the next release. And a user-friendly note
117124
should be added. Normally, there should be a new interface that will replace
118-
the old one, so a note should be something like: "<New Interface> should be
125+
the old one, so a note should be something like: "`<New Interface>` should be
119126
used instead".

RELEASE_PROCEDURE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@ library.
44
# Before Release
55

66
Nix uses [cargo release](https://github.com/crate-ci/cargo-release) to automate
7-
the release process. Based on changes since the last release, pick a new
7+
the release process. Based on changes since the last release, pick a new
88
version number following semver conventions. For nix, a change that drops
99
support for some Rust versions counts as a breaking change, and requires a
1010
major bump.
1111

1212
The release is prepared as follows:
1313

14-
- Ask for a new libc version if, necessary. It usually is. Then update the
15-
dependency in Cargo.toml accordingly.
14+
- Ask for a new libc version if, necessary. It usually is. Then update the
15+
dependency in `Cargo.toml` to rely on a release from crates.io.
16+
17+
```diff
18+
[dependencies]
19+
-libc = { git = "https://github.com/rust-lang/libc", rev = "<Revision>", features = ["extra_traits"] }
20+
+libc = { version = "<New Version>", features = ["extra_traits"] }
21+
```
22+
1623
- Update the version number in `Cargo.toml`
1724
- Generate `CHANGELOG.md` for this release by
1825
`towncrier build --version=<VERSION> --yes`

0 commit comments

Comments
 (0)