From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
mmayer@broadcom.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [RFC] linux: Make CONFIG_LOCALVERSION_AUTO work with OVERRIDE_SRCDIR
Date: Mon, 18 Jul 2022 22:21:03 +0200 [thread overview]
Message-ID: <20220718202103.GD2249625@scaer> (raw)
In-Reply-To: <20220718150145.4867a519@windsurf>
Florian, Thomas, All,
On 2022-07-18 15:01 +0200, Thomas Petazzoni via buildroot spake thusly:
> On Wed, 6 Jul 2022 14:06:21 -0700
> Florian Fainelli <f.fainelli@gmail.com> wrote:
> > Linux is able to generate an automic version based upon the git tree
> > that is being used which is very useful for making sure that the kernel
> > being used is truly the one that we intend to be using.
> >
> > When using LINUX_OVERRIDE_SRCDIR however, since we do not rsync the .git
> > folder, all of the necessary information for scripts/setlocalversion to
> > compute the exact version and git commit id is lost.
> >
> > Add a post rsync hook that copies it over in order to allow 'git
> > rev-parse' to work and produce an usable version.
> >
> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>
> Thanks for your patch. What bothers me is that it is a Linux-specific
> solution for a problem that isn't Linux-specific. Many other packages
> also use Git commands to generate a version string that they embed in
> their binaries. So this problem really is global and I'm not sure we
> want a Linux-specific fixup for it.
Indeed.
> To me the long term solution is to enable out of tree build of
> packages. This way, instead of rsync'ing the code, we would directly
> build it from its original location. Some initial work was done in this
> area, but it's obviously a much larger endeavor than the fixup you are
> proposing. A more immediate alternative would be to also rsync the .git
> folder instead of excluding it, but do that globally for all packages
> that use override-srcdir. The .git directory was explicitly excluded to
> reduce the amount of data to rsync.
And in any case, it is still possible to hack this for now:
- set LINUX_OVERRIDE_SRC_DIR in your local.mk
- define the post-rsync hook there as well
Note: it is usualy possible to add the hook in local.mk, but it is
fragile: if the package itself uses post-rsync hooks, but its first
assignment is not an append-assignment +=, then your hook in local.mk is
ignored. In practice, we have no package [*] that uses post-rsync hooks,
so it shoiuld be safe to do define one in local.mk.
[*] of course, there is one exception: uboot, and I wonder if we should
not have a better solution nowadays.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-07-18 20:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 21:06 [Buildroot] [RFC] linux: Make CONFIG_LOCALVERSION_AUTO work with OVERRIDE_SRCDIR Florian Fainelli
2022-07-18 13:01 ` Thomas Petazzoni via buildroot
2022-07-18 20:21 ` Yann E. MORIN [this message]
2022-07-18 23:05 ` Florian Fainelli
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=20220718202103.GD2249625@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=f.fainelli@gmail.com \
--cc=mmayer@broadcom.com \
--cc=thomas.petazzoni@bootlin.com \
/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.