Skip to content

Commit 27ef56e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into merge-upstream
2 parents c18520b + 9447d17 commit 27ef56e

Some content is hidden

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

98 files changed

+9075
-788
lines changed

.cirrus.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ task:
33
freebsd_instance:
44
image_family: freebsd-12-4
55
setup_script:
6-
- pkg install -y curl
6+
- pkg install -y libnghttp2 curl
77
- curl https://sh.rustup.rs -sSf --output rustup.sh
88
- sh rustup.sh --default-toolchain nightly -y --profile=minimal
99
- . $HOME/.cargo/env
@@ -15,9 +15,9 @@ task:
1515
task:
1616
name: nightly x86_64-unknown-freebsd-13
1717
freebsd_instance:
18-
image_family: freebsd-13-1
18+
image_family: freebsd-13-2
1919
setup_script:
20-
- pkg install -y curl
20+
- pkg install -y libnghttp2 curl
2121
- curl https://sh.rustup.rs -sSf --output rustup.sh
2222
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
2323
- . $HOME/.cargo/env
@@ -29,7 +29,9 @@ task:
2929
task:
3030
name: nightly x86_64-unknown-freebsd-14
3131
freebsd_instance:
32-
image_family: freebsd-14-0-snap
32+
# FIXME: FreeBSD 14 CI fails due to pkg installation.
33+
# Use 14 again once a new image is available on Cirrus CI.
34+
image_family: freebsd-13-2
3335
setup_script:
3436
- pkg install -y libnghttp2 curl
3537
- curl https://sh.rustup.rs -sSf --output rustup.sh

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ Thanks for considering submitting a PR!
33
Here's a checklist for things that will be checked during review or continuous integration.
44

55
- \[ ] Edit corresponding file(s) under `libc-test/semver` when you add/remove item(s)
6+
- \[ ] Your PR doesn't contain any *unstable* values like `*LAST` or `*MAX` (see [#3131](https://github.com/rust-lang/libc/issues/3131))
7+
- \[ ] If your PR increments version number, it must not contain any other changes
68
- \[ ] `rustc ci/style.rs && ./style src`
7-
- \[ ] `cd libc-test && cargo test` (This might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure.)
8-
- \[ ] Your PR that bumps up the crate version doesn't contain any other changes
9+
- \[ ] `cd libc-test && cargo test`
10+
- (this might fail on your env due to environment difference between your env and CI. Ignore failures if you are not sure)
911

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

.github/workflows/bors.yml

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
x86_64-unknown-linux-gnu,
2424
]
2525
steps:
26-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
26+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
2727
with:
2828
github_token: "${{ secrets.GITHUB_TOKEN }}"
2929
- uses: actions/checkout@v3
@@ -46,7 +46,7 @@ jobs:
4646
x86_64-apple-darwin,
4747
]
4848
steps:
49-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
49+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
5050
with:
5151
github_token: "${{ secrets.GITHUB_TOKEN }}"
5252
- uses: actions/checkout@v3
@@ -81,7 +81,7 @@ jobs:
8181
# ARCH: i686
8282
- target: i686-pc-windows-msvc
8383
steps:
84-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
84+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
8585
with:
8686
github_token: "${{ secrets.GITHUB_TOKEN }}"
8787
- uses: actions/checkout@v3
@@ -103,7 +103,7 @@ jobs:
103103
name: Style check
104104
runs-on: ubuntu-22.04
105105
steps:
106-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
106+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
107107
with:
108108
github_token: "${{ secrets.GITHUB_TOKEN }}"
109109
- uses: actions/checkout@v3
@@ -163,7 +163,7 @@ jobs:
163163
# x86_64-unknown-redox,
164164
]
165165
steps:
166-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
166+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
167167
with:
168168
github_token: "${{ secrets.GITHUB_TOKEN }}"
169169
- uses: actions/checkout@v3
@@ -191,7 +191,7 @@ jobs:
191191
armv7-unknown-linux-uclibceabihf
192192
]
193193
steps:
194-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
194+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
195195
with:
196196
github_token: "${{ secrets.GITHUB_TOKEN }}"
197197
- uses: actions/checkout@v3
@@ -210,7 +210,7 @@ jobs:
210210
needs: [docker_linux_tier1, style_check]
211211
runs-on: ubuntu-22.04
212212
steps:
213-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
213+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
214214
with:
215215
github_token: "${{ secrets.GITHUB_TOKEN }}"
216216
- uses: actions/checkout@v3
@@ -244,7 +244,7 @@ jobs:
244244
1.30.0,
245245
]
246246
steps:
247-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
247+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
248248
with:
249249
github_token: "${{ secrets.GITHUB_TOKEN }}"
250250
- uses: actions/checkout@v3
@@ -259,36 +259,32 @@ jobs:
259259

