Skip to content

feat: eventfd_read/write for Android/FreeBSD/Linux #3436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
# FIXME: FreeBSD 14 CI fails due to pkg installation.
# Use 14 again once a new image is available on Cirrus CI.
image_family: freebsd-13-2
image: freebsd-14-0-rc1-amd64
setup_script:
- pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
51 changes: 12 additions & 39 deletions .github/workflows/bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
Expand All @@ -106,7 +106,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
Expand Down Expand Up @@ -136,13 +136,6 @@ jobs:
asmjs-unknown-emscripten,
i686-linux-android,
i686-unknown-linux-musl,
mips-unknown-linux-gnu,
mips-unknown-linux-musl,
# FIXME: Somehow failed on CI
# https://github.com/rust-lang/libc/runs/1659882216
# mips64-unknown-linux-gnuabi64,
# mips64el-unknown-linux-gnuabi64,
mipsel-unknown-linux-musl,
powerpc-unknown-linux-gnu,
powerpc64-unknown-linux-gnu,
powerpc64le-unknown-linux-gnu,
Expand All @@ -167,7 +160,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
Expand Down Expand Up @@ -195,7 +188,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
- name: Execute run-docker.sh
Expand All @@ -214,7 +207,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Execute run-docker.sh
Expand Down Expand Up @@ -250,7 +243,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
Expand Down Expand Up @@ -285,7 +278,7 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=${{ matrix.target.toolchain }} sh ./ci/install-rust.sh
- name: Execute build.sh
Expand All @@ -310,7 +303,7 @@ jobs:
stable,
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
Expand All @@ -329,29 +322,11 @@ jobs:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
- name: Build with check-cfg
run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg=features,names,values,output

docs:
permissions:
actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
contents: read # to fetch code (actions/checkout)

name: Generate documentation
runs-on: ubuntu-22.04
needs: docker_linux_tier2
steps:
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@HEAD
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/checkout@v3
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Generate documentation
run: LIBC_CI=1 sh ci/dox.sh
run: LIBC_CI=1 LIBC_CHECK_CFG=1 cargo build -Z unstable-options -Z check-cfg

# These jobs doesn't actually test anything, but they're only used to tell
# bors the build completed, as there is no practical way to detect when a
Expand All @@ -374,7 +349,6 @@ jobs:
build_channels_linux,
build_channels_macos,
build_channels_windows,
docs,
]

steps:
Expand All @@ -396,7 +370,6 @@ jobs:
build_channels_linux,
build_channels_macos,
build_channels_windows,
docs,
]

steps:
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/docs.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
x86_64-unknown-linux-gnu,
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run-docker.sh
Expand All @@ -38,7 +38,7 @@ jobs:
x86_64-apple-darwin,
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
- name: Execute run.sh
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
# ARCH: i686
- target: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Self-update rustup
run: rustup self update
shell: bash
Expand All @@ -81,7 +81,7 @@ jobs:
name: Style check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: sh ./ci/install-rust.sh
- name: Check style
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libc"
version = "0.2.148"
version = "0.2.150"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ newer Rust features are only available on newer Rust toolchains:

## Platform support

[Platform-specific documentation (HEAD)][docs.head].
You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see.

See
[`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh)
Expand Down Expand Up @@ -107,4 +107,3 @@ dual licensed as above, without any additional terms or conditions.
[Documentation]: https://docs.rs/libc/badge.svg
[docs.rs]: https://docs.rs/libc
[License]: https://img.shields.io/crates/l/libc.svg
[docs.head]: https://rust-lang.github.io/libc/#platform-specific-documentation
18 changes: 13 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ fn main() {
);
}

// The ABI of libc used by libstd is backward compatible with FreeBSD 10.
// The ABI of libc used by std is backward compatible with FreeBSD 12.
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
//
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
match which_freebsd() {
Some(10) if libc_ci || rustc_dep_of_std => set_cfg("freebsd10"),
Some(10) if libc_ci => set_cfg("freebsd10"),
Some(11) if libc_ci => set_cfg("freebsd11"),
Some(12) if libc_ci => set_cfg("freebsd12"),
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
Some(13) if libc_ci => set_cfg("freebsd13"),
Some(14) if libc_ci => set_cfg("freebsd14"),
Some(_) | None => set_cfg("freebsd11"),
Expand Down Expand Up @@ -167,11 +167,19 @@ fn main() {
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
if libc_check_cfg {
for cfg in ALLOWED_CFGS {
println!("cargo:rustc-check-cfg=values({})", cfg);
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({})", cfg);
} else {
println!("cargo:rustc-check-cfg=values({})", cfg);
}
}
for &(name, values) in CHECK_CFG_EXTRA {
let values = values.join("\",\"");
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
} else {
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
}
}
}
}
Expand Down
40 changes: 5 additions & 35 deletions ci/android-install-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,10 @@

set -ex

NDK=android-ndk-r21d
wget --tries=20 -q https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
unzip -q ${NDK}-linux-x86_64.zip
NDK=android-ndk-r26b
wget --tries=20 -q https://dl.google.com/android/repository/${NDK}-linux.zip
unzip -q ${NDK}-linux.zip

case "$1" in
arm)
arch=arm
api=28
;;
armv7)
arch=arm
api=28
;;
aarch64)
arch=arm64
api=28
;;
i686)
arch=x86
api=28
;;
x86_64)
arch=x86_64
api=28
;;
*)
echo "invalid arch: $1"
exit 1
;;
esac;
mv ./${NDK}/toolchains/llvm/prebuilt/linux-x86_64 /android

python3 ${NDK}/build/tools/make_standalone_toolchain.py \
--install-dir "/android/ndk-${1}" \
--arch "${arch}" \
--api ${api}

rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}
rm -rf ./${NDK}-linux.zip ./${NDK}
Loading