Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Nov 2023 21:32:14 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>,  FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: revision not displayed in a2440348eed7
Message-ID:  <CANCZdfriQ8-pr=neV__G_ZWt%2BKF8-HR8cvi-C-7U5cWkthBefA@mail.gmail.com>
In-Reply-To: <20231108200308.4d51b67c@slippy>
References:  <202309260107.38Q17Vp0047265@kx.truefc.org> <bcb843e0-a2ca-18d9-70cd-cb702467c72a@aetern.org> <202309260629.38Q6T018051416@kx.truefc.org> <20230926181845.539e5816fbef80efda6162ec@dec.sakura.ne.jp> <202309261130.38QBUsLF053699@kx.truefc.org> <4c348f85-d99c-c7c3-5e1a-a435983b720b@plan-b.pwste.edu.pl> <20230926231431.20f42fec1075c3980446c50a@dec.sakura.ne.jp> <20230926221946.4F2C1623@slippy.cwsent.com> <20230927080723.f5157f938803c47a4185d431@dec.sakura.ne.jp> <1e2eb5a6-d728-efed-2b5d-b4a67ba9c861@plan-b.pwste.edu.pl> <14057457-119e-6bb1-ff00-a59cc9ad9680@plan-b.pwste.edu.pl> <20231108200308.4d51b67c@slippy>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Do you have WITHOUT_REPRODUCEABLE_BUILDS=YES in your src.conf?

Warner

On Wed, Nov 8, 2023, 9:03 PM Cy Schubert <Cy.Schubert@cschubert.com> wrote:

