Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Added local directory as source of kernel code
Date: Wed, 7 Nov 2018 19:52:26 +0100	[thread overview]
Message-ID: <20181107185226.GB4702@scaer> (raw)
In-Reply-To: <20181107174411.0b67a064@windsurf>

Nicolas, Thomas, All,

On 2018-11-07 17:44 +0100, Thomas Petazzoni spake thusly:
> On Wed, 7 Nov 2018 14:40:39 +0000, Nicolas Carrier wrote:
> > I have a workspace managed by google repo, which fetches the sources
> > of the external git repositories for which we have created .mk
> > buildroot Makefiles.
> > 
> > Because the sources are cloned by repo, I don't want them to be
> > fetched by buildroot, hence I used "_SITE_METHOD = local" for all the
> > packages.
> > 
> > For linux and u-boot, I can't do that because they dont support the
> > local method and I think there is no reason to make these two
> > packages an exception.
> 
> Well your patch is actually making u-boot and linux be exceptions. What
> if someone wants to build busybox from a local source tree ? And qt5 ?
> And openssl ? And then this other package ?

Exactly what I was about to write.

> As you can see, this approach does not really scale: we would have to
> add Config.in options to all packages to say "please build using the
> source code from folder XYZ instead of the normal upstream source
> code". That's why we have chosen to support this use case using
> OVERRIDE_SRCDIR.
> 
> > As for modifying the local.mk file to put some LINUX_OVERRIDE_SRCDIR
> > value inside, I want to avoid it because it would force me to version
> > the local.mk file for things to work out-of-the-box. Versionning this
> > file is problematic because developers needing to modify it
> > temporarily may commit it by error.
> 
> Here is what you could do:
> 
>  - Set BR2_PACKAGE_OVERRIDE_FILE to point to whatever file you like
>    instead of local.mk, say package-overrides.mk.
> 
>  - In this file, you set LINUX_OVERRIDE_SRCDIR as appropriate, but you
>    also do
> 
>    -include local.mk
> 
> And then you version control package-overrides.mk. Then your developer
> can continue locally to tinker with local.mk to have their own custom
> OVERRIDE_SRCDIR, and still have LINUX_OVERRIDE_SRCDIR used.

Exactly what I was going to suggest, e.g.:

    BR2_PACKAGE_OVERRIDE_FILE="$(TOPDIR)/package-overrides.mk"

which would contain something like:

    LINUX_OVERRIDE_SRCDIR="$(TOPDIR)/../sources/linux"
    -include local.mk

Obviously, you want this file to always be used, so you set it in your
defconfig files.

Alternatively, you can try to even be smart and snarky, and add a file
in your Buildroot tree, name 'GNUmakefile'. GNU make will favour using
that one if it is present, so you could do something like:

    $ cat GNUMakefile
    LINUX_OVERRIDE_SRCDIR="$(TOPDIR)/../sources/linux"
    include $(dir $(lastword $(MAKEFILE_LIST)))Makefile

This way, you do not even have to remember to set it in your defconfig
files. But this is really snarky.

> Alternatively, maybe we should decide that linux and u-boot are special
> packages, and just like for those packages we support fetching from
> custom tarballs and custom Git repositories, we should support fetching
> from custom local directories (this is what your patch implements, but
> until now, we have resisted going into this direction).

I would say we should not go that route, otherwise it would be difficult
to resist adding yet more exceptions, for people that have local "forks"
for some packages. And then it becomes a nightmare to maintain.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2018-11-07 18:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 10:06 [Buildroot] [PATCH 1/1] Added local directory as source of kernel code Nicolas Carrier
2018-11-07 13:57 ` Matthew Weber
2018-11-07 14:40   ` Nicolas Carrier
2018-11-07 16:44     ` Thomas Petazzoni
2018-11-07 17:08       ` Nicolas Carrier
2018-11-07 18:52       ` Yann E. MORIN [this message]
2018-11-07 21:26         ` Arnout Vandecappelle
2018-11-07 22:32           ` Yann E. MORIN
2018-11-08 10:07             ` Nicolas Carrier
2018-11-08 10:42           ` Thomas Petazzoni
2018-11-08 10:41         ` Thomas Petazzoni
2018-11-07 20:25 ` Arnout Vandecappelle
2018-11-09  7:37   ` Nicolas Carrier

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=20181107185226.GB4702@scaer \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox