From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Fri, 24 Jun 2016 17:11:03 +0200 Subject: [Buildroot] [PATCH 13/13 v7] core/legal-info: ensure legal-info works in off-line mode In-Reply-To: <073f2f8f95adc65a29ba10b04ce2072d04731b6c.1462637351.git.yann.morin.1998@free.fr> References: <073f2f8f95adc65a29ba10b04ce2072d04731b6c.1462637351.git.yann.morin.1998@free.fr> Message-ID: <20160624171103.220dfecb@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello, On Sat, 7 May 2016 18:14:38 +0200, 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 new rule depends, like the normal download mechanism, on a stamp > file, so that we do not emit a spurious hash-check message on successive > runs of 'make source'. > > 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" > Cc: Luca Ceresoli > Cc: Thomas Petazzoni > Cc: Peter Korsgaard > Tested-by: Luca Ceresoli > > --- > Notes: here is a case where one would need to be able to do an off-line > legal-info: > - a build farm (e.g. Jenkins slaves) without access to the internet; > - a single machine (not part of the farm) has access to the internet; > - that machine runs "make source" to populate a mirror (a "primary > mirror" or an NFS-mounted directory or anything else) that is > accessible to the build farm; > - machines in the build farm need the actual sources to run > legal-info, doing so off-line. Applied to master, thanks. Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com