mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
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] <support@github.com> * 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] <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>
This commit is contained in:
4 files changed
+7
-19
No files matched your search
Generated
+2
-2
@@ -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"
|
||||
|
||||
+1
-1
@@ -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"] }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<Duration> {
|
||||
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<Duration> {
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user