4.4.1 breaks recursive invocation with --print-directory [when adding to MAKEFLAGS]

2023-02-28 Thread Satish Balay via Bug reports and discussion for GNU make


This usage works with make-4.4 [and older versions] - but not 4.4.1

Satish



balay@p1 /home/balay/tmp
$ cat makefile
all:
@MAKEFLAGS="-j1 ${MAKEFLAGS}" ${MAKE} -f makefile hello
hello:
@echo Hello
balay@p1 /home/balay/tmp
$ ./make-4.4/make --print-directory
make: Entering directory '/home/balay/tmp'
make[1]: Entering directory '/home/balay/tmp'
Hello
make[1]: Leaving directory '/home/balay/tmp'
make: Leaving directory '/home/balay/tmp'
balay@p1 /home/balay/tmp
$ ./make-4.4.1/make --print-directory
make: Entering directory '/home/balay/tmp'
make[1]: Entering directory '/home/balay/tmp'
make[1]: *** No rule to make target 'w'.  Stop.
make[1]: Leaving directory '/home/balay/tmp'
make: *** [makefile:2: all] Error 2
make: Leaving directory '/home/balay/tmp'



Re: 4.4.1 breaks recursive invocation with --print-directory [when adding to MAKEFLAGS]

2023-02-28 Thread Dmitry Goncharov
On Tue, Feb 28, 2023 at 8:41 PM Satish Balay via Bug reports and
discussion for GNU make  wrote:
> $ cat makefile
> all:
> @MAKEFLAGS="-j1 ${MAKEFLAGS}" ${MAKE} -f makefile hello
> hello:
> @echo Hello

When you pass --print-directory MAKEFLAGS has the value "w".
When this makefile prepends -j1 the value of MAKEFLAGS becomes "-j1 w".
Among other changes short options are now in the first word on makeflags.

Well defined MAKEFLAGS has the following format
[shortoptions] [-option with arg]... [--long option]... [ -- cli definitions]

-j carries an argument and is supposed to follow short options.

If you change to
MAKEFLAGS="${MAKEFLAGS} -j1" $(MAKE) -f makefile hello
then it'll work.

i remember, Paul fixed something like this in glibc makefile.
However, since users can arrange flags in this random order, we'll
have to think what to do about this.
Thanks for your report.

regards, Dmitry



Re: 4.4.1 breaks recursive invocation with --print-directory [when adding to MAKEFLAGS]

2023-02-28 Thread Satish Balay via Bug reports and discussion for GNU make
On Tue, 28 Feb 2023, Dmitry Goncharov wrote:

> On Tue, Feb 28, 2023 at 8:41 PM Satish Balay via Bug reports and
> discussion for GNU make  wrote:
> > $ cat makefile
> > all:
> > @MAKEFLAGS="-j1 ${MAKEFLAGS}" ${MAKE} -f makefile hello
> > hello:
> > @echo Hello
> 
> When you pass --print-directory MAKEFLAGS has the value "w".
> When this makefile prepends -j1 the value of MAKEFLAGS becomes "-j1 w".
> Among other changes short options are now in the first word on makeflags.
> 
> Well defined MAKEFLAGS has the following format
> [shortoptions] [-option with arg]... [--long option]... [ -- cli definitions]
> 
> -j carries an argument and is supposed to follow short options.
> 
> If you change to
> MAKEFLAGS="${MAKEFLAGS} -j1" $(MAKE) -f makefile hello
> then it'll work.

For one, the long option '--print-directory' is automatically converted to this 
short notation - contributing to this issue.

And the reason we use the order '-j8 ${MAKEFLAGS}' is so that we have the 
following behavior':

- invoking 'make' defaults to using a default of '-j8'
- invoking 'make -j4' gives: '-j8 -j4' - i.e ability to override this (pre-set) 
default [when needed].

Will have to see if we can reorder options in the recommended order - in our 
intermediate makefile.

thanks,
Satish


> 
> i remember, Paul fixed something like this in glibc makefile.
> However, since users can arrange flags in this random order, we'll
> have to think what to do about this.
> Thanks for your report.
> 
> regards, Dmitry
> 


[bug #63852] Two test failure running the test suite as root

2023-02-28 Thread anonymous
Additional Item Attachment, bug #63852 (project make):

File name: makeerror-4.4.1-x86_64-pc-linux-gnu-4quo.tar.gz Size:46 KB
   




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/