mbox series

[0/4] go: improve vendoring

Message ID 20240226144040.2007482-1-lukas.funke-oss@weidmueller.com
Headers show
Series go: improve vendoring | expand

Message

Lukas Funke Feb. 26, 2024, 2:40 p.m. UTC
From: Lukas Funke <lukas.funke@weidmueller.com>

This series is intended to improve 'vendoring' for golang projects. 'Vendoring'
is the golang mechanism to build go-projects in an offline manner. It enables
the fetcher to gather all dependencies during fetching-phase and unpack them
during build into the workdirs 'vendor' folder.

During testing on our go-projects some issues were discovered, that prevent 
clean vendoring:

 - The '//go:embed' directive enables go-files to include additional source
   files. These files/folder are not considered in the manifest created by go.
   Thus, this files are not copied to the vendor folder by yocto, resulting
   in a broken build.
 - Some files contain additional '//go:build' directives, that instruct go to
   ignore this files during vendoring. This case is now covered as well.

Additional changes:

 - fix an issue where some go log messages are included in the vendor manifest
 - run pylint analysis on the 'go' recipetool part and incorporate suggestions

Lukas Funke (4):
  classes: go-vendor: improve handling of go vendoring
  recipetool: go: Do not restore go.mod/sum file
  recipetool: go: ignore 'go: *' log messages
  recipetool: go: apply pylint recommendations

 meta/classes/go-vendor.bbclass      | 324 ++++++++++++++++++-------
 scripts/lib/recipetool/create_go.py | 362 ++++++++++++++++------------
 2 files changed, 449 insertions(+), 237 deletions(-)