From b9234142f5e3c69f3372f15ab2e6df19c7bf6b64 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sat, 23 Oct 2021 21:30:51 +0300 Subject: addToStore, addToStoreFromDump: add references argument Allow to pass a set of references to be added as info to the added paths. --- src/libstore/daemon.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstore/daemon.cc') diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 164a9b2be..fa6606ba4 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -402,9 +402,9 @@ static void performOp(TunnelLogger * logger, ref store, return store->queryPathInfo(path); }, [&](FixedOutputHashMethod & fohm) { - if (!refs.empty()) - throw UnimplementedError("cannot yet have refs with flat or nar-hashed data"); - auto path = store->addToStoreFromDump(source, name, fohm.fileIngestionMethod, fohm.hashType, repair); + // if (!refs.empty()) + // throw UnimplementedError("cannot yet have refs with flat or nar-hashed data"); + auto path = store->addToStoreFromDump(source, name, fohm.fileIngestionMethod, fohm.hashType, repair, refs); return store->queryPathInfo(path); }, }, contentAddressMethod); -- cgit v1.2.3 From 9d4dcff37a14c5bab98761e417a2335a9ac68c96 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sat, 23 Oct 2021 21:31:46 +0300 Subject: addPath: allow paths with references Since 4806f2f6b0fd2cae401b89fe19d8c528ffd88b5f, we can't have paths with references passed to builtins.{path,filterSource}. This prevents many cases of those functions called on IFD outputs from working. Resolve this by passing the references found in the original path to the added path. --- src/libstore/daemon.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/libstore/daemon.cc') diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index fa6606ba4..b1cc07486 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -402,8 +402,6 @@ static void performOp(TunnelLogger * logger, ref store, return store->queryPathInfo(path); }, [&](FixedOutputHashMethod & fohm) { - // if (!refs.empty()) - // throw UnimplementedError("cannot yet have refs with flat or nar-hashed data"); auto path = store->addToStoreFromDump(source, name, fohm.fileIngestionMethod, fohm.hashType, repair, refs); return store->queryPathInfo(path); }, -- cgit v1.2.3