Skip to content

Commit c5449b7

Browse files
Merge remote-tracking branch 'real/main' into linux_wireless
2 parents b8b41f5 + 77fb037 commit c5449b7

File tree

24 files changed

+457
-4247
lines changed

24 files changed

+457
-4247
lines changed

.github/workflows/bors.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,7 @@ jobs:
226226
stable,
227227
beta,
228228
nightly,
229-
# FIXME: Disabled due to:
230-
# error: failed to parse registry's information for: serde
231-
#1.13.0,
232-
1.19.0,
233-
1.24.0,
234-
1.25.0,
235-
1.30.0,
229+
1.71.0,
236230
]
237231
steps:
238232
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
@@ -260,14 +254,7 @@ jobs:
260254
- { toolchain: stable, os: macos-13 }
261255
- { toolchain: beta, os: macos-13 }
262256
- { toolchain: nightly, os: macos-13 }
263-
# Use macOS 11 for older toolchains as newer Xcode donesn't work well.
264-
# FIXME: Disabled due to:
265-
# error: failed to parse registry's information for: serde
266-
#- { toolchain: 1.13.0, os: macos-11 }
267-
- { toolchain: 1.19.0, os: macos-11 }
268-
- { toolchain: 1.24.0, os: macos-11 }
269-
- { toolchain: 1.25.0, os: macos-11 }
270-
- { toolchain: 1.30.0, os: macos-11 }
257+
- { toolchain: 1.71.0, os: macos-13 }
271258
runs-on: ${{ matrix.target.os }}
272259
steps:
273260
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
@@ -291,10 +278,7 @@ jobs:
291278
fail-fast: true
292279
matrix:
293280
toolchain: [
294-
1.19.0,
295-
1.24.0,
296-
1.25.0,
297-
1.30.0,
281+
1.71.0,
298282
stable,
299283
]
300284
steps:

