All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 3/4] Add go target support
  2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
  2016-03-02 19:23 ` [Buildroot] [PATCH 1/4] Add package go-bootstrap Geoff Levand
  2016-03-02 19:23 ` [Buildroot] [PATCH 4/4] Add package flannel Geoff Levand
@ 2016-03-02 19:23 ` Geoff Levand
  2016-03-02 22:51   ` Thomas Petazzoni
  2016-03-02 19:23 ` [Buildroot] [PATCH 2/4] Add go host support Geoff Levand
  2016-03-02 20:49 ` [Buildroot] [PATCH 0/4] Add go language support Thomas Petazzoni
  4 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 19:23 UTC (permalink / raw)
  To: buildroot

Add the needed bits to build a go compiler for the target.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 package/Config.in    |  1 +
 package/go/Config.in |  9 +++++++++
 package/go/go.mk     | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 package/go/Config.in

diff --git a/package/Config.in b/package/Config.in
index 529ad33..b9905cf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -484,6 +484,7 @@ menu "Erlang libraries/modules"
 endmenu
 endif
 	source "package/gauche/Config.in"
+	source "package/go/Config.in"
 	source "package/guile/Config.in"
 	source "package/haserl/Config.in"
 	source "package/jamvm/Config.in"
diff --git a/package/go/Config.in b/package/go/Config.in
new file mode 100644
index 0000000..69c4644
--- /dev/null
+++ b/package/go/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_GO
+	bool "go"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	help
+	  The Go Programming Language.
+
+	  https://golang.org
+
diff --git a/package/go/go.mk b/package/go/go.mk
index 95168a7..aa354dd 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -70,4 +70,38 @@ define HOST_GO_INSTALL_CMDS
 	chmod -R +x $(GO_HOST_FINAL)/pkg/tool
 endef
 
+GO_DEPENDENCIES = host-go-bootstrap
+GO_FINAL = /usr/lib/go
+
+GO_MAKE_ENV = \
+	GOROOT_BOOTSTRAP=$(GO_BOOTSTRAP) \
+	GOROOT_FINAL=$(GO_FINAL) \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin" \
+	GOARCH=$(GO_GOARCH) \
+	GOARM=$(GO_GOARM) \
+	GOOS=linux \
+	CGO_ENABLED=0
+
+define GO_BUILD_CMDS
+	cd $(@D)/src && $(GO_MAKE_ENV) ./make.bash
+endef
+
+define GO_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/linux_$(GO_GOARCH)/go $(TARGET_DIR)/$(GO_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/linux_$(GO_GOARCH)/gofmt $(TARGET_DIR)/$(GO_FINAL)/bin/gofmt
+
+	ln -sf $(GO_FINAL)/bin/go $(TARGET_DIR)/usr/bin/
+	ln -sf $(GO_FINAL)/bin/gofmt $(TARGET_DIR)/usr/bin/
+
+	cp -a $(@D)/lib $(TARGET_DIR)/$(GO_FINAL)/
+	cp -a $(@D)/src $(TARGET_DIR)/$(GO_FINAL)/
+
+	mkdir -p $(TARGET_DIR)/$(GO_FINAL)/pkg/tool
+	cp -a $(@D)/pkg/include $(@D)/pkg/linux_$(GO_GOARCH) $(TARGET_DIR)/$(GO_FINAL)/pkg/
+	cp -a $(@D)/pkg/tool/linux_$(GO_GOARCH) $(TARGET_DIR)/$(GO_FINAL)/pkg/tool/
+	chmod -R +x $(TARGET_DIR)/$(GO_FINAL)/pkg/tool
+endef
+
 $(eval $(host-generic-package))
+$(eval $(generic-package))
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 2/4] Add go host support
  2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
                   ` (2 preceding siblings ...)
  2016-03-02 19:23 ` [Buildroot] [PATCH 3/4] Add go target support Geoff Levand
@ 2016-03-02 19:23 ` Geoff Levand
  2016-03-02 22:50   ` Thomas Petazzoni
  2016-03-02 20:49 ` [Buildroot] [PATCH 0/4] Add go language support Thomas Petazzoni
  4 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 19:23 UTC (permalink / raw)
  To: buildroot

Add a new package 'go' which builds the host cross compiler and libraries for the
go programming language.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 package/Config.in.host    |  1 +
 package/go/Config.in.host | 14 +++++++++
 package/go/go.hash        |  2 ++
 package/go/go.mk          | 73 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 90 insertions(+)
 create mode 100644 package/go/Config.in.host
 create mode 100644 package/go/go.hash
 create mode 100644 package/go/go.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index 7cacef9..158fbca 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go/Config.in.host"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
diff --git a/package/go/Config.in.host b/package/go/Config.in.host
new file mode 100644
index 0000000..928944b
--- /dev/null
+++ b/package/go/Config.in.host
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_GO_ARCH_SUPPORTS
+	bool
+	default y
+	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
+	depends on !BR2_ARM_CPU_ARMV4
+
+config BR2_PACKAGE_HOST_GO
+	bool "host go"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	help
+	  The Go Programming Language.
+
+	  https://golang.org
diff --git a/package/go/go.hash b/package/go/go.hash
new file mode 100644
index 0000000..e7c72de
--- /dev/null
+++ b/package/go/go.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  754e06dab1c31ab168fc9db9e32596734015ea9e24bc44cae7f237f417ce4efe  go1.5.3.src.tar.gz
diff --git a/package/go/go.mk b/package/go/go.mk
new file mode 100644
index 0000000..95168a7
--- /dev/null
+++ b/package/go/go.mk
@@ -0,0 +1,73 @@
+################################################################################
+#
+# golang
+#
+################################################################################
+
+GO_VERSION = 1.5.3
+GO_SITE = https://storage.googleapis.com/golang
+GO_SOURCE = go$(GO_VERSION).src.tar.gz
+
+GO_LICENSE = BSD-3c
+GO_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP = $(HOST_DIR)/usr/lib/go-1.4.2
+
+ifeq ($(BR2_arm),y)
+	GO_GOARCH = arm
+else ifeq ($(BR2_aarch64),y)
+	GO_GOARCH = arm64
+else ifeq ($(BR2_i386),y)
+	GO_GOARCH = 386
+else ifeq ($(BR2_x86_64),y)
+	GO_GOARCH = amd64
+else ifeq ($(BR2_powerpc),y)
+	GO_GOARCH = ppc64
+else
+	GO_GOARCH = unknown
+endif
+
+ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV3),yy)
+	GO_GOARM = 7
+else ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV2),yy)
+	GO_GOARM = 6
+else ifeq ($(BR2_arm),y)
+	GO_GOARM = 5
+endif
+
+GO_HOST_DEPENDENCIES = host-go-bootstrap
+GO_HOST_FINAL = $(HOST_DIR)/usr/lib/go
+
+GO_HOST_MAKE_ENV = \
+	GOROOT_BOOTSTRAP=$(GO_BOOTSTRAP) \
+	GOROOT_FINAL=$(GO_HOST_FINAL) \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin" \
+	GOARCH=$(GO_GOARCH) \
+	GOARM=$(GO_GOARM) \
+	GOOS=linux \
+	CGO_ENABLED=1 \
+	CC_FOR_TARGET=$(TARGET_CC) \
+	CXX_FOR_TARGET=$(TARGET_CXX)
+
+define HOST_GO_BUILD_CMDS
+	cd $(@D)/src && $(GO_HOST_MAKE_ENV) ./make.bash
+endef
+
+define HOST_GO_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_HOST_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_HOST_FINAL)/bin/gofmt
+
+	ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
+	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
+
+	cp -a $(@D)/lib $(GO_HOST_FINAL)/
+	cp -a $(@D)/src $(GO_HOST_FINAL)/
+
+	mkdir -p $(GO_HOST_FINAL)/pkg
+	cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(GO_HOST_FINAL)/pkg/
+	cp -a $(@D)/pkg/tool $(GO_HOST_FINAL)/pkg/
+	chmod -R +x $(GO_HOST_FINAL)/pkg/tool
+endef
+
+$(eval $(host-generic-package))
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
@ 2016-03-02 19:23 Geoff Levand
  2016-03-02 19:23 ` [Buildroot] [PATCH 1/4] Add package go-bootstrap Geoff Levand
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 19:23 UTC (permalink / raw)
  To: buildroot

