All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mirza Krak <mirza.krak@northern.tech>
To: buildroot@busybox.net
Subject: [Buildroot] [[PATCH v2 2/2] package/mender-artifact: initial support
Date: Wed, 12 Sep 2018 21:26:32 +0200	[thread overview]
Message-ID: <CADHdJwDw=2qRkodAzZW+GGGGeyP_HtbDO1Kr5VA9e53_tuE1Zw@mail.gmail.com> (raw)
In-Reply-To: <20180902154734.4f5a7f40@windsurf>

On Sun, Sep 2, 2018 at 3:47 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Mirza,
>
> Overall it looks good, except for one aspect, which will require a bit
> of discussion.
>
> On Mon, 27 Aug 2018 13:37:28 +0200, Mirza Krak wrote:
>
> > diff --git a/package/mender-artifact/Config.in.host b/package/mender-artifact/Config.in.host
> > new file mode 100644
> > index 0000000000..d2deabc783
> > --- /dev/null
> > +++ b/package/mender-artifact/Config.in.host
> > @@ -0,0 +1,20 @@
> > +config BR2_PACKAGE_HOST_MENDER_ARTIFACT
> > +     bool "host mender-artifact"
> > +     depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> > +     depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
> > +     depends on BR2_TOOLCHAIN_HAS_THREADS
>
> I am not happy about those dependencies, because they are dependencies
> meant to be used for *target* packages, not for *host* packages.
>
> BR2_TOOLCHAIN_HAS_THREADS is easy: it's not needed for host packages,
> as we assume the build machine has thread support.
>
> For the other dependencies, it's a bit more complicated, but I believe
> somewhat similar to the situation we have with the Rust support.
>
> Right now, BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS indicates if the
> currently selected target architecture is supported by Go. This is fine
> for target packages.
>
> But apparently, host-go provides really two things:
>
>  (1) A Go compiler capable of building code for the host machine.
>
>  (2) A Go compiler capable of building code for the target machine.
>
> For Go target packages, We are currently using (2), and for packages
> that rely on (2), using BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS make sense.
>
> However, with your support for host packages, what we rely on is (1).
> And for that BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS doesn't make a lot of
> sense.
>
> For example, BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS says that Go is not
> available on the ARC architecture. But for building a host package, we
> really don't care about this: what matters is that Go is capable of
> building code for the x86 or x86-64 build machine.
>
> Therefore, we should probably use the same strategy as Rust, which is
> proposed in patch http://patchwork.ozlabs.org/patch/961158/:
>
>  - The BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS is changed to only indicate if
>    Go supports the host/build system architecture. In our case, it
>    should probably just be:
>
>         depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS
>
>    All host Go packages should depend on this option.
>
>  - A new BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS that indicates if Go
>    supports the target system architecture. It should be:
>
>         depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
>         depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \
>                 || BR2_i386 || BR2_x86_64 || BR2_powerpc64le \
>                 || BR2_mips64 || BR2_mips64el
>         depends on !BR2_ARM_CPU_ARMV4
>         # MIPS R6 support in Go has not yet been developed.
>         depends on !BR2_MIPS_CPU_MIPS64R6
>
> Of course we can only do this if host-go builds correctly regardless of
> whether the target architecture is supported or not. What Rust does is:
>
>  - If the target is architecture is supported by Rust, it installs
>    support for building code for both the host and the target
>    architectures.
>
>  - If the target is architecture is not supported by Rust, it only
>    installs support for building code for the host architecture.
>
> Do you know how Go supports this ? I have no idea how Go is told to
> support this or that architecture. Could you investigate this ?

My priorities have shifted a bit but I plan on getting back on this
one (need to investigate as I do not know the answers to above).

If someone else holds the answers please feel free to jump in.

-- 
Mirza Krak | Embedded Solutions Architect | https://mender.io

 Northern.tech AS | @northerntechHQ

  reply	other threads:[~2018-09-12 19:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27 11:37 [Buildroot] [[PATCH v2 0/2] mender-artifact support Mirza Krak
2018-08-27 11:37 ` [Buildroot] [[PATCH v2 1/2] package/pkg-golang: add support for building host packages Mirza Krak
2018-09-05 15:26   ` Angelo Compagnucci
2018-08-27 11:37 ` [Buildroot] [[PATCH v2 2/2] package/mender-artifact: initial support Mirza Krak
2018-09-02 13:47   ` Thomas Petazzoni
2018-09-12 19:26     ` Mirza Krak [this message]
2018-09-02 13:25 ` [Buildroot] [[PATCH v2 0/2] mender-artifact support Thomas Petazzoni
2018-09-02 20:00   ` Mirza Krak
2018-09-02 20:12     ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADHdJwDw=2qRkodAzZW+GGGGeyP_HtbDO1Kr5VA9e53_tuE1Zw@mail.gmail.com' \
    --to=mirza.krak@northern.tech \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.