lilypond-devel
[Top][All Lists]
Advanced

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

Re: echo but return false in make


From: Julien Rioux
Subject: Re: echo but return false in make
Date: Fri, 17 Jun 2011 16:08:25 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10

On 17/06/2011 3:10 PM, Graham Percival wrote:
On Fri, Jun 17, 2011 at 07:35:19PM +0100, Graham Percival wrote:
On Fri, Jun 17, 2011 at 02:18:55PM -0400, Julien Rioux wrote:
On 17/06/2011 2:11 PM, Graham Percival wrote:
  make ...blah... || echo "build failed"&&  tail logfile

but then when blah fails, make will not stop, since the return
status from echo&&  tail is a success (assuming the log file
exists). How would you return failure and force make to stop?
...
The short answer is that I cannot believe that we've exhausted all
options yet.  I want Phil to look into those options; of course I
welcome any suggestions from people on this list.  But off the top
of my head, I'd say that we can't possibly say that we're out of
ideas until we've spent at least 5 hours googling and/or reading
documentation about make and/or experimenting with make and
stepmake.

ok, I've got a simple solution which avoids all
bash/sh/make/stepmake confusion altogether: write a simple
(5-line?) python script.  The script is basically just

import sys
cmd = sys.argv[1]
target = sys.argv[2]
status = os.system(cmd+" "+target)
if not status:
     print "Something went wrong!  Look in",
     print target.replace(".ly", ".log")
     sys.exit(1)
sys.exit(0) # success


(not tested)

Now, that's a totally gratuitious use of python... but OTOH, why
not?  We already require python, and we use it for tons of other
stuff... and really, a
   compile-lilypond-book-file-with-warning-about-log.py
script would be *far* easier for casual hackers to read+understand
than all that make and sh garbage.  (ok, the script name is a bit
long, but that's easily thought about)


ok, there we go.  We have a backup plan.  I'm not wedded to the
"small python script" idea, but if all else fails, it will
definitely work.  There might be a better solution out there; I'm
happy to hear alternatives.

Cheers,
- Graham

Hmm, sure that's one way. However, you guys control the source code of lilypond, so that you can make this change in the lilypond binary itself instead of using any kind of indirect way you can imagine to call lilypond and then cat its log file. Why not make lilypond, maybe with the --log command-line flag, behave in the way you really want, i.e., as I understand it all output goes to the .log file and error output (but not progress output) also goes to stderr, with the mention of the log filename.

Regards,
Julien




reply via email to

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