From 639b8b1f33246144efb541340d949a6aa396da1a Mon Sep 17 00:00:00 2001 From: Marcel Tyszkiewicz Date: Wed, 18 Oct 2023 10:41:15 +0200 Subject: [PATCH] Make static linking conditional --- serve/package.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serve/package.go b/serve/package.go index 848e3ffed4..f17e5268de 100644 --- a/serve/package.go +++ b/serve/package.go @@ -110,7 +110,7 @@ func (s *PluginServe) build(pluginDirectory, goos, goarch, distPath, pluginVersi return nil, err } ldFlags := fmt.Sprintf("-s -w -X %s/plugin.Version=%s", importPath, pluginVersion) - if s.plugin.IsStaticLinkingEnabled() { + if s.plugin.IsStaticLinkingEnabled() && strings.EqualFold(goos, plugin.GoOSLinux) { ldFlags += " -linkmode external -extldflags=-static" } args := []string{"build", "-o", pluginPath}