Skip to content

Commit fabfcdb

Browse files
committed
fix: discard stderr on swift demangler
1 parent 5cbe8d4 commit fabfcdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

metadata-generator/src/Meta/MetaFactory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ std::string demangleSwiftName(std::string name) {
497497
// Otherwise, `swift demange` starts bufferring its stdout when it discovers that its not
498498
// in an interactive terminal.
499499
using namespace redi;
500-
static const std::string cmd = "script -q /dev/null xcrun swift demangle";
500+
// script always pipes stderr to stdout, so ensure to discard stderr through sh
501+
static const std::string cmd = "script -q /dev/null sh -c 'xcrun swift demangle 2>/dev/null'";
501502
static pstream ps(cmd, pstreams::pstdin|pstreams::pstdout|pstreams::pstderr);
502503

503504
// Send the name to child process

0 commit comments

Comments
 (0)