Hi,

This series add support for the go programming language.  I tested the build of
the included flannel package on i386, powerpc64, arm (32 bit) and arm64.  I did
runtime testing of the generated flannel binary on arm64.

Patch 1 adds a host only bootstrap compiler needed to build the latest go
versions.  The host and target support can be build independently, but either
of the two need this bootstrap package.

Patch 2 adds support for a host cross compiler, libraries and tools.

Patch 3 adds support for a native compiler, libraries and tools for the target.

Patch 4 add a go language package flannel that can be used to test the go
compiler.

Please consider for merege.

-Geoff

The following changes since commit aaf6c28a5c49251df31b82c48c971bc18183cf6b:

  Update for 2016.02 (2016-03-01 21:47:30 +0100)

are available in the git repository at:

  git at github.com:glevand/buildroot--buildroot.git for-merge-go

for you to fetch changes up to 1572d192abce3a19798cdfe75f3aef8f9e3e504c:

  Add package flannel (2016-03-02 11:20:54 -0800)

----------------------------------------------------------------
Geoff Levand (4):
      Add package go-bootstrap
      Add go host support
      Add go target support
      Add package flannel

 package/Config.in                      |   2 +
 package/Config.in.host                 |   2 +
 package/flannel/Config.in              |   9 +++
 package/flannel/flannel.hash           |   3 +
 package/flannel/flannel.mk             |  37 ++++++++++++
 package/go-bootstrap/Config.in.host    |   6 ++
 package/go-bootstrap/go-bootstrap.hash |   2 +
 package/go-bootstrap/go-bootstrap.mk   |  36 +++++++++++
 package/go/Config.in                   |   9 +++
 package/go/Config.in.host              |  14 +++++
 package/go/go.hash                     |   2 +
 package/go/go.mk                       | 107 +++++++++++++++++++++++++++++++++
 12 files changed, 229 insertions(+)
 create mode 100644 package/flannel/Config.in
 create mode 100644 package/flannel/flannel.hash
 create mode 100644 package/flannel/flannel.mk
 create mode 100644 package/go-bootstrap/Config.in.host
 create mode 100644 package/go-bootstrap/go-bootstrap.hash
 create mode 100644 package/go-bootstrap/go-bootstrap.mk
 create mode 100644 package/go/Config.in
 create mode 100644 package/go/Config.in.host
 create mode 100644 package/go/go.hash
 create mode 100644 package/go/go.mk

-- 
2.5.0

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 4/4] Add package flannel
  2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
  2016-03-02 19:23 ` [Buildroot] [PATCH 1/4] Add package go-bootstrap Geoff Levand
@ 2016-03-02 19:23 ` Geoff Levand
  2016-03-02 22:53   ` Thomas Petazzoni
  2016-03-02 19:23 ` [Buildroot] [PATCH 3/4] Add go target support Geoff Levand
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 19:23 UTC (permalink / raw)
  To: buildroot

Flannel is a virtual network that gives a subnet to each host for use
with container runtimes.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 package/Config.in            |  1 +
 package/flannel/Config.in    |  9 +++++++++
 package/flannel/flannel.hash |  3 +++
 package/flannel/flannel.mk   | 37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 package/flannel/Config.in
 create mode 100644 package/flannel/flannel.hash
 create mode 100644 package/flannel/flannel.mk

diff --git a/package/Config.in b/package/Config.in
index b9905cf..bb917f0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1332,6 +1332,7 @@ endif
 	source "package/faifa/Config.in"
 	source "package/fastd/Config.in"
 	source "package/fcgiwrap/Config.in"
+	source "package/flannel/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
diff --git a/package/flannel/Config.in b/package/flannel/Config.in
new file mode 100644
index 0000000..0da356d
--- /dev/null
+++ b/package/flannel/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_FLANNEL
+	bool "flannel"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO
+	help
+	  Flannel is a virtual network that gives a subnet to each host for use
+	  with container runtimes.
+
+	  https://github.com/coreos/flannel
diff --git a/package/flannel/flannel.hash b/package/flannel/flannel.hash
new file mode 100644
index 0000000..7459298
--- /dev/null
+++ b/package/flannel/flannel.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d flannel-v0.5.5.tar.gz
+
diff --git a/package/flannel/flannel.mk b/package/flannel/flannel.mk
new file mode 100644
index 0000000..93347af
--- /dev/null
+++ b/package/flannel/flannel.mk
@@ -0,0 +1,37 @@
+################################################################################
+#
+# flannel
+#
+################################################################################
+
+FLANNEL_VERSION = v0.5.5
+FLANNEL_SITE = https://github.com/coreos/flannel.git
+FLANNEL_SITE_METHOD = git
+
+FLANNEL_LICENSE = Apache-2.0
+FLANNEL_LICENSE_FILES = LICENSE
+
+FLANNEL_DEPENDENCIES = host-go
+
+FLANNEL_MAKE_ENV = \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(@D)/gopath" \
+	GOARCH=$(GO_GOARCH) \
+	CGO_ENABLED=1
+
+define FLANNEL_CONFIGURE_CMDS
+	mkdir -p $(@D)/gopath/src/github.com/coreos
+	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel
+endef
+
+define FLANNEL_BUILD_CMDS
+	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+		build -v -o $(@D)/bin/flanneld .
+endef
+
+define FLANNEL_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/flanneld $(TARGET_DIR)/opt/bin/flanneld
+	$(INSTALL) -D -m 0755 $(@D)/dist/mk-docker-opts.sh $(TARGET_DIR)/opt/bin/mk-docker-opts.sh
+endef
+
+$(eval $(generic-package))
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/4] Add package go-bootstrap
  2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
@ 2016-03-02 19:23 ` Geoff Levand
  2016-03-02 22:43   ` Thomas Petazzoni
  2016-03-02 19:23 ` [Buildroot] [PATCH 4/4] Add package flannel Geoff Levand
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 19:23 UTC (permalink / raw)
  To: buildroot

Add a new package go-bootstrap which builds a bootstrap compiler for the
go programming language.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 package/Config.in.host                 |  1 +
 package/go-bootstrap/Config.in.host    |  6 ++++++
 package/go-bootstrap/go-bootstrap.hash |  2 ++
 package/go-bootstrap/go-bootstrap.mk   | 36 ++++++++++++++++++++++++++++++++++
 4 files changed, 45 insertions(+)
 create mode 100644 package/go-bootstrap/Config.in.host
 create mode 100644 package/go-bootstrap/go-bootstrap.hash
 create mode 100644 package/go-bootstrap/go-bootstrap.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index 1c691a3..7cacef9 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go-bootstrap/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
diff --git a/package/go-bootstrap/Config.in.host b/package/go-bootstrap/Config.in.host
new file mode 100644
index 0000000..99cca79
--- /dev/null
+++ b/package/go-bootstrap/Config.in.host
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	bool
+	help
+	  Bootstrap compiler needed to build go1.5 and later versions.
+
+	  https://golang.org
diff --git a/package/go-bootstrap/go-bootstrap.hash b/package/go-bootstrap/go-bootstrap.hash
new file mode 100644
index 0000000..1d0566a
--- /dev/null
+++ b/package/go-bootstrap/go-bootstrap.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b go1.4.2.src.tar.gz
diff --git a/package/go-bootstrap/go-bootstrap.mk b/package/go-bootstrap/go-bootstrap.mk
new file mode 100644
index 0000000..464f95e
--- /dev/null
+++ b/package/go-bootstrap/go-bootstrap.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# go-bootstrap
+#
+################################################################################
+
+GO_BOOTSTRAP_VERSION = 1.4.2
+GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
+GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz
+
+GO_BOOTSTRAP_LICENSE = BSD-3c
+GO_BOOTSTRAP_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP_FINAL = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
+
+GO_BOOTSTRAP_MAKE_ENV = \
+	GOOS=linux \
+	GOROOT_FINAL="$(GO_BOOTSTRAP_FINAL)" \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin"
+
+define HOST_GO_BOOTSTRAP_BUILD_CMDS
+	cd $(@D)/src && $(GO_BOOTSTRAP_MAKE_ENV) ./make.bash
+endef
+
+define HOST_GO_BOOTSTRAP_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
+
+	cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
+	cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/
+	cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
+	chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool
+endef
+
+$(eval $(host-generic-package))
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
                   ` (3 preceding siblings ...)
  2016-03-02 19:23 ` [Buildroot] [PATCH 2/4] Add go host support Geoff Levand
@ 2016-03-02 20:49 ` Thomas Petazzoni
  2016-03-02 21:47   ` Geoff Levand
  4 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 20:49 UTC (permalink / raw)
  To: buildroot

Hello Geoff,

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:

> This series add support for the go programming language.  I tested the build of
> the included flannel package on i386, powerpc64, arm (32 bit) and arm64.  I did
> runtime testing of the generated flannel binary on arm64.
> 
> Patch 1 adds a host only bootstrap compiler needed to build the latest go
> versions.  The host and target support can be build independently, but either
> of the two need this bootstrap package.
> 
> Patch 2 adds support for a host cross compiler, libraries and tools.
> 
> Patch 3 adds support for a native compiler, libraries and tools for the target.
> 
> Patch 4 add a go language package flannel that can be used to test the go
> compiler.

Thanks a lot for this submission!

However, we already have some pending Go-related packages in our patch
queue. What I would like to see is a single patch series adding Go
support, which is approved by the different developers interested in Go
support in Buildroot.

The other Go patch series are:

  http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
  (from Ludovic Guegan)

  http://patchwork.ozlabs.org/patch/542108/
  (from Christian Stewart)

I have Cc'ed Ludovic and Christian. It would be good if you could sync
with them.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 20:49 ` [Buildroot] [PATCH 0/4] Add go language support Thomas Petazzoni
@ 2016-03-02 21:47   ` Geoff Levand
  2016-03-02 21:52     ` Christian Stewart
  2016-03-02 22:18     ` Thomas Petazzoni
  0 siblings, 2 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 21:47 UTC (permalink / raw)
  To: buildroot

Hi All,

On Wed, 2016-03-02 at 21:49 +0100, Thomas Petazzoni wrote:
> However, we already have some pending Go-related packages in our
> patch
> queue. What I would like to see is a single patch series adding Go
> support, which is approved by the different developers interested in Go
> support in Buildroot.

Thanks for trying to coordinating things.

> The other Go patch series are:
> 
>   http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
>   (from Ludovic Guegan)

I took a quick look at this.  Patch 1, which builds the go
complier, has the bootstrap and final compiler built in the
same package.  I think it better to split the bootstrap out
into its own package as I have done since then the two packages
are each then simpler and I think easier to maintain.

Also, this implementation does not build cross compilers
correctly, nor does it install the go pkg and tools, nor does
it enable CGO_ENABLED for C language linkage support.

All in all, think my patches seem more complete in adding
go compiler support.

I think the other patches in Ludovic's series can be considered
independent of the go compiler.  Patch 4 which adds pkg-golang.mk
is something needed.  I had planned to look into this.

>  http://patchwork.ozlabs.org/patch/542108//
>   (from Christian Stewart)

I did see this is now out of date, building go compiler version
1.4.2.  It also doesn't seem to install the go tools.  To bring
these up to date would need almost a complete re-write since
the current compiler now requires a bootstrap compiler.  I
think my patches superseed this series.

My proposal is to use my patches to provide the basic go compiler
support.  Ludovic's other patches provide additional language
support, and seem as though they could be useful, but they are
additions to the basic compiler support, and I think can be
considered independently.

Is my proposal acceptable?  Let's work to move forward.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 21:47   ` Geoff Levand
@ 2016-03-02 21:52     ` Christian Stewart
  2016-03-02 22:31       ` Geoff Levand
  2016-03-02 22:18     ` Thomas Petazzoni
  1 sibling, 1 reply; 25+ messages in thread
From: Christian Stewart @ 2016-03-02 21:52 UTC (permalink / raw)
  To: buildroot

All,
On Wed, Mar 2, 2016 at 4:47 PM Geoff Levand <geoff@infradead.org> wrote: >> http://patchwork.ozlabs.org/patch/542108//
>> (from Christian Stewart)

>I did see this is now out of date, building go compiler version
>1.4.2. It also doesn't seem to install the go tools. To bring
>these up to date would need almost a complete re-write since
>the current compiler now requires a bootstrap compiler. I
>think my patches superseed this series.
This is correct. I built the original series with Yann as a solution to
implement Docker under Buildroot, which worked fine for our project. If there is
some other better series that implements the Go compiler as well as the ?go?
tools installed into the target, I can adapt the other packages in my series
(Docker, Aufs-Utils, etc) to support the superseeding packages.
I'm fine with going ahead with this.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160302/2113e9a3/attachment.html>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 21:47   ` Geoff Levand
  2016-03-02 21:52     ` Christian Stewart
@ 2016-03-02 22:18     ` Thomas Petazzoni
  2016-03-02 22:43       ` Geoff Levand
  1 sibling, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:18 UTC (permalink / raw)
  To: buildroot

Geoff,

On Wed, 02 Mar 2016 13:47:14 -0800, Geoff Levand wrote:

> >   http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
> >   (from Ludovic Guegan)
> 
> I took a quick look at this.  Patch 1, which builds the go
> complier, has the bootstrap and final compiler built in the
> same package.  I think it better to split the bootstrap out
> into its own package as I have done since then the two packages
> are each then simpler and I think easier to maintain.

I'll have a look at this specific aspect. Having two packages that use
the same source is not always the best solution, but I'll have a look.

> Also, this implementation does not build cross compilers
> correctly, nor does it install the go pkg and tools, nor does
> it enable CGO_ENABLED for C language linkage support.
> 
> All in all, think my patches seem more complete in adding
> go compiler support.
> 
> I think the other patches in Ludovic's series can be considered
> independent of the go compiler.  Patch 4 which adds pkg-golang.mk
> is something needed.  I had planned to look into this.

OK. As I said, what I would like to see is one single patch series that
contains the full support, and that is approved by the interested
parties (you, Ludovic and Christian). The Buildroot maintainers cannot
be expert in all topics, and diving into the Go topic would require
quite some time. So I'd like to see a single patch series acknowledged
by all parties so that we can have some good confidence that it does
things the right way.

Of course, it can also be two separate patch series: one from you with
the core Go stuff (acknowledged by Christian and Ludovic), and another
from Ludovic with the Go package infrastructure (acknowledged by you
and Christian).

> I did see this is now out of date, building go compiler version
> 1.4.2.  It also doesn't seem to install the go tools.  To bring
> these up to date would need almost a complete re-write since
> the current compiler now requires a bootstrap compiler.  I
> think my patches superseed this series.

OK. I'll mark Christian's patch as Superseded then.

> My proposal is to use my patches to provide the basic go compiler
> support.  Ludovic's other patches provide additional language
> support, and seem as though they could be useful, but they are
> additions to the basic compiler support, and I think can be
> considered independently.
> 
> Is my proposal acceptable?  Let's work to move forward.

It is acceptable to me, but please work with Ludovic and Christian to
get to a point where they can give their Acked-by to your patches.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 21:52     ` Christian Stewart
@ 2016-03-02 22:31       ` Geoff Levand
  2016-03-02 22:40         ` Christian Stewart
  0 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 22:31 UTC (permalink / raw)
  To: buildroot

