Skip to content

Commit b71e7ac

Browse files
committed
omit go's buildvcs for more reproducible builds
1 parent 7406b09 commit b71e7ac

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PATH_SEPARATOR = $(shell if uname | grep -qE "MINGW|WIN32|CYGWIN"; then echo ";"
88
GO_COMPILER = PATH="$(GO_DIR)/bin$(PATH_SEPARATOR)$(PATH)" GOROOT="$(GO_DIR)" CGO_ENABLED=0
99

1010
# Strip debug info and clear the build id for reproducible builds
11-
GO_FLAGS += "-ldflags=-s -w -buildid="
11+
GO_FLAGS += "-ldflags=-s -w -buildid=" -buildvcs=false
1212

1313
# Avoid embedding the build path in the executable for more reproducible builds
1414
GO_FLAGS += -trimpath

scripts/esbuild.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ exports.buildWasmLib = async (esbuildPath) => {
134134
'build',
135135
'-o', path.join(npmWasmDir, 'esbuild.wasm'),
136136
'-ldflags=-s -w -buildid=', // This removes ~0.14mb of unnecessary WebAssembly code
137+
'-buildvcs=false',
137138
'-trimpath',
138139
path.join(repoDir, 'cmd', 'esbuild'),
139140
],
@@ -278,7 +279,7 @@ exports.writeFileAtomic = (where, contents) => {
278279
}
279280

280281
exports.buildBinary = () => {
281-
childProcess.execFileSync('go', ['build', '-ldflags=-s -w -buildid=', '-trimpath', './cmd/esbuild'], { cwd: repoDir, stdio: 'ignore' })
282+
childProcess.execFileSync('go', ['build', '-ldflags=-s -w -buildid=', '-buildvcs=false', '-trimpath', './cmd/esbuild'], { cwd: repoDir, stdio: 'ignore' })
282283
return path.join(repoDir, process.platform === 'win32' ? 'esbuild.exe' : 'esbuild')
283284
}
284285

0 commit comments

Comments
 (0)