Skip to content

Commit 6e95369

Browse files
committed
Merge remote-tracking branch 'rustlang/master'
2 parents 92b24f5 + 7644a1f commit 6e95369

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5331
-1793
lines changed

.travis.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ matrix:
1414
- name: "Documentation"
1515
env: TARGET=x86_64-unknown-linux-gnu
1616
script: sh ci/dox.sh
17-
install: true
17+
install:
18+
- travis_retry rustup component add rust-src
19+
- travis_retry cargo install xargo
1820
stage: tools-and-build-and-tier1
1921
- name: "Shellcheck"
2022
install: true
@@ -23,11 +25,24 @@ matrix:
2325
- shellcheck ci/*.sh
2426
stage: tools-and-build-and-tier1
2527
- name: "Style"
26-
install: rustup component add rustfmt-preview
28+
install: true
2729
script:
2830
- rustc ci/style.rs && ./style src
2931
# Disabled due to rust-lang/rustfmt#3341
30-
# - cargo fmt --all -- --check
32+
#- |
33+
# if rustup component add rustfmt-preview ; then
34+
# cargo fmt --all -- --check
35+
# fi
36+
stage: tools-and-build-and-tier1
37+
- name: "Semver Linux"
38+
install: travis_retry cargo +nightly install semverver
39+
script: sh ci/semver.sh
40+
stage: tools-and-build-and-tier1
41+
- name: "Semver MacOSX"
42+
install: travis_retry cargo +nightly install semverver
43+
script: sh ci/semver.sh
44+
os: osx
45+
osx_image: xcode10
3146
stage: tools-and-build-and-tier1
3247

3348
# BUILD stable, beta, nightly
@@ -45,7 +60,9 @@ matrix:
4560
script: sh ci/build.sh
4661
stage: tools-and-build-and-tier1
4762
rust: nightly
48-
install: true
63+
install:
64+
- travis_retry rustup component add rust-src
65+
- travis_retry cargo install xargo
4966
- name: "Build Stable Rust"
5067
script: sh ci/build.sh
5168
stage: tools-and-build-and-tier1
@@ -189,9 +206,14 @@ matrix:
189206
stage: tier2
190207

191208
allow_failures:
209+
# FIXME: android build bots time out irregularly
210+
- env: TARGET=aarch64-linux-android
211+
- env: TARGET=arm-linux-androideabi
192212
# FIXME: https://github.com/rust-lang/libc/issues/1226
193213
- env: TARGET=asmjs-unknown-emscripten
194214
- env: TARGET=wasm32-unknown-emscripten
215+
- name: "Semver Linux"
216+
- name: "Semver MacOSX"
195217

196218
install: travis_retry rustup target add $TARGET
197219

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to `libc`
2+
3+
Welcome! If you are reading this document, it means you are interested in contributing
4+
to the `libc` crate.
5+
6+
## Adding an API
7+
8+
Want to use an API which currently isn't bound in `libc`? It's quite easy to add
9+
one!
10+
11+
The internal structure of this crate is designed to minimize the number of
12+
`#[cfg]` attributes in order to easily be able to add new items which apply
13+
to all platforms in the future. As a result, the crate is organized
14+
hierarchically based on platform. Each module has a number of `#[cfg]`'d
15+
children, but only one is ever actually compiled. Each module then reexports all
16+
the contents of its children.
17+
18+
This means that for each platform that libc supports, the path from a
19+
leaf module to the root will contain all bindings for the platform in question.
20+
Consequently, this indicates where an API should be added! Adding an API at a
21+
particular level in the hierarchy means that it is supported on all the child
22+
platforms of that level. For example, when adding a Unix API it should be added
23+
to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to
24+
`src/unix/notbsd/linux/mod.rs`.
25+
26+
If you're not 100% sure at what level of the hierarchy an API should be added
27+
at, fear not! This crate has CI support which tests any binding against all
28+
platforms supported, so you'll see failures if an API is added at the wrong
29+
level or has different signatures across platforms.
30+
31+
With that in mind, the steps for adding a new API are:
32+
33+
1. Determine where in the module hierarchy your API should be added.
34+
2. Add the API.
35+
3. Send a PR to this repo.
36+
4. Wait for CI to pass, fixing errors.
37+
5. Wait for a merge!
38+
39+
### Test before you commit
40+
41+
We have two automated tests running on [Travis](https://travis-ci.org/rust-lang/libc):
42+
43+
1. [`libc-test`](https://github.com/alexcrichton/ctest)
44+
- `cd libc-test && cargo test`
45+
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
46+
2. Style checker
47+
- `rustc ci/style.rs && ./style src`
48+
49+
### Releasing your change to crates.io
50+
51+
Now that you've done the amazing job of landing your new API or your new
52+
platform in this crate, the next step is to get that sweet, sweet usage from
53+
crates.io! The only next step is to bump the version of libc and then publish
54+
it. If you'd like to get a release out ASAP you can follow these steps:
55+
56+
1. Update the version number in `Cargo.toml`, you'll just be bumping the patch
57+
version number.
58+
2. Run `cargo update` to regenerate the lockfile to encode your version bump in
59+
the lock file. You may pull in some other updated dependencies, that's ok.
60+
3. Send a PR to this repository. It should [look like this][example], but it'd
61+
also be nice to fill out the description with a small rationale for the
62+
release (any rationale is ok though!)
63+
4. Once merged the release will be tagged and published by one of the libc crate
64+
maintainers.
65+
66+
[example]: https://github.com/rust-lang/libc/pull/583

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libc"
3-
version = "0.2.48"
3+
version = "0.2.49"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

0 commit comments

Comments
 (0)