Skip to content

Commit e364761

Browse files
committed
chore: add labels to FIXMEs
1 parent 962dcb3 commit e364761

File tree

145 files changed

+1434
-640
lines changed

Some content is hidden

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

145 files changed

+1434
-640
lines changed

.cirrus.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ task:
33
env:
44
HOME: /tmp # cargo cache needs it
55
TARGET: x86_64-unknown-freebsd
6+
# FIXME(freebsd): FreeBSD has a segfault when `RUST_BACKTRACE` is set
7+
# https://github.com/rust-lang/rust/issues/132185
8+
RUST_BACKTRACE: "0"
69
matrix:
710
- name: nightly freebsd-13 i686
811
# Test i686 FreeBSD in 32-bit emulation on a 64-bit host.

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ jobs:
135135
- i686-unknown-linux-musl
136136
- loongarch64-unknown-linux-gnu
137137
- loongarch64-unknown-linux-musl
138-
- powerpc-unknown-linux-gnu
138+
# FIXME(ppc): SIGILL running tests, see
139+
# https://github.com/rust-lang/libc/pull/4254#issuecomment-2636288713
140+
# - powerpc-unknown-linux-gnu
139141
- powerpc64-unknown-linux-gnu
140142
- powerpc64le-unknown-linux-gnu
141143
- riscv64gc-unknown-linux-gnu

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
target
22
Cargo.lock
33
*~
4-
style

build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1717
"libc_const_extern_fn",
1818
"libc_deny_warnings",
1919
"libc_ctest",
20+
// Corresponds to `__USE_TIME_BITS64` in UAPI
21+
"linux_time_bits64",
2022
];
2123

2224
// Extra values to allow for check-cfg.
@@ -78,6 +80,12 @@ fn main() {
7880
Some(_) | None => (),
7981
}
8082

83+
let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok();
84+
println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64");
85+
if linux_time_bits64 {
86+
set_cfg("linux_time_bits64");
87+
}
88+
8189
// On CI: deny all warnings
8290
if libc_ci {
8391
set_cfg("libc_deny_warnings");

ci/run.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ if [ -n "${QEMU:-}" ]; then
8181
fi
8282

8383
cmd="cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}"
84+
test_flags="--skip check_style"
8485

8586
# Run tests in the `libc` crate
8687
case "$target" in
@@ -101,25 +102,31 @@ if [ "$target" = "s390x-unknown-linux-gnu" ]; then
101102
passed=0
102103
until [ $n -ge $N ]; do
103104
if [ "$passed" = "0" ]; then
104-
if $cmd --no-default-features; then
105+
# shellcheck disable=SC2086
106+
if $cmd --no-default-features -- $test_flags; then
105107
passed=$((passed+1))
106108
continue
107109
fi
108110
elif [ "$passed" = "1" ]; then
109-
if $cmd; then
111+
# shellcheck disable=SC2086
112+
if $cmd -- $test_flags; then
110113
passed=$((passed+1))
111114
continue
112115
fi
113116
elif [ "$passed" = "2" ]; then
114-
if $cmd --features extra_traits; then
117+
# shellcheck disable=SC2086
118+
if $cmd --features extra_traits -- $test_flags; then
115119
break
116120
fi
117121
fi
118122
n=$((n+1))
119123
sleep 1
120124
done
121125
else
122-
$cmd --no-default-features
123-
$cmd
124-
$cmd --features extra_traits
126+
# shellcheck disable=SC2086
127+
$cmd --no-default-features -- $test_flags
128+
# shellcheck disable=SC2086
129+
$cmd -- $test_flags
130+
# shellcheck disable=SC2086
131+
$cmd --features extra_traits -- $test_flags
125132
fi

ci/runtest-android.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::env;
2-
use std::process::Command;
32
use std::path::{Path, PathBuf};
3+
use std::process::Command;
44

55
fn main() {
66
let args = env::args_os()
77
.skip(1)
8-
.filter(|arg| arg != "--quiet")
8+
.filter(|arg| arg != "--quiet" && arg != "--skip" && arg != "check_style")
99
.collect::<Vec<_>>();
1010
assert_eq!(args.len(), 1);
1111
let test = PathBuf::from(&args[0]);
@@ -36,14 +36,16 @@ fn main() {
3636
let stdout = String::from_utf8_lossy(&output.stdout);
3737
let stderr = String::from_utf8_lossy(&output.stderr);
3838

39-
println!("status: {}\nstdout ---\n{}\nstderr ---\n{}",
40-
output.status,
41-
stdout,
42-
stderr);
39+
println!(
40+
"status: {}\nstdout ---\n{}\nstderr ---\n{}",
41+
output.status, stdout, stderr
42+
);
4343

44-
if !stderr.lines().any(|l| (l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok"))
45-
&& !stdout.lines().any(|l| (l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok"))
46-
{
44+
if !stderr.lines().any(|l| {
45+
(l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok")
46+
}) && !stdout.lines().any(|l| {
47+
(l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok")
48+
}) {
4749
panic!("failed to find successful test run");
4850
};
4951
}

ci/style.rs

Lines changed: 0 additions & 214 deletions
This file was deleted.

ci/style.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ -n "${CI:-}" ]; then
99
check="--check"
1010
fi
1111

12-
rustc ci/style.rs && ./style src
12+
cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture
1313

1414
command -v rustfmt
1515
rustfmt -V

ci/verify-build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ test_target() {
7171
$cmd
7272
$cmd --features extra_traits
7373

74+
if [ "$os" = "linux" ]; then
75+
# Test with the equivalent of __USE_TIME_BITS64
76+
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd
77+
fi
78+
7479
# Test again without default features, i.e. without "std"
7580
$cmd --no-default-features
7681
$cmd --no-default-features --features extra_traits

libc-test/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ A test crate for the libc crate.
1515
[dependencies]
1616
libc = { path = "..", version = "1.0.0-alpha.1", default-features = false }
1717

18+
[dev-dependencies]
19+
syn = { version = "2.0.91", features = ["full", "visit"] }
20+
proc-macro2 = { version = "1.0.92", features = ["span-locations"] }
21+
glob = "0.3.2"
22+
annotate-snippets = { version = "0.11.5", features = ["testing-colors"] }
23+
1824
[build-dependencies]
1925
cc = "1.0.83"
2026
# FIXME: Use fork ctest until the maintainer gets back.
@@ -90,3 +96,13 @@ harness = false
9096
name = "primitive_types"
9197
path = "test/primitive_types.rs"
9298
harness = true
99+
100+
[[test]]
101+
name = "style"
102+
path = "test/check_style.rs"
103+
harness = true
104+
105+
[[test]]
106+
name = "style_tests"
107+
path = "test/style_tests.rs"
108+
harness = true

0 commit comments

Comments
 (0)