> On Wed, 8 Nov 2023 15:14:34 +0100
> Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> wrote:
>
> > W dniu 8.11.2023 o 14:10, Marek Zarychta pisze:
> > >
> > > W dniu 27.09.2023 o 01:07, Tomoaki AOKI pisze:
> > >> On Tue, 26 Sep 2023 15:19:46 -0700
> > >> Cy Schubert <Cy.Schubert@cschubert.com> wrote:
> > >>
> > >>> In message <20230926231431.20f42fec1075c3980446c50a@dec.sakura.ne.jp
> >,
> > >>> Tomoaki
> > >>> AOKI writes:
> > >>>> On Tue, 26 Sep 2023 15:48:50 +0200
> > >>>> Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> wrote:
> > >>>>
> > >>>>> W dniu 26.09.2023 o 13:30, KIRIYAMA Kazuhiko pisze:
> > >>>>>> At least up to 15.0-CURRENT, nothing has happend by
> > >>>>>> WITHOUT_REPRODUCIBLE_BUILD=yes. Something has changed in
> > >>>>>> 15.0-CURRENT at some time. I've rebuilded with 3fb80f1476c7,
> > >>>>>> but revision not showed by `uname -a' ;-(
> > >>>>>>
> > >>>>>> What changed ????
> > >>>>> Nothing changed. Perhaps your build system can't check git hash ?
> If
> > >>>>> your sources are from git repository, you need at least git-lite
> > >>>>> installed and full git repository available on build machine. If
> you
> > >>>>> checked out the repository with gitup and have gitup installed, it
> > >>>>> should also work. It won't work if your build machine has accessÂ
> to
> > >>>>> only a part of the repository like worktree.
> > >>>>>
> > >>>>> Cheers
> > >>>>>
> > >>>>> --
> > >>>>> Marek Zarychta
> > >>>> Just a possibility, but copying src tree to directory other than the
> > >>>> directory where checked out from git repo and building there could
> > >>>> lose track with git hash.
> > >>>>
> > >>>> Another possibility is that if you build src with any user other
> than
> > >>>> the one owning local (pulled) git repo could also lose track with
> git
> > >>>> hash. For example, if I `git log HEAD` with regular user and the
> local
> > >>>> repo is pulled by root, it fails. No special configuration is done.
> > >>>>
> > >>>> % git log HEAD
> > >>>> fatal: detected dubious ownership in repository at '/usr/src'
> > >>>> To add an exception for this directory, call:
> > >>>>
> > >>>>          git config --global --add safe.directory /usr/src
> > >>>>
> > >>>>
> > >>> This could be due to e6dc6a27230, which was committed this morning.
> > >>> There
> > >>> is discussion on the src commits ML (dev-commits-src-all,
> > >>> dev-commits-src-main) about reverting the change.
> > >>>
> > >>>
> > >>> --
> > >>> Cheers,
> > >>> Cy Schubert <Cy.Schubert@cschubert.com>
> > >>> FreeBSD UNIX:  <cy@FreeBSD.org>   Web: https://FreeBSD.org
> > >>> NTP:           <cy@nwtime.org>    Web: https://nwtime.org
> > >>>
> > >>>             e^(i*pi)+1=0
> > >> Would be unrelated here, unfortunately.
> > >> As the subject says, the commit the original reporter is bitten at
> (not
> > >> bi-sected) is at a2440348eed7, which is before e6dc6a27230.
> > >
> > > Let's refresh this thread. It looks like (at least for stable/14)
> > > build system doesn't hardcode revision into the kernel anymore. Last
> > > time it worked to me was just after branching stable/14. Today I tried
> > > to build kernel from sources mounted over NFS and I ened with:
> > >
> > > # strings /usr/obj/usr/src/amd64.amd64/sys/BSDONDELL/kernel | grep
> > > 14.0-STABLE
> > > @(#)FreeBSD 14.0-STABLE #6 -dirty: Tue Nov  7 14:04:35 CET 2023
> > > FreeBSD 14.0-STABLE #6 -dirty: Tue Nov  7 14:04:35 CET 2023
> > > 14.0-STABLE
> > >
> > > the source repository is updated, consisted, but mounted read-only
> > > over NFS
> > >
> > > /usr/src# git status
> > > On branch stable/14
> > > Your branch is up to date with 'origin/stable/14'.
> > >
> > > Untracked files:
> > >   (use "git add <file>..." to include in what will be committed)
> > >         sys/amd64/conf/BSDONDELL
> > >
> > > It took 2.53 seconds to enumerate untracked files.
> > > See 'git help status' for information on how to improve this.
> > >
> > > nothing added to commit but untracked files present (use "git add" to
> > > track)
> > >
> > >
> > > Any clues what could be wrong ? Does /usr/src/  require write
> > > permissions now ?
> >
> >
> > I am sorry for the false alarm. It looks like using META MODE prevented
> > updating this info. After cleaning obj dir and rebuilding revision is
> > visible:
> > # strings /usr/obj/usr/src/amd64.amd64/sys/BSDONDELL/kernel | grep
> > 14.0-STABLE
> > @(#)FreeBSD 14.0-STABLE #0 stable/14-n265707-d2c65a1c9486: Wed Nov  8
> > 14:16:31 CET 2023
> > FreeBSD 14.0-STABLE #0 stable/14-n265707-d2c65a1c9486: Wed Nov  8
> > 14:16:31 CET 2023
> >
>
> sys/conf/newvers.sh is responsible for getting the git hash into the
> kernel. If it finds a .git directory it will extract the hash to insert
> it into the kernel.
>
> I suspect there is something about your source tree that causes it to
> think there is no .git directory. In sys/conf/newvers.sh you will see
> where it sets $git_cmd when a .git directory exists. It subsequently
> tests for a non-zero $git_cmd string whereby it extracts the git hash.
>
> You might want to look through newvers.sh. Understanding what it does
> might point you to the cause of your problem, should it be that your
> tree is missing a .git directory or if your .git directory isn't quite
> right.
>
> That's the hypothesis ATM.
>
> --
> Cheers,
> Cy Schubert <Cy.Schubert@cschubert.com>
> FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
> NTP:           <cy@nwtime.org>    Web:  https://nwtime.org
>
>                         e^(i*pi)+1=0
>
>

[-- Attachment #2 --]
<div dir="auto">Do you have WITHOUT_REPRODUCEABLE_BUILDS=YES in your src.conf?<div dir="auto"><br></div><div dir="auto">Warner</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 8, 2023, 9:03 PM Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com">Cy.Schubert@cschubert.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, 8 Nov 2023 15:14:34 +0100<br>
Marek Zarychta &lt;<a href="mailto:zarychtam@plan-b.pwste.edu.pl" target="_blank" rel="noreferrer">zarychtam@plan-b.pwste.edu.pl</a>&gt; wrote:<br>
<br>
&gt; W dniu 8.11.2023 o 14:10, Marek Zarychta pisze:<br>
&gt; &gt;<br>
&gt; &gt; W dniu 27.09.2023 o 01:07, Tomoaki AOKI pisze:  <br>
&gt; &gt;&gt; On Tue, 26 Sep 2023 15:19:46 -0700<br>
&gt; &gt;&gt; Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com" target="_blank" rel="noreferrer">Cy.Schubert@cschubert.com</a>&gt; wrote:<br>
&gt; &gt;&gt;  <br>
&gt; &gt;&gt;&gt; In message &lt;<a href="mailto:20230926231431.20f42fec1075c3980446c50a@dec.sakura.ne.jp" target="_blank" rel="noreferrer">20230926231431.20f42fec1075c3980446c50a@dec.sakura.ne.jp</a>&gt;,<br>
&gt; &gt;&gt;&gt; Tomoaki<br>
&gt; &gt;&gt;&gt; AOKI writes:  <br>
&gt; &gt;&gt;&gt;&gt; On Tue, 26 Sep 2023 15:48:50 +0200<br>
&gt; &gt;&gt;&gt;&gt; Marek Zarychta &lt;<a href="mailto:zarychtam@plan-b.pwste.edu.pl" target="_blank" rel="noreferrer">zarychtam@plan-b.pwste.edu.pl</a>&gt; wrote:<br>
&gt; &gt;&gt;&gt;&gt;  <br>
&gt; &gt;&gt;&gt;&gt;&gt; W dniu 26.09.2023 o 13:30, KIRIYAMA Kazuhiko pisze:  <br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; At least up to 15.0-CURRENT, nothing has happend by<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; WITHOUT_REPRODUCIBLE_BUILD=yes. Something has changed in<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; 15.0-CURRENT at some time. I&#39;ve rebuilded with 3fb80f1476c7,<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; but revision not showed by `uname -a&#39; ;-(<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt;&gt; What changed ????  <br>
&gt; &gt;&gt;&gt;&gt;&gt; Nothing changed. Perhaps your build system can&#39;t check git hash ? If<br>
&gt; &gt;&gt;&gt;&gt;&gt; your sources are from git repository, you need at least git-lite<br>
&gt; &gt;&gt;&gt;&gt;&gt; installed and full git repository available on build machine. If you<br>
&gt; &gt;&gt;&gt;&gt;&gt; checked out the repository with gitup and have gitup installed, it<br>
&gt; &gt;&gt;&gt;&gt;&gt; should also work. It won&#39;t work if your build machine has access  to<br>
&gt; &gt;&gt;&gt;&gt;&gt; only a part of the repository like worktree.<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; Cheers<br>
&gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;&gt; -- <br>
&gt; &gt;&gt;&gt;&gt;&gt; Marek Zarychta  <br>
&gt; &gt;&gt;&gt;&gt; Just a possibility, but copying src tree to directory other than the<br>
&gt; &gt;&gt;&gt;&gt; directory where checked out from git repo and building there could<br>
&gt; &gt;&gt;&gt;&gt; lose track with git hash.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Another possibility is that if you build src with any user other than<br>
&gt; &gt;&gt;&gt;&gt; the one owning local (pulled) git repo could also lose track with git<br>
&gt; &gt;&gt;&gt;&gt; hash. For example, if I `git log HEAD` with regular user and the local<br>
&gt; &gt;&gt;&gt;&gt; repo is pulled by root, it fails. No special configuration is done.<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; % git log HEAD<br>
&gt; &gt;&gt;&gt;&gt; fatal: detected dubious ownership in repository at &#39;/usr/src&#39;<br>
&gt; &gt;&gt;&gt;&gt; To add an exception for this directory, call:<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;          git config --global --add safe.directory /usr/src<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;  <br>
&gt; &gt;&gt;&gt; This could be due to e6dc6a27230, which was committed this morning. <br>
&gt; &gt;&gt;&gt; There<br>
&gt; &gt;&gt;&gt; is discussion on the src commits ML (dev-commits-src-all,<br>
&gt; &gt;&gt;&gt; dev-commits-src-main) about reverting the change.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; -- <br>
&gt; &gt;&gt;&gt; Cheers,<br>
&gt; &gt;&gt;&gt; Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com" target="_blank" rel="noreferrer">Cy.Schubert@cschubert.com</a>&gt;<br>
&gt; &gt;&gt;&gt; FreeBSD UNIX:  &lt;cy@FreeBSD.org&gt;   Web: <a href="https://FreeBSD.org" rel="noreferrer noreferrer" target="_blank">https://FreeBSD.org</a><br>;
&gt; &gt;&gt;&gt; NTP:           &lt;<a href="mailto:cy@nwtime.org" target="_blank" rel="noreferrer">cy@nwtime.org</a>&gt;    Web: <a href="https://nwtime.org" rel="noreferrer noreferrer" target="_blank">https://nwtime.org</a><br>;
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;             e^(i*pi)+1=0  <br>
&gt; &gt;&gt; Would be unrelated here, unfortunately.<br>
&gt; &gt;&gt; As the subject says, the commit the original reporter is bitten at (not<br>
&gt; &gt;&gt; bi-sected) is at a2440348eed7, which is before e6dc6a27230.  <br>
&gt; &gt;<br>
&gt; &gt; Let&#39;s refresh this thread. It looks like (at least for stable/14) <br>
&gt; &gt; build system doesn&#39;t hardcode revision into the kernel anymore. Last <br>
&gt; &gt; time it worked to me was just after branching stable/14. Today I tried <br>
&gt; &gt; to build kernel from sources mounted over NFS and I ened with:<br>
&gt; &gt;<br>
&gt; &gt; # strings /usr/obj/usr/src/amd64.amd64/sys/BSDONDELL/kernel | grep <br>
&gt; &gt; 14.0-STABLE<br>
&gt; &gt; @(#)FreeBSD 14.0-STABLE #6 -dirty: Tue Nov  7 14:04:35 CET 2023<br>
&gt; &gt; FreeBSD 14.0-STABLE #6 -dirty: Tue Nov  7 14:04:35 CET 2023<br>
&gt; &gt; 14.0-STABLE<br>
&gt; &gt;<br>
&gt; &gt; the source repository is updated, consisted, but mounted read-only <br>
&gt; &gt; over NFS<br>
&gt; &gt;<br>
&gt; &gt; /usr/src# git status<br>
&gt; &gt; On branch stable/14<br>
&gt; &gt; Your branch is up to date with &#39;origin/stable/14&#39;.<br>
&gt; &gt;<br>
&gt; &gt; Untracked files:<br>
&gt; &gt;   (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)<br>
&gt; &gt;         sys/amd64/conf/BSDONDELL<br>
&gt; &gt;<br>
&gt; &gt; It took 2.53 seconds to enumerate untracked files.<br>
&gt; &gt; See &#39;git help status&#39; for information on how to improve this.<br>
&gt; &gt;<br>
&gt; &gt; nothing added to commit but untracked files present (use &quot;git add&quot; to <br>
&gt; &gt; track)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Any clues what could be wrong ? Does /usr/src/  require write <br>
&gt; &gt; permissions now ?  <br>
&gt; <br>
&gt; <br>
&gt; I am sorry for the false alarm. It looks like using META MODE prevented <br>
&gt; updating this info. After cleaning obj dir and rebuilding revision is <br>
&gt; visible:<br>
&gt; # strings /usr/obj/usr/src/amd64.amd64/sys/BSDONDELL/kernel | grep <br>
&gt; 14.0-STABLE<br>
&gt; @(#)FreeBSD 14.0-STABLE #0 stable/14-n265707-d2c65a1c9486: Wed Nov  8 <br>
&gt; 14:16:31 CET 2023<br>
&gt; FreeBSD 14.0-STABLE #0 stable/14-n265707-d2c65a1c9486: Wed Nov  8 <br>
&gt; 14:16:31 CET 2023<br>
&gt; <br>
<br>
sys/conf/newvers.sh is responsible for getting the git hash into the<br>
kernel. If it finds a .git directory it will extract the hash to insert<br>
it into the kernel.<br>
<br>
I suspect there is something about your source tree that causes it to<br>
think there is no .git directory. In sys/conf/newvers.sh you will see<br>
where it sets $git_cmd when a .git directory exists. It subsequently<br>
tests for a non-zero $git_cmd string whereby it extracts the git hash.<br>
<br>
You might want to look through newvers.sh. Understanding what it does<br>
might point you to the cause of your problem, should it be that your<br>
tree is missing a .git directory or if your .git directory isn&#39;t quite<br>
right.<br>
<br>
That&#39;s the hypothesis ATM.<br>
<br>
-- <br>
Cheers,<br>
Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com" target="_blank" rel="noreferrer">Cy.Schubert@cschubert.com</a>&gt;<br>
FreeBSD UNIX:  &lt;cy@FreeBSD.org&gt;   Web:  <a href="https://FreeBSD.org" rel="noreferrer noreferrer" target="_blank">https://FreeBSD.org</a><br>;
NTP:           &lt;<a href="mailto:cy@nwtime.org" target="_blank" rel="noreferrer">cy@nwtime.org</a>&gt;    Web:  <a href="https://nwtime.org" rel="noreferrer noreferrer" target="_blank">https://nwtime.org</a><br>;
<br>
                        e^(i*pi)+1=0<br>
<br>
</blockquote></div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfriQ8-pr=neV__G_ZWt%2BKF8-HR8cvi-C-7U5cWkthBefA>