Hi Christian,

On Wed, 2016-03-02 at 21:52 +0000, Christian Stewart wrote:
> I can
> adapt the other packages in my series (Docker, Aufs-Utils, etc) to support the superseeding packages.
> I'm fine with going ahead with this.

As Thomas requested, could you please review my three
patches that add the compiler support and either give
comments or your Acked-by.  Thanks.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 22:31       ` Geoff Levand
@ 2016-03-02 22:40         ` Christian Stewart
  2016-03-21 16:32           ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Christian Stewart @ 2016-03-02 22:40 UTC (permalink / raw)
  To: buildroot

Geoff,
On Wed, Mar 2, 2016 at 5:31 PM Geoff Levand <geoff@infradead.org> wrote: > As Thomas requested, could you please review my three > patches that add the compiler support and either give
> comments or your Acked-by. Thanks.
I will adjust my Docker setup to use your Go package as the base runtime, test,
and ack it when everything works fine on my end.
Should be within the next day or so.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160302/20f2e6b7/attachment.html>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 22:18     ` Thomas Petazzoni
@ 2016-03-02 22:43       ` Geoff Levand
  2016-03-02 22:54         ` Thomas Petazzoni
  0 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-02 22:43 UTC (permalink / raw)
  To: buildroot

Hi,

On Wed, 2016-03-02 at 23:18 +0100, Thomas Petazzoni wrote:
> I took a quick look at this.  Patch 1, which builds the go
> > complier, has the bootstrap and final compiler built in the
> > same package.  I think it better to split the bootstrap out
> > into its own package as I have done since then the two packages
> > are each then simpler and I think easier to maintain.
> 
> I'll have a look at this specific aspect. Having two packages that use
> the same source is not always the best solution, but I'll have a look.

Just to mention it, the two use different source versions, 1.4.3
for the bootstrap, and 1.5.3 (currently) for the final compiler.

> > OK. As I said, what I would like to see is one single patch series that
> contains the full support, and that is approved by the interested
> parties (you, Ludovic and Christian). The Buildroot maintainers cannot
> be expert in all topics, and diving into the Go topic would require
> quite some time. So I'd like to see a single patch series acknowledged
> by all parties so that we can have some good confidence that it does
> things the right way.
> 
> Of course, it can also be two separate patch series: one from you with
> the core Go stuff (acknowledged by Christian and Ludovic), and another
> from Ludovic with the Go package infrastructure (acknowledged by you
> and Christian).

I understand your need to have these things reviewed by the interested
parties.  I will work towards the consensus.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/4] Add package go-bootstrap
  2016-03-02 19:23 ` [Buildroot] [PATCH 1/4] Add package go-bootstrap Geoff Levand
@ 2016-03-02 22:43   ` Thomas Petazzoni
  2016-03-03  1:11     ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:43 UTC (permalink / raw)
  To: buildroot

Geoff,

The commit title should be:

	go-bootstrap: new host package

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:

> diff --git a/package/Config.in.host b/package/Config.in.host
> index 1c691a3..7cacef9 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -13,6 +13,7 @@ menu "Host utilities"
>  	source "package/genext2fs/Config.in.host"
>  	source "package/genimage/Config.in.host"
>  	source "package/genpart/Config.in.host"
> +	source "package/go-bootstrap/Config.in.host"

There is no need for a Config.in.host file for this package, it is
just a build dependency for the go compiler, it doesn't need to be
exposed in menuconfig.

> diff --git a/package/go-bootstrap/Config.in.host b/package/go-bootstrap/Config.in.host
> new file mode 100644
> index 0000000..99cca79
> --- /dev/null
> +++ b/package/go-bootstrap/Config.in.host
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_HOST_GO_BOOTSTRAP
> +	bool
> +	help
> +	  Bootstrap compiler needed to build go1.5 and later versions.
> +
> +	  https://golang.org

So, this is not needed.

> diff --git a/package/go-bootstrap/go-bootstrap.mk b/package/go-bootstrap/go-bootstrap.mk
> new file mode 100644
> index 0000000..464f95e
> --- /dev/null
> +++ b/package/go-bootstrap/go-bootstrap.mk
> @@ -0,0 +1,36 @@
> +################################################################################
> +#
> +# go-bootstrap
> +#
> +################################################################################
> +
> +GO_BOOTSTRAP_VERSION = 1.4.2
> +GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
> +GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz

Will Go 1.4.x always be capable of building newer Go compilers ?

> +
> +GO_BOOTSTRAP_LICENSE = BSD-3c
> +GO_BOOTSTRAP_LICENSE_FILES = LICENSE
> +
> +GO_BOOTSTRAP_FINAL = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
> +
> +GO_BOOTSTRAP_MAKE_ENV = \
> +	GOOS=linux \
> +	GOROOT_FINAL="$(GO_BOOTSTRAP_FINAL)" \
> +	GOROOT="$(@D)" \
> +	GOBIN="$(@D)/bin"
> +
> +define HOST_GO_BOOTSTRAP_BUILD_CMDS
> +	cd $(@D)/src && $(GO_BOOTSTRAP_MAKE_ENV) ./make.bash
> +endef
> +
> +define HOST_GO_BOOTSTRAP_INSTALL_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
> +	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
> +
> +	cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
> +	cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/

Is it normal to copy source code to HOST_DIR ?

> +	cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
> +	chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool

Why aren't those tools already installed +x by the build process ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 2/4] Add go host support
  2016-03-02 19:23 ` [Buildroot] [PATCH 2/4] Add go host support Geoff Levand
@ 2016-03-02 22:50   ` Thomas Petazzoni
  2016-03-03  1:11     ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:50 UTC (permalink / raw)
  To: buildroot

Geoff,

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:
> Add a new package 'go' which builds the host cross compiler and libraries for the
> go programming language.
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>

Like the previous commit, the title should be:

	go: new host package

> diff --git a/package/Config.in.host b/package/Config.in.host
> index 7cacef9..158fbca 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -13,6 +13,7 @@ menu "Host utilities"
>  	source "package/genext2fs/Config.in.host"
>  	source "package/genimage/Config.in.host"
>  	source "package/genpart/Config.in.host"
> +	source "package/go/Config.in.host"
>  	source "package/go-bootstrap/Config.in.host"
>  	source "package/gptfdisk/Config.in.host"
>  	source "package/imx-usb-loader/Config.in.host"
> diff --git a/package/go/Config.in.host b/package/go/Config.in.host
> new file mode 100644
> index 0000000..928944b
> --- /dev/null
> +++ b/package/go/Config.in.host
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_GO_ARCH_SUPPORTS
> +	bool
> +	default y
> +	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
> +	depends on !BR2_ARM_CPU_ARMV4
> +
> +config BR2_PACKAGE_HOST_GO
> +	bool "host go"
> +	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
> +	select BR2_PACKAGE_HOST_GO_BOOTSTRAP

Due to the removal of Config.in.host for the go-bootstrap package, this
line has become useless.

> +	help
> +	  The Go Programming Language.
> +
> +	  https://golang.org

We normally don't have Config.in for host packages, as they are just
build dependencies. In this case, we could also decide to not have any
package/go/Config.in.host, and simply have the flannel package use
"host-go" in its <pkg>_DEPENDENCIES variable.

However, we may consider that some users may want to build the host Go
compiler even if they don't have a package that uses it, so maybe it's
acceptable.

I'm still a bit bothered by the fact that a Config.in option describing
a *host* package depends on BR2_PACKAGE_GO_ARCH_SUPPORTS. But I guess
it's fine since the Go compiler is really going to be a cross-compiler.

> diff --git a/package/go/go.mk b/package/go/go.mk
> new file mode 100644
> index 0000000..95168a7
> --- /dev/null
> +++ b/package/go/go.mk
> @@ -0,0 +1,73 @@
> +################################################################################
> +#
> +# golang
> +#
> +################################################################################
> +
> +GO_VERSION = 1.5.3
> +GO_SITE = https://storage.googleapis.com/golang
> +GO_SOURCE = go$(GO_VERSION).src.tar.gz
> +
> +GO_LICENSE = BSD-3c
> +GO_LICENSE_FILES = LICENSE
> +
> +GO_BOOTSTRAP = $(HOST_DIR)/usr/lib/go-1.4.2

Why don't you use $(GO_BOOTSTRAP_FINAL) instead ?

> +
> +ifeq ($(BR2_arm),y)
> +	GO_GOARCH = arm

Please don't indent such variable definitions.

> +else ifeq ($(BR2_aarch64),y)
> +	GO_GOARCH = arm64
> +else ifeq ($(BR2_i386),y)
> +	GO_GOARCH = 386
> +else ifeq ($(BR2_x86_64),y)
> +	GO_GOARCH = amd64
> +else ifeq ($(BR2_powerpc),y)
> +	GO_GOARCH = ppc64
> +else
> +	GO_GOARCH = unknown
> +endif
> +
> +ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV3),yy)
> +	GO_GOARM = 7
> +else ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV2),yy)
> +	GO_GOARM = 6
> +else ifeq ($(BR2_arm),y)
> +	GO_GOARM = 5
> +endif

You should use BR2_ARM_CPU_ARMV5, BR2_ARM_CPU_ARMV6 and
BR2_ARM_CPU_ARMV7 here.

> GO_HOST_DEPENDENCIES = host-go-bootstrap

Wrong variable name, it should be HOST_GO_DEPENDENCIES.

> GO_HOST_FINAL = $(HOST_DIR)/usr/lib/go

Ditto: HOST_GO_<...>

> GO_HOST_MAKE_ENV = \

Same.

> +define HOST_GO_INSTALL_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_HOST_FINAL)/bin/go
> +	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_HOST_FINAL)/bin/gofmt
> +
> +	ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
> +	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
> +
> +	cp -a $(@D)/lib $(GO_HOST_FINAL)/
> +	cp -a $(@D)/src $(GO_HOST_FINAL)/

Same question: why do we install source code ?

> +
> +	mkdir -p $(GO_HOST_FINAL)/pkg
> +	cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(GO_HOST_FINAL)/pkg/
> +	cp -a $(@D)/pkg/tool $(GO_HOST_FINAL)/pkg/
> +	chmod -R +x $(GO_HOST_FINAL)/pkg/tool

Same question :-)

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 3/4] Add go target support
  2016-03-02 19:23 ` [Buildroot] [PATCH 3/4] Add go target support Geoff Levand