260260
name: Build Channels macOS
261261
needs: macos
262-
# FIXME: Use macOS 11 for now as CI failed with a linker error on macOS 12 image:
263-
# ld: in /.../x86_64-apple-darwin/lib/libstd-a4729905.rlib(rust.metadata.bin),
264-
# archive member 'rust.metadata.bin' with length 2958149 is not mach-o or llvm bitcode file '/.../x86_64-apple-darwin/lib/libstd-a4729905.rlib'
265-
# Possibly related: https://github.com/actions/runner-images/issues/6350
266-
runs-on: macos-11
267262
env:
268263
OS: macos
269264
strategy:
270265
fail-fast: true
271266
max-parallel: 4
272267
matrix:
273-
toolchain: [
274-
stable,
275-
beta,
276-
nightly,
277-
1.13.0,
278-
1.19.0,
279-
1.24.0,
280-
1.25.0,
281-
1.30.0,
282-
]
268+
target:
269+
- { toolchain: stable, os: macos-12 }
270+
- { toolchain: beta, os: macos-12 }
271+
- { toolchain: nightly, os: macos-12 }
272+
# Use macOS 11 for older toolchains as newer Xcode donesn't work well.
273+
- { toolchain: 1.13.0, os: macos-11 }
274+
- { toolchain: 1.19.0, os: macos-11 }
275+
- { toolchain: 1.24.0, os: macos-11 }
276+
- { toolchain: 1.25.0, os: macos-11 }
277+
- { toolchain: 1.30.0, os: macos-11 }
278+
runs-on: ${{ matrix.target.os }}
283279
steps:
284-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
280+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
285281
with:
286282
github_token: "${{ secrets.GITHUB_TOKEN }}"
287283
- uses: actions/checkout@v3
288284
- name: Setup Rust toolchain
289-
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
285+
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
290286
- name: Execute build.sh
291-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
287+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/build.sh
292288

293289
build_channels_windows:
294290
permissions:
@@ -314,34 +310,25 @@ jobs:
314310
run: rustup self update
315311
shell: bash
316312
- name: Execute build.sh
317-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
313+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
318314
shell: bash
319315

320-
semver_linux:
321-
if: ${{ false }} # This is currently broken
322-
name: Semver Linux
323-
runs-on: ubuntu-22.04
324-
continue-on-error: true
325-
steps:
326-
- uses: actions/checkout@v3
327-
- name: Setup Rust toolchain
328-
# Should update the semverver revision in semver.sh if we touch nightly ver.
329-
run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
330-
- name: Check breaking changes
331-
run: sh ci/semver.sh linux
316+
check_cfg:
317+
permissions:
318+
actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
319+
contents: read # to fetch code (actions/checkout)
332320

333-
semver_macos:
334-
if: ${{ false }} # This is currently broken
335-
name: Semver macOS
336-
runs-on: macos-12
337-
continue-on-error: true
321+
name: "Check #[cfg]s"
322+
runs-on: ubuntu-22.04
338323
steps:
324+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
325+
with:
326+
github_token: "${{ secrets.GITHUB_TOKEN }}"
339327
- uses: actions/checkout@v3
340328
- name: Setup Rust toolchain
341-
# Pin nightly version to make semverver compilable.
342-
run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
343-
- name: Check breaking changes
344-
run: sh ci/semver.sh macos
329+
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
330+
- name: Build with check-cfg
331+
run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg=features,names,values,output
345332

