fix building with Musl, fixing static builds

Musl stdout macro expands¹ to something that isn't a valid identifier,
so we get syntax errors when compiling usage of a method called stdout
with Musl's stdio.h.

[1]: https://git.musl-libc.org/cgit/musl/tree/include/stdio.h?id=ab31e9d6a0fa7c5c408856c89df2dfb12c344039#n67

Change-Id: I10e6f6a49504399bf8edd59c5d9e4e62449469e8
This commit is contained in:
Qyriad 2024-07-21 13:15:30 -06:00
parent 53f3e39815
commit 8d12e0fbb7
4 changed files with 4 additions and 4 deletions

View file

@ -695,7 +695,7 @@ struct GitInputScheme : InputScheme
}); });
Finally const _wait([&] { proc.wait(); }); Finally const _wait([&] { proc.wait(); });
unpackTarfile(*proc.stdout(), tmpDir); unpackTarfile(*proc.getStdout(), tmpDir);
} }
auto storePath = store->addToStore(name, tmpDir, FileIngestionMethod::Recursive, htSHA256, filter); auto storePath = store->addToStore(name, tmpDir, FileIngestionMethod::Recursive, htSHA256, filter);

View file

@ -932,7 +932,7 @@ void runPostBuildHook(
Finally const _wait([&] { proc.wait(); }); Finally const _wait([&] { proc.wait(); });
// FIXME just process the data, without a wrapper sink class // FIXME just process the data, without a wrapper sink class
proc.stdout()->drainInto(sink); proc.getStdout()->drainInto(sink);
} }
void DerivationGoal::buildDone() void DerivationGoal::buildDone()

View file

@ -251,7 +251,7 @@ std::pair<int, std::string> runProgram(RunOptions && options)
try { try {
auto proc = runProgram2(options); auto proc = runProgram2(options);
Finally const _wait([&] { proc.wait(); }); Finally const _wait([&] { proc.wait(); });
stdout = proc.stdout()->drain(); stdout = proc.getStdout()->drain();
} catch (ExecError & e) { } catch (ExecError & e) {
status = e.status; status = e.status;
} }

View file

@ -106,7 +106,7 @@ public:
void wait(); void wait();
Source * stdout() const { return stdoutSource.get(); } Source * getStdout() const { return stdoutSource.get(); };
}; };
std::pair<int, std::string> runProgram(RunOptions && options); std::pair<int, std::string> runProgram(RunOptions && options);