Page MenuHomeFreeBSD

Makefile.inc1: suppress user->root warning about unsafe .git ownership
AbandonedPublic

Authored by dch on Mar 11 2025, 12:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 10, 8:00 AM
Unknown Object (File)
Mon, Apr 7, 10:48 PM
Unknown Object (File)
Mon, Apr 7, 8:03 AM
Unknown Object (File)
Thu, Mar 27, 11:04 AM
Unknown Object (File)
Mar 20 2025, 2:52 AM
Unknown Object (File)
Mar 19 2025, 9:18 PM
Unknown Object (File)
Mar 14 2025, 5:08 AM
Unknown Object (File)
Mar 13 2025, 12:19 PM
Subscribers

Details

Summary

Björn reports:

make installworld runs git again but if build as user and owning the
files as user and installing as root that gives the obvious warning:

make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: 
Using cached toolchain metadata from build at lab-top on Mon Mar 10 
22:35:33 UTC 2025

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
make[1]: "/usr/src/Makefile.inc1" line 601: warning: Command 
"/usr/local/bin/git -C /usr/src show -s --format=%ct HEAD" exited with 
status 128
Test Plan

e.g.

root@wintermute /u/src# /usr/local/bin/git  -C /usr/src show -s --format=%ct 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
root@wintermute /u/src# /usr/local/bin/git -c safe.directory=/usr/src -C /usr/src show -s --format=%ct HEAD
1741695465
root@wintermute /u/src#

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62867
Build 59751: arc lint + arc unit

Event Timeline

dch requested review of this revision.Mar 11 2025, 12:18 PM
dch retitled this revision from Makefile.inc1: suppress user->root warning about unsafe .git permissions to Makefile.inc1: suppress user->root warning about unsafe .git ownership.Mar 11 2025, 12:19 PM
dch edited the summary of this revision. (Show Details)
dch added reviewers: bz, cperciva.
dch edited the test plan for this revision. (Show Details)

It looks like this predates db6f2bb93a9706963f66d270edb5ee62c37a9296; the message shouldn't be emitted for "normal" make installworld and the *package* targets shouldn't be run as root. I don't object to this change but it should not be necessary now.

jhb already dealt with this