346333
docs:
347334
permissions:
@@ -352,7 +339,7 @@ jobs:
352339
runs-on: ubuntu-22.04
353340
needs: docker_linux_tier2
354341
steps:
355-
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
342+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
356343
with:
357344
github_token: "${{ secrets.GITHUB_TOKEN }}"
358345
- uses: actions/checkout@v3

.github/workflows/docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Upload documentation to GitHub Pages
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
# Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages
99
permissions:
@@ -25,11 +25,13 @@ jobs:
2525
- name: Generate documentation
2626
run: LIBC_CI=1 sh ci/dox.sh
2727
- name: Setup Pages
28-
uses: actions/configure-pages@v2
28+
uses: actions/configure-pages@v3
29+
- name: Fix permissions
30+
run: rm -f ./target/doc/.lock
2931
- name: Upload artifact
30-
uses: actions/upload-pages-artifact@v1
32+
uses: actions/upload-pages-artifact@v2
3133
with:
3234
path: 'target/doc'
3335
- name: Deploy to GitHub Pages
3436
id: deployment
35-
uses: actions/deploy-pages@v1
37+
uses: actions/deploy-pages@v2

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, synchronize, reopened]
66
push:
77
branches:
8-
- master
8+
- main
99

1010
permissions:
1111
contents: read # to fetch code (actions/checkout)

Cargo.toml

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77
repository = "https://github.com/rust-lang/libc"
88
homepage = "https://github.com/rust-lang/libc"
99
documentation = "https://docs.rs/libc/"
10-
keywords = ["libc", "ffi", "bindings", "operating", "system" ]
10+
keywords = ["libc", "ffi", "bindings", "operating", "system"]
1111
categories = ["external-ffi-bindings", "no-std", "os"]
1212
build = "build.rs"
1313
exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"]
@@ -17,6 +17,115 @@ Raw FFI bindings to platform libraries like libc.
1717

