Skip to content

Commit 295da95

Browse files
committed
fix: Better Go build flags for plugins packaging
1 parent 51f4d60 commit 295da95

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

serve/package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (s *PluginServe) build(pluginDirectory string, target plugin.BuildTarget, d
130130
stripSymbols = ""
131131
}
132132
ldFlags := fmt.Sprintf("%[1]s -w -X %[2]s/plugin.Version=%[3]s -X %[2]s/resources/plugin.Version=%[3]s", stripSymbols, importPath, pluginVersion)
133-
args := []string{"build", "-o", pluginPath, "-buildmode=exe", "-ldflags", ldFlags}
133+
args := []string{"build", "-trimpath", "-buildvcs=false", "-mod=readonly", "-o", pluginPath, "-buildmode=exe", "-ldflags", ldFlags}
134134
cmd := exec.Command("go", args...)
135135
cmd.Dir = pluginDirectory
136136
cmd.Stdout = os.Stdout

0 commit comments

Comments
 (0)