From 8d12e0fbb7306cbc58b12ef051d7067d703738de Mon Sep 17 00:00:00 2001 From: Qyriad Date: Sun, 21 Jul 2024 13:15:30 -0600 Subject: [PATCH] fix building with Musl, fixing static builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/libfetchers/git.cc | 2 +- src/libstore/build/derivation-goal.cc | 2 +- src/libutil/processes.cc | 2 +- src/libutil/processes.hh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc index 81c579e84..9fd8d7bbf 100644 --- a/src/libfetchers/git.cc +++ b/src/libfetchers/git.cc @@ -695,7 +695,7 @@ struct GitInputScheme : InputScheme }); Finally const _wait([&] { proc.wait(); }); - unpackTarfile(*proc.stdout(), tmpDir); + unpackTarfile(*proc.getStdout(), tmpDir); } auto storePath = store->addToStore(name, tmpDir, FileIngestionMethod::Recursive, htSHA256, filter); diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 7cf8a55c9..d0152355f 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -932,7 +932,7 @@ void runPostBuildHook( Finally const _wait([&] { proc.wait(); }); // FIXME just process the data, without a wrapper sink class - proc.stdout()->drainInto(sink); + proc.getStdout()->drainInto(sink); } void DerivationGoal::buildDone() diff --git a/src/libutil/processes.cc b/src/libutil/processes.cc index 4fe3dcfb4..05b1321e9 100644 --- a/src/libutil/processes.cc +++ b/src/libutil/processes.cc @@ -251,7 +251,7 @@ std::pair runProgram(RunOptions && options) try { auto proc = runProgram2(options); Finally const _wait([&] { proc.wait(); }); - stdout = proc.stdout()->drain(); + stdout = proc.getStdout()->drain(); } catch (ExecError & e) { status = e.status; } diff --git a/src/libutil/processes.hh b/src/libutil/processes.hh index f61b9696d..dc09a9ba4 100644 --- a/src/libutil/processes.hh +++ b/src/libutil/processes.hh @@ -106,7 +106,7 @@ public: void wait(); - Source * stdout() const { return stdoutSource.get(); } + Source * getStdout() const { return stdoutSource.get(); }; }; std::pair runProgram(RunOptions && options);