1818
[package.metadata.docs.rs]
1919
features = ["const-extern-fn", "extra_traits"]
20+
default-target = "x86_64-unknown-linux-gnu"
21+
targets = [
22+
"aarch64-apple-ios",
23+
"aarch64-linux-android",
24+
"aarch64-pc-windows-msvc",
25+
"aarch64-unknown-freebsd",
26+
"aarch64-unknown-fuchsia",
27+
"aarch64-unknown-hermit",
28+
"aarch64-unknown-linux-gnu",
29+
"aarch64-unknown-linux-musl",
30+
"aarch64-unknown-netbsd",
31+
"aarch64-unknown-openbsd",
32+
"aarch64-wrs-vxworks",
33+
"arm-linux-androideabi",
34+
"arm-unknown-linux-gnueabi",
35+
"arm-unknown-linux-gnueabihf",
36+
"arm-unknown-linux-musleabi",
37+
"arm-unknown-linux-musleabihf",
38+
"armebv7r-none-eabi",
39+
"armebv7r-none-eabihf",
40+
"armv5te-unknown-linux-gnueabi",
41+
"armv5te-unknown-linux-musleabi",
42+
"armv7-linux-androideabi",
43+
"armv7-unknown-linux-gnueabihf",
44+
"armv7-unknown-linux-musleabihf",
45+
"armv7-wrs-vxworks-eabihf",
46+
"armv7r-none-eabi",
47+
"armv7r-none-eabihf",
48+
"hexagon-unknown-linux-musl",
49+
"i586-pc-windows-msvc",
50+
"i586-unknown-linux-gnu",
51+
"i586-unknown-linux-musl",
52+
"i686-linux-android",
53+
"i686-pc-windows-gnu",
54+
"i686-pc-windows-msvc",
55+
"i686-pc-windows-msvc",
56+
"i686-unknown-freebsd",
57+
"i686-unknown-haiku",
58+
"i686-unknown-linux-gnu",
59+
"i686-unknown-linux-musl",
60+
"i686-unknown-netbsd",
61+
"i686-unknown-openbsd",
62+
"i686-wrs-vxworks",
63+
"mips-unknown-linux-gnu",
64+
"mips-unknown-linux-musl",
65+
"mips64-unknown-linux-gnuabi64",
66+
"mips64-unknown-linux-muslabi64",
67+
"mips64el-unknown-linux-gnuabi64",
68+
"mips64el-unknown-linux-muslabi64",
69+
"mipsel-sony-psp",
70+
"mipsel-unknown-linux-gnu",
71+
"mipsel-unknown-linux-musl",
72+
"nvptx64-nvidia-cuda",
73+
"powerpc-unknown-linux-gnu",
74+
"powerpc-unknown-linux-gnuspe",
75+
"powerpc-unknown-netbsd",
76+
"powerpc-wrs-vxworks",
77+
"powerpc-wrs-vxworks-spe",
78+
"powerpc64-unknown-freebsd",
79+
"powerpc64-unknown-linux-gnu",
80+
"powerpc64-wrs-vxworks",
81+
"powerpc64le-unknown-linux-gnu",
82+
"riscv32gc-unknown-linux-gnu",
83+
"riscv32i-unknown-none-elf",
84+
"riscv32imac-unknown-none-elf",
85+
"riscv32imc-unknown-none-elf",
86+
"riscv64gc-unknown-freebsd",
87+
"riscv64gc-unknown-linux-gnu",
88+
"riscv64gc-unknown-linux-musl",
89+
"riscv64gc-unknown-none-elf",
90+
"riscv64imac-unknown-none-elf",
91+
"s390x-unknown-linux-gnu",
92+
"s390x-unknown-linux-musl",
93+
"sparc-unknown-linux-gnu",
94+
"sparc64-unknown-linux-gnu",
95+
"sparc64-unknown-netbsd",
96+
"sparcv9-sun-solaris",
97+
"thumbv6m-none-eabi",
98+
"thumbv7em-none-eabi",
99+
"thumbv7em-none-eabihf",
100+
"thumbv7m-none-eabi",
101+
"thumbv7neon-linux-androideabi",
102+
"thumbv7neon-unknown-linux-gnueabihf",
103+
"wasm32-unknown-emscripten",
104+
"wasm32-unknown-unknown",
105+
"wasm32-wasi",
106+
"x86_64-apple-darwin",
107+
"x86_64-apple-ios",
108+
"x86_64-fortanix-unknown-sgx",
109+
"x86_64-linux-android",
110+
"x86_64-pc-solaris",
111+
"x86_64-pc-windows-gnu",
112+
"x86_64-pc-windows-msvc",
113+
"x86_64-unknown-dragonfly",
114+
"x86_64-unknown-freebsd",
115+
"x86_64-unknown-fuchsia",
116+
"x86_64-unknown-haiku",
117+
"x86_64-unknown-hermit",
118+
"x86_64-unknown-illumos",
119+
"x86_64-unknown-l4re-uclibc",
120+
"x86_64-unknown-linux-gnu",
121+
"x86_64-unknown-linux-gnux32",
122+
"x86_64-unknown-linux-musl",
123+
"x86_64-unknown-netbsd",
124+
"x86_64-unknown-openbsd",
125+
"x86_64-unknown-redox",
126+
"x86_64-wrs-vxworks"
127+
]
128+
cargo-args = ["-Zbuild-std=core"]
20129

21130
[dependencies]
22131
rustc-std-workspace-core = { version = "1.0.0", optional = true }
@@ -29,7 +138,7 @@ rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
29138
extra_traits = []
30139
const-extern-fn = []
31140
# use_std is deprecated, use `std` instead
32-
use_std = [ 'std' ]
141+
use_std = ['std']
33142

34143
[workspace]
35144
members = ["libc-test"]

0 commit comments

Comments
 (0)