Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

log when build fails #2

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,7 @@ void Builder::Cleanup() {
}
}

if (compiler_log_) {
fprintf(compiler_log_, "#Done(%" PRId64 ")\n", GetTimeMillis());
fclose(compiler_log_);
compiler_log_ = NULL;
}
compiler_log_ = NULL;
}

Node* Builder::AddTarget(const string& name, string* err) {
Expand Down
18 changes: 13 additions & 5 deletions src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1172,19 +1172,27 @@ int NinjaMain::RunBuild(int argc, char** argv) {
printf("ninja: build stopped: %s.\n", err.c_str());
#else

if(ShouldBeColorFul(false)){
printf("\x1b[31m" "FAILED:" "\x1b[0m" " %s.\n", err.c_str());
} else {
printf("FAILED: %s.\n", err.c_str());
}
if (ShouldBeColorFul(false)) {
printf("\x1b[31m" "FAILED:" "\x1b[0m" " %s.\n", err.c_str());
} else {
printf("FAILED: %s.\n", err.c_str());
}
fprintf(compiler_log_, "FAILED: %s.\n", err.c_str());

#endif

fprintf(compiler_log_, "#Done(%" PRId64 ")\n", GetTimeMillis());
fclose(compiler_log_);

if (err.find("interrupted by user") != string::npos) {
return 2;
}
return 1;
}

fprintf(compiler_log_, "#Done(%" PRId64 ")\n", GetTimeMillis());
fclose(compiler_log_);

return 0;
}

Expand Down