Merge pull request #40143 from yrashk/sit-0.3.2-aarch64

sit: fix tests on aarch64
This commit is contained in:
xeji 2018-05-07 23:01:48 +02:00 committed by GitHub
commit 02fff4699c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

@ -0,0 +1,17 @@
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 {

@ -15,6 +15,8 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "102haqix13nwcncng1s8qkw68spn6fhh3vysk2nbahw6f78zczqg";
patches = [ ./aarch64-eexist.patch ];
meta = with stdenv.lib; {
description = "Serverless Information Tracker";
homepage = https://sit.sh/;