lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Any clean way to suppress --keep-going?


From: Greg Chicares
Subject: Re: [lmi] Any clean way to suppress --keep-going?
Date: Tue, 29 Sep 2020 20:27:55 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 2020-09-29 18:43, Vadim Zeitlin wrote:
> 
>  As I'm testing my changes with the official makefiles, I'm starting to
> remember why I avoided using them as much as possible in the past... One of
> very unusual and unexpected things they do is to force MAKEFLAGS to contain
> --keep-going, which means that any kind of fatal error has all the chances
> of being scrolled away from the screen before you can even see it (unless
> you use --silent, but this has other problems).

Usually, I...

  https://www.gnu.org/software/make/manual/make.html#Testing
| would rather that make try compiling every file that can be tried,
| to show you as many compilation errors as possible

and that's why I prefer that '--keep-going' be the default.

You must have a very different style of working, and I just don't
understand it. If I make one mistake, I probably make many, maybe
enough to flush a thousand-line scrollback buffer. When I'm working
in a "valyuta" branch, I might suppress 'operator double()' for
example, and use a compile command like
  make [whatever] 2>&1 |tee eraseme | less -S
so that I can use 'sed' to extract errors by category, or even
'grep --count' to identify what categories I have. I.e., just piping
into 'less' is not convenient enough--I want to save the output for
additional postprocessing.

In a project that uses 'make' more conventionally, isn't every
command echoed by default, so that diagnostics fly off the screen
faster than you can press Ctrl-S? But I guess you don't mind if
warnings scroll rapidly away, as long as the build halts on error.
I'm so used to piping into 'less' that I just automatically search
for '\*\*\*'.

Are you talking about the makefiles that build lmi itself, or
something like 'install_libxml2_libxslt.make', which we'd probably
both agree should be rewritten as a script? But even in that case,
where building libxslt failed, I was glad that 'install_msw.sh'
didn't have "set -e", so I could see that libxslt was the only
thing that broke the other day.

> And I don't think there is
> any clean way to prevent this option from being used, short of editing
> GNUmakefile or doing "make MAKEFLAGS=-rR" which does work, but is ugly and
> difficult (at least for me) to remember.

Have you tried
  https://www.gnu.org/software/make/manual/make.html#index-_002dS
'-S' or its synonyms '--stop' and '--no-keep-going'?

Or have I imposed '--keep-going' so forcibly as to block '--stop'?
Adding a target to test that, right below where MAKEFLAGS is set:

 MAKEFLAGS := \
   --no-builtin-rules \
   --no-builtin-variables \
 
+xyzzy:
+       @echo "MAKEFLAGS is: '$(MAKEFLAGS)'"
+

and then running a few tests suggests that I may have:

$ GNUMAKEFLAGS="--no-keep-going" MAKEFLAGS="--no-keep-going" make 
--no-keep-going xyzzy
MAKEFLAGS is: 'krR'

No, wait, that test is wrong--instead, write "MAKEFLAGS" after "make":

$ make xyzzy                                                          
MAKEFLAGS is: 'krR'

$ make MAKEFLAGS= xyzzy
MAKEFLAGS is: ''

So that works, while this doesn't:

$ make --no-keep-going xyzzy
MAKEFLAGS is: 'krR'

but the important thing is that one of them works.

>  I wonder if we could at least make this a make variable, so I could do
> "make KEEP_GOING=''" without changing the current behaviour nor changing
> the makefile?

I was thinking of something like the following patch, but doesn't
  make MAKEFLAGS= xyzzy
above already do what you want, just as well?

-MAKEFLAGS := \
+# add a comment explaining this:
+
+LMIMAKEFLAGS := \
   --keep-going \
   --no-builtin-rules \
   --no-builtin-variables \
 
+MAKEFLAGS := $(LMIMAKEFLAGS)
+

> Ideally, of course, I'd say that this option should be just
> removed and then "make -k" be used when/if it's needed, but as I don't
> think you'd agree to do this

Well, I can report how many times I made 'GNUmakefile' on any day.
Let's pick the ides of September because it's lucky:

/opt/lmi/src/lmi[1]$ls -l /tmp |grep "Sep 13" >eraseme
/opt/lmi/src/lmi[0]$head -3 eraseme                   
-rw-rw-r-- 1 greg greg   345 Sep 13 09:22 lmi_env_1599988941_597276033.eraseme
-rw-rw-r-- 1 greg greg   345 Sep 13 09:29 lmi_env_1599989398_423402333.eraseme
-rw-rw-r-- 1 greg greg   345 Sep 13 09:31 lmi_env_1599989508_401504309.eraseme
/opt/lmi/src/lmi[0]$wc -l eraseme                     
310 eraseme

So I get 310 votes that day, or maybe 10000 a month. Still, even
though this may be the People's Democratic Republic of lmi, I'd
make the "LMIMAKEFLAGS" change above (after careful testing)
if there's a real advantage to it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]