Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/1] package/balena-engine: bump to version 20.10.26
@ 2023-02-02 13:26 Christian Stewart via buildroot
  2023-02-05 15:35 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Stewart via buildroot @ 2023-02-02 13:26 UTC (permalink / raw)
  To: buildroot; +Cc: Christian Stewart, Yann E . MORIN, Thomas Petazzoni

This update requires a workaround for the non-standard vendor/ structure in the
balena-engine repository, which has an invalid vendor/modules.txt file.

Removing the vendor/modules.txt file fixes the build error.

Reference: https://github.com/moby/moby/issues/44618#issuecomment-1343565705

The go download post-process script uses go mod init to create the go.mod file
which specifies a language version of go1.16 on default. Use go mod edit to
adjust the go.mod file to the required minimum version go1.19 for generic types
used by docker-engine. (Fixes a build error).

Remove the vendor/archive sub-tree (fixes a build error) because Go no longer
allows having duplicate packages in GOPATH and GOROOT. vendor/archive/tar cannot
be in vendor/ because it exists in the standard library. Remove it from vendor/.

https://github.com/balena-os/balena-engine/releases/tag/v20.10.26

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/balena-engine/balena-engine.hash |  2 +-
 package/balena-engine/balena-engine.mk   | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/package/balena-engine/balena-engine.hash b/package/balena-engine/balena-engine.hash
index 4adb8ce561..6a92a40cc8 100644
--- a/package/balena-engine/balena-engine.hash
+++ b/package/balena-engine/balena-engine.hash
@@ -1,3 +1,3 @@
 # Locally computed
-sha256  4fb38109d133d499de366466a612fb6f523ea99d56fcd69b45dc494a75fbce0f  balena-engine-20.10.21.tar.gz
+sha256  1482b64e35d5406be719e362647ed7d0599cf4eead7770247ebd972c4c85ede5  balena-engine-20.10.26.tar.gz
 sha256  7c87873291f289713ac5df48b1f2010eb6963752bbd6b530416ab99fc37914a8  LICENSE
diff --git a/package/balena-engine/balena-engine.mk b/package/balena-engine/balena-engine.mk
index ecfb62bfbf..3b8b2f9ac6 100644
--- a/package/balena-engine/balena-engine.mk
+++ b/package/balena-engine/balena-engine.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-BALENA_ENGINE_VERSION = 20.10.21
+BALENA_ENGINE_VERSION = 20.10.26
 BALENA_ENGINE_SITE = $(call github,balena-os,balena-engine,v$(BALENA_ENGINE_VERSION))
 
 BALENA_ENGINE_LICENSE = Apache-2.0
@@ -34,6 +34,18 @@ BALENA_ENGINE_TAGS = \
 
 BALENA_ENGINE_BUILD_TARGETS = cmd/balena-engine
 
+# remove the conflicting vendor/modules.txt
+# remove the conflicting vendor/archive (not allowed in go1.20)
+# https://github.com/moby/moby/issues/44618#issuecomment-1343565705
+define BALENA_ENGINE_CONFIGURE_CMDS
+	if [ -f $(@D)/vendor/modules.txt ]; then \
+		rm $(@D)/vendor/modules.txt; \
+	fi
+	if [ -d $(@D)/vendor/archive ]; then \
+		rm -rf $(@D)/vendor/archive; \
+	fi
+endef
+
 ifeq ($(BR2_INIT_SYSTEMD),y)
 BALENA_ENGINE_DEPENDENCIES += systemd
 BALENA_ENGINE_TAGS += journald
-- 
2.39.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1 1/1] package/balena-engine: bump to version 20.10.26
  2023-02-02 13:26 [Buildroot] [PATCH v1 1/1] package/balena-engine: bump to version 20.10.26 Christian Stewart via buildroot
@ 2023-02-05 15:35 ` Yann E. MORIN
  2023-02-06  5:11   ` Christian Stewart via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2023-02-05 15:35 UTC (permalink / raw)
  To: Christian Stewart; +Cc: Thomas Petazzoni, buildroot

Christian, All,

On 2023-02-02 05:26 -0800, Christian Stewart via buildroot spake thusly:
> This update requires a workaround for the non-standard vendor/ structure in the
> balena-engine repository, which has an invalid vendor/modules.txt file.
> 
> Removing the vendor/modules.txt file fixes the build error.
> 
> Reference: https://github.com/moby/moby/issues/44618#issuecomment-1343565705
> 
> The go download post-process script uses go mod init to create the go.mod file

That's not correct. The download go-post-process script does not run
that command at all.

Furthermore, in the case of the balena-engine package, the
go-post-process script actually does absolutely nothing at all. Indeed,
it will notice that the vendor/ directory already exists, and thus will
exit early:

   17 # Already vendored tarball, nothing to do
   18 if tar tf "${output}" | grep -q "^[^/]*/vendor" ; then
   19     exit 0
   20 fi
   21
   22 post_process_unpack "${base_name}" "${output}"
   23
   24 # Do the Go vendoring
   25 pushd "${base_name}" > /dev/null
   26
   27 if [ ! -f go.mod ]; then
   28     echo "ERROR: no vendor/ folder and no go.mod, aborting"
   29     exit 1
   30 fi
   31
   32 go mod vendor -v -modcacherw
   33 popd > /dev/null
   34
   35 post_process_repack $(pwd) "${base_name}" "${output}"

