From ee5860f54283615a9029f34c446f144a2a01b0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 30 Nov 2025 14:24:12 +0100 Subject: [PATCH] Fix crash when querying realisations without ca-derivations enabled queryRealisationUncached was crashing with an assertion failure when ca-derivations experimental feature is not enabled, because the SQLite statements for realisations are only initialized when ca-derivations is enabled. Return nullptr (no realisation found) when ca-derivations is disabled, matching the behavior of other CA-related functions like registerDrvOutput which check for the feature before proceeding. --- src/libstore/local-store.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 2c4d546f8..1ff47ff35 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1634,6 +1634,10 @@ void LocalStore::queryRealisationUncached( const DrvOutput & id, Callback> callback) noexcept { try { + if (!experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { + callback(nullptr); + return; + } auto maybeRealisation = retrySQLite>( [&]() { return queryRealisation_(*_state->lock(), id); }); if (maybeRealisation)