> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> c...@lists.openembedded.org> On Behalf Of Lukas Funke
> Sent: den 17 oktober 2023 15:27
> To: openembedded-core@lists.openembedded.org
> Cc: Bruce Ashfield <bruce.ashfi...@gmail.com>; Vyacheslav Yurkov
> <uvv.m...@gmail.com>; Martin Jansa <martin.ja...@gmail.com>; Lukas Funke
> <lukas.fu...@weidmueller.com>
> Subject: [OE-Core][PATCH v2 0/4] recipetool: Add handler to create go
> recipes
> 
> From: Lukas Funke <lukas.fu...@weidmueller.com>
> 
> This patch series adds a recipetool handler in order to create 'go' recipes.
> Each recipe contains a list of dependencies in their SRC_URI
> variable which are derived from the projects `go.mod` file. For each
> dependency the corresponding license file uri/hash is added.
> 
> The recipe may not work ad-hoc, but is a good starting point to create
> a working recipe and have a working offline-build.
> 
> Lukas Funke (4):
>   classes: go-vendor: Add go-vendor class
>   selftest: recipetool: Add test for go recipe handler
>   recipetool: Ignore *.go files while scanning for licenses
>   recipetool: Add handler to create go recipes
> 
>  meta/classes/go-vendor.bbclass             | 135 ++++
>  meta/lib/oeqa/selftest/cases/recipetool.py | 163 +++++
>  scripts/lib/recipetool/create.py           |   2 +-
>  scripts/lib/recipetool/create_go.py        | 730 +++++++++++++++++++++
>  4 files changed, 1029 insertions(+), 1 deletion(-)
>  create mode 100644 meta/classes/go-vendor.bbclass
>  create mode 100644 scripts/lib/recipetool/create_go.py
> 
> --
> 2.30.2

I do not know much (anything) about Go modules, but we have a couple of 
recipes that use Go modules, and I would like to offer some suggestions. 

I would recommend to separate the recipe and the main Go module from 
the dependencies similar to how it is done for Rust by the 
cargo-update-recipe-crates bbclass, which puts the dependencies in a 
separate include file.

In our recipes we use the following pattern:

LICENSE = "... & ${GO_MOD_LICENSES}"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=..."
require ${BPN}-licenses.inc

...

SRC_URI = "..."
require ${BPN}-go-mods.inc

and then in the ${BPN}-licenses.inc file we have something like:

GO_MOD_LICENSES = "Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT"

LIC_FILES_CHKSUM += "\
    ...
"

and in the ${BPN}-go-mods.inc file:

SRC_URI += "\
    ...
"

Separating the three files like the above keeps the automatically 
generated parts out of the main recipe, which I believe is a good 
thing.

And yes, we have some bbclass and some tool to help with the above, 
similar to what you are adding in this series.

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#189753): 
https://lists.openembedded.org/g/openembedded-core/message/189753
Mute This Topic: https://lists.openembedded.org/mt/102017388/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to