Furthermore, for balena-engine, this all works because it is not using
the go-mod infra, and despite this uses a populated vendor/ directory.
So, we're not running the vendoring as it is already done, and we can
thus delete the problematic file.

So, you'll have to reword/rework the explanations.

Note that this also applies to your other patches touching the
docker-related packages, notably "package/docker-engine: bump version to
v23.0.0", so I'll mark the rest of that series as changes requested too.

Regards,
Yann E. MORIN.

> which specifies a language version of go1.16 on default. Use go mod edit to
> adjust the go.mod file to the required minimum version go1.19 for generic types
> used by docker-engine. (Fixes a build error).
> 
> Remove the vendor/archive sub-tree (fixes a build error) because Go no longer
> allows having duplicate packages in GOPATH and GOROOT. vendor/archive/tar cannot
> be in vendor/ because it exists in the standard library. Remove it from vendor/.
> 
> https://github.com/balena-os/balena-engine/releases/tag/v20.10.26
> 
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
>  package/balena-engine/balena-engine.hash |  2 +-
>  package/balena-engine/balena-engine.mk   | 14 +++++++++++++-
>  2 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/package/balena-engine/balena-engine.hash b/package/balena-engine/balena-engine.hash
> index 4adb8ce561..6a92a40cc8 100644
> --- a/package/balena-engine/balena-engine.hash
> +++ b/package/balena-engine/balena-engine.hash
> @@ -1,3 +1,3 @@
>  # Locally computed
> -sha256  4fb38109d133d499de366466a612fb6f523ea99d56fcd69b45dc494a75fbce0f  balena-engine-20.10.21.tar.gz
> +sha256  1482b64e35d5406be719e362647ed7d0599cf4eead7770247ebd972c4c85ede5  balena-engine-20.10.26.tar.gz
>  sha256  7c87873291f289713ac5df48b1f2010eb6963752bbd6b530416ab99fc37914a8  LICENSE
> diff --git a/package/balena-engine/balena-engine.mk b/package/balena-engine/balena-engine.mk
> index ecfb62bfbf..3b8b2f9ac6 100644
> --- a/package/balena-engine/balena-engine.mk
> +++ b/package/balena-engine/balena-engine.mk
> @@ -4,7 +4,7 @@
>  #
>  ################################################################################
>  
> -BALENA_ENGINE_VERSION = 20.10.21
> +BALENA_ENGINE_VERSION = 20.10.26
>  BALENA_ENGINE_SITE = $(call github,balena-os,balena-engine,v$(BALENA_ENGINE_VERSION))
>  
>  BALENA_ENGINE_LICENSE = Apache-2.0
> @@ -34,6 +34,18 @@ BALENA_ENGINE_TAGS = \
>  
>  BALENA_ENGINE_BUILD_TARGETS = cmd/balena-engine
>  
> +# remove the conflicting vendor/modules.txt
> +# remove the conflicting vendor/archive (not allowed in go1.20)
> +# https://github.com/moby/moby/issues/44618#issuecomment-1343565705
> +define BALENA_ENGINE_CONFIGURE_CMDS
> +	if [ -f $(@D)/vendor/modules.txt ]; then \
> +		rm $(@D)/vendor/modules.txt; \

No need to test if a file exists before removing it; just
unconditionally delete it:
    rm -f $(@D)/vendor/modules.txt

> +	fi
> +	if [ -d $(@D)/vendor/archive ]; then \
> +		rm -rf $(@D)/vendor/archive; \

Ditto, just delete the directory without checking whether it exists.

Regards,
Yann E. MORIN.

> +	fi
> +endef
> +
>  ifeq ($(BR2_INIT_SYSTEMD),y)
>  BALENA_ENGINE_DEPENDENCIES += systemd
>  BALENA_ENGINE_TAGS += journald
> -- 
> 2.39.1
> 
> _______________________________________________
> 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

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

* Re: [Buildroot] [PATCH v1 1/1] package/balena-engine: bump to version 20.10.26
  2023-02-05 15:35 ` Yann E. MORIN
@ 2023-02-06  5:11   ` Christian Stewart via buildroot
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Stewart via buildroot @ 2023-02-06  5:11 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Christian Stewart, Thomas Petazzoni, Buildroot Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 806 bytes --]

Yann,

On Sun, Feb 5, 2023, 7:36 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:

> Christian, All,
>
> On 2023-02-02 05:26 -0800, Christian Stewart via buildroot spake thusly:
> > This update requires a workaround for the non-standard vendor/ structure
> in the
> > balena-engine repository, which has an invalid vendor/modules.txt file.
> >
> > Removing the vendor/modules.txt file fixes the build error.
> >
> > Reference:
> https://github.com/moby/moby/issues/44618#issuecomment-1343565705
> >
> > The go download post-process script uses go mod init to create the
> go.mod file
>
> That's not correct. The download go-post-process script does not run
> that command at all.
>

My mistake, I had a commit in my working branch that adds go mod init if
the go.mod doesn't exist.

Thanks,
Christian


>

[-- Attachment #1.2: Type: text/html, Size: 1588 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-02-06  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-02 13:26 [Buildroot] [PATCH v1 1/1] package/balena-engine: bump to version 20.10.26 Christian Stewart via buildroot
2023-02-05 15:35 ` Yann E. MORIN
2023-02-06  5:11   ` Christian Stewart via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox