Skip to content

Commit b5d2254

Browse files
authored
Merge branch 'main' into stat-flags-and-mode-type
2 parents 12339fe + f5d998e commit b5d2254

Some content is hidden

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

78 files changed

+2198
-831
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
task:
22
name: nightly x86_64-unknown-freebsd-13
33
freebsd_instance:
4-
image_family: freebsd-13-2
4+
image_family: freebsd-13-3
55
setup_script:
66
- pkg install -y libnghttp2 curl
77
- curl https://sh.rustup.rs -sSf --output rustup.sh
@@ -15,7 +15,7 @@ task:
1515
task:
1616
name: nightly x86_64-unknown-freebsd-14
1717
freebsd_instance:
18-
image: freebsd-14-0-release-amd64-ufs
18+
image: freebsd-14-1-release-amd64-ufs
1919
setup_script:
2020
- pkg install -y libnghttp2 curl
2121
- curl https://sh.rustup.rs -sSf --output rustup.sh

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
Thanks for considering submitting a PR!
22

3-
We have the [contribution guide](https://github.com/rust-lang/libc/blob/main/CONTRIBUTING.md). Please read it if you're new here!
3+
We have the
4+
[contribution guide](https://github.com/rust-lang/libc/blob/main/CONTRIBUTING.md).
5+
Please read it if you're new here!
46

5-
Here's a checklist for things that will be checked during review or continuous integration.
7+
Here is a checklist for things that will be checked during review or continuous
8+
integration:
69

7-
- \[ ] Edit corresponding file(s) under `libc-test/semver` when you add/remove item(s), e.g. edit `linux.txt` if you add an item to `src/unix/linux_like/linux/mod.rs`
8-
- \[ ] Your PR doesn't contain any private or *unstable* values like `*LAST` or `*MAX` (see [#3131](https://github.com/rust-lang/libc/issues/3131))
10+
- \[ ] Edit corresponding file(s) under `libc-test/semver` when you add/remove
11+
item(s), e.g. edit `linux.txt` if you add an item to
12+
`src/unix/linux_like/linux/mod.rs`
13+
- \[ ] Your PR doesn't contain any private or _unstable_ values like `*LAST` or
14+
`*MAX` (see [#3131](https://github.com/rust-lang/libc/issues/3131))
15+
- \[ ] Provide a link to relevant source (headers or documentation) if your PR
16+
adds or changes API.
917
- \[ ] If your PR has a breaking change, please clarify it
10-
- \[ ] If your PR increments version number, it must NOT contain any other changes (otherwise a release could be delayed)
18+
- \[ ] If your PR increments version number, it must NOT contain any other
19+
changes (otherwise a release could be delayed)
1120
- \[ ] Make sure `ci/style.sh` passes
1221
- \[ ] `cd libc-test && cargo test`
13-
- (this might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure)
22+
- (this might fail on your env due to environment difference between your env
23+
and CI. Ignore local failures if you are not sure)
1424

1525
Delete this line and everything above before opening your PR.

.github/workflows/full_ci.yml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
contents: read # to fetch code (actions/checkout)
3232

3333
name: macOS
34-
runs-on: macos-13
34+
runs-on: macos-14
3535
strategy:
3636
fail-fast: true
3737
matrix:
3838
target: [
39-
x86_64-apple-darwin,
39+
aarch64-apple-darwin,
4040
]
4141
steps:
4242
- uses: actions/checkout@v4
@@ -140,45 +140,6 @@ jobs:
140140
- name: Execute run-docker.sh
141141
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
142142

143-
# These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
144-
# Because of this, only the nightly compiler can be used on these targets.
145-
docker_linux_build_std:
146-
permissions:
147-
contents: read # to fetch code (actions/checkout)
148-
149-
if: ${{ false }} # This is currently broken
150-
name: Docker Linux Build-Std Targets
151-
needs: [docker_linux_tier1, style_check]
152-
runs-on: ubuntu-22.04
153-
strategy:
154-
fail-fast: true
155-
max-parallel: 12
156-
matrix:
157-
target: [
158-
armv7-unknown-linux-uclibceabihf
159-
]
160-
steps:
161-
- uses: actions/checkout@v4
162-
- name: Setup Rust toolchain
163-
run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
164-
- name: Execute run-docker.sh
165-
run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }}
166-
167-
# devkitpro's pacman needs to be connected from Docker.
168-
docker_switch:
169-
permissions:
170-
contents: read # to fetch code (actions/checkout)
171-
172-
name: Docker Switch
173-
needs: [docker_linux_tier1, style_check]
174-
runs-on: ubuntu-22.04
175-
steps:
176-
- uses: actions/checkout@v4
177-
- name: Setup Rust toolchain
178-
run: sh ./ci/install-rust.sh
179-
- name: Execute run-docker.sh
180-
run: LIBC_CI=1 sh ./ci/run-docker.sh switch
181-
182143
build_channels_linux:
183144
permissions:
184145
contents: read # to fetch code (actions/checkout)
@@ -218,10 +179,10 @@ jobs:
218179
max-parallel: 4
219180
matrix:
220181
target:
221-
- { toolchain: stable, os: macos-13 }
222-
- { toolchain: beta, os: macos-13 }
223-
- { toolchain: nightly, os: macos-13 }
224-
- { toolchain: 1.71.0, os: macos-13 }
182+
- { toolchain: stable, os: macos-14 }
183+
- { toolchain: beta, os: macos-14 }
184+
- { toolchain: nightly, os: macos-14 }
185+
- { toolchain: 1.71.0, os: macos-14 }
225186
runs-on: ${{ matrix.target.os }}
226187
steps:
227188
- uses: actions/checkout@v4
@@ -275,11 +236,9 @@ jobs:
275236
needs: [
276237
docker_linux_tier1,
277238
docker_linux_tier2,
278-
#docker_linux_build_std,
279239
macos,
280240
windows,
281241
style_check,
282-
docker_switch,
283242
build_channels_linux,
284243
build_channels_macos,
285244
build_channels_windows,

CONTRIBUTING.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,41 @@
33
Welcome! If you are reading this document, it means you are interested in contributing
44
to the `libc` crate.
55

6-
## v0.2 changes
6+
## v1.0 Roadmap
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+
`libc` has two active branches: `main` and `libc-0.2`. `main` is for active
9+
development of the upcoming v1.0 release, and should be the target of all pull
10+
requests. `libc-0.2` is for updates to the currently released version.
11+
12+
If a pull request to `main` is a good candidate for inclusion in an `0.2.x`
13+
release, include `@rustbot label stable-nominated` in a comment to propose this.
14+
Good candidates will usually meet the following:
15+
16+
1. The included changes are non-breaking.
17+
2. The change applies cleanly to both branches.
18+
3. There is a usecase that justifies inclusion in a stable release (all
19+
additions should always have a usecase, hopefully).
20+
21+
Once a `stable-nominated` PR targeting `main` has merged, it can be cherry
22+
picked to the `libc-0.2` branch. A maintainer will likely do these cherry
23+
picks in a batch.
24+
25+
Alternatively, you can start this process yourself by creating a new branch
26+
based on `libc-0.2` and running `git cherry-pick -xe commit-sha-on-main` (`git
27+
cherry-pick -xe start-sha^..end-sha` if a range of commits is needed). `git`
28+
will automatically add the "cherry picked from commit" note, but try to add a
29+
backport note so the original PR gets crosslinked:
30+
31+
```
32+
# ... original commit message ...
33+
34+
(backport <https://github.com/rust-lang/libc/pull/1234>) # add manually
35+
(cherry picked from commit 104b6a4ae31c726814c36318dc718470cc96e167) # added by git
36+
```
37+
38+
Once the cherry-pick is complete, open a PR targeting `libc-0.2`.
39+
40+
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
1241

1342
## Adding an API
1443

@@ -51,7 +80,7 @@ With that in mind, the steps for adding a new API are:
5180
5. Wait for a merge!
5281

5382
<sup>1</sup>: Note that this list has nothing to do with any Unix or Posix
54-
standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
83+
standard, it's just a list shared among all OSs that declare `#[cfg(unix)]`.
5584

5685
## Test before you commit
5786

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ targets = [
4747
"armv7-wrs-vxworks-eabihf",
4848
"armv7r-none-eabi",
4949
"armv7r-none-eabihf",
50-
"hexagon-unknown-linux-musl",
50+
# FIXME(hexagon): excluded due to duplicate symbol errors
51+
# "hexagon-unknown-linux-musl",
5152
"i586-pc-windows-msvc",
5253
"i586-unknown-linux-gnu",
5354
"i586-unknown-linux-musl",

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ More detailed information about the design of this library can be found in its
1616

1717
[rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md
1818

19-
## v0.3 Roadmap
19+
## v1.0 Roadmap
2020

21-
The main branch is now for v0.3 which has some breaking changes.
21+
Currently, `libc` has two active branches: `main` for the upcoming v1.0 release,
22+
and `libc-0.2` for the currently published version. By default all pull requests
23+
should target `main`; once reviewed, they can be cherry picked to the `libc-0.2`
24+
branch if needed.
2225

23-
For v0.2, please submit PRs to the `libc-0.2` branch instead.
24-
We will stop making new v0.2 releases once we release v0.3 on crates.io.
26+
We will stop making new v0.2 releases once v1.0 is released.
2527

26-
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
28+
See the section in [CONTRIBUTING.md](CONTRIBUTING.md#v10-roadmap) for more
29+
details.
2730

2831
## Usage
2932

build.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::str;
77
// make sure to add it to this list as well.
88
const ALLOWED_CFGS: &'static [&'static str] = &[
99
"emscripten_new_stat_abi",
10+
"espidf_time64",
1011
"freebsd10",
1112
"freebsd11",
1213
"freebsd12",
@@ -16,7 +17,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1617
"libc_const_extern_fn",
1718
"libc_const_extern_fn_unstable",
1819
"libc_deny_warnings",
19-
"libc_thread_local",
2020
];
2121

2222
// Extra values to allow for check-cfg.
@@ -36,22 +36,29 @@ fn main() {
3636
let (rustc_minor_ver, is_nightly) = rustc_minor_nightly();
3737
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
3838
let libc_ci = env::var("LIBC_CI").is_ok();
39-
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok();
39+
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80;
4040
let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
4141

4242
// The ABI of libc used by std is backward compatible with FreeBSD 12.
4343
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
4444
//
4545
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
4646
// running tests to ensure that the ABI is correct.
47-
match which_freebsd() {
48-
Some(10) if libc_ci => set_cfg("freebsd10"),
49-
Some(11) if libc_ci => set_cfg("freebsd11"),
50-
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
51-
Some(13) if libc_ci => set_cfg("freebsd13"),
52-
Some(14) if libc_ci => set_cfg("freebsd14"),
53-
Some(15) if libc_ci => set_cfg("freebsd15"),
54-
Some(_) | None => set_cfg("freebsd11"),
47+
let which_freebsd = if libc_ci {
48+
which_freebsd().unwrap_or(11)
49+
} else if rustc_dep_of_std {
50+
12
51+
} else {
52+
11
53+
};
54+
match which_freebsd {
55+
x if x < 10 => panic!("FreeBSD older than 10 is not supported"),
56+
10 => set_cfg("freebsd10"),
57+
11 => set_cfg("freebsd11"),
58+
12 => set_cfg("freebsd12"),
59+
13 => set_cfg("freebsd13"),
60+
14 => set_cfg("freebsd14"),
61+
_ => set_cfg("freebsd15"),
5562
}
5663

5764
match emcc_version_code() {
@@ -65,11 +72,6 @@ fn main() {
6572
set_cfg("libc_deny_warnings");
6673
}
6774

68-
// #[thread_local] is currently unstable
69-
if rustc_dep_of_std {
70-
set_cfg("libc_thread_local");
71-
}
72-
7375
// Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
7476
if rustc_minor_ver >= 62 {
7577
set_cfg("libc_const_extern_fn");

ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ about above), and then shut down.
158158
poweroff
159159

160160
1. Exit the post install shell: `exit`
161-
1. Back in in the installer choose Reboot
161+
1. Back in the installer choose Reboot
162162
1. If all went well the machine should reboot and show a login prompt.
163163
If you switch to the serial console by choosing View > serial0 in
164164
the qemu menu, you should be logged in as root.

ci/build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ x86_64-unknown-redox \
147147

148148
RUST_APPLE_TARGETS="\
149149
aarch64-apple-ios \
150-
x86_64-apple-darwin \
151-
x86_64-apple-ios \
152150
"
153151

154152
RUST_NIGHTLY_APPLE_TARGETS="\
@@ -211,6 +209,8 @@ for TARGET in $TARGETS; do
211209
done
212210

213211
# Targets which are not available via rustup and must be built with -Zbuild-std
212+
# FIXME(hexagon): hexagon-unknown-linux-musl should be tested but currently has
213+
# duplicate symbol errors from `compiler_builtins`.
214214
RUST_LINUX_NO_CORE_TARGETS="\
215215
aarch64-pc-windows-msvc \
216216
aarch64-unknown-freebsd \
@@ -223,7 +223,6 @@ armebv7r-none-eabihf \
223223
armv7-wrs-vxworks-eabihf \
224224
armv7r-none-eabi \
225225
armv7r-none-eabihf \
226-
hexagon-unknown-linux-musl \
227226
i586-pc-windows-msvc \
228227
i686-pc-windows-msvc \
229228
i686-unknown-haiku \

ci/docker/sparc64-unknown-linux-gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:23.10
1+
FROM ubuntu:22.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
curl ca-certificates \

0 commit comments

Comments
 (0)