Fix compilation on Rust-1.76

(cherry picked from commit a77aaebdcd14809091e3d906361593ab76e3a41d)
This commit is contained in:
wk333 2024-10-15 11:14:34 +08:00 committed by openeuler-sync-bot
parent 741be68258
commit bd9dfcb4e0
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From cd966ac70595391b2382c1ef75c179847a845878 Mon Sep 17 00:00:00 2001
From: Dan Gohman <dev@sunfishcode.online>
Date: Tue, 23 Aug 2022 13:36:15 -0700
Subject: [PATCH] Fix compilation on Rust beta.
---
vendor/cap-primitives/src/rustix/linux/fs/set_times_impl.rs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/cap-primitives/src/rustix/linux/fs/set_times_impl.rs b/vendor/cap-primitives/src/rustix/linux/fs/set_times_impl.rs
index 9a2da047..5844c7d7 100644
--- a/vendor/cap-primitives/src/rustix/linux/fs/set_times_impl.rs
+++ b/vendor/cap-primitives/src/rustix/linux/fs/set_times_impl.rs
@@ -3,7 +3,6 @@
use super::procfs::set_times_through_proc_self_fd;
use crate::fs::{open, OpenOptions, SystemTimeSpec};
-use fs_set_times::SetTimes;
use std::path::Path;
use std::{fs, io};
@@ -17,7 +16,8 @@ pub(crate) fn set_times_impl(
// access, so first try write.
match open(start, path, OpenOptions::new().write(true)) {
Ok(file) => {
- return file.set_times(
+ return fs_set_times::SetTimes::set_times(
+ &file,
atime.map(SystemTimeSpec::into_std),
mtime.map(SystemTimeSpec::into_std),
)
@@ -31,7 +31,8 @@ pub(crate) fn set_times_impl(
// Next try read.
match open(start, path, OpenOptions::new().read(true)) {
Ok(file) => {
- return file.set_times(
+ return fs_set_times::SetTimes::set_times(
+ &file,
atime.map(SystemTimeSpec::into_std),
mtime.map(SystemTimeSpec::into_std),
)

View File

@ -4,7 +4,7 @@
Name: rpm-ostree
Version: 2022.16
Release: 4
Release: 5
Summary: Hybrid image/package system
License: Apache-2.0 or MIT and GPL-2.0-or-later and LGPL-2.0-or-later
URL: https://github.com/coreos/rpm-ostree
@ -13,6 +13,8 @@ Patch0: fix-compose-err.patch
Patch1: fix-2022.16-build-error.patch
Patch2: add-for-support-NestOS-kernel.patch
Patch3: fix-compose-error-for-selinux.patch
# https://github.com/bytecodealliance/cap-std/commit/cd966ac70595391b2382c1ef75c179847a845878
Patch4: fix-compilation-on-Rust-beta.patch
%if %{with rust}
%if !%{defined rust_arches}
@ -69,6 +71,8 @@ Header files for rpm-ostree.
%prep
%autosetup -n %{name}-%{version} -p1
# for patch4
sed -i "s/3f6633fa050c0751542d023624f627955436d78cf8eba355370b886683a9d471/f2340d99ce67f1bb842ae2ba6dd57a253b3427d0f7185c59e74fd5f5c3ceec12/" vendor/cap-primitives/.cargo-checksum.json
%build
%{?rusttoolset} env NOCONFIGURE=1 ./autogen.sh
@ -125,6 +129,9 @@ install -pm 0644 src/daemon/org.projectatomic.rpmostree1.conf %{buildroot}/etc/d
%{_mandir}/man*/*
%changelog
* Tue Oct 15 2024 wangkai <13474090681@163.com> - 2022.16-5
- Fix compilation on Rust-1.76
* Fri Oct 13 2023 wangyueliang <wangyueliang@kylinos.cn> - 2022.16-4
- merge feature from branch openEuler-22.03-LTS-SP1
- DESC: add loongarch64 and sw_64 support