Merge pull request #40151 from yrashk/sit-aarch64-isel

sit: better fix for aarch64 bug
This commit is contained in:
xeji 2018-05-08 22:09:25 +02:00 committed by GitHub
commit ab4a04c38b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 18 deletions

View file

@ -1,17 +0,0 @@
diff --git a/sit-core/src/repository.rs b/sit-core/src/repository.rs
index ebd357d..074dcc9 100644
--- a/sit-core/src/repository.rs
+++ b/sit-core/src/repository.rs
@@ -305,6 +305,12 @@ impl Repository {
let id: String = name.into();
let mut path = self.items_path.clone();
path.push(&id);
+ #[cfg(all(debug_assertions, target_arch = "aarch64"))] {
+ use std::io;
+ if path.is_dir() {
+ return Err(io::Error::from_raw_os_error(17).into()); // 17 is EEXIST
+ }
+ }
fs::create_dir(path)?;
let id = OsString::from(id);
Ok(Item {

View file

@ -0,0 +1,9 @@
diff --git a/.cargo/config b/.cargo/config
new file mode 100644
index 0000000..15e7649
--- /dev/null
+++ b/.cargo/config
@@ -0,0 +1,3 @@
+# https://github.com/rust-lang/rust/issues/50516
+[target.'cfg(all(debug_assertions, target_arch = "aarch64"))']
+rustflags = ["-C", "llvm-args=-fast-isel"]

View file

@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "102haqix13nwcncng1s8qkw68spn6fhh3vysk2nbahw6f78zczqg";
patches = [ ./aarch64-eexist.patch ];
patches = [ ./aarch64-isel.patch ];
meta = with stdenv.lib; {
description = "Serverless Information Tracker";