Merge pull request #4613 from povik/err-never-silence

log: Never silence `log_cmd_error`
This commit is contained in:
Martin Povišer 2024-10-07 16:12:31 +02:00 committed by GitHub
commit e46cc57cc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -459,8 +459,21 @@ void log_cmd_error(const char *format, ...)
if (log_cmd_error_throw) {
log_last_error = vstringf(format, ap);
// Make sure the error message gets through any selective silencing
// of log output
bool pop_errfile = false;
if (log_errfile != NULL) {
log_files.push_back(log_errfile);
pop_errfile = true;
}
log("ERROR: %s", log_last_error.c_str());
log_flush();
if (pop_errfile)
log_files.pop_back();
throw log_cmd_error_exception();
}

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
trap 'echo "ERROR in logger_cmd_error.sh" >&2; exit 1' ERR
(../../yosys -v 3 -C <<EOF
yosys -import
hierarchy -top nonexistent
EOF
) 2>&1 | grep -F "ERROR: Module \`nonexistent' not found!" > /dev/null