From cf963b74c804674799a06145b364f815bdbff002 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:07:51 +0900 Subject: [PATCH] Bump libc from 0.2.178 to 0.2.179 (#6654) * Bump libc from 0.2.178 to 0.2.179 Bumps [libc](https://github.com/rust-lang/libc) from 0.2.178 to 0.2.179. - [Release notes](https://github.com/rust-lang/libc/releases) - [Changelog](https://github.com/rust-lang/libc/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-lang/libc/compare/0.2.178...0.2.179) --- updated-dependencies: - dependency-name: libc dependency-version: 0.2.179 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix musl and wasi builds after libc 0.2.179 upgrade (#6655) * Initial plan * Fix musl and wasi build failures after libc 0.2.179 upgrade - Remove wasi-specific implementation of get_process_time that used CLOCK_PROCESS_CPUTIME_ID - Exclude wasi from CLOCK_PROCESS_CPUTIME_ID constant export - Add musl and wasi to use st_atim/st_mtim/st_ctim timespec fields for stat structure Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/vm/src/stdlib/os.rs | 4 ++-- crates/vm/src/stdlib/time.rs | 16 ++-------------- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55ade0703..f9741bc50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1681,9 +1681,9 @@ checksum = "2c4a545a15244c7d945065b5d392b2d2d7f21526fba56ce51467b06ed445e8f7" [[package]] name = "libc" -version = "0.2.178" +version = "0.2.179" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" [[package]] name = "libffi" diff --git a/Cargo.toml b/Cargo.toml index 5bd392e9d..a0c4a1493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,7 @@ insta = "1.46" itertools = "0.14.0" is-macro = "0.3.7" junction = "1.3.0" -libc = "0.2.178" +libc = "0.2.179" libffi = "5" log = "0.4.29" nix = { version = "0.30", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] } diff --git a/crates/vm/src/stdlib/os.rs b/crates/vm/src/stdlib/os.rs index 416f26018..415097b90 100644 --- a/crates/vm/src/stdlib/os.rs +++ b/crates/vm/src/stdlib/os.rs @@ -918,7 +918,7 @@ pub(super) mod _os { fn from_stat(stat: &StatStruct, vm: &VirtualMachine) -> Self { let (atime, mtime, ctime); #[cfg(any(unix, windows))] - #[cfg(not(target_os = "netbsd"))] + #[cfg(not(any(target_os = "netbsd", target_os = "wasi", target_env = "musl")))] { atime = (stat.st_atime, stat.st_atime_nsec); mtime = (stat.st_mtime, stat.st_mtime_nsec); @@ -930,7 +930,7 @@ pub(super) mod _os { mtime = (stat.st_mtime, stat.st_mtimensec); ctime = (stat.st_ctime, stat.st_ctimensec); } - #[cfg(target_os = "wasi")] + #[cfg(any(target_os = "wasi", target_env = "musl"))] { atime = (stat.st_atim.tv_sec, stat.st_atim.tv_nsec); mtime = (stat.st_mtim.tv_sec, stat.st_mtim.tv_nsec); diff --git a/crates/vm/src/stdlib/time.rs b/crates/vm/src/stdlib/time.rs index 97d60ae98..8c368b9cc 100644 --- a/crates/vm/src/stdlib/time.rs +++ b/crates/vm/src/stdlib/time.rs @@ -441,19 +441,6 @@ mod decl { )) } - // same as the get_process_time impl for most unixes - #[cfg(all(target_arch = "wasm32", target_os = "wasi"))] - pub(super) fn get_process_time(vm: &VirtualMachine) -> PyResult { - let time: libc::timespec = unsafe { - let mut time = std::mem::MaybeUninit::uninit(); - if libc::clock_gettime(libc::CLOCK_PROCESS_CPUTIME_ID, time.as_mut_ptr()) == -1 { - return Err(vm.new_os_error("Failed to get clock time".to_owned())); - } - time.assume_init() - }; - Ok(Duration::new(time.tv_sec as u64, time.tv_nsec as u32)) - } - #[cfg(not(any( windows, target_os = "macos", @@ -466,7 +453,7 @@ mod decl { target_os = "solaris", target_os = "openbsd", target_os = "redox", - all(target_arch = "wasm32", not(target_os = "unknown")) + all(target_arch = "wasm32", target_os = "emscripten") )))] fn get_process_time(vm: &VirtualMachine) -> PyResult { Err(vm.new_not_implemented_error("process time unsupported in this system")) @@ -601,6 +588,7 @@ mod platform { target_os = "netbsd", target_os = "solaris", target_os = "openbsd", + target_os = "wasi", )))] #[pyattr] use libc::CLOCK_PROCESS_CPUTIME_ID;