From 783d547bddf66070b3a33b1fd4b972d945e5942c Mon Sep 17 00:00:00 2001 From: Yurii Rashkovskii Date: Mon, 7 May 2018 13:33:51 -0700 Subject: [PATCH] sit: fix tests on aarch64 As we found out in #40032, sit tests won't pass on aarch64. The problem seems to be related to `create_dir` not returning an error if the directory already exists, happening specifically on aarch64+debug (not aarch64+release) This update injects a patch for tests that will also be included in subsequent versions of SIT. --- .../version-management/sit/aarch64-eexist.patch | 17 +++++++++++++++++ .../version-management/sit/default.nix | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/applications/version-management/sit/aarch64-eexist.patch diff --git a/pkgs/applications/version-management/sit/aarch64-eexist.patch b/pkgs/applications/version-management/sit/aarch64-eexist.patch new file mode 100644 index 00000000000..8b45e77d040 --- /dev/null +++ b/pkgs/applications/version-management/sit/aarch64-eexist.patch @@ -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 { diff --git a/pkgs/applications/version-management/sit/default.nix b/pkgs/applications/version-management/sit/default.nix index 0cc75f8bd5a..ae84add283e 100644 --- a/pkgs/applications/version-management/sit/default.nix +++ b/pkgs/applications/version-management/sit/default.nix @@ -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/;