Skip to content

Commit cf963b7

Browse files
dependabot[bot]Copilotyouknowone
authored
Bump libc from 0.2.178 to 0.2.179 (RustPython#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](rust-lang/libc@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] <support@github.com> * Fix musl and wasi builds after libc 0.2.179 upgrade (RustPython#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] <support@github.com> 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>
1 parent ead7e0c commit cf963b7

4 files changed

Lines changed: 7 additions & 19 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ insta = "1.46"
177177
itertools = "0.14.0"
178178
is-macro = "0.3.7"
179179
junction = "1.3.0"
180-
libc = "0.2.178"
180+
libc = "0.2.179"
181181
libffi = "5"
182182
log = "0.4.29"
183183
nix = { version = "0.30", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] }

crates/vm/src/stdlib/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ pub(super) mod _os {
918918
fn from_stat(stat: &StatStruct, vm: &VirtualMachine) -> Self {
919919
let (atime, mtime, ctime);
920920
#[cfg(any(unix, windows))]
921-
#[cfg(not(target_os = "netbsd"))]
921+
#[cfg(not(any(target_os = "netbsd", target_os = "wasi", target_env = "musl")))]
922922
{
923923
atime = (stat.st_atime, stat.st_atime_nsec);
924924
mtime = (stat.st_mtime, stat.st_mtime_nsec);
@@ -930,7 +930,7 @@ pub(super) mod _os {
930930
mtime = (stat.st_mtime, stat.st_mtimensec);
931931
ctime = (stat.st_ctime, stat.st_ctimensec);
932932
}
933-
#[cfg(target_os = "wasi")]
933+
#[cfg(any(target_os = "wasi", target_env = "musl"))]
934934
{
935935
atime = (stat.st_atim.tv_sec, stat.st_atim.tv_nsec);
936936
mtime = (stat.st_mtim.tv_sec, stat.st_mtim.tv_nsec);

crates/vm/src/stdlib/time.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -441,19 +441,6 @@ mod decl {
441441
))
442442
}
443443

444-
// same as the get_process_time impl for most unixes
445-
#[cfg(all(target_arch = "wasm32", target_os = "wasi"))]
446-
pub(super) fn get_process_time(vm: &VirtualMachine) -> PyResult<Duration> {
447-
let time: libc::timespec = unsafe {
448-
let mut time = std::mem::MaybeUninit::uninit();
449-
if libc::clock_gettime(libc::CLOCK_PROCESS_CPUTIME_ID, time.as_mut_ptr()) == -1 {
450-
return Err(vm.new_os_error("Failed to get clock time".to_owned()));
451-
}
452-
time.assume_init()
453-
};
454-
Ok(Duration::new(time.tv_sec as u64, time.tv_nsec as u32))
455-
}
456-
457444
#[cfg(not(any(
458445
windows,
459446
target_os = "macos",
@@ -466,7 +453,7 @@ mod decl {
466453
target_os = "solaris",
467454
target_os = "openbsd",
468455
target_os = "redox",
469-
all(target_arch = "wasm32", not(target_os = "unknown"))
456+
all(target_arch = "wasm32", target_os = "emscripten")
470457
)))]
471458
fn get_process_time(vm: &VirtualMachine) -> PyResult<Duration> {
472459
Err(vm.new_not_implemented_error("process time unsupported in this system"))
@@ -601,6 +588,7 @@ mod platform {
601588
target_os = "netbsd",
602589
target_os = "solaris",
603590
target_os = "openbsd",
591+
target_os = "wasi",
604592
)))]
605593
#[pyattr]
606594
use libc::CLOCK_PROCESS_CPUTIME_ID;

0 commit comments

Comments
 (0)