From nobody Thu Nov 09 05:44:51 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SQrWg0RKhz500w1 for ; Thu, 9 Nov 2023 05:45:03 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Received: from plan-b.pwste.edu.pl (plan-b.pwste.edu.pl [IPv6:2001:678:618::40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "plan-b.pwste.edu.pl", Issuer "GEANT OV RSA CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SQrWd3yZBz4THm for ; Thu, 9 Nov 2023 05:45:00 +0000 (UTC) (envelope-from zarychtam@plan-b.pwste.edu.pl) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=plan-b.pwste.edu.pl header.s=plan-b-mailer header.b="m9me/1/P"; spf=none (mx1.freebsd.org: domain of zarychtam@plan-b.pwste.edu.pl has no SPF policy when checking 2001:678:618::40) smtp.mailfrom=zarychtam@plan-b.pwste.edu.pl; dmarc=pass (policy=none) header.from=plan-b.pwste.edu.pl Received: from [IPV6:2a02:22e0:cf00:1ff:670b:7c3b:d2b4:4fc8] (mzar@[IPv6:2a02:22e0:cf00:1ff:670b:7c3b:d2b4:4fc8]) (authenticated bits=0) by plan-b.pwste.edu.pl (8.17.2/8.17.2) with ESMTPSA id 3A95irD8085897 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Thu, 9 Nov 2023 06:44:53 +0100 (CET) (envelope-from zarychtam@plan-b.pwste.edu.pl) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=plan-b.pwste.edu.pl; s=plan-b-mailer; t=1699508695; bh=ZQH1lwXkp1fyF2yBU7BhJZATmZC468p4opFaBAz9AVM=; h=Date:To:References:From:Subject:In-Reply-To; b=m9me/1/PvIYBGALRyhgaU+Mlu/3TlgvlJhH8AqRUW/pp9KKtwhStRK5BgPaMyDVqk 6BpM2DGkNVOamYoX2004PsfvTUtC9StkWR2aFeM92BSWWKaoNBB7C/yVfYiooRNJ0B pNkd5m5CW5XYGWp6YMv3XnRIdhvOfdN9KKS3iIbDF7JpK1Uh3b0fJ3hkeRjlCtb7d5 G1yNIRvJQsPjq0VP2BwSXUmz5zdyEujKOBitWBWWn6jTvuZQbnvfX2SpyoKtEEvkTB 04Th1oLGBRCeaMh+v5j2QaNLoeMzGKpSS/YQubJJOqgsG2Bz5e8Jhz6GP+Q0EV6np9 PX5KRgw4cFxNQ== Content-Type: multipart/alternative; boundary="------------KDURBFP6o46I0B68GSj5yvpI" Message-ID: <6de97ce0-9371-5471-31b3-215a7b56c549@plan-b.pwste.edu.pl> Date: Thu, 9 Nov 2023 06:44:51 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: freebsd-current@freebsd.org References: <202309260107.38Q17Vp0047265@kx.truefc.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> Content-Language: en-US From: Marek Zarychta Subject: Re: revision not displayed in a2440348eed7 In-Reply-To: X-Spamd-Result: default: False [-3.70 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[plan-b.pwste.edu.pl,none]; R_DKIM_ALLOW(-0.20)[plan-b.pwste.edu.pl:s=plan-b-mailer]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ONCE_RECEIVED(0.10)[]; ASN(0.00)[asn:206006, ipnet:2001:678:618::/48, country:PL]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[plan-b.pwste.edu.pl:+]; R_SPF_NA(0.00)[no SPF record]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 4SQrWd3yZBz4THm X-Spamd-Bar: --- This is a multi-part message in MIME format. --------------KDURBFP6o46I0B68GSj5yvpI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit W dniu 9.11.2023 o 05:32, Warner Losh pisze: > Do you have WITHOUT_REPRODUCEABLE_BUILDS=YES in your src.conf? > Yes,  I have it. > Warner > > On Wed, Nov 8, 2023, 9:03 PM Cy Schubert > wrote: > > On Wed, 8 Nov 2023 15:14:34 +0100 > Marek Zarychta 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 wrote: > > >> > > >>> In message > <20230926231431.20f42fec1075c3980446c50a@dec.sakura.ne.jp>, > > >>> Tomoaki > > >>> AOKI writes: > > >>>> On Tue, 26 Sep 2023 15:48:50 +0200 > > >>>> Marek Zarychta 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 > > >>> FreeBSD UNIX:    Web: https://FreeBSD.org > > > >>> NTP:           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 ..." 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. > Thank you for the clue. The error was temporary only, due to not mounting /usr/src_head which holds the repository but mounting only workdir /usr/src_14 newvers.sh wasn't able to check git hash. Cleanup, mounting again both directories and rebuilding the kernel solved the problem. > -- > Cheers, > Cy Schubert > FreeBSD UNIX:    Web: https://FreeBSD.org > > NTP:               Web: https://nwtime.org > >                         e^(i*pi)+1=0 > Thank you for your help. -- Marek Zarychta --------------KDURBFP6o46I0B68GSj5yvpI Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
W dniu 9.11.2023 o 05:32, Warner Losh pisze:
Do you have WITHOUT_REPRODUCEABLE_BUILDS=YES in your src.conf?

Yes,  I have it.
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.

Thank you for the clue. The error was temporary only, due to not mounting /usr/src_head which holds the repository but mounting only workdir /usr/src_14 newvers.sh wasn't able to check git hash. Cleanup, mounting again both directories and rebuilding the kernel solved the problem.

--
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

Thank you for your help.

-- 
Marek Zarychta
--------------KDURBFP6o46I0B68GSj5yvpI--