-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
When verilator fails to compile the return value is sometimes incorrect, causing bazel to think it was successfull when it wasn't.
Currently it does (see verilator/private/verilator_process_wrapper.cc)
int result = std::system(cmd.c_str());
if (result != 0) {
return result;
}
but std::system doesn't return the exit code. Running on ubuntu it returns exit_code << 8 for me, so a 1 becomes 256 which bazel then helpfully converts to 0.
I'm now using
if (result != 0) {
if (WIFEXITED(result)) {
int exit_code = WEXITSTATUS(result);
return exit_code;
} else {
return 1; // Process was terminated by signal
}
}
and it works, but I have no idea whether this is a portable solution.
Metadata
Metadata
Assignees
Labels
No labels