All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Perale <thomas.perale@essensium.com>
Cc: Christian Stewart <christian@paral.in>,
	Thomas Perale <thomas.perale@mind.be>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 5/6] package/go/go-bin: new host-go provider
Date: Sat, 1 Jun 2024 17:51:15 +0200	[thread overview]
Message-ID: <ZltDc6AXn_CC83Gy@landeda> (raw)
In-Reply-To: <20240415162229.1357491-6-thomas.perale@mind.be>

Thomas, All,

On 2024-04-15 18:22 +0200, Thomas Perale via buildroot spake thusly:
> This package provides a pre-built version for the host-go virtual
> package introduced in the previous commits:
> 
>  - host-go-bin installs a pre-built version of the Go compiler.
> 
> By default, host-go remains built from sources to keep the same
> behavior as the former version.
> 
> The menuconfig entry for host-go is updated to expose the host-go-bin
> provider. The dependencies are set as such as if host-go-src does not
> support the host architecture, it will automatically fall back to
> host-go-bin and vice versa.
> 
> Signed-off-by: Thomas Perale <thomas.perale@mind.be>

I eventually did not apply this one, because the runtime test you
intorduced in the following commit does not work:

    $ ./support/testing/run-tests -o $(pwd)/run-tests -d ~/src/ -k -t 2 -j22 tests.package.test_go
    17:30:47 TestGoSource                             Starting
    17:30:47 TestGoBin                                Starting
    17:30:48 TestGoSource                             Building
    17:30:48 TestGoBin                                Building
    17:32:34 TestGoBin                                Building done
    17:32:40 TestGoBin                                Cleaning up
    F17:35:38 TestGoSource                             Building done
    17:35:44 TestGoSource                             Cleaning up
    .
    ======================================================================
    FAIL: test_run (tests.package.test_go.TestGoBin.test_run)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/ymorin/dev/buildroot/buildroot/next/support/testing/tests/package/test_go.py", line 27, in test_run
        self.assertRunOk("tinifier -h")
      File "/home/ymorin/dev/buildroot/buildroot/next/support/testing/infra/basetest.py", line 89, in assertRunOk
        self.assertEqual(
    AssertionError: 132 != 0 :
    Failed to run: tinifier -h
    output was:
      Illegal instruction

    ----------------------------------------------------------------------
    Ran 2 tests in 296.303s

    FAILED (failures=1)

I had however did a few changes, that you can probably carry on your
next iteration, see below...

> ---
[--SNIP--]
> diff --git a/package/go/go-bin/Config.in.host b/package/go/go-bin/Config.in.host
> new file mode 100644
> index 0000000000..b259afa197
> --- /dev/null
> +++ b/package/go/go-bin/Config.in.host
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH
> +	string "Translate the HOSTARCH into the architecture name used by the Go compiler"
> +	default armv6l   if BR2_HOSTARCH = "arm"
> +	default arm64    if BR2_HOSTARCH = "aarch64"
> +	default ppc64le  if BR2_HOSTARCH = "powerpc64le"
> +	default s390x    if BR2_HOSTARCH = "s390x"
> +	default 386      if BR2_HOSTARCH = "x86"
> +	default amd64    if BR2_HOSTARCH = "x86_64"
> +	default ""

'default' for strings must be strings, e.g.:
    default "armv6l" if BR2_HOSTARCH = "arm"

Also, no need for an empty default, i.e. no need for:
    default ""

[--SNIP--]
> diff --git a/package/go/go-bin/go-bin.hash b/package/go/go-bin/go-bin.hash
> new file mode 100644
> index 0000000000..298503c156
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.hash
> @@ -0,0 +1,8 @@
> +# sha256 checksum from https://go.dev/dl/
> +sha256  586d9eb7fe0489ab297ad80dd06414997df487c5cf536c490ffeaa8d8f1807a7  go1.22.2.linux-386.tar.gz
> +sha256  5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471216a17  go1.22.2.linux-amd64.tar.gz
> +sha256  36e720b2d564980c162a48c7e97da2e407dfcc4239e1e58d98082dfa2486a0c1  go1.22.2.linux-arm64.tar.gz
> +sha256  9243dfafde06e1efe24d59df6701818e6786b4adfdf1191098050d6d023c5369  go1.22.2.linux-armv6l.tar.gz
> +sha256  32ea3dfef75d6a4d42a28a315148ba54c4f6f9a8dc93a522d421d13df0e6c3b7  go1.22.2.linux-ppc64le.tar.gz
> +sha256  2b39019481c28c560d65e9811a478ae10e3ef765e0f59af362031d386a71bfef  go1.22.2.linux-s390x.tar.gz

I had to update all those hashes:

    sha256 fefba30bb0d3dd1909823ee38c9f1930c3dc5337a2ac4701c2277a329a386b57 go1.22.3.linux-386.tar.gz
    sha256 8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36 go1.22.3.linux-amd64.tar.gz
    sha256 6c33e52a5b26e7aa021b94475587fce80043a727a54ceb0eee2f9fc160646434 go1.22.3.linux-arm64.tar.gz
    sha256 f2bacad20cd2b96f23a86d4826525d42b229fd431cc6d0dec61ff3bc448ef46e go1.22.3.linux-armv6l.tar.gz
    sha256 04b7b05283de30dd2da20bf3114b2e22cc727938aed3148babaf35cc951051ac go1.22.3.linux-ppc64le.tar.gz
    sha256 2aba796417a69be5f3ed489076bac79c1c02b36e29422712f9f3bf51da9cf2d4 go1.22.3.linux-s390x.tar.gz

> +sha256  2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067  LICENSE
> diff --git a/package/go/go-bin/go-bin.mk b/package/go/go-bin/go-bin.mk
> new file mode 100644
> index 0000000000..6c5c1b6485
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.mk
> @@ -0,0 +1,19 @@
> +################################################################################
> +#
> +# go-bin
> +#
> +################################################################################
> +
> +GO_BIN_SITE = https://go.dev/dl

Note that we do not always use the same _SITE for all the various go
packages, but as far as I could see, https://go.dev/dl has all the
source archives, so maybe we should use that for all the go packages?

> +GO_BIN_LICENSE = BSD-3-Clause
> +GO_BIN_LICENSE_FILES = LICENSE

I also added:

    HOST_GO_BIN_ACTUAL_SOURCE_TARBALL = go$(GO_VERSION).src.tar.gz

and the corresonding hash:

    sha256 80648ef34f903193d72a59c0dff019f5f98ae0c9aa13ade0b0ecbff991a76f68 go1.22.3.src.tar.gz

Note that, as https://go.dev/dl does have the source tarball, I did not
need to specify HOST_GO_BIN_ACTUAL_SOURCE_SITE

Regards,
Yann E. MORIN.

> +HOST_GO_BIN_PROVIDES = host-go
> +
> +HOST_GO_BIN_SOURCE = go$(GO_VERSION).linux-$(call qstrip, $(BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH)).tar.gz
> +
> +define HOST_GO_BIN_INSTALL_CMDS
> +	$(GO_BINARIES_INSTALL)
> +endef
> +
> +$(eval $(host-generic-package))
> --
> 2.44.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-06-01 15:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 16:22 [Buildroot] [PATCH v2 0/6] support for a pre-built Go compiler Thomas Perale via buildroot
2024-04-15 16:22 ` [Buildroot] [PATCH v2 1/6] DEVELOPERS: add Thomas Perale for 'go' Thomas Perale via buildroot
2024-04-15 16:44   ` Yann E. MORIN
2024-04-15 17:38     ` Thomas Perale via buildroot
2024-04-15 20:20       ` Yann E. MORIN
2024-06-01 15:39   ` Yann E. MORIN
2024-04-15 16:22 ` [Buildroot] [PATCH v2 2/6] package/go: new subdirectory for go variants Thomas Perale via buildroot
2024-06-01 15:41   ` Yann E. MORIN
2024-04-15 16:22 ` [Buildroot] [PATCH v2 3/6] package/pkg-golang: select BR2_PACKAGE_HOST_GO Thomas Perale via buildroot
2024-06-01 15:41   ` Yann E. MORIN
2024-06-06 11:44   ` Yann E. MORIN
2024-04-15 16:22 ` [Buildroot] [PATCH v2 4/6] package/go: make host package a virtual package Thomas Perale via buildroot
2024-06-01 15:42   ` Yann E. MORIN
2024-04-15 16:22 ` [Buildroot] [PATCH v2 5/6] package/go/go-bin: new host-go provider Thomas Perale via buildroot
2024-06-01 15:51   ` Yann E. MORIN [this message]
2024-06-14  4:07     ` Christian Stewart via buildroot
2024-06-14  5:44       ` Yann E. MORIN
2024-06-15  7:20         ` Yann E. MORIN
2024-08-19 21:22       ` Yann E. MORIN
2024-04-15 16:22 ` [Buildroot] [PATCH v2 6/6] support/testing: add tests for Go providers Thomas Perale via buildroot
2024-06-01 15:51   ` Yann E. MORIN
2024-06-01 15:54 ` [Buildroot] [PATCH v2 0/6] support for a pre-built Go compiler Yann E. MORIN

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=ZltDc6AXn_CC83Gy@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=christian@paral.in \
    --cc=thomas.perale@essensium.com \
    --cc=thomas.perale@mind.be \
    /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.