All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 06/16 v4] core/legal-info: ensure legal-info works in off-line mode
Date: Thu, 4 Feb 2016 00:35:44 +0100	[thread overview]
Message-ID: <20160203233544.GD3428@free.fr> (raw)
In-Reply-To: <b64d74dcfda277aa72757454fc79a388540bd8a8.1454536753.git.yann.morin.1998@free.fr>

All,

On 2016-02-03 23:21 +0100, Yann E. MORIN spake thusly:
> TBC: explain the part about the stamp file

Damn, I borked my rebase and lost that part of the commit log... :-(

I'll rewrite it tomorrow (too late now).

Sorry for the mess... :-/

Regards,
Yann E. MORIN.

> Almost all packages which are saved for legal-info have their source
> archives downloaded as part of 'make source', which makes an off-line
> build completely possible [0].
> 
> However, for the pre-configured external toolchains, the source tarball
> is different, as the main tarball is a binary package. And that source
> tarball is only downloaded during the legal-info phase, which makes it
> inconvenient for full off-line builds.
> 
> We fix that by adding a new rule, $(1)-legal-source which only
> $(1)-all-source depends on, so that we only download it for a top-level
> 'make source', not as part of the standard download mechanism (i.e. only
> what is really needed to build).
> 
> This way, we can do a complete [0] off-line build and are still able to
> generate legal-info, while at the same time we do not incur any download
> overhead during a simple build.
> 
> Also, we previously downloaded the _ACTUAL_SOURCE_TARBALL when it was
> not empty. However, since _ACTUAL_SOURCE_TARBALL defaults to the value
> of _SOURCE, it can not be empty when _SOURCE is not. Thus, we'd get a
> spurious report of a missing hash for the tarball, since it was not in
> a standard package rule (configure, build, install..) and thus would
> miss the PKG and PKGDIR variables to find the .hash file.
> 
> We fix that in this commit as well, by:
> 
>   - setting PKG and PKGDIR just for the -legal-source rule;
> 
>   - only downloading _ACTUAL_SOURCE_TARBALL if it is not empty *and* not
>     the same as _SOURCE (to avoid a second report about the hash).
> 
> [0] Save for nodejs which invarriably wants to download stuff at build
> time. Sigh... :-( Fixing that is work for another time...
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Luca Ceresoli <luca@lucaceresoli.net>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> 
> ---
> Changes v3 -> v4:
>   - handle it with a stamp file  (Luca)
> 
> Changes v2 -> v3:
>   - re-order the PHONY targets  (Arnout)
>   - don't reorder setting _ACTUAL_SOURCE/_SITE, it's done in its own
>     patch now  (Arnout)
>   - adapt the commit log accordingly  (Arnout)
>   - typo
> 
> Changes v1 -> v2:
>   - drop the 'redistribute == ignore', it does not exist yet
> ---
>  package/pkg-generic.mk | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 5958029..95dbffd 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -123,6 +123,12 @@ $(BUILD_DIR)/%/.stamp_downloaded:
>  	$(Q)mkdir -p $(@D)
>  	$(Q)touch $@
>  
> +# Retrieve actual source archive, e.g. for prebuilt external toolchains
> +$(BUILD_DIR)/%/.stamp_actual_downloaded:
> +	$(call DOWNLOAD,$($(PKG)_ACTUAL_SOURCE_SITE)/$($(PKG)_ACTUAL_SOURCE_TARBALL)); \
> +	$(Q)mkdir -p $(@D)
> +	$(Q)touch $@
> +
>  # Unpack the archive
>  $(BUILD_DIR)/%/.stamp_extracted:
>  	@$(call step_start,extract)
> @@ -527,6 +533,7 @@ $(2)_TARGET_RSYNC =	        $$($(2)_DIR)/.stamp_rsynced
>  $(2)_TARGET_PATCH =		$$($(2)_DIR)/.stamp_patched
>  $(2)_TARGET_EXTRACT =		$$($(2)_DIR)/.stamp_extracted
>  $(2)_TARGET_SOURCE =		$$($(2)_DIR)/.stamp_downloaded
> +$(2)_TARGET_ACTUAL_SOURCE =	$$($(2)_DIR)/.stamp_actual_downloaded
>  $(2)_TARGET_DIRCLEAN =		$$($(2)_DIR)/.stamp_dircleaned
>  
>  # default extract command
> @@ -634,6 +641,17 @@ $(1)-depends:		$$($(2)_FINAL_DEPENDENCIES)
>  
>  $(1)-source:		$$($(2)_TARGET_SOURCE)
>  
> +$(1)-all-source:	$(1)-legal-source
> +$(1)-legal-info:	$(1)-legal-source
> +$(1)-legal-source:	$(1)-source
> +
> +# Only downlaod the actual source if it differs from the 'main' archive
> +ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),)
> +ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
> +$(1)-legal-source:	$$($(2)_TARGET_ACTUAL_SOURCE)
> +endif # actual sources != sources
> +endif # actual sources != ""
> +
>  $(1)-source-check:
>  	$$(foreach p,$$($(2)_ALL_DOWNLOADS),$$(call SOURCE_CHECK,$$(p))$$(sep))
>  
> @@ -659,6 +677,7 @@ $(1)-extract:		$(1)-rsync
>  $(1)-rsync:		$$($(2)_TARGET_RSYNC)
>  
>  $(1)-source:
> +$(1)-legal-source:
>  
>  $(1)-source-check:
>  	test -d $$($(2)_OVERRIDE_SRCDIR)
> @@ -731,6 +750,8 @@ $$($(2)_TARGET_PATCH):			PKGDIR=$(pkgdir)
>  $$($(2)_TARGET_EXTRACT):		PKG=$(2)
>  $$($(2)_TARGET_SOURCE):			PKG=$(2)
>  $$($(2)_TARGET_SOURCE):			PKGDIR=$(pkgdir)
> +$$($(2)_TARGET_ACTUAL_SOURCE):		PKG=$(2)
> +$$($(2)_TARGET_ACTUAL_SOURCE):		PKGDIR=$(pkgdir)
>  $$($(2)_TARGET_DIRCLEAN):		PKG=$(2)
>  
>  # Compute the name of the Kconfig option that correspond to the
> @@ -801,9 +822,6 @@ else
>  # Other packages
>  
>  ifeq ($$($(2)_REDISTRIBUTE),YES)
> -ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
> -	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
> -endif
>  # Copy the source tarball
>  	$$(Q)$$(call hardlink-copy,\
>  		     $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\
> @@ -898,6 +916,7 @@ endif
>  	$(1)-install-staging \
>  	$(1)-install-target \
>  	$(1)-legal-info \
> +	$(1)-legal-source \
>  	$(1)-patch \
>  	$(1)-rebuild \
>  	$(1)-reconfigure \
> -- 
> 1.9.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2016-02-03 23:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 22:22 [Buildroot] [PATCH 00/16 v4] legal-info improvements and completeness (branch yem/legal-2) Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 01/16 v4] toolchain/external: newer Linaro toolchains do not provide source code Yann E. MORIN
2016-02-03 22:46   ` Thomas Petazzoni
2016-02-03 22:21 ` [Buildroot] [PATCH 02/16 v4] toolchain/external: add hashes for actual sources Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 03/16 v4] core/pkg-utils: add macro to hardlink-or-copy Yann E. MORIN
2016-02-12 22:28   ` Luca Ceresoli
2016-02-12 22:46     ` Yann E. MORIN
2016-02-12 22:57       ` Arnout Vandecappelle
2016-02-12 22:58       ` Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 04/16 v4] core/legal-info: use the macro to install source archives Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 05/16 v4] core/pkg-generic: reorder variables definitions for legal-info Yann E. MORIN
2016-02-11 22:22   ` Luca Ceresoli
2016-02-03 22:21 ` [Buildroot] [PATCH 06/16 v4] core/legal-info: ensure legal-info works in off-line mode Yann E. MORIN
2016-02-03 23:35   ` Yann E. MORIN [this message]
2016-02-12 13:00   ` Luca Ceresoli
2016-02-03 22:21 ` [Buildroot] [PATCH 07/16 v4] core/pkg-generic: add variable to store the package rawname-version Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 08/16 v4] core/legal-info: install source archives in their own sub-dir Yann E. MORIN
2016-02-03 22:21 ` [Buildroot] [PATCH 09/16 v4] core/legal-info: add package version to license directory Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 10/16 v4] core/apply-patches: store full path of applied patches Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 11/16 v4] core/legal-info: also save patches Yann E. MORIN
2016-03-04 23:45   ` Luca Ceresoli
2016-03-06 10:25     ` Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 12/16 v4] core/legal-info: renumber saved patches Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 13/16 v4] core/legal-info: also save extra downloads Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 14/16 v4] core/legal-info: generate a hash of all saved files Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 15/16 v4] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
2016-02-03 22:22 ` [Buildroot] [PATCH 16/16 v4] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
2016-02-14 23:00   ` Luca Ceresoli

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=20160203233544.GD3428@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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.