git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit783d547bddf66070b3a33b1fd4b972d945e5942c authorYurii Rashkovskii <yrashk@gmail.com> dateMon 7 May 2018, 13:33 (9 years ago) parent17fe52a
2 files changed+19
pkgs/applications/version-management/sit/aarch64-eexist.patch+17 pkgs/applications/version-management/sit/default.nix+2
pkgs/applications/version-management/sit/aarch64-eexist.patchnew file+17
@@ -0,0 +1,17 @@
1+diff --git a/sit-core/src/repository.rs b/sit-core/src/repository.rs
2+index ebd357d..074dcc9 100644
3+--- a/sit-core/src/repository.rs
4++++ b/sit-core/src/repository.rs
5+@@ -305,6 +305,12 @@ impl Repository {
6+ let id: String = name.into();
7+ let mut path = self.items_path.clone();
8+ path.push(&id);
9++ #[cfg(all(debug_assertions, target_arch = "aarch64"))] {
10++ use std::io;
11++ if path.is_dir() {
12++ return Err(io::Error::from_raw_os_error(17).into()); // 17 is EEXIST
13++ }
14++ }
15+ fs::create_dir(path)?;
16+ let id = OsString::from(id);
17+ Ok(Item {
pkgs/applications/version-management/sit/default.nix+2
@@ -15,6 +15,8 @@ rustPlatform.buildRustPackage rec {
1515
1616 cargoSha256 = "102haqix13nwcncng1s8qkw68spn6fhh3vysk2nbahw6f78zczqg";
1717
18+ patches = [ ./aarch64-eexist.patch ];
19+
1820 meta = with stdenv.lib; {
1921 description = "Serverless Information Tracker";
2022 homepage = https://sit.sh/;