mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Swift: add autobuild failure diagnostics
This commit is contained in:
@@ -3,6 +3,14 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <spawn.h>
|
||||
#include "absl/strings/str_join.h"
|
||||
|
||||
#include "swift/xcode-autobuilder/XcodeBuildLogging.h"
|
||||
|
||||
static codeql::Logger& logger() {
|
||||
static codeql::Logger ret{"build"};
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int waitpid_status(pid_t child) {
|
||||
int status;
|
||||
@@ -52,13 +60,12 @@ void buildTarget(Target& target, bool dryRun) {
|
||||
argv.push_back("CODE_SIGNING_ALLOWED=NO");
|
||||
|
||||
if (dryRun) {
|
||||
for (auto& arg : argv) {
|
||||
std::cout << arg + " ";
|
||||
}
|
||||
std::cout << "\n";
|
||||
std::cout << absl::StrJoin(argv, " ") << "\n";
|
||||
} else {
|
||||
if (!exec(argv)) {
|
||||
std::cerr << "Build failed\n";
|
||||
DIAGNOSE_ERROR(build_command_failed, "The detected build command failed (tried {})",
|
||||
absl::StrJoin(argv, " "));
|
||||
codeql::Log::flush();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user