deno/tools/release/create_symcache.ts
Bartek Iwańczuk 3e58caa8f4
ci: disable symcache generation on Windows (#30646)
Due to V8 upgrade in https://github.com/denoland/deno/pull/30629, we are
not generating debug symbols on Windows and because of that
symcache generation is not available.
2025-09-08 22:39:54 +00:00

31 lines
955 B
TypeScript

// Copyright 2018-2025 the Deno authors. MIT license.
// deno-lint-ignore-file no-console
import { createSymcache } from "jsr:@deno/panic@0.1.0";
import path from "node:path";
// Generate symcache for the current Deno executable.
let debugFile = Deno.execPath();
if (Deno.build.os === "windows") {
// TODO(bartlomieju): fix the regression from V8 upgrade
// https://github.com/denoland/deno/pull/30629
// debugFile = debugFile.replace(/\.exe$/, ".pdb");
Deno.exit(0);
} else if (Deno.build.os === "darwin") {
const resolvedPath = Deno.realPathSync(`${debugFile}.dSYM`);
const { name } = path.parse(resolvedPath);
debugFile = path.join(resolvedPath, "Contents/Resources/DWARF", name);
}
const outfile = Deno.args[0];
if (!outfile) {
console.error("Usage: ./target/release/deno -A create_symcache.ts <outfile>");
Deno.exit(1);
}
const symcache = createSymcache(Deno.readFileSync(debugFile));
Deno.writeFileSync(outfile, symcache);