Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-20 Thread Navdeep Parhar
On Sun, Jul 19, 2015 at 11:05:48PM -0700, Don Lewis wrote:
> On 19 Jul, O'Connor, Daniel wrote:
> > 
> >> On 19 Jul 2015, at 02:56, Simon J. Gerraty  wrote:
> >> 
> >> O'Connor, Daniel  wrote:
> >>> However, Crochet _does_ build on the NFS client _and_ when the
> >>> source tree isn't in /usr/src which makes this issue very strange
> >>> :-/
> >> 
> >> I've seen similar errors in rescue... (no NFS) though I cannot 
> >> quite recall the cause other than it seems very sensitive
> >> to MAKEOBJDIRPREFIX value.
> > 
> > Yeah the subject is wrong (I just updated it).
> > 
> > I just did a build like so and it worked..
> > env MAKEOBJDIRPREFIX=/src/obj-amd64 make -j 8 buildworld
> > 
> > But this did not..
> > make -j 8 buildworld MAKEOBJDIRPREFIX=/src/obj-amd64
> > 
> > So, it seems MAKEOBJDIRPREFIX only works as an environmental variable
> > - I wonder if there is a way the make system can be changed to warn
> > about that?
> 
> At least it is documented in /usr/share/mk/bsd.obj.mk:
> 
> # MAKEOBJDIRPREFIX  Specifies somewhere other than /usr/obj to root the object
> #   tree.  Note: MAKEOBJDIRPREFIX is an *environment* variable
> #   and works properly only if set as an environment variable,
> #   not as a global or command line variable!
> #
> #   E.g. use `env MAKEOBJDIRPREFIX=/somewhere/obj make'
> 
> Not the most obvious place to look ...

It is documented in build(7) too:

MAKEOBJDIRPREFIX  Defines the prefix for directory names in the tree of
built objects.  Defaults to /usr/obj if not defined.  This variable
should only be set in the environment and not via /etc/make.conf or the
command line.


Regards,
Navdeep
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread Don Lewis
On 19 Jul, O'Connor, Daniel wrote:
> 
>> On 19 Jul 2015, at 02:56, Simon J. Gerraty  wrote:
>> 
>> O'Connor, Daniel  wrote:
>>> However, Crochet _does_ build on the NFS client _and_ when the
>>> source tree isn't in /usr/src which makes this issue very strange
>>> :-/
>> 
>> I've seen similar errors in rescue... (no NFS) though I cannot 
>> quite recall the cause other than it seems very sensitive
>> to MAKEOBJDIRPREFIX value.
> 
> Yeah the subject is wrong (I just updated it).
> 
> I just did a build like so and it worked..
> env MAKEOBJDIRPREFIX=/src/obj-amd64 make -j 8 buildworld
> 
> But this did not..
> make -j 8 buildworld MAKEOBJDIRPREFIX=/src/obj-amd64
> 
> So, it seems MAKEOBJDIRPREFIX only works as an environmental variable
> - I wonder if there is a way the make system can be changed to warn
> about that?

At least it is documented in /usr/share/mk/bsd.obj.mk:

# MAKEOBJDIRPREFIX  Specifies somewhere other than /usr/obj to root the object
#   tree.  Note: MAKEOBJDIRPREFIX is an *environment* variable
#   and works properly only if set as an environment variable,
#   not as a global or command line variable!
#
#   E.g. use `env MAKEOBJDIRPREFIX=/somewhere/obj make'

Not the most obvious place to look ...

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread O'Connor, Daniel

> On 20 Jul 2015, at 11:40, Simon J. Gerraty  wrote:
> 
> O'Connor, Daniel  wrote:
 So, it seems MAKEOBJDIRPREFIX only works as an environmental variable
> 
>> Weird, I could have sworn I have set it on the command line and had it
>> work, but..
> 
> In most "normal" usage you will likely not notice a difference.
> It is only when a makefile is "being clever" that things go south when
> you break its expectations.

I guess, buildworld is pretty clever though :)

