forked from lix-project/lix
Merge pull request #6330 from edolstra/run-remote-store
nix {run,shell}: Print a better error message if the store is not local
This commit is contained in:
commit
2d572a250f
|
@ -38,9 +38,12 @@ void runProgramInStore(ref<Store> store,
|
||||||
unshare(CLONE_NEWUSER) doesn't work in a multithreaded program
|
unshare(CLONE_NEWUSER) doesn't work in a multithreaded program
|
||||||
(which "nix" is), so we exec() a single-threaded helper program
|
(which "nix" is), so we exec() a single-threaded helper program
|
||||||
(chrootHelper() below) to do the work. */
|
(chrootHelper() below) to do the work. */
|
||||||
auto store2 = store.dynamic_pointer_cast<LocalStore>();
|
auto store2 = store.dynamic_pointer_cast<LocalFSStore>();
|
||||||
|
|
||||||
if (store2 && store->storeDir != store2->getRealStoreDir()) {
|
if (!store2)
|
||||||
|
throw Error("store '%s' is not a local store so it does not support command execution", store->getUri());
|
||||||
|
|
||||||
|
if (store->storeDir != store2->getRealStoreDir()) {
|
||||||
Strings helperArgs = { chrootHelperName, store->storeDir, store2->getRealStoreDir(), program };
|
Strings helperArgs = { chrootHelperName, store->storeDir, store2->getRealStoreDir(), program };
|
||||||
for (auto & arg : args) helperArgs.push_back(arg);
|
for (auto & arg : args) helperArgs.push_back(arg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue