devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Gnau <andreas.gnau@iopsys.eu>
To: "david@gibson.dropbear.id.au" <david@gibson.dropbear.id.au>,
	Anthony Ortega <anthony.ortega@terranorbital.com>
Cc: "devicetree-compiler@vger.kernel.org"
	<devicetree-compiler@vger.kernel.org>
Subject: Re: DTC Version and Reproducible Builds
Date: Mon, 23 Sep 2024 12:46:20 +0200	[thread overview]
Message-ID: <58d4594d-ef04-4b3f-9a4e-f97fa37c1827@iopsys.eu> (raw)
In-Reply-To: <Zu1XAFqbtWnDcOmR@zatzit.fritz.box>

On Mon, Sep 16, 2024 at 07:51:31PM +0000, Anthony Ortega wrote:
 > I am trying to generate reproducible builds for a Linux environment
 > using Buildroot. One of the last packages that is giving me trouble
 > is the DTC programs.
 > [...]
 > They all seem to intend to encode the git
 > version of the package they were pulled from. However, in a build
 > system such as Buildroot the DTC source is staged in such a way that
 > the git information is stripped away. While that in of itself is not
 > a problem, the problem is that it may be getting built in an output
 > directory that is within a larger git repository. Therefore, when
 > the setlocalversion script runs, it ends up pulling the version of
 > this larger git repository.

Yocto/OpenEmbedded[1] and OpenWrt[2] avoid such issues by setting 
GIT_CEILING_DIRECTORIES. Maybe buildroot could do the same and fix it 
for all packages, not just dtc tools?

[1] 
https://git.openembedded.org/openembedded-core/tree/meta/conf/bitbake.conf?id=bb3101fffceacfa4c021c33affb7c785da8d859f#n788

[2] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=include/package.mk;h=7fbecf98dc7c9a5b11ce1958e254578f7e4d9c73;hb=7850e197670afff38426075953ba6a71f0f431c8#l202

On 2024-09-20 13:05, david@gibson.dropbear.id.au wrote:
 > Unfortunately, I don't think our system can be configured to use
 > meson without a massive overhaul. In the short term I've applied a
 > patch in our build that removes the line that grabs the commit tag
 > during build.

On Thu, Sep 19, 2024 at 09:45:04PM +0000, Anthony Ortega wrote:
 > But, in any case, I wasn't suggesting this as a practical workaround,
 > but more as a diagnostic.  If it works with meson we can look closer
 > at what it's doing and maybe duplicate it with make.

I do not know what other projects do, but most likely those that do not 
exhibit this issue, set the git-dir explicitly (or use GIT_CEILING_DIRS) 
to avoid git taking some repository above the source directory.

I still think as a first thing, buildroot should implement a generic 
solution and then we can look into fixing dtc and tools.

Regards, Andreas

  reply	other threads:[~2024-09-23 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <PH1P110MB15070467257B855EE1B1BB008B60A@PH1P110MB1507.NAMP110.PROD.OUTLOOK.COM>
2024-09-18  2:48 ` DTC Version and Reproducible Builds david
2024-09-19 21:45   ` Anthony Ortega
2024-09-20 11:05     ` david
2024-09-23 10:46       ` Andreas Gnau [this message]
2024-09-24 11:10         ` david

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=58d4594d-ef04-4b3f-9a4e-f97fa37c1827@iopsys.eu \
    --to=andreas.gnau@iopsys.eu \
    --cc=anthony.ortega@terranorbital.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).