diff --git a/scripts/go-deadcode.mjs b/scripts/go-deadcode.mjs index 0b8b4414..ff85eb83 100644 --- a/scripts/go-deadcode.mjs +++ b/scripts/go-deadcode.mjs @@ -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); }