Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jun 2016 14:08:27 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        "Simon J. Gerraty" <sjg@juniper.net>
Cc:        arch@freebsd.org
Subject:   Re: Build work 11.0 plans status update
Message-ID:  <84851e7b-60b9-b3dc-7410-45dc2b3ba1c1@FreeBSD.org>
In-Reply-To: <99714.1467316694@kaos.jnpr.net>
References:  <201605270001.u4R01mKT087678@repo.freebsd.org> <fb451ad5-da16-cdbe-6106-8b67705600b3@FreeBSD.org> <20160527182543.GB4025@FreeBSD.org> <0d639d52-3ed4-a86d-3d45-b93c02939ce7@FreeBSD.org> <99714.1467316694@kaos.jnpr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/30/16 12:58 PM, Simon J. Gerraty wrote:
> Bryan Drewery <bdrewery@freebsd.org> wrote:
>>   3. Default AUTO_OBJ in subdirs.  This one is kind of tricky and need=
s
>>      some more thought.  Non-root especially may be problematic since
>>      it will try to write to /usr/obj by default.  I likely will hold
>>      off on this and not propose it for 11.0.
>=20
> Surely this can be made dependent on writability of OBJROOT (/usr/obj/)=
?
>=20

Maybe.  I'd rather not introduce something like this since it is invoked
from sys.mk.  I really hate adding more executions.  To bad there is no
make writable() function...

<MAKEOBJDIR / OBJROOT / OBJTOP determined here>

CAN_WRITE!=3D test -w ${MAKEOBJDIR} && echo 1 || echo 0
# The above test is not really enough either since we want to test every
component of the directory which is what mkdir -p is already doing in
auto.obj.mk...
.if ${CAN_WRITE} =3D=3D 1
__DEFAULT_YES_OPTIONS+=3D AUTO_OBJ
.endif

.include <bsd.mkopt.mk>

.if ${MK_AUTO_OBJ} =3D=3D "yes"
.include <auto.obj.mk>
.endif


What seems more efficient to me is to default AUTO_OBJ to on and then
have auto.obj.mk consider an EPERM to just disable the feature for some
cases.  The 'for some cases' is where it becomes murky since we want to
force auto obj on for things like buildworld/DIRDEPS regardless of
writability as those should error and stop.  Building a user or in a
subdir (not DIRDEPS) may be fine to ignore the EPERM and build in source
tree since that's a historical behavior.

--=20
Regards,
Bryan Drewery



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84851e7b-60b9-b3dc-7410-45dc2b3ba1c1>