Buildroot Archive on 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: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Thomas Perale <thomas.perale@mind.be>,
	Anisse Astier <anisse@astier.eu>,
	Christian Stewart <christian@aperture.us>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/go/go-bin: new host-go provider
Date: Sun, 15 Sep 2024 16:14:05 +0200	[thread overview]
Message-ID: <ZubrrZkLW8Gbic5q@landeda> (raw)
In-Reply-To: <20240914152323.2630539-2-thomas.perale@mind.be>

Thomas, All,

On 2024-09-14 17:23 +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've done a few changes:

  - update hashes for 1.22.7
  - add hash for the source tarball
  - set _DL_SUBDIR
  - don't set a prompt to BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH

Applied to master with those fixes, thanks a lot!

Regards,
Yann E. MORIN.

> ---
>  package/go/Config.in.host        | 22 ++++++++++++++++------
>  package/go/go-bin/Config.in.host | 13 +++++++++++++
>  package/go/go-bin/go-bin.hash    |  8 ++++++++
>  package/go/go-bin/go-bin.mk      | 20 ++++++++++++++++++++
>  package/go/go.mk                 |  2 ++
>  5 files changed, 59 insertions(+), 6 deletions(-)
>  create mode 100644 package/go/go-bin/Config.in.host
>  create mode 100644 package/go/go-bin/go-bin.hash
>  create mode 100644 package/go/go-bin/go-bin.mk
> 
> diff --git a/package/go/Config.in.host b/package/go/Config.in.host
> index eefca03b02..435faec555 100644
> --- a/package/go/Config.in.host
> +++ b/package/go/Config.in.host
> @@ -34,7 +34,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
>  config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
>  	bool
>  	default y
> -	depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
> +	depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
>  
>  # CGO linking for the host. Since we use the same compiler for target
>  # and host, if the target can't do CGO linking, then the host can't.
> @@ -57,7 +57,8 @@ if BR2_PACKAGE_HOST_GO
>  
>  choice
>  	prompt "Go compiler variant"
> -	default BR2_PACKAGE_HOST_GO_SRC
> +	default BR2_PACKAGE_HOST_GO_SRC if BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
> +	default BR2_PACKAGE_HOST_GO_BIN if BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
>  	help
>  	  Select a Go compiler variant.
>  
> @@ -65,18 +66,27 @@ choice
>  
>  config BR2_PACKAGE_HOST_GO_SRC
>  	bool "host go (source)"
> +	depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
>  	help
>  	  This package will build the go compiler for the host.
>  
> -endchoice
> +config BR2_PACKAGE_HOST_GO_BIN
> +	bool "host go (pre-built)"
> +	depends on BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
> +	help
> +	  This package will install pre-built versions of the compiler
>  
> -endif
> +endchoice
>  
>  config BR2_PACKAGE_PROVIDES_HOST_GO
>  	string
> -	# Default to host-go-src, as the only provider for now
> -	default "host-go-src"
> +	# Default to host-go-src
> +	default "host-go-src" if BR2_PACKAGE_HOST_GO_SRC
> +	default "host-go-bin" if BR2_PACKAGE_HOST_GO_BIN
> +
> +endif
>  
> +source "package/go/go-bin/Config.in.host"
>  source "package/go/go-bootstrap-stage1/Config.in.host"
>  source "package/go/go-bootstrap-stage2/Config.in.host"
>  source "package/go/go-bootstrap-stage3/Config.in.host"
> diff --git a/package/go/go-bin/Config.in.host b/package/go/go-bin/Config.in.host
> new file mode 100644
> index 0000000000..51fe3c3fdc
> --- /dev/null
> +++ b/package/go/go-bin/Config.in.host
> @@ -0,0 +1,13 @@
> +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"
> +
> +config BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
> +	bool
> +	default y
> +	depends on BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH != ""
> diff --git a/package/go/go-bin/go-bin.hash b/package/go/go-bin/go-bin.hash
> new file mode 100644
> index 0000000000..12fd4c2816
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.hash
> @@ -0,0 +1,8 @@
> +# sha256 checksum from https://go.dev/dl/
> +sha256  3ea4c78e6fa52978ae1ed2e5927ad17495da440c9fae7787b1ebc1d0572f7f43  go1.22.5.linux-386.tar.gz
> +sha256  904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0  go1.22.5.linux-amd64.tar.gz
> +sha256  8d21325bfcf431be3660527c1a39d3d9ad71535fabdf5041c826e44e31642b5a  go1.22.5.linux-arm64.tar.gz
> +sha256  8c4587cf3e63c9aefbcafa92818c4d9d51683af93ea687bf6c7508d6fa36f85e  go1.22.5.linux-armv6l.tar.gz
> +sha256  5312bb420ac0b59175a58927e70b4660b14ab7319aab54398b6071fabcbfbb09  go1.22.5.linux-ppc64le.tar.gz
> +sha256  24c6c5c9d515adea5d58ae78388348c97614a0c21ac4d4f4c0dab75e893b0b5d  go1.22.5.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..155483a2fc
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.mk
> @@ -0,0 +1,20 @@
> +################################################################################
> +#
> +# go-bin
> +#
> +################################################################################
> +
> +GO_BIN_SITE = https://go.dev/dl
> +HOST_GO_BIN_ACTUAL_SOURCE_TARBALL = go$(GO_VERSION).src.tar.gz
> +GO_BIN_LICENSE = BSD-3-Clause
> +GO_BIN_LICENSE_FILES = LICENSE
> +
> +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))
> diff --git a/package/go/go.mk b/package/go/go.mk
> index 4c56660651..f48d25d415 100644
> --- a/package/go/go.mk
> +++ b/package/go/go.mk
> @@ -71,6 +71,8 @@ HOST_GO_TARGET_ENV = \
>  	$(HOST_GO_COMMON_ENV) \
>  	GOOS="linux" \
>  	GOARCH=$(GO_GOARCH) \
> +	$(if $(GO_GO386),GO386=$(GO_GO386)) \
> +	$(if $(GO_GOARM),GOARM=$(GO_GOARM)) \
>  	CC="$(TARGET_CC)" \
>  	CXX="$(TARGET_CXX)" \
>  	CGO_CFLAGS="$(TARGET_CFLAGS)" \
> -- 
> 2.46.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-09-15 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-14 15:23 [Buildroot] [PATCH 0/2] Add go-bin virtual package to go providers Thomas Perale via buildroot
2024-09-14 15:23 ` [Buildroot] [PATCH 1/2] package/go/go-bin: new host-go provider Thomas Perale via buildroot
2024-09-15 14:14   ` Yann E. MORIN [this message]
2024-09-14 15:23 ` [Buildroot] [PATCH 2/2] support/testing: add tests for Go providers Thomas Perale via buildroot
2024-09-15 14:16   ` Yann E. MORIN
2024-09-15 14:18 ` [Buildroot] [PATCH 0/2] Add go-bin virtual package to go providers 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=ZubrrZkLW8Gbic5q@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=anisse@astier.eu \
    --cc=buildroot@buildroot.org \
    --cc=christian@aperture.us \
    --cc=thomas.perale@essensium.com \
    --cc=thomas.perale@mind.be \
    --cc=thomas.petazzoni@bootlin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox