From 5210e0ea4e73d56ec1d659cd4b1c21627b38aa7b Mon Sep 17 00:00:00 2001 From: Salim B Date: Fri, 10 Apr 2026 09:38:01 +0200 Subject: [PATCH] docs: tweak build flags in example Go recipe - added the `-w` ldflag to tell the linker to omit the DWARF symbol table and thereby reduce binary size on Windows, too (not an issue anymore these days I think) - added `-trimpath` to make the compiler replace all local build system paths in the binary with generic, relative paths, thereby improving build reproducibility --- docs/maintainer/example_recipes/go.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/maintainer/example_recipes/go.md b/docs/maintainer/example_recipes/go.md index 7c3a7c343d..966b338fdc 100644 --- a/docs/maintainer/example_recipes/go.md +++ b/docs/maintainer/example_recipes/go.md @@ -23,8 +23,8 @@ build: - cd src - go-licenses save . --save_path ../library_licenses - if: unix - then: go build -v -o $PREFIX/bin/example-package -ldflags="-s -w" - else: go build -v -o %LIBRARY_BIN%\example-package.exe -ldflags="-s" + then: go build -v -o $PREFIX/bin/example-package -ldflags="-s -w" -trimpath . + else: go build -v -o %LIBRARY_BIN%\example-package.exe -ldflags="-s -w" -trimpath . - if: unix then: - mkdir -p $PREFIX/share/zsh/site-functions $PREFIX/share/bash-completion/completions $PREFIX/share/fish/vendor_completions.d