Skip to content

Commit b593b96

Browse files
authored
Merge pull request #18 from microsoft/mamalisz/rust-build-improvements
Stop rustc build from failing on file not found error
2 parents cc67ab4 + adc25c4 commit b593b96

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

SPECS/rust/robust-build.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- rustc-1.39-0-src/src/librustc_incremental/persist/fs.rs 2020-08-12 10:36:42.776264792 -0700
2+
+++ rustc-1.39-0-src/src/librustc_incremental/persist/fs.rs 2020-08-12 10:42:43.797059804 -0700
3+
@@ -880,7 +880,10 @@
4+
fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
5+
if p.exists() {
6+
let canonicalized = p.canonicalize()?;
7+
- std_fs::remove_dir_all(canonicalized)
8+
+ match std_fs::remove_dir_all(canonicalized) {
9+
+ Err(ref err) if err.kind() == io::ErrorKind::NotFound => Ok(()),
10+
+ result => result,
11+
+ }
12+
} else {
13+
Ok(())
14+
}

SPECS/rust/rust.spec

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Rust Programming Language
22
Name: rust
33
Version: 1.39.0
4-
Release: 6%{?dist}
4+
Release: 7%{?dist}
55
License: ASL 2.0 and MIT
66
URL: https://www.rust-lang.org/
77
Group: Applications/System
@@ -16,6 +16,8 @@ Source5: https://static.rust-lang.org/dist/2019-09-26/cargo-0.39.0-aarch6
1616
Source6: https://static.rust-lang.org/dist/2019-09-26/rustc-1.38.0-aarch64-unknown-linux-gnu.tar.gz
1717
Source7: https://static.rust-lang.org/dist/2019-09-26/rust-std-1.38.0-aarch64-unknown-linux-gnu.tar.gz
1818

19+
Patch0: robust-build.patch
20+
1921
BuildRequires: git
2022
BuildRequires: cmake
2123
BuildRequires: glibc
@@ -33,6 +35,9 @@ pushd $HOME
3335
tar xf %{SOURCE1} --no-same-owner
3436
popd
3537
%setup -q -n rustc-%{version}-src
38+
39+
%patch0 -p1
40+
3641
# Setup build/cache directory
3742
%define BUILD_CACHE_DIR build/cache/2019-09-26/
3843
mkdir -pv %{BUILD_CACHE_DIR}
@@ -97,6 +102,8 @@ rm %{buildroot}%{_docdir}/%{name}/*.old
97102
%{_sysconfdir}/bash_completion.d/cargo
98103

99104
%changelog
105+
* Wed Aug 12 2020 Mateusz Malisz <[email protected]> 1.39.0-7
106+
- Add patch for the build to not fail on file not found error.
100107
* Fri Jun 12 2020 Henry Beberman <[email protected]> 1.39.0-6
101108
- Temporarily disable generation of debug symbols.
102109
* Thu May 28 2020 Chris Co <[email protected]> - 1.39.0-5

0 commit comments

Comments
 (0)