[Buildroot] [PATCH 1/4] package/goc: new virtual package

Thomas Perale thomas.perale at essensium.com
Tue Oct 18 08:03:30 UTC 2022


Dear Christian, Thomas,

I also do agree renaming the 'go' package to 'go-src' is clearer. But then
to not modify the content of `package/pkg-golang.mk` I will also need to
move the variable used by `package/pkg-golang.mk` aswell as `package/go-src/
go-src.mk` to `package/go/go.mk` (for instance `HOST_GO_COMMON_ENV`,
`HOST_GO_TARGET_ENV`, ...) or they will be renamed to `HOST_GO_SRC_*`.
Correct me if I'm wrong but there is no way to predict the order of
inclusion of '.mk' files, so `package/go-src/go-src.mk` might access to
undefined variable.

This is why I think a next patch should propose the same structure for
`nodejs`, `rust`, `go` using subdirectories:

package/
├─ go/
│  ├─ go-src/
│  ├─ go-bin/
│  ├─ go-bootstrap/
│  ├─ go.mk (<---- Contain the 'global' variable used by
`pkg-golang.mk`, `go-src/go-src.mk`, `go-bin/go-bin.mk`)
│  ├─ Config.in

Where `package/go/go.mk` is a virtual package that include the go variants:

```
HOST_GO_TARGET_ENV = \
...

HOST_GO_HOST_ENV = \
...

$(eval $(host-virtual-package))

include $(sort $(wildcard package/go/*/*.mk))
```

This solution won't change `pkg-golang.mk` but since it introduce a new way
to handle package variant I prefer to keep it for a next patch.

PERALE Thomas


On Mon, Oct 17, 2022 at 8:51 PM Christian Stewart <christian at paral.in>
wrote:

> Hi Yann,
>
> Just to reply to that one question on why a host go compiler is useful-
>
> On Mon, Oct 17, 2022 at 11:45 AM Yann E. MORIN <yann.morin.1998 at free.fr>
> wrote:
> > >    - host go compiler (see patch linked below)
> >
> > If we have a pre-built host-go in the tree, thetre is then no reason to
> > be able to use the host system go compiler, is there?
>
> The host Go compiler may be compiled from source (i.e. Gentoo) and the
> user (me) wants to trust the gentoo binary for Go over downloading
> another precompiled bin from the internet.
>
> Thomas -
>
> On Mon, Oct 17, 2022 at 11:48 AM Thomas Petazzoni
> <thomas.petazzoni at bootlin.com> wrote:
> >  - NodeJS (proposed by me)
> >    virtual package:             host-nodejs
> >    pre-compiled package:        host-nodejs-bin
> >    from source package:         host-nodejs-src
> >
> >    The odd thing here being that host-nodejs is a virtual package, but
> >    nodejs is a regular package building NodeJS from source for the
> >    target.
> >
> >  - Go (proposed by Thomas Perale)
> >    virtual package:             host-goc
> >    pre-compiled package:        host-go-bin
> >    from source package:         host-go
> >
> > So Thomas aligned on the naming used in the Rust world. I must say I do
> > have a preference for the naming I have chosen for NodeJS, which IMO is
> > clearer.
>
> I agree that the following would be preferable:
>
> virtual package:             host-go
> pre-compiled package:        host-go-bin
> from source package:         host-go-src
>
> ... although I would submit that all 3 could live in a single host-go
> package.
>
> Best,
> Christian Stewart
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20221018/4efa08ea/attachment-0001.html>


More information about the buildroot mailing list