Skip to content
Merged
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
5 changes: 4 additions & 1 deletion scripts/go-deadcode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ if (listed.error || listed.status !== 0) {
const roots = [...new Set(listed.stdout.split(/\r?\n/).map(line => line.trim()).filter(Boolean))].sort();
if (!roots.length) { console.error("No production main packages found"); process.exit(1); }
console.log("Production deadcode roots:\n" + roots.join("\n"));
const result = run(["go", "tool", "deadcode", "-test=false", "-json", ...roots]);
// deadcode always passes its own -tags to `go list`, which overrides the
// GOFLAGS tags the wrapper exports. Without the tag here it analyzes a build
// nothing else compiles, and Linux spends minutes linking it uncached.
const result = run(["go", "tool", "deadcode", "-tags=duckdb_use_static_lib", "-test=false", "-json", ...roots]);
if (result.error) { console.error(result.error.message); process.exit(1); }
if (result.stderr) process.stderr.write(result.stderr);
if (result.status !== 0) { if(result.stdout) process.stdout.write(result.stdout); process.exit(result.status ?? 1); }
Expand Down
Loading