.github/workflows/full_ci.yml

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
name: full CI
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
branches:
7+
- libc-0.2
8+
types:
9+
- labeled
10+
11+
jobs:
12+
docker_linux_tier1:
13+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
14+
permissions:
15+
contents: read # to fetch code (actions/checkout)
16+
17+
name: Docker Linux Tier1
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
target: [
23+
i686-unknown-linux-gnu,
24+
x86_64-unknown-linux-gnu,
25+
]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Setup Rust toolchain
29+
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
30+
- name: Execute run-docker.sh
31+
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
32+
33+
macos:
34+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
35+
permissions:
36+
contents: read # to fetch code (actions/checkout)
37+
38+
name: macOS
39+
runs-on: macos-13
40+
strategy:
41+
fail-fast: true
42+
matrix:
43+
target: [
44+
x86_64-apple-darwin,
45+
]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Setup Rust toolchain
49+
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
50+
- name: Execute run.sh
51+
run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
52+
53+
windows:
54+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
55+
permissions:
56+
contents: read # to fetch code (actions/checkout)
57+
58+
name: Windows
59+
runs-on: windows-2022
60+
env:
61+
OS: windows
62+
strategy:
63+
fail-fast: true
64+
matrix:
65+
include:
66+
- target: x86_64-pc-windows-gnu
67+
env:
68+
ARCH_BITS: 64
69+
ARCH: x86_64
70+
- target: x86_64-pc-windows-msvc
71+
- target: i686-pc-windows-gnu
72+
env:
73+
ARCH_BITS: 32
74+
ARCH: i686
75+
- target: i686-pc-windows-msvc
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: Self-update rustup
79+
run: rustup self update
80+
shell: bash
81+
- name: Setup Rust toolchain
82+
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
83+
shell: bash
84+
- name: Execute run.sh
85+
run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
86+
shell: bash
87+
88+
style_check:
89+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
90+
permissions:
91+
contents: read # to fetch code (actions/checkout)
92+
93+
name: Style check
94+
runs-on: ubuntu-22.04
95+
steps:
96+
- uses: actions/checkout@v4
97+
- name: Setup Rust toolchain
98+
run: sh ./ci/install-rust.sh
99+
- name: Check style
100+
run: sh ci/style.sh
101+
102+
docker_linux_tier2:
103+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
104+
permissions:
105+
contents: read # to fetch code (actions/checkout)
106+
107+
name: Docker Linux Tier2
108+
needs: [docker_linux_tier1, style_check]
109+
runs-on: ubuntu-22.04
110+
strategy:
111+
fail-fast: true
112+
max-parallel: 12
113+
matrix:
114+
target: [
115+
aarch64-linux-android,
116+
aarch64-unknown-linux-gnu,
117+
aarch64-unknown-linux-musl,
118+
arm-linux-androideabi,
119+
arm-unknown-linux-gnueabihf,
120+
arm-unknown-linux-musleabihf,
121+
i686-linux-android,
122+
i686-unknown-linux-musl,
123+
powerpc-unknown-linux-gnu,
124+
powerpc64-unknown-linux-gnu,
125+
powerpc64le-unknown-linux-gnu,
126+
s390x-unknown-linux-gnu,
127+
riscv64gc-unknown-linux-gnu,
128+
# FIXME: A recent nightly causes a linker failure:
129+
# https://github.com/rust-lang/rust/issues/76679
130+
# See this comment for more details:
131+
# https://github.com/rust-lang/libc/pull/2225#issuecomment-880696737
132+
#wasm32-wasi,
133+
sparc64-unknown-linux-gnu,
134+
wasm32-unknown-emscripten,
135+
x86_64-linux-android,
136+
# FIXME: Exec format error (os error 8)
137+
#x86_64-unknown-linux-gnux32,
138+
x86_64-unknown-linux-musl,
139+
# FIXME: It seems some items in `src/unix/mod.rs`
140+
# aren't defined on redox actually.
141+
# x86_64-unknown-redox,
142+
]
143+
steps:
144+
- uses: actions/checkout@v4
145+
- name: Setup Rust toolchain
146+
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
147+
- name: Execute run-docker.sh
148+
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
149+
150+
# These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
151+
# Because of this, only the nightly compiler can be used on these targets.
152+
docker_linux_build_std:
153+
permissions:
154+
contents: read # to fetch code (actions/checkout)
155+
156+
if: ${{ false }} # This is currently broken
157+
name: Docker Linux Build-Std Targets
158+
needs: [docker_linux_tier1, style_check]
159+
runs-on: ubuntu-22.04
160+
strategy:
161+
fail-fast: true
162+
max-parallel: 12
163+
matrix:
164+
target: [
165+
armv7-unknown-linux-uclibceabihf
166+
]
167+
steps:
168+
- uses: actions/checkout@v4
169+
- name: Setup Rust toolchain
170+
run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
171+
- name: Execute run-docker.sh
172+
run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }}
173+
174+
# devkitpro's pacman needs to be connected from Docker.
175+
docker_switch:
176+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
177+
permissions:
178+
contents: read # to fetch code (actions/checkout)
179+
180+
name: Docker Switch
181+
needs: [docker_linux_tier1, style_check]
182+
runs-on: ubuntu-22.04
183+
steps:
184+
- uses: actions/checkout@v4
185+
- name: Setup Rust toolchain
186+
run: sh ./ci/install-rust.sh
187+
- name: Execute run-docker.sh
188+
run: LIBC_CI=1 sh ./ci/run-docker.sh switch
189+
190+
build_channels_linux:
191+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
192+
permissions:
193+
contents: read # to fetch code (actions/checkout)
194+
195+
name: Build Channels Linux
196+
needs: docker_linux_tier2
197+
runs-on: ubuntu-22.04
198+
env:
199+
OS: linux
200+
strategy:
201+
fail-fast: true
202+
max-parallel: 5
203+
matrix:
204+
toolchain: [
205+
stable,
206+
beta,
207+
nightly,
208+
1.71.0,
209+
]
210+
steps:
211+
- uses: actions/checkout@v4
212+
- name: Setup Rust toolchain
213+
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
214+
- name: Execute build.sh
215+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
216+
217+
build_channels_macos:
218+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
219+
permissions:
220+
contents: read # to fetch code (actions/checkout)
221+
222+
name: Build Channels macOS
223+
needs: macos
224+
env:
225+
OS: macos
226+
strategy:
227+
fail-fast: true
228+
max-parallel: 4
229+
matrix:
230+
target:
231+
- { toolchain: stable, os: macos-13 }
232+
- { toolchain: beta, os: macos-13 }
233+
- { toolchain: nightly, os: macos-13 }
234+
- { toolchain: 1.71.0, os: macos-13 }
235+
runs-on: ${{ matrix.target.os }}
236+
steps:
237+
- uses: actions/checkout@v4
238+
- name: Setup Rust toolchain
239+
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
240+
- name: Execute build.sh
241+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
242+
243+
build_channels_windows:
244+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
245+
permissions:
246+
contents: read # to fetch code (actions/checkout)
247+
248+
name: Build Channels Windows
249+
runs-on: windows-2022
250+
env:
251+
OS: windows
252+
strategy:
253+
fail-fast: true
254+
matrix:
255+
toolchain: [
256+
1.71.0,
257+
stable,
258+
]
259+
steps:
260+
- uses: actions/checkout@v4
261+
- name: Self-update rustup
262+
run: rustup self update
263+
shell: bash
264+
- name: Execute build.sh
265+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
266+
shell: bash
267+
268+
check_cfg:
269+
if: github.event.label.name == 'libc-0.2-pre-merge-ci'
270+
permissions:
271+
contents: read # to fetch code (actions/checkout)
272+
273+
name: "Check #[cfg]s"
274+
runs-on: ubuntu-22.04
275+
steps:
276+
- uses: actions/checkout@v4
277+
- name: Setup Rust toolchain
278+
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
279+
- name: Build with check-cfg
280+
run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg
281+
282+
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
283+
# protection, rather than having to add each job separately.
284+
success:
285+
name: Success
286+
runs-on: ubuntu-22.04
287+
needs: [
288+
docker_linux_tier1,
289+
docker_linux_tier2,
290+
#docker_linux_build_std,
291+
macos,
292+
windows,
293+
style_check,
294+
docker_switch,
295+
build_channels_linux,
296+
build_channels_macos,
297+
build_channels_windows,
298+
]
299+
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
300+
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
301+
# dependencies fails.
302+
if: always() # make sure this is never "skipped"
303+
steps:
304+
# Manually check the status of all dependencies. `if: failure()` does not work.
305+
- name: check if any dependency failed
306+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
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
7+
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.
12+
613
## Adding an API
714

815
Want to use an API which currently isn't bound in `libc`? It's quite easy to add

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ targets = [
6767
"mips64-unknown-linux-muslabi64",
6868
"mips64el-unknown-linux-gnuabi64",
6969
"mips64el-unknown-linux-muslabi64",
70-
"mipsel-sony-psp",
7170
"mipsel-unknown-linux-gnu",
7271
"mipsel-unknown-linux-musl",
7372
"nvptx64-nvidia-cuda",

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ 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
20+
21+
The main branch is now for v0.3 which has some breaking changes.
22+
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.
25+
26+
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
27+
1928
## Usage
2029

2130
Add the following to your `Cargo.toml`:

0 commit comments

Comments
 (0)