about summary refs log tree commit diff
path: root/third_party/nix/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore')
-rw-r--r--third_party/nix/src/libstore/build.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/third_party/nix/src/libstore/build.cc b/third_party/nix/src/libstore/build.cc
index 74db67e862a7..afd2374b0ac1 100644
--- a/third_party/nix/src/libstore/build.cc
+++ b/third_party/nix/src/libstore/build.cc
@@ -15,6 +15,8 @@
 
 #include <absl/strings/ascii.h>
 #include <absl/strings/numbers.h>
+#include <absl/strings/str_cat.h>
+#include <absl/strings/str_format.h>
 #include <absl/strings/str_split.h>
 #include <fcntl.h>
 #include <glog/logging.h>
@@ -1970,10 +1972,12 @@ void DerivationGoal::startBuilder() {
        by `nix-store --register-validity'.  However, the deriver
        fields are left empty. */
     std::string s = get(drv->env, "exportReferencesGraph");
-    std::vector<std::string> ss = absl::StrSplit(s, absl::ByAnyChar(" \t\n\r"));
+    std::vector<std::string> ss =
+        absl::StrSplit(s, absl::ByAnyChar(" \t\n\r"), absl::SkipEmpty());
     if (ss.size() % 2 != 0) {
-      throw BuildError(
-          format("odd number of tokens in 'exportReferencesGraph': '%1%'") % s);
+      throw BuildError(absl::StrFormat(
+          "odd number of tokens %d in 'exportReferencesGraph': '%s'", ss.size(),
+          s));
     }
     for (auto i = ss.begin(); i != ss.end();) {
       std::string fileName = *i++;
@@ -3959,7 +3963,7 @@ SubstitutionGoal::SubstitutionGoal(const Path& storePath, Worker& worker,
     : Goal(worker), repair(repair) {
   this->storePath = storePath;
   state = &SubstitutionGoal::init;
-  name = (format("substitution of '%1%'") % storePath).str();
+  name = absl::StrCat("substitution of ", storePath);
   trace("created");
   maintainExpectedSubstitutions =
       std::make_unique<MaintainCount<uint64_t>>(worker.expectedSubstitutions);