Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2025 03:06:29 -0700
From:      Kevin Bowling <kevin.bowling@kev009.com>
To:        =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: dd8c666d8b78 - main - src.sys.mk: Support src.conf in SRCTOP
Message-ID:  <CAK7dMtA9fjiT8xAgaQFNRzLnqHun=Aq-HZYaEKhWiCRy--Gq%2Bw@mail.gmail.com>
In-Reply-To: <202509101658.58AGwlFE061466@gitrepo.freebsd.org>
References:  <202509101658.58AGwlFE061466@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This turned out to be surprising and led to a puzzle and potentially
unbootable system.  I had a very bare bones src.conf in the root from
a long time ago for MIPS hacking, and it got used as my src.conf after
this commit instead of /etc/src.conf.

I think the order should probably be inverted for POLA, keeping
/etc/src.conf as the primary.

It would also be nice to know the "why?" of this change in the commit
message, it only describes "what".

Regards,
Kevin

On Wed, Sep 10, 2025 at 9:58=E2=80=AFAM Dag-Erling Sm=C3=B8rgrav <des@freeb=
sd.org> wrote:
>
> The branch main has been updated by des:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Ddd8c666d8b78f6b9ddb691f050=
5837fa885ff3b4
>
> commit dd8c666d8b78f6b9ddb691f0505837fa885ff3b4
> Author:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> AuthorDate: 2025-09-10 16:57:26 +0000
> Commit:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> CommitDate: 2025-09-10 16:58:30 +0000
>
>     src.sys.mk: Support src.conf in SRCTOP
>
>     If SRCCONF is not defined and src.conf exists at the top level of the
>     source tree, use that instead of /etc/src.conf.
>
>     MFC after:      3 days
>     Reviewed by:    kevans, imp
>     Differential Revision:  https://reviews.freebsd.org/D52470
> ---
>  .gitignore                  | 1 +
>  share/man/man5/src.conf.5   | 9 ++++++---
>  share/mk/src.sys.mk         | 4 ++++
>  sys/conf/kern.pre.mk        | 4 ++++
>  tools/build/options/makeman | 7 +++++--
>  5 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index 3ed711f301ac..a53a26f16d4f 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -29,3 +29,4 @@ tags
>  .clangd
>  .ccls-cache
>  sys/*/compile
> +/src.conf
> diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
> index 2895c0cf4746..a1abbcbda01e 100644
> --- a/share/man/man5/src.conf.5
> +++ b/share/man/man5/src.conf.5
> @@ -1,5 +1,5 @@
>  .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman=
.
> -.Dd August 20, 2025
> +.Dd September 10, 2025
>  .Dt SRC.CONF 5
>  .Os
>  .Sh NAME
> @@ -29,8 +29,11 @@ variables that control the aspects of how the system b=
uilds.
>  .Pp
>  The default location of
>  .Nm
> -is
> -.Pa /etc/src.conf ,
> +is the top level of the source tree, or
> +.Pa /etc/src.conf
> +if no
> +.Nm
> +is found in the source tree itself,
>  though an alternative location can be specified in the
>  .Xr make 1
>  variable
> diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
> index 2b9fc255a26d..ec035fb71e54 100644
> --- a/share/mk/src.sys.mk
> +++ b/share/mk/src.sys.mk
> @@ -6,7 +6,11 @@
>
>  .if !defined(_WITHOUT_SRCCONF)
>  # Allow user to configure things that only effect src tree builds.
> +.if exists(${SRCTOP}/src.conf)
> +SRCCONF?=3D      ${SRCTOP}/src.conf
> +.else
>  SRCCONF?=3D      /etc/src.conf
> +.endif
>  .if !empty(SRCCONF) && \
>      (exists(${SRCCONF}) || ${SRCCONF} !=3D "/etc/src.conf") && \
>      !target(_srcconf_included_)
> diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
> index 1fcfd6467e7f..0251486247da 100644
> --- a/sys/conf/kern.pre.mk
> +++ b/sys/conf/kern.pre.mk
> @@ -8,7 +8,11 @@
>  # the rest of /usr/src, but they still always process SRCCONF even thoug=
h
>  # the normal mechanisms to prevent that (compiling out of tree) won't
>  # work. To ensure they do work, we have to duplicate thee few lines here=
.
> +.if exists(${SRCTOP}/src.conf)
> +SRCCONF?=3D      ${SRCTOP}/src.conf
> +.else
>  SRCCONF?=3D      /etc/src.conf
> +.endif
>  .if (exists(${SRCCONF}) || ${SRCCONF} !=3D "/etc/src.conf") && !target(_=
srcconf_included_)
>  .include "${SRCCONF}"
>  _srcconf_included_:
> diff --git a/tools/build/options/makeman b/tools/build/options/makeman
> index ddd08443e61c..88ee5884d180 100755
> --- a/tools/build/options/makeman
> +++ b/tools/build/options/makeman
> @@ -222,8 +222,11 @@ variables that control the aspects of how the system=
 builds.
>  .Pp
>  The default location of
>  .Nm
> -is
> -.Pa /etc/src.conf ,
> +is the top level of the source tree, or
> +.Pa /etc/src.conf
> +if no
> +.Nm
> +is found in the source tree itself,
>  though an alternative location can be specified in the
>  .Xr make 1
>  variable



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAK7dMtA9fjiT8xAgaQFNRzLnqHun=Aq-HZYaEKhWiCRy--Gq%2Bw>