>>> I thought there was a check in src/Makefile for that.
>> 
>> Not so far as I can tell - it certainly gets quite far before blowing
>> up with a non useful error message :)
> 
> The check in src/Makefile is only guarding against MAKEOBJDIRPREFIX set
> in say make.conf, it explicitly discards the possibility of setting
> MAKEOBJDIRPREFIX on command line - which seems wrong.
> 
> Also with bmake, you *can* usefully set MAKEOBJDIRPREFIX in a makefile
> since the choice of .OBJDIR can be made after make starts reading
> makefiles.
> 
> So the current test is perhaps out dated on that score too - though
> only if something like auto.obj.mk is being used (-DWITH_AUTO_OBJ)
> which I don't think I've tested with buildworld.

I know sod all about *make but as an 'end user' a seat belt to warn about this 
problem would be Really Nice (tm).

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread Simon J. Gerraty
O'Connor, Daniel  wrote:
> >> So, it seems MAKEOBJDIRPREFIX only works as an environmental variable

> Weird, I could have sworn I have set it on the command line and had it
> work, but..

In most "normal" usage you will likely not notice a difference.
It is only when a makefile is "being clever" that things go south when
you break its expectations.

> > I thought there was a check in src/Makefile for that.
> 
> Not so far as I can tell - it certainly gets quite far before blowing
> up with a non useful error message :)

The check in src/Makefile is only guarding against MAKEOBJDIRPREFIX set
in say make.conf, it explicitly discards the possibility of setting
MAKEOBJDIRPREFIX on command line - which seems wrong.

Also with bmake, you *can* usefully set MAKEOBJDIRPREFIX in a makefile
since the choice of .OBJDIR can be made after make starts reading
makefiles.

So the current test is perhaps out dated on that score too - though
only if something like auto.obj.mk is being used (-DWITH_AUTO_OBJ)
which I don't think I've tested with buildworld.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread O'Connor, Daniel

> On 20 Jul 2015, at 04:29, Simon J. Gerraty  wrote:
> O'Connor, Daniel  wrote:
>> 
>> But this did not..
>> make -j 8 buildworld MAKEOBJDIRPREFIX=/src/obj-amd64
> 
> Nor should it.
> There are several makefiles in the tree that expect to be able to 
> change MAKEOBJDIRPREFIX in the environment of a sub-make.
> When you set it on the command line like that you prevent such changes
> from working.

Ahh.. You learn something new every day :)

>> So, it seems MAKEOBJDIRPREFIX only works as an environmental variable
> 
> Yes, it has always been documented that way.

Weird, I could have sworn I have set it on the command line and had it work, 
but..

>> - I wonder if there is a way the make system can be changed to warn
>> about that?
> 
> I thought there was a check in src/Makefile for that.

Not so far as I can tell - it certainly gets quite far before blowing up with a 
non useful error message :)

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread Simon J. Gerraty
O'Connor, Daniel  wrote:
> Yeah the subject is wrong (I just updated it).
> 
> I just did a build like so and it worked..
> env MAKEOBJDIRPREFIX=/src/obj-amd64 make -j 8 buildworld

That's the right way to use it.

> But this did not..
> make -j 8 buildworld MAKEOBJDIRPREFIX=/src/obj-amd64

Nor should it.
There are several makefiles in the tree that expect to be able to 
change MAKEOBJDIRPREFIX in the environment of a sub-make.
When you set it on the command line like that you prevent such changes
from working.

> So, it seems MAKEOBJDIRPREFIX only works as an environmental variable

Yes, it has always been documented that way.

> - I wonder if there is a way the make system can be changed to warn
> about that?

I thought there was a check in src/Makefile for that.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: -current broken when MAKEOBJDIRPREFIX is set (was: src is on NFS)

2015-07-19 Thread O'Connor, Daniel

> On 19 Jul 2015, at 02:56, Simon J. Gerraty  wrote:
> 
> O'Connor, Daniel  wrote:
>> However, Crochet _does_ build on the NFS client _and_ when the source
>> tree isn't in /usr/src which makes this issue very strange :-/
> 
> I've seen similar errors in rescue... (no NFS) though I cannot 
> quite recall the cause other than it seems very sensitive
> to MAKEOBJDIRPREFIX value.

Yeah the subject is wrong (I just updated it).

I just did a build like so and it worked..
env MAKEOBJDIRPREFIX=/src/obj-amd64 make -j 8 buildworld

But this did not..
make -j 8 buildworld MAKEOBJDIRPREFIX=/src/obj-amd64

So, it seems MAKEOBJDIRPREFIX only works as an environmental variable - I 
wonder if there is a way the make system can be changed to warn about that?

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"