Skip to content

Commit eba0f41

Browse files
authored
chore: pin libc to 0.2.171 & bump CI image (#2632)
* try reproducing the CI error * pin libc to 0.2.171 * bump changelog CI runner image * ci: downgrade libc for hurd * style: allow clippy::unwrap_or_default
1 parent b561476 commit eba0f41

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.github/workflows/check_new_changelog.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99

1010
jobs:
1111
check_new_changelog:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- name: checkout
1515
uses: actions/checkout@v4

.github/workflows/ci.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ jobs:
7878
# Use cross for QEMU-based testing
7979
# cross needs to execute Docker, GitHub Action already has it installed
8080
cross:
81-
# Still use 20.04 for this CI step as test `test_prctl::test_set_vma_anon_name`
82-
# would fail on 22.04 and 24.04 (at least for now)
83-
# https://github.com/nix-rust/nix/issues/2418
84-
runs-on: ubuntu-20.04
81+
runs-on: ubuntu-24.04
8582
needs: [rustfmt, minver, macos, x86_64_linux_native_builds, rust_stable]
8683
strategy:
8784
fail-fast: false
@@ -363,6 +360,13 @@ jobs:
363360
- name: install src
364361
run: rustup component add rust-src
365362

363+
# Cargo uses the latest version of libc(without lock file), which is, at the time of writing
364+
# this, 0.2.172. And the hurd target is broken with 0.2.172: https://github.com/rust-lang/libc/issues/4421
365+
# So we need to downgrade it.
366+
- name: downgrade libc to 0.2.171 on hurd
367+
if: ${{ matrix.target == 'i686-unknown-hurd-gnu' }}
368+
run: cargo update -p libc --precise 0.2.171
369+
366370
- name: build
367371
uses: ./.github/actions/build
368372
with:

src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
#![cfg_attr(docsrs, feature(doc_cfg))]
9898
#![deny(clippy::cast_ptr_alignment)]
9999
#![deny(unsafe_op_in_unsafe_fn)]
100+
// I found the change suggested by this rules could hurt code readability. I cannot
101+
// remeber every type's default value, in such cases, it forces me to open
102+
// the std doc to insepct the Default value, which is unnecessary with
103+
// `.unwrap_or(value)`.
104+
#![allow(clippy::unwrap_or_default)]
100105

101106
// Re-exported external crates
102107
pub use libc;

test/sys/test_prctl.rs

+5
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ mod test_prctl {
131131
prctl::set_thp_disable(original).unwrap();
132132
}
133133

134+
// Ignore this test under QEMU, as it started failing after updating the Linux CI
135+
// runner image, for reasons unknown.
136+
//
137+
// See: https://github.com/nix-rust/nix/issues/2418
134138
#[test]
139+
#[cfg_attr(qemu, ignore)]
135140
fn test_set_vma_anon_name() {
136141
use nix::errno::Errno;
137142
use nix::sys::mman;

0 commit comments

Comments
 (0)