[bug #63429] Escape sequence in logs are lost with -O option

2022-11-27 Thread Paul D. Smith
Follow-up Comment #2, bug #63429 (project make):

I guess you could also do this in your makefile:

grep --color=$(if $(MAKE_TERMOUT),always,auto) foo $<

and that should also work.


___

Reply to this item at:

  

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




[bug #63347] make 4.4 change in behavior for sub-make invoked via $(shell)

2022-11-27 Thread Paul D. Smith
Follow-up Comment #10, bug #63347 (project make):

The problem in the kernel build system is not related to this change; the
issue can also be seen with the released GNU make 4.4 version.

For example, set *MAKEFLAGS* like this in your environment before invoking the
kernel build:

$ export MAKEFLAGS=-I/usr/local/mk

or this:

$ export MAKEFLAGS=-Orecurse


If you use vanilla GNU make 4.4 without this patch, this will force the kernel
into "silent mode".

Basically any flag that (a) uses a single-letter option to introduce it (so it
won't be caught by the kernel build environment's --% filter) and (b) contains
an "s", will cause this problem.

The best way to check GNU make single-letter command line flags is described
in the GNU make manual:
https://www.gnu.org/software/make/manual/make.html#Testing-Flags



___

Reply to this item at:

  

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




[bug #63347] make 4.4 change in behavior for sub-make invoked via $(shell)

2022-11-27 Thread Dmitry Goncharov
Follow-up Comment #9, bug #63347 (project make):

> Differences that I could spot:
> - there's "rR" instead of "-rR"
> - "-rR" is at the beginning not at the end
> - MAKE_OPTS are part of MAKEFLAGS --

Well defined MAKEFLAGS has the following format
[shortoptions] [-option with arg]... [--long option]... [ -- cli definitions]
e.g.
rRs -Isrc -j2 -Orecurse --jobserver-auth=fifo:/tmp/GMfifo14676
--no-print-directory -- H=h C=c A=a

makefile can contain something like
MAKEFLAGS+=-k
MAKEFLAGS=r

Once parsing is over make rearranges MAKEFLAGS to conform to this format.
This patch causes make to do this rearrangement at parse time, each time
MAKEFLAGS is modified.
You observe the differences between a defined MAKEFLAGS and not defined
MAKEFLAGS.


> that's what confuses kernel's build system since it merely looks for 's' in
> MAKEFLAGS after stripping long options: 

Thanks for your report.
i submitted a patch here
https://lore.kernel.org/linux-kbuild/CAK7LNAQP4S0ACMkB3KtaJTaeRkpT_KjRa4CrYxNJboTdthN=z...@mail.gmail.com/T/#m6e2681847c0b7968a713765f1df455bfae307807



___

Reply to this item at:

  

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




[bug #63429] Escape sequence in logs are lost with -O option

2022-11-27 Thread Paul D. Smith
Update of bug #63429 (project make):

  Status:None => Not A Bug  
 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

There is no way to avoid this.  In order for output sync to ensure output is
not jumbled, it has to save the output to a file and print it later.  Tools
like grep, etc. choose color or not color output by looking to see whether the
output device is a terminal or not.  This is so that if you use something like
*grep foo | sed ...* etc. you won't see all the control characters.

When make redirects the output of the command to a file, grep sees that it is
no longer writing to a terminal and so disables color mode.

GNU make will set the environment variable MAKE_TERMOUT if the command it's
running will _eventually_ be written to a terminal.  It would be possible for
tools like grep etc. to check that variable and, if it's set, behave the same
as if it was writing to a terminal.  But that would require enhancement to
grep.

The only possible way to solve this in GNU make would be to create a pty for
each command but that is extremely complicated and non-portable.


___

Reply to this item at:

  

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