Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca@lucaceresoli.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 06/16 v3] core/legal-info: ensure legal-info works in off-line mode
Date: Sat, 30 Jan 2016 15:56:29 +0100	[thread overview]
Message-ID: <56ACCF1D.5090103@lucaceresoli.net> (raw)
In-Reply-To: <bd9e70a4286f01ccd6612f19ee541aad9350ac79.1454004518.git.yann.morin.1998@free.fr>

Hi Yann,

Yann E. MORIN wrote:
> 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...

Thanks for the detailed comment!
I didn't even find any typo... :) but I have a note below.

> @@ -771,6 +775,20 @@ endif
>   endif
>   endif
>
> +# Download actual sources if they differ from the extracted sources
> +# (e.g. for external toolchains)
> +#
> +# We need to provide PKG and PKGDIR, because there's no .stamp file for
> +# the legal-info step.
> +$(1)-legal-source:	PKG=$(2)
> +$(1)-legal-source:	PKGDIR=$(pkgdir)
> +$(1)-legal-source:
> +ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),)
> +ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
> +	$$(call DOWNLOAD,$$($(2)_ACTUAL_SOURCE_SITE)/$$($(2)_ACTUAL_SOURCE_TARBALL))
> +endif # actual sources != sources
> +endif # actual sources != ""

This created a side effect that is harmless, but a bit unpleasant.

Before this patch, running 'make source' with all sources already
fetched did not produce any output. Now, when using a package that 
defines _ACTUAL_SOURCE_SITE, it does:

$ make source
arm-2014.05-29-arm-none-linux-gnueabi.src.tar.bz2: OK (sha256: [...])
$

This is caused by not having a stamp file for the actual source
tarball. I suppose we should create a .stamp_actual_downloaded.

For the rest the patch looks good and it works.

-- 
Luca

  reply	other threads:[~2016-01-30 14:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 18:15 [Buildroot] [PATCH 0/16 v3] legal-info improvements and completeness (branch yem/legal-2) Yann E. MORIN
2016-01-28 18:14 ` [Buildroot] [PATCH 01/16 v3] core/legal-info: update the legal-info report header Yann E. MORIN
2016-02-01 22:42   ` Thomas Petazzoni
2016-01-28 18:15 ` [Buildroot] [PATCH 02/16 v3] toolchain/external: add hashes for actual sources Yann E. MORIN
2016-01-31 22:30   ` Arnout Vandecappelle
2016-02-01 13:54     ` Yann E. MORIN
2016-02-01 14:08       ` Arnout Vandecappelle
2016-01-28 18:15 ` [Buildroot] [PATCH 03/16 v3] core/pkg-utils: add macro to hardlink-or-copy Yann E. MORIN
2016-01-30 11:29   ` Luca Ceresoli
2016-01-30 11:55     ` Yann E. MORIN
2016-01-31 22:43   ` Arnout Vandecappelle
2016-02-01 10:13     ` Luca Ceresoli
2016-02-01 11:22       ` Arnout Vandecappelle
2016-01-28 18:15 ` [Buildroot] [PATCH 04/16 v3] core/legal-info: use the macro to install source archives Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 05/16 v3] core/pkg-generic: reorder variables definitions for legal-info Yann E. MORIN
2016-01-30 15:02   ` Luca Ceresoli
2016-01-30 15:46     ` Yann E. MORIN
2016-01-31 22:47   ` Arnout Vandecappelle
2016-01-28 18:15 ` [Buildroot] [PATCH 06/16 v3] core/legal-info: ensure legal-info works in off-line mode Yann E. MORIN
2016-01-30 14:56   ` Luca Ceresoli [this message]
2016-01-30 15:24     ` Yann E. MORIN
2016-01-30 15:31       ` Luca Ceresoli
2016-01-30 15:43         ` Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 07/16 v3] core/pkg-generic: add variable to store the package rawname-version Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 08/16 v3] core/legal-info: install source archives in their own sub-dir Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 09/16 v3] core/legal-info: add package version to license directory Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 10/16 v3] core/apply-patches: store full path of applied patches Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 11/16 v3] core/legal-info: also save patches Yann E. MORIN
2016-01-31 10:18   ` Luca Ceresoli
2016-01-28 18:15 ` [Buildroot] [PATCH 12/16 v3] core/legal-info: renumber saved patches Yann E. MORIN
2016-01-31 19:42   ` Luca Ceresoli
2016-01-31 20:02     ` Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 13/16 v3] core/legal-info: also save extra downloads Yann E. MORIN
2016-01-31 14:38   ` Luca Ceresoli
2016-01-28 18:15 ` [Buildroot] [PATCH 14/16 v3] core/legal-info: generate a hash of all saved files Yann E. MORIN
2016-01-31 14:40   ` Luca Ceresoli
2016-01-28 18:15 ` [Buildroot] [PATCH 15/16 v3] core/legal-info: allow ignoring packages from the legal-info Yann E. MORIN
2016-01-31 20:11   ` Luca Ceresoli
2016-01-31 21:44     ` Yann E. MORIN
2016-01-28 18:15 ` [Buildroot] [PATCH 16/16 v3] core/pkg-virtual: ignore from legal-info output Yann E. MORIN
2016-02-01  9:07   ` 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=56ACCF1D.5090103@lucaceresoli.net \
    --to=luca@lucaceresoli.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox