Fix zig build (#14163)

This commit is contained in:
Ashcon Partovi
2024-09-25 12:42:47 -07:00
committed by GitHub
parent 128c658f91
commit 291a50aff5
4 changed files with 18 additions and 34 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env node
import { spawn as nodeSpawn } from "node:child_process";
import { existsSync, readFileSync, readdirSync, mkdirSync, cpSync, chmodSync } from "node:fs";
import { basename, join, relative, resolve } from "node:path";
import { existsSync, readFileSync, mkdirSync, cpSync, chmodSync } from "node:fs";
import { basename, join, resolve } from "node:path";
// https://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem
const generateFlags = [
@@ -118,26 +118,6 @@ async function build(args) {
.flatMap(([flag, value]) => [flag, value]);
await spawn("cmake", buildArgs, { env }, "compilation");
const buildFiles = ["ccache.log", "compile_commands.json"];
const buildPaths = [buildPath, ...readdirSync(buildPath).map(path => join(buildPath, path))];
const buildArtifacts = [];
for (const buildPath of buildPaths) {
for (const buildFile of buildFiles) {
const path = join(buildPath, buildFile);
if (existsSync(path)) {
buildArtifacts.push(path);
}
}
}
if (isBuildkite()) {
await Promise.all(
buildArtifacts.map(path =>
spawn("buildkite-agent", ["artifact", "upload", relative(buildPath, path)], { cwd: buildPath, env }),
),
);
}
printDuration("total", Date.now() - startTime);
}