@ 2016-03-02 22:51   ` Thomas Petazzoni
  2016-03-03  1:11     ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:51 UTC (permalink / raw)
  To: buildroot

Dear Geoff Levand,

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:
> Add the needed bits to build a go compiler for the target.
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>

We don't support or want to support doing development on the target, so
I think the target variant of the go compiler is not needed.

See
https://buildroot.org/downloads/manual/manual.html#faq-no-compiler-on-target
for more details.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 4/4] Add package flannel
  2016-03-02 19:23 ` [Buildroot] [PATCH 4/4] Add package flannel Geoff Levand
@ 2016-03-02 22:53   ` Thomas Petazzoni
  2016-03-03  1:11     ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:53 UTC (permalink / raw)
  To: buildroot

Dear Geoff Levand,

The commit title should be:

	flannel: new package

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:

> diff --git a/package/flannel/flannel.hash b/package/flannel/flannel.hash
> new file mode 100644
> index 0000000..7459298
> --- /dev/null
> +++ b/package/flannel/flannel.hash
> @@ -0,0 +1,3 @@
> +# Locally computed:
> +sha256 c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d flannel-v0.5.5.tar.gz
> +

Unneeded empty new line.

> +FLANNEL_VERSION = v0.5.5
> +FLANNEL_SITE = https://github.com/coreos/flannel.git
> +FLANNEL_SITE_METHOD = git

Please use the github helper function.

> +
> +FLANNEL_LICENSE = Apache-2.0
> +FLANNEL_LICENSE_FILES = LICENSE
> +
> +FLANNEL_DEPENDENCIES = host-go
> +
> +FLANNEL_MAKE_ENV = \
> +	GOBIN="$(@D)/bin" \
> +	GOPATH="$(@D)/gopath" \
> +	GOARCH=$(GO_GOARCH) \
> +	CGO_ENABLED=1
> +
> +define FLANNEL_CONFIGURE_CMDS
> +	mkdir -p $(@D)/gopath/src/github.com/coreos
> +	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel

This probably warrants a comment above to explain why this is needed.

> +endef
> +
> +define FLANNEL_BUILD_CMDS
> +	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
> +		build -v -o $(@D)/bin/flanneld .
> +endef
> +
> +define FLANNEL_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/bin/flanneld $(TARGET_DIR)/opt/bin/flanneld
> +	$(INSTALL) -D -m 0755 $(@D)/dist/mk-docker-opts.sh $(TARGET_DIR)/opt/bin/mk-docker-opts.sh
> +endef
> +
> +$(eval $(generic-package))

Other than that, looks good to me.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 22:43       ` Geoff Levand
@ 2016-03-02 22:54         ` Thomas Petazzoni
  2016-03-03  1:09           ` Geoff Levand
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-02 22:54 UTC (permalink / raw)
  To: buildroot

Geoff,

On Wed, 02 Mar 2016 14:43:12 -0800, Geoff Levand wrote:

> On Wed, 2016-03-02 at 23:18 +0100, Thomas Petazzoni wrote:
> > I took a quick look at this.  Patch 1, which builds the go
> > > complier, has the bootstrap and final compiler built in the
> > > same package.  I think it better to split the bootstrap out
> > > into its own package as I have done since then the two packages
> > > are each then simpler and I think easier to maintain.
> > 
> > I'll have a look at this specific aspect. Having two packages that use
> > the same source is not always the best solution, but I'll have a look.
> 
> Just to mention it, the two use different source versions, 1.4.3
> for the bootstrap, and 1.5.3 (currently) for the final compiler.

Yeah, I just discovered this while reviewing your patches. In this
case, it definitely makes sense. I forgot that the 1.5 Go compiler had
some parts of it in Go, and therefore needed a previous Go compiler.

> > > OK. As I said, what I would like to see is one single patch series that
> > contains the full support, and that is approved by the interested
> > parties (you, Ludovic and Christian). The Buildroot maintainers cannot
> > be expert in all topics, and diving into the Go topic would require
> > quite some time. So I'd like to see a single patch series acknowledged
> > by all parties so that we can have some good confidence that it does
> > things the right way.
> > 
> > Of course, it can also be two separate patch series: one from you with
> > the core Go stuff (acknowledged by Christian and Ludovic), and another
> > from Ludovic with the Go package infrastructure (acknowledged by you
> > and Christian).
> 
> I understand your need to have these things reviewed by the interested
> parties.  I will work towards the consensus.

Thanks a lot!

On my side, I reviewed your patches. There are a few comments/issues,
but nothing major. Overall it looks fairly simple and straightforward.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 22:54         ` Thomas Petazzoni
@ 2016-03-03  1:09           ` Geoff Levand
  0 siblings, 0 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-03  1:09 UTC (permalink / raw)
  To: buildroot

On Wed, 2016-03-02 at 23:54 +0100, Thomas Petazzoni wrote:
> On my side, I reviewed your patches. There are a few comments/issues,
> but nothing major. Overall it looks fairly simple and
> straightforward.

I made the mentioned fixes.  I'll repost the series after testing.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/4] Add package go-bootstrap
  2016-03-02 22:43   ` Thomas Petazzoni
@ 2016-03-03  1:11     ` Geoff Levand
  2016-03-03  8:15       ` Thomas Petazzoni
  0 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-03  1:11 UTC (permalink / raw)
  To: buildroot

On Wed, 2016-03-02 at 23:43 +0100, Thomas Petazzoni wrote:
> The commit title should be:
> 
> 	> go-bootstrap: new host package

OK.

> --- a/package/Config.in.host
> > +++ b/package/Config.in.host
> > @@ -13,6 +13,7 @@ menu "Host utilities"
> >  > > 	> > source "package/genext2fs/Config.in.host"
> >  > > 	> > source "package/genimage/Config.in.host"
> >  > > 	> > source "package/genpart/Config.in.host"
> > +> > 	> > source "package/go-bootstrap/Config.in.host"
> 
> There is no need for a Config.in.host file for this package, it is
> just a build dependency for the go compiler, it doesn't need to be
> exposed in menuconfig.

OK.

> > new file mode 100644
> > index 0000000..464f95e
> > --- /dev/null
> > +++ b/package/go-bootstrap/go-bootstrap.mk
> > @@ -0,0 +1,36 @@
> > +################################################################################
> > +#
> > +# go-bootstrap
> > +#
> > +################################################################################
> > +
> > +GO_BOOTSTRAP_VERSION = 1.4.2
> > +GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
> > +GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz
> 
> Will Go 1.4.x always be capable of building newer Go compilers ?

Yes, at least that is the current situation.  FYI, the go bootstrap
plan is documented here:

  https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNAfepWy2yhPUBs96FGV28

> > > > +define HOST_GO_BOOTSTRAP_INSTALL_CMDS
> > +> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
> > +> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
> > +
> > +> > 	> > cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
> > +> > 	> > cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/
> 
> Is it normal to copy source code to HOST_DIR ?

There is a known issue which requires the source tree to be installed:

  https://golang.org/issue/2775

I'll add a comment to the .mk file.

> > +> > 	> > cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
> > +> > 	> > chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool
> 
> Why aren't those tools already installed +x by the build process ?

This is not needed I'll remove the line here and in go.mk.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 2/4] Add go host support
  2016-03-02 22:50   ` Thomas Petazzoni
