Bug 233265 - 'make -V MAKEOBJDIRPREFIX' at the top of base source tree doesn't work if value of MAKEOBJDIRPREFIX is customized
Summary: 'make -V MAKEOBJDIRPREFIX' at the top of base source tree doesn't work if val...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-17 00:39 UTC by Yasuhiro KIMURA
Modified: 2018-11-19 08:34 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro KIMURA 2018-11-17 00:39:02 UTC
I'm writing shell script to build and install base system from source and -V option of make(1) is used in it to get value of MAKEOBJDIRPREFIX.

By default it works fine with all of head, releng/11.2, releng/12.0, stable/11 and stable/12.

----------------------------------------------------------------------
yasu@eastasia[2389]% svn info /usr0/freebsd/base/head
Path: /usr0/freebsd/base/head
Working Copy Root Path: /usr0/freebsd/base/head
URL: https://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 340474
Node Kind: directory
Schedule: normal
Last Changed Author: karels
Last Changed Rev: 340474
Last Changed Date: 2018-11-16 12:42:29 +0900 (Fri, 16 Nov 2018)

yasu@eastasia[2390]% make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/head
/usr/obj
yasu@eastasia[2391]% svn info /usr0/freebsd/base/releng/11.2
Path: /usr0/freebsd/base/releng/11.2
Working Copy Root Path: /usr0/freebsd/base/releng/11.2
URL: https://svn.freebsd.org/base/releng/11.2
Relative URL: ^/releng/11.2
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 338990
Node Kind: directory
Schedule: normal
Last Changed Author: gordon
Last Changed Rev: 338981
Last Changed Date: 2018-09-28 03:36:30 +0900 (Fri, 28 Sep 2018)

yasu@eastasia[2392]% make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/releng/11.2
/usr/obj
yasu@eastasia[2393]% svn info /usr0/freebsd/base/releng/12.0
Path: /usr0/freebsd/base/releng/12.0
Working Copy Root Path: /usr0/freebsd/base/releng/12.0
URL: https://svn.freebsd.org/base/releng/12.0
Relative URL: ^/releng/12.0
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 340471
Node Kind: directory
Schedule: normal
Last Changed Author: gjb
Last Changed Rev: 340470
Last Changed Date: 2018-11-16 09:00:59 +0900 (Fri, 16 Nov 2018)

yasu@eastasia[2394]% make -C /usr0/freebsd/base/releng/12.0 -V MAKEOBJDIRPREFIX
/usr/obj
yasu@eastasia[2395]% svn info /usr0/freebsd/base/stable/11
Path: /usr0/freebsd/base/stable/11
Working Copy Root Path: /usr0/freebsd/base/stable/11
URL: https://svn.freebsd.org/base/stable/11
Relative URL: ^/stable/11
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 340473
Node Kind: directory
Schedule: normal
Last Changed Author: ygy
Last Changed Rev: 340449
Last Changed Date: 2018-11-15 17:43:17 +0900 (Thu, 15 Nov 2018)

yasu@eastasia[2396]% make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/stable/11
/usr/obj
yasu@eastasia[2397]% svn info /usr0/freebsd/base/stable/12
Path: /usr0/freebsd/base/stable/12
Working Copy Root Path: /usr0/freebsd/base/stable/12
URL: https://svn.freebsd.org/base/stable/12
Relative URL: ^/stable/12
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 340474
Node Kind: directory
Schedule: normal
Last Changed Author: gjb
Last Changed Rev: 340471
Last Changed Date: 2018-11-16 09:03:31 +0900 (Fri, 16 Nov 2018)

yasu@eastasia[2398]% make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/stable/12
/usr/obj
----------------------------------------------------------------------

But if I customize value of MAKEOBJDIRPREFIX then it still works with releng/11.2 and stable/11 but doesn't with head, releng/12.0 and stable/12.

----------------------------------------------------------------------
yasu@eastasia[2399]% env MAKEOBJDIRPREFIX=/usr0/freebsd/base/ogj make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/head

yasu@eastasia[2400]% env MAKEOBJDIRPREFIX=/usr0/freebsd/base/ogj make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/releng/11.2
/usr0/freebsd/base/ogj
yasu@eastasia[2401]% env MAKEOBJDIRPREFIX=/usr0/freebsd/base/ogj make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/releng/12.0

yasu@eastasia[2402]% env MAKEOBJDIRPREFIX=/usr0/freebsd/base/ogj make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/stable/11
/usr0/freebsd/base/ogj
yasu@eastasia[2403]% env MAKEOBJDIRPREFIX=/usr0/freebsd/base/ogj make -V MAKEOBJDIRPREFIX -C /usr0/freebsd/base/stable/12

yasu@eastasia[2404]%
----------------------------------------------------------------------

I used env(1) to customize but I got same results when I use src-env.conf.

To find when behavior changed I bisected head from base r302408 (revision that stable/11 is cleated) to base r340439 and got following result.

Order	Revision	Does 'make -V MAKEOBJDIRPREFIX` work?
----------------------------------------------------------------------
1	302408		Yes		
2	340439		No
3	323176		Yes
4	332305		No
5	327441		No
6	325415		No
7	324362		Yes
8	324940		Yes
9	325181		Yes
10	325295		No
11	325248		Yes
12	325271		Yes
13	325285		Yes
14	325290		No
15	325288		No
16	325287		Yes

That is, behavior changed at base r325288. And commit message says as following.

----------------------------------------------------------------------
Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>.  This
new format is used regardless of cross or native build.  It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.
----------------------------------------------------------------------

As far as I read this, behavior change of 'make -V MAKEOBJDIRPREFIX` doesn't seem intentional. So I decided to submit this bug report.

Add committer of base r325288 to CC list.