From 940d71c32dbe6582d698c64fd600ad900f104643 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 Jul 2020 13:25:30 +0200 Subject: [PATCH] Fix build --- file-cache.hh | 2 +- flake.nix | 4 ++-- generate-programs-index.cc | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/file-cache.hh b/file-cache.hh index 8b1dfde..a7f1916 100644 --- a/file-cache.hh +++ b/file-cache.hh @@ -129,7 +129,7 @@ public: contains a JSON serialisation of the listing of the NAR contents) from the binary cache. */ auto now1 = std::chrono::steady_clock::now(); - auto s = binaryCache->getFile(storePathToHash(storePath) + ".ls"); + auto s = binaryCache->getFile(std::string(baseNameOf(storePath).substr(0, StorePath::HashLen)) + ".ls"); if (!s) printInfo("warning: no listing of %s in binary cache", storePath); else { diff --git a/flake.nix b/flake.nix index a5e44a9..654a03a 100644 --- a/flake.nix +++ b/flake.nix @@ -32,13 +32,13 @@ $(pkg-config --libs nix-main) \ $(pkg-config --libs nix-expr) \ $(pkg-config --libs nix-store) \ - -lsqlite3 -lgc -lnixrust + -lsqlite3 -lgc g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \ $(pkg-config --cflags nix-main) \ $(pkg-config --libs nix-main) \ $(pkg-config --libs nix-store) \ - -lsqlite3 -lnixrust + -lsqlite3 ''; }; diff --git a/generate-programs-index.cc b/generate-programs-index.cc index 1797f62..5e46c2d 100644 --- a/generate-programs-index.cc +++ b/generate-programs-index.cc @@ -11,6 +11,7 @@ #include "thread-pool.hh" #include "sqlite.hh" #include "binary-cache-store.hh" +#include "logging.hh" #include "file-cache.hh" @@ -40,7 +41,7 @@ void mainWrapped(int argc, char * * argv) Path nixpkgsPath = argv[5]; settings.readOnlyMode = true; - settings.showTrace = true; + loggerSettings.showTrace = true; auto localStore = openStore(); std::string binaryCacheUri = argv[3]; @@ -121,7 +122,7 @@ void mainWrapped(int argc, char * * argv) } } catch (AssertionError & e) { } catch (Error & e) { - e.addPrefix(fmt("in package ā€˜%sā€™: ", package.attrPath)); + e.addTrace({}, hintfmt("in package '%s': ", package.attrPath)); throw; }