Build work 11.0 plans status update
Simon J. Gerraty
sjg at juniper.net
Fri Jul 1 08:58:56 UTC 2016
Bryan Drewery <bdrewery at freebsd.org> wrote:
> 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
Yes but you need only do it once - ie. if .MAKE.LEVEL==0
the result isn't going to change.
.if ${.MAKE.LEVEL} == 0
x != test -w ${OBJROOT:U${MAKEOBJDIRPREFIX:U/usr/obj}}/.; echo $$?
if ${x} != 0 && defined(WITH_AUTO_OBJ)
# they explicitly asked for it and we cannot do it
.error cannot write ${OBJROOT:U${MAKEOBJDIRPREFIX:U/usr/obj}} fix that or set WITHOUT_AUTO_OBJ
.endif
.endif
> # 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 you are allowed to write /usr/obj/.
you should be able to write anything below it.
Of course using a OBJROOT private to the tree, avoids such problems.
SRCTOP=/some/where/src
OBJROOT=/some/where/obj
which is what we use....
> 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.
auto.obj.mk will already throw an error if it cannot do what it was
asked to.
I like brutal simplicity.
That is much safer than soldiering on dribbling all over src for an hour
when that is not what the user wanted.
More information about the freebsd-arch
mailing list