aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-06-02 08:22:24 -0600
committerBen Burdette <bburdette@gmail.com>2020-06-02 08:22:24 -0600
commitd82d230b4015c50e698e3be1ec7a3e12277a3251 (patch)
treea37b7c45eb868aa15339dae10b3f43e35899fb46
parent734283d636318b6dfc249afe1ddbb20bb4d02ed4 (diff)
elide the 'ErrorInfo' in logError and logWarning calls
-rw-r--r--src/build-remote/build-remote.cc11
-rw-r--r--src/error-demo/error-demo.cc111
-rw-r--r--src/libstore/build.cc107
-rw-r--r--src/libstore/filetransfer.cc11
-rw-r--r--src/libstore/local-store.cc45
-rw-r--r--src/libstore/optimise-store.cc21
-rw-r--r--src/libutil/logging.cc7
-rw-r--r--src/nix-env/nix-env.cc27
-rw-r--r--src/nix-store/nix-store.cc17
-rw-r--r--src/nix/verify.cc26
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc28
11 files changed, 187 insertions, 224 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 0caa97fa4..2f0b8c825 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -200,12 +200,11 @@ static int _main(int argc, char * * argv)
} catch (std::exception & e) {
auto msg = chomp(drainFD(5, false));
- logError(
- ErrorInfo {
- .name = "Remote build",
- .hint = hintfmt("cannot build on '%s': %s%s",
- bestMachine->storeUri, e.what(),
- (msg.empty() ? "" : ": " + msg))
+ logError({
+ .name = "Remote build",
+ .hint = hintfmt("cannot build on '%s': %s%s",
+ bestMachine->storeUri, e.what(),
+ (msg.empty() ? "" : ": " + msg))
});
bestMachine->enabled = false;
continue;
diff --git a/src/error-demo/error-demo.cc b/src/error-demo/error-demo.cc
index 0216092e3..f1e17b3de 100644
--- a/src/error-demo/error-demo.cc
+++ b/src/error-demo/error-demo.cc
@@ -62,101 +62,96 @@ int main()
// For completeness sake, show 'info' through 'vomit' levels.
// But this is maybe a heavy format for those.
- logger->logEI(
- ErrorInfo { .level = lvlInfo,
+ logger->logEI({ .level = lvlInfo,
.name = "Info name",
.description = "Info description",
});
- logger->logEI(
- ErrorInfo { .level = lvlTalkative,
+ logger->logEI({ .level = lvlTalkative,
.name = "Talkative name",
.description = "Talkative description",
});
- logger->logEI(
- ErrorInfo { .level = lvlChatty,
+ logger->logEI({ .level = lvlChatty,
.name = "Chatty name",
.description = "Chatty description",
});
- logger->logEI(
- ErrorInfo { .level = lvlDebug,
+ logger->logEI({ .level = lvlDebug,
.name = "Debug name",
.description = "Debug description",
});
- logger->logEI(
- ErrorInfo { .level = lvlVomit,
+ logger->logEI({ .level = lvlVomit,
.name = "Vomit name",
.description = "Vomit description",
});
// Error in a program; no hint and no nix code.
- logError(
- ErrorInfo { .name = "name",
- .description = "error description",
- });
+ logError({
+ .name = "name",
+ .description = "error description",
+ });
// Warning with name, description, and hint.
// The hintfmt function makes all the substituted text yellow.
- logWarning(
- ErrorInfo { .name = "name",
- .description = "error description",
- .hint = hintfmt("there was a %1%", "warning"),
- });
+ logWarning({
+ .name = "name",
+ .description = "error description",
+ .hint = hintfmt("there was a %1%", "warning"),
+ });
// Warning with nix file, line number, column, and the lines of
// code where a warning occurred.
SymbolTable testTable;
auto problem_file = testTable.create("myfile.nix");
- logWarning(
- ErrorInfo { .name = "warning name",
- .description = "warning description",
- .hint = hintfmt("this hint has %1% templated %2%!!",
- "yellow",
- "values"),
- .nixCode = NixCode {
- .errPos = Pos(problem_file, 40, 13),
- .prevLineOfCode = std::nullopt,
- .errLineOfCode = "this is the problem line of code",
- .nextLineOfCode = std::nullopt
- }});
+ logWarning({
+ .name = "warning name",
+ .description = "warning description",
+ .hint = hintfmt("this hint has %1% templated %2%!!",
+ "yellow",
+ "values"),
+ .nixCode = NixCode {
+ .errPos = Pos(problem_file, 40, 13),
+ .prevLineOfCode = std::nullopt,
+ .errLineOfCode = "this is the problem line of code",
+ .nextLineOfCode = std::nullopt
+ }});
// Error with previous and next lines of code.
- logError(
- ErrorInfo { .name = "error name",
- .description = "error with code lines",
- .hint = hintfmt("this hint has %1% templated %2%!!",
- "yellow",
- "values"),
- .nixCode = NixCode {
- .errPos = Pos(problem_file, 40, 13),
- .prevLineOfCode = "previous line of code",
- .errLineOfCode = "this is the problem line of code",
- .nextLineOfCode = "next line of code",
- }});
+ logError({
+ .name = "error name",
+ .description = "error with code lines",
+ .hint = hintfmt("this hint has %1% templated %2%!!",
+ "yellow",
+ "values"),
+ .nixCode = NixCode {
+ .errPos = Pos(problem_file, 40, 13),
+ .prevLineOfCode = "previous line of code",
+ .errLineOfCode = "this is the problem line of code",
+ .nextLineOfCode = "next line of code",
+ }});
// Error without lines of code.
- logError(
- ErrorInfo { .name = "error name",
- .description = "error without any code lines.",
- .hint = hintfmt("this hint has %1% templated %2%!!",
- "yellow",
- "values"),
- .nixCode = NixCode {
- .errPos = Pos(problem_file, 40, 13)
- }});
+ logError({
+ .name = "error name",
+ .description = "error without any code lines.",
+ .hint = hintfmt("this hint has %1% templated %2%!!",
+ "yellow",
+ "values"),
+ .nixCode = NixCode {
+ .errPos = Pos(problem_file, 40, 13)
+ }});
// Error with only hint and name..
- logError(
- ErrorInfo { .name = "error name",
- .hint = hintfmt("hint %1%", "only"),
- .nixCode = NixCode {
- .errPos = Pos(problem_file, 40, 13)
- }});
+ logError({
+ .name = "error name",
+ .hint = hintfmt("hint %1%", "only"),
+ .nixCode = NixCode {
+ .errPos = Pos(problem_file, 40, 13)
+ }});
return 0;
}
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 4630432c9..04e8d2ebe 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1158,10 +1158,9 @@ void DerivationGoal::loadDerivation()
trace("loading derivation");
if (nrFailed != 0) {
- logError(
- ErrorInfo {
- .name = "missing derivation during build",
- .hint = hintfmt("cannot build missing derivation '%s'", worker.store.printStorePath(drvPath))
+ logError({
+ .name = "missing derivation during build",
+ .hint = hintfmt("cannot build missing derivation '%s'", worker.store.printStorePath(drvPath))
});
done(BuildResult::MiscFailure);
return;
@@ -1313,12 +1312,11 @@ void DerivationGoal::repairClosure()
/* Check each path (slow!). */
for (auto & i : outputClosure) {
if (worker.pathContentsGood(i)) continue;
- logError(
- ErrorInfo {
- .name = "Corrupt path in closure",
- .hint = hintfmt(
- "found corrupted or missing path '%s' in the output closure of '%s'",
- worker.store.printStorePath(i), worker.store.printStorePath(drvPath))
+ logError({
+ .name = "Corrupt path in closure",
+ .hint = hintfmt(
+ "found corrupted or missing path '%s' in the output closure of '%s'",
+ worker.store.printStorePath(i), worker.store.printStorePath(drvPath))
});
auto drvPath2 = outputsToDrv.find(i);
if (drvPath2 == outputsToDrv.end())
@@ -1353,12 +1351,11 @@ void DerivationGoal::inputsRealised()
if (nrFailed != 0) {
if (!useDerivation)
throw Error("some dependencies of '%s' are missing", worker.store.printStorePath(drvPath));
- logError(
- ErrorInfo {
- .name = "Dependencies could not be built",
- .hint = hintfmt(
- "cannot build derivation '%s': %s dependencies couldn't be built",
- worker.store.printStorePath(drvPath), nrFailed)
+ logError({
+ .name = "Dependencies could not be built",
+ .hint = hintfmt(
+ "cannot build derivation '%s': %s dependencies couldn't be built",
+ worker.store.printStorePath(drvPath), nrFailed)
});
done(BuildResult::DependencyFailed);
return;
@@ -1844,12 +1841,11 @@ HookReply DerivationGoal::tryBuildHook()
} catch (SysError & e) {
if (e.errNo == EPIPE) {
- logError(
- ErrorInfo {
- .name = "Build hook died",
- .hint = hintfmt(
- "build hook died unexpectedly: %s",
- chomp(drainFD(worker.hook->fromHook.readSide.get())))
+ logError({
+ .name = "Build hook died",
+ .hint = hintfmt(
+ "build hook died unexpectedly: %s",
+ chomp(drainFD(worker.hook->fromHook.readSide.get())))
});
worker.hook = 0;
return rpDecline;
@@ -3692,11 +3688,10 @@ void DerivationGoal::registerOutputs()
/* Apply hash rewriting if necessary. */
bool rewritten = false;
if (!outputRewrites.empty()) {
- logWarning(
- ErrorInfo {
- .name = "Rewriting hashes",
- .hint = hintfmt("rewriting hashes in '%1%'; cross fingers", path)
- });
+ logWarning({
+ .name = "Rewriting hashes",
+ .hint = hintfmt("rewriting hashes in '%1%'; cross fingers", path)
+ });
/* Canonicalise first. This ensures that the path we're
rewriting doesn't contain a hard link to /etc/shadow or
@@ -3875,10 +3870,9 @@ void DerivationGoal::registerOutputs()
if (settings.enforceDeterminism)
throw NotDeterministic(hint);
- logError(
- ErrorInfo {
- .name = "Output determinism error",
- .hint = hint
+ logError({
+ .name = "Output determinism error",
+ .hint = hint
});
@@ -4145,12 +4139,11 @@ void DerivationGoal::handleChildOutput(int fd, const string & data)
{
logSize += data.size();
if (settings.maxLogSize && logSize > settings.maxLogSize) {
- logError(
- ErrorInfo {
- .name = "Max log size exceeded",
- .hint = hintfmt(
- "%1% killed after writing more than %2% bytes of log output",
- getName(), settings.maxLogSize)
+ logError({
+ .name = "Max log size exceeded",
+ .hint = hintfmt(
+ "%1% killed after writing more than %2% bytes of log output",
+ getName(), settings.maxLogSize)
});
killChild();
done(BuildResult::LogLimitExceeded);
@@ -4467,12 +4460,11 @@ void SubstitutionGoal::tryNext()
&& !sub->isTrusted
&& !info->checkSignatures(worker.store, worker.store.getPublicKeys()))
{
- logWarning(
- ErrorInfo {
- .name = "Invalid path signature",
- .hint = hintfmt("substituter '%s' does not have a valid signature for path '%s'",
- sub->getUri(), worker.store.printStorePath(storePath))
- });
+ logWarning({
+ .name = "Invalid path signature",
+ .hint = hintfmt("substituter '%s' does not have a valid signature for path '%s'",
+ sub->getUri(), worker.store.printStorePath(storePath))
+ });
tryNext();
return;
}
@@ -4954,12 +4946,11 @@ void Worker::waitForInput()
j->respectTimeouts &&
after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime))
{
- logError(
- ErrorInfo {
- .name = "Silent build timeout",
- .hint = hintfmt(
- "%1% timed out after %2% seconds of silence",
- goal->getName(), settings.maxSilentTime)
+ logError({
+ .name = "Silent build timeout",
+ .hint = hintfmt(
+ "%1% timed out after %2% seconds of silence",
+ goal->getName(), settings.maxSilentTime)
});
goal->timedOut();
}
@@ -4969,12 +4960,11 @@ void Worker::waitForInput()
j->respectTimeouts &&
after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout))
{
- logError(
- ErrorInfo {
- .name = "Build timeout",
- .hint = hintfmt(
- "%1% timed out after %2% seconds",
- goal->getName(), settings.buildTimeout)
+ logError({
+ .name = "Build timeout",
+ .hint = hintfmt(
+ "%1% timed out after %2% seconds",
+ goal->getName(), settings.buildTimeout)
});
goal->timedOut();
}
@@ -5035,10 +5025,9 @@ bool Worker::pathContentsGood(const StorePath & path)
}
pathContentsGoodCache.insert_or_assign(path.clone(), res);
if (!res)
- logError(
- ErrorInfo {
- .name = "Corrupted path",
- .hint = hintfmt("path '%s' is corrupted or missing!", store.printStorePath(path))
+ logError({
+ .name = "Corrupted path",
+ .hint = hintfmt("path '%s' is corrupted or missing!", store.printStorePath(path))
});
return res;
}
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index 89588d662..6ca3393ab 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -599,12 +599,11 @@ struct curlFileTransfer : public FileTransfer
workerThreadMain();
} catch (nix::Interrupted & e) {
} catch (std::exception & e) {
- logError(
- ErrorInfo {
- .name = "File transfer",
- .hint = hintfmt("unexpected error in download thread: %s",
- e.what())
- });
+ logError({
+ .name = "File transfer",
+ .hint = hintfmt("unexpected error in download thread: %s",
+ e.what())
+ });
}
{
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index abcfe5271..53fb4ce68 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -87,12 +87,11 @@ LocalStore::LocalStore(const Params & params)
struct group * gr = getgrnam(settings.buildUsersGroup.get().c_str());
if (!gr)
- logError(
- ErrorInfo {
- .name = "'build-users-group' not found",
- .hint = hintfmt(
- "warning: the group '%1%' specified in 'build-users-group' does not exist",
- settings.buildUsersGroup)
+ logError({
+ .name = "'build-users-group' not found",
+ .hint = hintfmt(
+ "warning: the group '%1%' specified in 'build-users-group' does not exist",
+ settings.buildUsersGroup)
});
else {
struct stat st;
@@ -1242,12 +1241,11 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
Path linkPath = linksDir + "/" + link.name;
string hash = hashPath(htSHA256, linkPath).first.to_string(Base32, false);
if (hash != link.name) {
- logError(
- ErrorInfo {
- .name = "Invalid hash",
- .hint = hintfmt(
- "link '%s' was modified! expected hash '%s', got '%s'",
- linkPath, link.name, hash)
+ logError({
+ .name = "Invalid hash",
+ .hint = hintfmt(
+ "link '%s' was modified! expected hash '%s', got '%s'",
+ linkPath, link.name, hash)
});
if (repair) {
if (unlink(linkPath.c_str()) == 0)
@@ -1281,11 +1279,10 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
auto current = hashSink->finish();
if (info->narHash != nullHash && info->narHash != current.first) {
- logError(
- ErrorInfo {
- .name = "Invalid hash - path modified",
- .hint = hintfmt("path '%s' was modified! expected hash '%s', got '%s'",
- printStorePath(i), info->narHash.to_string(), current.first.to_string())
+ logError({
+ .name = "Invalid hash - path modified",
+ .hint = hintfmt("path '%s' was modified! expected hash '%s', got '%s'",
+ printStorePath(i), info->narHash.to_string(), current.first.to_string())
});
if (repair) repairPath(i); else errors = true;
} else {
@@ -1337,10 +1334,9 @@ void LocalStore::verifyPath(const Path & pathS, const StringSet & store,
if (!done.insert(pathS).second) return;
if (!isStorePath(pathS)) {
- logError(
- ErrorInfo {
- .name = "Nix path not found",
- .hint = hintfmt("path '%s' is not in the Nix store", pathS)
+ logError({
+ .name = "Nix path not found",
+ .hint = hintfmt("path '%s' is not in the Nix store", pathS)
});
return;
}
@@ -1364,10 +1360,9 @@ void LocalStore::verifyPath(const Path & pathS, const StringSet & store,
auto state(_state.lock());
invalidatePath(*state, path);
} else {
- logError(
- ErrorInfo {
- .name = "Missing path with referrers",
- .hint = hintfmt("path '%s' disappeared, but it still has valid referrers!", pathS)
+ logError({
+ .name = "Missing path with referrers",
+ .hint = hintfmt("path '%s' disappeared, but it still has valid referrers!", pathS)
});
if (repair)
try {
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index c9ecca5a8..cc0507be2 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -130,10 +130,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
NixOS (example: $fontconfig/var/cache being modified). Skip
those files. FIXME: check the modification time. */
if (S_ISREG(st.st_mode) && (st.st_mode & S_IWUSR)) {
- logWarning(
- ErrorInfo {
- .name = "Suspicious file",
- .hint = hintfmt("skipping suspicious writable file '%1%'", path)
+ logWarning({
+ .name = "Suspicious file",
+ .hint = hintfmt("skipping suspicious writable file '%1%'", path)
});
return;
}
@@ -198,10 +197,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
}
if (st.st_size != stLink.st_size) {
- logWarning(
- ErrorInfo {
- .name = "Corrupted link",
- .hint = hintfmt("removing corrupted link '%1%'", linkPath)
+ logWarning({
+ .name = "Corrupted link",
+ .hint = hintfmt("removing corrupted link '%1%'", linkPath)
});
unlink(linkPath.c_str());
goto retry;
@@ -237,10 +235,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
/* Atomically replace the old file with the new hard link. */
if (rename(tempLink.c_str(), path.c_str()) == -1) {
if (unlink(tempLink.c_str()) == -1)
- logError(
- ErrorInfo {
- .name = "Unlink error",
- .hint = hintfmt("unable to unlink '%1%'", tempLink)
+ logError({
+ .name = "Unlink error",
+ .hint = hintfmt("unable to unlink '%1%'", tempLink)
});
if (errno == EMLINK) {
/* Some filesystems generate too many links on the rename,
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 071a7ec7e..41378b0db 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -251,10 +251,9 @@ bool handleJSONLogMessage(const std::string & msg,
}
} catch (std::exception & e) {
- logError(
- ErrorInfo {
- .name = "Json log message",
- .hint = hintfmt("bad log message from builder: %s", e.what())
+ logError({
+ .name = "Json log message",
+ .hint = hintfmt("bad log message from builder: %s", e.what())
});
}
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index bbce5dcda..8231a07a4 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -123,10 +123,9 @@ static void getAllExprs(EvalState & state,
if (hasSuffix(attrName, ".nix"))
attrName = string(attrName, 0, attrName.size() - 4);
if (!attrs.insert(attrName).second) {
- logError(
- ErrorInfo {
- .name = "Name collision",
- .hint = hintfmt("warning: name collision in input Nix expressions, skipping '%1%'", path2)
+ logError({
+ .name = "Name collision",
+ .hint = hintfmt("warning: name collision in input Nix expressions, skipping '%1%'", path2)
});
continue;
}
@@ -875,11 +874,10 @@ static void queryJSON(Globals & globals, vector<DrvInfo> & elems)
auto placeholder = metaObj.placeholder(j);
Value * v = i.queryMeta(j);
if (!v) {
- logError(
- ErrorInfo {
- .name = "Invalid meta attribute",
- .hint = hintfmt("derivation '%s' has invalid meta attribute '%s'",
- i.queryName(), j)
+ logError({
+ .name = "Invalid meta attribute",
+ .hint = hintfmt("derivation '%s' has invalid meta attribute '%s'",
+ i.queryName(), j)
});
placeholder.write(nullptr);
} else {
@@ -1131,12 +1129,11 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs)
attrs2["name"] = j;
Value * v = i.queryMeta(j);
if (!v)
- logError(
- ErrorInfo {
- .name = "Invalid meta attribute",
- .hint = hintfmt(
- "derivation '%s' has invalid meta attribute '%s'",
- i.queryName(), j)
+ logError({
+ .name = "Invalid meta attribute",
+ .hint = hintfmt(
+ "derivation '%s' has invalid meta attribute '%s'",
+ i.queryName(), j)
});
else {
if (v->type == tString) {
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 6b83093b1..5e42736fc 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -704,7 +704,7 @@ static void opVerify(Strings opFlags, Strings opArgs)
else throw UsageError("unknown flag '%1%'", i);
if (store->verifyStore(checkContents, repair)) {
- logWarning(ErrorInfo {
+ logWarning({
.name = "Store consistency",
.description = "not all errors were fixed"
});
@@ -729,14 +729,13 @@ static void opVerifyPath(Strings opFlags, Strings opArgs)
store->narFromPath(path, sink);
auto current = sink.finish();
if (current.first != info->narHash) {
- logError(
- ErrorInfo {
- .name = "Hash mismatch",
- .hint = hintfmt(
- "path '%s' was modified! expected hash '%s', got '%s'",
- store->printStorePath(path),
- info->narHash.to_string(),
- current.first.to_string())
+ logError({
+ .name = "Hash mismatch",
+ .hint = hintfmt(
+ "path '%s' was modified! expected hash '%s', got '%s'",
+ store->printStorePath(path),
+ info->narHash.to_string(),
+ current.first.to_string())
});
status = 1;
}
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 8c845bfc2..8ecd9a8f3 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -99,15 +99,14 @@ struct CmdVerify : StorePathsCommand
if (hash.first != info->narHash) {
corrupted++;
act2.result(resCorruptedPath, store->printStorePath(info->path));
- logError(
- ErrorInfo {
- .name = "Hash error - path modified",
- .hint = hintfmt(
- "path '%s' was modified! expected hash '%s', got '%s'",
- store->printStorePath(info->path),
- info->narHash.to_string(),
- hash.first.to_string())
- });
+ logError({
+ .name = "Hash error - path modified",
+ .hint = hintfmt(
+ "path '%s' was modified! expected hash '%s', got '%s'",
+ store->printStorePath(info->path),
+ info->narHash.to_string(),
+ hash.first.to_string())
+ });
}
}
@@ -156,11 +155,10 @@ struct CmdVerify : StorePathsCommand
if (!good) {
untrusted++;
act2.result(resUntrustedPath, store->printStorePath(info->path));
- logError(
- ErrorInfo {
- .name = "Untrusted path",
- .hint = hintfmt("path '%s' is untrusted",
- store->printStorePath(info->path))
+ logError({
+ .name = "Untrusted path",
+ .hint = hintfmt("path '%s' is untrusted",
+ store->printStorePath(info->path))
});
}
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index dcea72529..82feacb3d 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -39,19 +39,17 @@ std::set<std::string> runResolver(const Path & filename)
throw SysError("statting '%s'", filename);
if (!S_ISREG(st.st_mode)) {
- logError(
- ErrorInfo {
- .name = "Regular MACH file",
- .hint = hintfmt("file '%s' is not a regular file", filename)
+ logError({
+ .name = "Regular MACH file",
+ .hint = hintfmt("file '%s' is not a regular file", filename)
});
return {};
}
if (st.st_size < sizeof(mach_header_64)) {
- logError(
- ErrorInfo {
- .name = "File too short",
- .hint = hintfmt("file '%s' is too short for a MACH binary", filename)
+ logError({
+ .name = "File too short",
+ .hint = hintfmt("file '%s' is too short for a MACH binary", filename)
});
return {};
}
@@ -74,20 +72,18 @@ std::set<std::string> runResolver(const Path & filename)
}
}
if (mach64_offset == 0) {
- logError(
- ErrorInfo {
- .name = "No mach64 blobs",
- .hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
+ logError({
+ .name = "No mach64 blobs",
+ .hint = hintfmt("Could not find any mach64 blobs in file '%1%', continuing...", filename)
});
return {};
}
} else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) {
mach64_offset = 0;
} else {
- logError(
- ErrorInfo {
- .name = "Magic number",
- .hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
+ logError({
+ .name = "Magic number",
+ .hint = hintfmt("Object file has unknown magic number '%1%', skipping it...", magic)
});
return {};
}