Skip to content

Commit 956717f

Browse files
authored
Merge pull request rust-lang#4015 from tgross35/format-markdown
[0.2] Format all markdown files to rewrap text
2 parents 7084470 + a354261 commit 956717f

File tree

4 files changed

+92
-92
lines changed

4 files changed

+92
-92
lines changed

CONTRIBUTING.md

+34-38
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Contributing to `libc`
22

3-
Welcome! If you are reading this document, it means you are interested in contributing
4-
to the `libc` crate.
3+
Welcome! If you are reading this document, it means you are interested in
4+
contributing to the `libc` crate.
55

66
## v0.2 changes
77

8-
If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch.
9-
If you want to add any breaking changes, it should be submitted to the main branch,
10-
which has changes for v0.3.
11-
We will support and make a new release for v0.2 until we make the first release of v0.3.
8+
If you want to add your changes to v0.2, please submit them to the `libc-0.2`
9+
branch. If you want to add any breaking changes, it should be submitted to the
10+
main branch, which has changes for v0.3. We will support and make a new release
11+
for v0.2 until we make the first release of v0.3.
1212

1313
## Adding an API
1414

1515
Want to use an API which currently isn't bound in `libc`? It's quite easy to add
1616
one!
1717

1818
The internal structure of this crate is designed to minimize the number of
19-
`#[cfg]` attributes in order to easily be able to add new items which apply
20-
to all platforms in the future. As a result, the crate is organized
21-
hierarchically based on platform. Each module has a number of `#[cfg]`'d
22-
children, but only one is ever actually compiled. Each module then reexports all
23-
the contents of its children.
24-
25-
This means that for each platform that libc supports, the path from a
26-
leaf module to the root will contain all bindings for the platform in question.
19+
`#[cfg]` attributes in order to easily be able to add new items which apply to
20+
all platforms in the future. As a result, the crate is organized hierarchically
21+
based on platform. Each module has a number of `#[cfg]`'d children, but only one
22+
is ever actually compiled. Each module then reexports all the contents of its
23+
children.
24+
25+
This means that for each platform that libc supports, the path from a leaf
26+
module to the root will contain all bindings for the platform in question.
2727
Consequently, this indicates where an API should be added! Adding an API at a
2828
particular level in the hierarchy means that it is supported on all the child
2929
platforms of that level. For example, when adding a Unix API it should be added
@@ -55,7 +55,8 @@ standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
5555

5656
## Test before you commit
5757

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