@ 2016-03-03  1:11     ` Geoff Levand
  0 siblings, 0 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-03  1:11 UTC (permalink / raw)
  To: buildroot

On Wed, 2016-03-02 at 23:50 +0100, Thomas Petazzoni wrote:
> --- /dev/null
> > +++ b/package/go/Config.in.host
> > @@ -0,0 +1,14 @@
> > +config BR2_PACKAGE_GO_ARCH_SUPPORTS
> > +> > 	> > bool
> > +> > 	> > default y
> > +> > 	> > depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
> > +> > 	> > depends on !BR2_ARM_CPU_ARMV4
> > +
> > +config BR2_PACKAGE_HOST_GO
> > +> > 	> > bool "host go"
> > +> > 	> > depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
> > +> > 	> > select BR2_PACKAGE_HOST_GO_BOOTSTRAP
> 
> Due to the removal of Config.in.host for the go-bootstrap package, this
> line has become useless.

OK.

> 
> > +> > 	> > help
> > +> > 	> >   The Go Programming Language.
> > +
> > +> > 	> >   https://golang.org
> 
> We normally don't have Config.in for host packages, as they are just
> build dependencies. In this case, we could also decide to not have any
> package/go/Config.in.host, and simply have the flannel package use
> "host-go" in its _DEPENDENCIES variable.
> 
> However, we may consider that some users may want to build the host Go
> compiler even if they don't have a package that uses it, so maybe it's
> acceptable.

Either way seems fine, but having the option seems more flexible for
users.

> I'm still a bit bothered by the fact that a Config.in option describing
> a *host* package depends on BR2_PACKAGE_GO_ARCH_SUPPORTS. But I guess
> it's fine since the Go compiler is really going to be a cross-compiler.

Yes, my thinking was that if you try to build go for a target arch that
is not supported the build will blow up.  For the package maintainer
they can use BR2_PACKAGE_GO_ARCH_SUPPORTS to only build for targets
that the compiler supports.  

> > +GO_VERSION = 1.5.3
> > +GO_SITE = https://storage.googleapis.com/golang
> > +GO_SOURCE = go$(GO_VERSION).src.tar.gz
> > +
> > +GO_LICENSE = BSD-3c
> > +GO_LICENSE_FILES = LICENSE
> > +
> > +GO_BOOTSTRAP = $(HOST_DIR)/usr/lib/go-1.4.2
> 
> Why don't you use $(GO_BOOTSTRAP_FINAL) instead ?

Yes, should work better.

> 
> > +
> > +ifeq ($(BR2_arm),y)
> > +> > 	> > GO_GOARCH = arm
> 
> Please don't indent such variable definitions.

OK.

> 
> > +else ifeq ($(BR2_aarch64),y)
> > +> > 	> > GO_GOARCH = arm64
> > +else ifeq ($(BR2_i386),y)
> > +> > 	> > GO_GOARCH = 386
> > +else ifeq ($(BR2_x86_64),y)
> > +> > 	> > GO_GOARCH = amd64
> > +else ifeq ($(BR2_powerpc),y)
> > +> > 	> > GO_GOARCH = ppc64
> > +else
> > +> > 	> > GO_GOARCH = unknown
> > +endif
> > +
> > +ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV3),yy)
> > +> > 	> > GO_GOARM = 7
> > +else ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV2),yy)
> > +> > 	> > GO_GOARM = 6
> > +else ifeq ($(BR2_arm),y)
> > +> > 	> > GO_GOARM = 5
> > +endif
> 
> You should use BR2_ARM_CPU_ARMV5, BR2_ARM_CPU_ARMV6 and
> BR2_ARM_CPU_ARMV7 here.

OK.  I re-did the logic here a little. 

> 
> > GO_HOST_DEPENDENCIES = host-go-bootstrap
> 
> Wrong variable name, it should be HOST_GO_DEPENDENCIES.
> 
> > GO_HOST_FINAL = $(HOST_DIR)/usr/lib/go
> 
> Ditto: HOST_GO_<...>
> 
> > GO_HOST_MAKE_ENV = \
> 
> Same.

I think I got them all...

> 
> > +define HOST_GO_INSTALL_CMDS
> > +> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_HOST_FINAL)/bin/go
> > +> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_HOST_FINAL)/bin/gofmt
> > +
> > +> > 	> > ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
> > +> > 	> > ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
> > +
> > +> > 	> > cp -a $(@D)/lib $(GO_HOST_FINAL)/
> > +> > 	> > cp -a $(@D)/src $(GO_HOST_FINAL)/
> 
> Same question: why do we install source code ?

As before, to work-around a know issue.  I'll add the comment here.

> > +
> > +> > 	> > mkdir -p $(GO_HOST_FINAL)/pkg
> > +> > 	> > cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(GO_HOST_FINAL)/pkg/
> > +> > 	> > cp -a $(@D)/pkg/tool $(GO_HOST_FINAL)/pkg/
> > +> > 	> > chmod -R +x $(GO_HOST_FINAL)/pkg/tool
> 
> Same question :-)

Removed it.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 3/4] Add go target support
  2016-03-02 22:51   ` Thomas Petazzoni
@ 2016-03-03  1:11     ` Geoff Levand
  0 siblings, 0 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-03  1:11 UTC (permalink / raw)
  To: buildroot

Hi,

On Wed, 2016-03-02 at 23:51 +0100, Thomas Petazzoni wrote:
> On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:
> > Add the needed bits to build a go compiler for the target.
> > 
> > Signed-off-by: Geoff Levand <geoff@infradead.org>
> 
> We don't support or want to support doing development on the target, so
> I think the target variant of the go compiler is not needed.
> 
> See
> https://buildroot.org/downloads/manual/manual.html#faq-no-compiler-on-target
> for more details.

If I have read the above document correctly the primary reason
for not having a target side toolchain was concerns
of complexity and maintanence.  I don't think that is the
case with this go package.

My motovation for having a target go is to include the go
tools that can be used for debugging go programs, etc.
Also, for minimal systems it is common to have a Linux
container with the just the go compiler in it, and then
only loading that container when installing a go
program from source.  By having a target go compiler
such a container can be build from buildroot.

See https://hub.docker.com/_/golang/

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 4/4] Add package flannel
  2016-03-02 22:53   ` Thomas Petazzoni
