[Buildroot] [PATCH next 05/12] support/download/go-post-process: implement Go vendoring support

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Nov 25 20:37:04 UTC 2020


Hello Christian,

Thanks for the feedback!

On Wed, 25 Nov 2020 12:28:31 -0800
Christian Stewart <christian at paral.in> wrote:

> This looks good. There's only one problem - if the package does not
> come with a go.mod file (which is the case with
> nvidia-container-toolkit).
> 
> In this case we need to run the $(2)_GEN_GOMOD script before running
> the download post-process.
> 
> Today, this is written as so and creates a go.mod if it doesn't already exist:
> 
> # Generate a go.mod file if it doesn't exist. Note: Go is configured
> # to use the "vendor" dir and not make network calls.
> define $(2)_GEN_GOMOD
> if [ ! -f $$(@D)/go.mod ]; then \
>   printf "module $$($(2)_GOMOD)\n" > $$(@D)/go.mod; \
> fi
> endef
> $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD

Ah, good point. Do you have an example of such a package (publicly
available)? That would help testing a solution.

I guess the best solution is to modify the POST_PATCH_HOOKS to be done
by the download post-process script ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list