6061
1. [`libc-test`](https://github.com/gnzlbg/ctest)
6162
- `cd libc-test && cargo test`
@@ -65,36 +66,31 @@ We have two automated tests running on [GitHub Actions](https://github.com/rust-
6566

6667
## Breaking change policy
6768

68-
Sometimes an upstream adds a breaking change to their API e.g. removing outdated items,
69-
changing the type signature, etc. And we probably should follow that change to build the
70-
`libc` crate successfully. It's annoying to do the equivalent of semver-major versioning
71-
for each such change. Instead, we mark the item as deprecated and do the actual change
72-
after a certain period. The steps are:
69+
Sometimes an upstream adds a breaking change to their API e.g. removing outdated
70+
items, changing the type signature, etc. And we probably should follow that
71+
change to build the `libc` crate successfully. It's annoying to do the
72+
equivalent of semver-major versioning for each such change. Instead, we mark the
73+
item as deprecated and do the actual change after a certain period. The steps
74+
are:
7375

7476
1. Add `#[deprecated(since = "", note="")]` attribute to the item.
75-
- The `since` field should have a next version of `libc`
76-
(e.g., if the current version is `0.2.1`, it should be `0.2.2`).
77-
- The `note` field should have a reason to deprecate and a tracking issue to call for comments
78-
(e.g., "We consider removing this as the upstream removed it.
79-
If you're using it, please comment on #XXX").
77+
- The `since` field should have a next version of `libc` (e.g., if the current
78+
version is `0.2.1`, it should be `0.2.2`).
79+
- The `note` field should have a reason to deprecate and a tracking issue to
80+
call for comments (e.g., "We consider removing this as the upstream removed
81+
it. If you're using it, please comment on #XXX").
82+
8083
2. If we don't see any concerns for a while, do the change actually.
8184

8285
## Supported target policy
8386

84-
When Rust removes a support for a target, the libc crate also may remove the support anytime.
87+
When Rust removes a support for a target, the libc crate also may remove the
88+
support anytime.
8589

8690
## Releasing your change to crates.io
8791

88-
Now that you've done the amazing job of landing your new API or your new
89-
platform in this crate, the next step is to get that sweet, sweet usage from
90-
crates.io! The only next step is to bump the version of libc and then publish
91-
it. If you'd like to get a release out ASAP you can follow these steps:
92-
93-
1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`.
94-
1. Send a PR to this repository. It should [look like this][example-pr], but it'd
95-
also be nice to fill out the description with a small rationale for the
96-
release (any rationale is ok though!).
97-
1. Once merged, the release will be tagged and published by one of the libc crate
98-
maintainers.
92+
This repository uses [release-plz] to handle releases. Once your pull request
93+
has been merged, a maintainer just needs to verify the generated changelog, then
94+
merge the bot's release PR. This will automatically publish to crates.io!
9995

100-
[example-pr]: https://github.com/rust-lang/libc/pull/2120
96+
[release-plz]: https://github.com/MarcoIeni/release-plz

README.md

+34-34
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This crate exports all underlying platform types, functions, and constants under
1111
the crate root, so all items are accessible as `libc::foo`. The types and values
1212
of all the exported APIs match the platform that libc is compiled for.
1313

14-
Windows API bindings are not included in this crate. If you are looking for WinAPI
15-
bindings, consider using crates like [windows-sys].
14+
Windows API bindings are not included in this crate. If you are looking for
15+
WinAPI bindings, consider using crates like [windows-sys].
1616

1717
More detailed information about the design of this library can be found in its
1818
[associated RFC][rfc].
@@ -24,10 +24,11 @@ More detailed information about the design of this library can be found in its
2424

2525
The main branch is now for v0.3 which has some breaking changes.
2626

27-
For v0.2, please submit PRs to the `libc-0.2` branch instead.
28-
We will stop making new v0.2 releases once we release v0.3 on crates.io.
27+
For v0.2, please submit PRs to the `libc-0.2` branch instead. We will stop
28+
making new v0.2 releases once we release v0.3 on crates.io.
2929

30-
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
30+
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for
31+
details.
3132

3233
## Usage
3334

@@ -40,46 +41,45 @@ libc = "0.2"
4041

4142
## Features
4243

43-
* `std`: by default `libc` links to the standard library. Disable this
44-
feature to remove this dependency and be able to use `libc` in `#![no_std]`
45-
crates.
44+
* `std`: by default `libc` links to the standard library. Disable this feature
45+
to remove this dependency and be able to use `libc` in `#![no_std]` crates.
4646

4747
* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`.
4848
This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`.
4949

50-
* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s.
51-
If you use Rust >= 1.62, this feature is implicitly enabled.
52-
Otherwise it requires a nightly rustc.
50+
* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s. If you
51+
use Rust >= 1.62, this feature is implicitly enabled. Otherwise it requires a
52+
nightly rustc.
5353

5454
* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
5555

5656
## Rust version support
5757

58-
The minimum supported Rust toolchain version is currently **Rust 1.13.0**.
59-
(libc does not currently have any policy regarding changes to the minimum
60-
supported Rust version; such policy is a work in progress.) APIs requiring
61-
newer Rust features are only available on newer Rust toolchains:
58+
The minimum supported Rust toolchain version is currently **Rust 1.13.0**. (libc
59+
does not currently have any policy regarding changes to the minimum supported
60+
Rust version; such policy is a work in progress.) APIs requiring newer Rust
61+
features are only available on newer Rust toolchains:
6262

6363
| Feature | Version |
64-
|----------------------|---------|
65-
| `union` | 1.19.0 |
66-
| `const mem::size_of` | 1.24.0 |
67-
| `repr(align)` | 1.25.0 |
68-
| `extra_traits` | 1.25.0 |
69-
| `core::ffi::c_void` | 1.30.0 |
70-
| `repr(packed(N))` | 1.33.0 |
71-
| `cfg(target_vendor)` | 1.33.0 |
72-
| `const-extern-fn` | 1.62.0 |
64+
| -------------------- | ------- |
65+
| `union` | 1.19.0 |
66+
| `const mem::size_of` | 1.24.0 |
67+
| `repr(align)` | 1.25.0 |
68+
| `extra_traits` | 1.25.0 |
69+
| `core::ffi::c_void` | 1.30.0 |
70+
| `repr(packed(N))` | 1.33.0 |
71+
| `cfg(target_vendor)` | 1.33.0 |
72+
| `const-extern-fn` | 1.62.0 |
7373

7474
## Platform support
7575

76-
You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see.
76+
You can see the platform(target)-specific docs on [docs.rs], select a platform
77+
you want to see.
7778

78-
See
79-
[`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh)
80-
for the platforms on which `libc` is guaranteed to build for each Rust
81-
toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the
82-
platforms in which `libc` tests are run.
79+
See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh) for
80+
the platforms on which `libc` is guaranteed to build for each Rust toolchain.
81+
The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which
82+
`libc` tests are run.
8383

8484
<div class="platform_docs"></div>
8585

@@ -97,13 +97,13 @@ at your option.
9797

9898
## Contributing
9999

100-
We welcome all people who want to contribute. Please see the [contributing
101-
instructions] for more information.
100+
We welcome all people who want to contribute. Please see the
101+
[contributing instructions] for more information.
102102

103103
[contributing instructions]: https://github.com/rust-lang/libc/blob/HEAD/CONTRIBUTING.md
104104

105-
Contributions in any form (issues, pull requests, etc.) to this project
106-
must adhere to Rust's [Code of Conduct].
105+
Contributions in any form (issues, pull requests, etc.) to this project must
106+
adhere to Rust's [Code of Conduct].
107107

108108
[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct
109109

ci/README.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ result the CI is pretty complicated and also pretty large! Hopefully this can
44
serve as a guide through the sea of scripts in this directory and elsewhere in
55
this project.
66

7-
Note that this documentation is quite outdated. See CI config and scripts
8-
in the `ci` directory how we run CI now.
7+
Note that this documentation is quite outdated. See CI config and scripts in the
8+
`ci` directory how we run CI now.
99

1010
# Files
1111

@@ -20,8 +20,9 @@ First up, let's talk about the files in this directory:
2020

2121
# CI Systems
2222

23-
Currently this repository leverages a combination of GitHub Actions and Cirrus CI
24-
for running tests. You can find tested triples in [Actions config] or [Cirrus config].
23+
Currently this repository leverages a combination of GitHub Actions and Cirrus
24+
CI for running tests. You can find tested triples in [Actions config] or
25+
[Cirrus config].
2526

2627
The Windows triples are all pretty standard, they just set up their environment
2728
then run tests, no need for downloading any extra target libs (we just download
@@ -101,8 +102,10 @@ about above), and then shut down.
101102

102103
1. [Download the latest stable amd64-bootonly release ISO](https://www.freebsd.org/where.html).
103104
E.g. FreeBSD-11.1-RELEASE-amd64-bootonly.iso
104-
2. Create the disk image: `qemu-img create -f qcow2 FreeBSD-11.1-RELEASE-amd64.qcow2 2G`
105-
3. Boot the machine: `qemu-system-x86_64 -cdrom FreeBSD-11.1-RELEASE-amd64-bootonly.iso -drive if=virtio,file=FreeBSD-11.1-RELEASE-amd64.qcow2 -net nic,model=virtio -net user`
105+
2. Create the disk image:
106+
`qemu-img create -f qcow2 FreeBSD-11.1-RELEASE-amd64.qcow2 2G`
107+
3. Boot the machine:
108+
`qemu-system-x86_64 -cdrom FreeBSD-11.1-RELEASE-amd64-bootonly.iso -drive if=virtio,file=FreeBSD-11.1-RELEASE-amd64.qcow2 -net nic,model=virtio -net user`
106109
4. Run the installer, and install FreeBSD:
107110
1. Install
108111
1. Continue with default keymap
@@ -159,9 +162,9 @@ about above), and then shut down.
159162

160163
1. Exit the post install shell: `exit`
161164
1. Back in in the installer choose Reboot
162-
1. If all went well the machine should reboot and show a login prompt.
163-
If you switch to the serial console by choosing View > serial0 in
164-
the qemu menu, you should be logged in as root.
165+
1. If all went well the machine should reboot and show a login prompt. If you
166+
switch to the serial console by choosing View > serial0 in the qemu menu,
167+
you should be logged in as root.
165168
1. Shutdown the machine: `shutdown -p now`
166169

167170
Helpful links
@@ -178,8 +181,8 @@ Helpful links
178181
4. run installer
179182
5. `echo 'set tty com0' >> /etc/boot.conf`
180183
6. `echo 'boot' >> /etc/boot.conf`
181-
7. Modify /etc/ttys, change the `tty00` at the end from 'unknown off' to
182-
'vt220 on secure'
184+
7. Modify /etc/ttys, change the `tty00` at the end from 'unknown off' to 'vt220
185+
on secure'
183186
8. Modify same line in /etc/ttys to have `"/root/foo.sh"` as the shell
184187
9. Add this script to `/root/foo.sh`
185188

libc-test/semver/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ ensure that APIs aren't removed between libc releases.
66
## File order
77

88
Files are including in the following order:
9-
* Family, e.g. `unix.txt`. NOTE: Windows is skipped here and includes as OS
10-
name below.
11-
* Vendor, e.g. `apple.txt`. This allows us to have a single file with system
12-
calls shared between multiple OSs, e.g. `ios.txt`, `macos.txt` share the same
13-
kernel.
14-
* OS, e.g `linux.txt`, `macos.txt`, `windows.txt`.
15-
* Architecture specific system calls, e.g. `linux-x86_64.txt` or
16-
`linux-aarch64.txt`.
17-
* Target environment, e.g. `windows-mscv.txt` or `windows-gnu.txt`.
9+
10+
* Family, e.g. `unix.txt`. NOTE: Windows is skipped here and includes as OS name
11+
below.
12+
* Vendor, e.g. `apple.txt`. This allows us to have a single file with system
13+
calls shared between multiple OSs, e.g. `ios.txt`, `macos.txt` share the same
14+
kernel.
15+
* OS, e.g `linux.txt`, `macos.txt`, `windows.txt`.
16+
* Architecture specific system calls, e.g. `linux-x86_64.txt` or
17+
`linux-aarch64.txt`.
18+
* Target environment, e.g. `windows-mscv.txt` or `windows-gnu.txt`.

0 commit comments

Comments
 (0)