@ 2016-03-03  1:11     ` Geoff Levand
  0 siblings, 0 replies; 25+ messages in thread
From: Geoff Levand @ 2016-03-03  1:11 UTC (permalink / raw)
  To: buildroot

On Wed, 2016-03-02 at 23:53 +0100, Thomas Petazzoni wrote:
> The commit title should be:
> 
> 	flannel: new package
> 
> On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:
> 
> > diff --git a/package/flannel/flannel.hash
> > b/package/flannel/flannel.hash
> > new file mode 100644
> > index 0000000..7459298
> > --- /dev/null
> > +++ b/package/flannel/flannel.hash
> > @@ -0,0 +1,3 @@
> > +# Locally computed:
> > +sha256
> > c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d
> > flannel-v0.5.5.tar.gz
> > +
> 
> Unneeded empty new line.

OK.

> 
> > +FLANNEL_VERSION = v0.5.5
> > +FLANNEL_SITE = https://github.com/coreos/flannel.git
> > +FLANNEL_SITE_METHOD = git
> 
> Please use the github helper function.

OK.

> 
> > +
> > +FLANNEL_LICENSE = Apache-2.0
> > +FLANNEL_LICENSE_FILES = LICENSE
> > +
> > +FLANNEL_DEPENDENCIES = host-go
> > +
> > +FLANNEL_MAKE_ENV = \
> > +	GOBIN="$(@D)/bin" \
> > +	GOPATH="$(@D)/gopath" \
> > +	GOARCH=$(GO_GOARCH) \
> > +	CGO_ENABLED=1
> > +
> > +define FLANNEL_CONFIGURE_CMDS
> > +	mkdir -p $(@D)/gopath/src/github.com/coreos
> > +	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel
> 
> This probably warrants a comment above to explain why this is needed.

OK.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/4] Add package go-bootstrap
  2016-03-03  1:11     ` Geoff Levand
@ 2016-03-03  8:15       ` Thomas Petazzoni
  0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2016-03-03  8:15 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 02 Mar 2016 17:11:07 -0800, Geoff Levand wrote:

> > Will Go 1.4.x always be capable of building newer Go compilers ?
> 
> Yes, at least that is the current situation.  FYI, the go bootstrap
> plan is documented here:
> 
>   https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNAfepWy2yhPUBs96FGV28

OK, thanks for the pointer.

> > Is it normal to copy source code to HOST_DIR ?
> 
> There is a known issue which requires the source tree to be installed:
> 
>   https://golang.org/issue/2775
> 
> I'll add a comment to the .mk file.

Yes good idea.

> > > +> > 	> > cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
> > > +> > 	> > chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool
> > 
> > Why aren't those tools already installed +x by the build process ?
> 
> This is not needed I'll remove the line here and in go.mk.

Great, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-02 22:40         ` Christian Stewart
@ 2016-03-21 16:32           ` Geoff Levand
  2016-03-22 18:09             ` Christian Stewart
  0 siblings, 1 reply; 25+ messages in thread
From: Geoff Levand @ 2016-03-21 16:32 UTC (permalink / raw)
  To: buildroot

Hi Christian,

On Wed, 2016-03-02 at 22:40 +0000, Christian Stewart wrote:
> On Wed, Mar 2, 2016 at 5:31 PM Geoff Levand <geoff@infradead.org> wrote:

> > As Thomas requested, could you please review my three> patches that add the compiler support and either give
> > comments or your Acked-by.  Thanks.
> I will adjust my Docker setup to use your Go package as the base runtime, test, and ack it when everything works fine on my end.
> Should be within the next day or so.

And thing to report yet about getting your packages
to build with my new go language patches?  If I
can help in any way, please let me know.

-Geoff

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 0/4] Add go language support
  2016-03-21 16:32           ` Geoff Levand
@ 2016-03-22 18:09             ` Christian Stewart
  0 siblings, 0 replies; 25+ messages in thread
From: Christian Stewart @ 2016-03-22 18:09 UTC (permalink / raw)
  To: buildroot

Hey Geoff,
On Mon, Mar 21, 2016 at 12:32 PM Geoff Levand <geoff@infradead.org> wrote: > And thing to report yet about getting your packages
> to build with my new go language patches? If I
> can help in any way, please let me know.
>
> -Geoff
I've been out of the country for the past week and haven't had a chance to work
on the Docker stuff yet. I'm sorry if this has been blocking your work in any
way.
Starting around the week of May 18th my primary focus will shift back to the
Docker under Buildroot work, and I should be far more active with patches /
improvements / fixes at that time. In the meantime I will attempt to get the
packages to build on top of your series, but I'm not entirely sure what time
this week I'll be able to do that.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160322/a174a07d/attachment.html>

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-03-22 18:09 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02 19:23 [Buildroot] [PATCH 0/4] Add go language support Geoff Levand
2016-03-02 19:23 ` [Buildroot] [PATCH 1/4] Add package go-bootstrap Geoff Levand
2016-03-02 22:43   ` Thomas Petazzoni
2016-03-03  1:11     ` Geoff Levand
2016-03-03  8:15       ` Thomas Petazzoni
2016-03-02 19:23 ` [Buildroot] [PATCH 4/4] Add package flannel Geoff Levand
2016-03-02 22:53   ` Thomas Petazzoni
2016-03-03  1:11     ` Geoff Levand
2016-03-02 19:23 ` [Buildroot] [PATCH 3/4] Add go target support Geoff Levand
2016-03-02 22:51   ` Thomas Petazzoni
2016-03-03  1:11     ` Geoff Levand
2016-03-02 19:23 ` [Buildroot] [PATCH 2/4] Add go host support Geoff Levand
2016-03-02 22:50   ` Thomas Petazzoni
2016-03-03  1:11     ` Geoff Levand
2016-03-02 20:49 ` [Buildroot] [PATCH 0/4] Add go language support Thomas Petazzoni
2016-03-02 21:47   ` Geoff Levand
2016-03-02 21:52     ` Christian Stewart
2016-03-02 22:31       ` Geoff Levand
2016-03-02 22:40         ` Christian Stewart
2016-03-21 16:32           ` Geoff Levand
2016-03-22 18:09             ` Christian Stewart
2016-03-02 22:18     ` Thomas Petazzoni
2016-03-02 22:43       ` Geoff Levand
2016-03-02 22:54         ` Thomas Petazzoni
2016-03-03  1:09           ` Geoff Levand

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.