From 7c76a812fe452e3ed0eba5834565176b6974c91c Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Thu, 27 Nov 2025 02:42:24 +0300 Subject: [PATCH] libstore: Align LocalFSStore to 8 bytes even on i686-linux This works around https://hydra.nixos.org/build/314579538/nixlog/1. --- src/libstore/include/nix/store/binary-cache-store.hh | 4 +++- src/libstore/include/nix/store/local-fs-store.hh | 5 ++++- src/libstore/ssh-store.cc | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libstore/include/nix/store/binary-cache-store.hh b/src/libstore/include/nix/store/binary-cache-store.hh index e64dc3eae..e7b3d07eb 100644 --- a/src/libstore/include/nix/store/binary-cache-store.hh +++ b/src/libstore/include/nix/store/binary-cache-store.hh @@ -65,7 +65,9 @@ struct BinaryCacheStoreConfig : virtual StoreConfig * @note subclasses must implement at least one of the two * virtual getFile() methods. */ -struct BinaryCacheStore : virtual Store, virtual LogStore +struct alignas(8) /* Work around ASAN failures on i686-linux. */ + BinaryCacheStore : virtual Store, + virtual LogStore { using Config = BinaryCacheStoreConfig; diff --git a/src/libstore/include/nix/store/local-fs-store.hh b/src/libstore/include/nix/store/local-fs-store.hh index 2fb9e1402..7b8dde9b0 100644 --- a/src/libstore/include/nix/store/local-fs-store.hh +++ b/src/libstore/include/nix/store/local-fs-store.hh @@ -66,7 +66,10 @@ public: this, rootDir.get() ? *rootDir.get() + "/nix/store" : storeDir, "real", "Physical path of the Nix store."}; }; -struct LocalFSStore : virtual Store, virtual GcStore, virtual LogStore +struct alignas(8) /* Work around ASAN failures on i686-linux. */ + LocalFSStore : virtual Store, + virtual GcStore, + virtual LogStore { using Config = LocalFSStoreConfig; diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index ce973e734..dc70b4ba8 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -37,7 +37,8 @@ StoreReference SSHStoreConfig::getReference() const }; } -struct SSHStore : virtual RemoteStore +struct alignas(8) /* Work around ASAN failures on i686-linux. */ + SSHStore : virtual RemoteStore { using Config = SSHStoreConfig;