[Buildroot] <PACKAGE>_SOURCE with <PACKAGE>_SITE_METHOD = git can result to tar.gz with mismatched file extension

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sat Dec 3 14:52:47 UTC 2022


Hello,

+Yann Morin in Cc.

On Fri, 2 Dec 2022 21:02:06 +0700
Bagas Sanjaya <bagasdotme at gmail.com> wrote:

> Hello,
> 
> I noticed odd behavior when <PACKAGE>_SOURCE is set whereas <PACKAGE>
> is downloaded via git (<PACKAGE>_SITE_METHOD = git).
> 
> For example, I'm trying to bump Git package to commit
> c000d916380bb59db69c78546928eadd076b9c7d (v2.39.0-rc0). On the makefile
> (package/git/git.mk), I bumped by:
> 
> ---- >8 ----  
> diff --git a/package/git/git.mk b/package/git/git.mk
> index dc587170e8..1990bf8e67 100644
> --- a/package/git/git.mk
> +++ b/package/git/git.mk
> @@ -4,9 +4,10 @@
>  #
>  ################################################################################
>  
> -GIT_VERSION = 2.31.4
> +GIT_VERSION = c000d916380bb59db69c78546928eadd076b9c7d
>  GIT_SOURCE = git-$(GIT_VERSION).tar.xz
> -GIT_SITE = $(BR2_KERNEL_MIRROR)/software/scm/git
> +GIT_SITE = file:///home/bagas/repo/git-scm
> +GIT_SITE_METHOD = git
>  GIT_LICENSE = GPL-2.0, LGPL-2.1+
>  GIT_LICENSE_FILES = COPYING LGPL-2.1
>  GIT_CPE_ID_VENDOR = git-scm
> 
> (note: I fetch from my local Git project repository, hence file:// URI).
> 
> When I fetch the sources (make source), the generated tarball is actually
> .tar.gz with $(GIT_VERSION) as the filename. This causes extracting the
> tarball to fail. In this case, the tarball is decompressed first with
> xzcat, and it complains due to unrecognized compressed format (gzip
> instead of xz).

I think you're right. We assume that _SOURCE is not defined when a
_SITE_METHOD using a VCS (git, cvs, svn, hg) is used.

I guess we have two options here:

 (1) Detect this situation, and error out, to prevent this situation
 from happening

 (2) Actually support overriding _SOURCE, but in this case, we should
 comply with the specified compression algorithm

Yann, thoughts? (1) seems easier to me, I don't know if the benefits of
(2) are really relevant.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



More information about the buildroot mailing list