Reviewers: percivall,
Message:
Please review simple initial patch.
Description:
Initial reduction of make doc op - Issue 2075
This proposed patch reduces output to 113,500 lines by pushing lilypond
output to logfiles. If there is an error with lilypond-book trying to
compile a lilypond file, it issues a simple error message pointing at
the relevant logfile and exits.
Please review this at http://codereview.appspot.com/5453046/
Affected files:
M make/lilypond-vars.make
M make/ly-rules.make
M make/lysdoc-targets.make
M python/lilylib.py
M scripts/lilypond-book.py
Index: make/lilypond-vars.make
diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make
index
cf1bc11203487102b4c3bb39d569aae1445a81fc..57cddb16ee37c75cd6cf850deed8cf1430e3d4cb
100644
--- a/make/lilypond-vars.make
+++ b/make/lilypond-vars.make
@@ -55,13 +55,13 @@ $(LANG_TEXIDOC_FLAGS) \
-danti-alias-factor=$(ANTI_ALIAS_FACTOR)
ifdef QUIET_BUILD
-LILYPOND_BOOK_VERBOSE =
+LILYPOND_BOOK_WARN = --loglevel=NONE
else
-LILYPOND_BOOK_VERBOSE = --verbose
+LILYPOND_BOOK_WARN = --loglevel=WARN
endif
LILYPOND_BOOK_INFO_IMAGES_DIR = $(if
$(INFO_IMAGES_DIR),--info-images-dir=$(INFO_IMAGES_DIR),)
-LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE)
$(LILYPOND_BOOK_INFO_IMAGES_DIR)
+LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_WARN)
$(LILYPOND_BOOK_INFO_IMAGES_DIR)
ifeq ($(out),)
LILYPOND_BOOK_PROCESS = true
Index: make/ly-rules.make
diff --git a/make/ly-rules.make b/make/ly-rules.make
index
0df0643ee3158ec5ad2c0a685d752942ea30d18e..a876b04f1864ea548e03997b35aecccbed5bbcbd
100644
--- a/make/ly-rules.make
+++ b/make/ly-rules.make
@@ -22,11 +22,11 @@ $(eval $(firstword $(TEXI_FILES_FROM_TELY)):\
# don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
# it is not, for --srcdir builds
$(outdir)/%.texi: %.tely $(outdir)/version.itexi
$(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
- LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK)
$(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS)
$(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir)
--format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
+ LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK)
$(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS)
$(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir)
--format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS)
--redirect-lilypond-output $<
$(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi
$(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
- LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK)
$(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS)
$(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)'
--output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS)
$<
+ LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK)
$(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS)
$(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)'
--output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS)
--redirect-lilypond-output $<
$(outdir)/%.html.omf: %.tely
Index: make/lysdoc-targets.make
diff --git a/make/lysdoc-targets.make b/make/lysdoc-targets.make
index
e39fa1c58bc047a626e8ef32abe649a40e95550c..5290e3962feb6cbc06192050791facc66f2349fe
100644
--- a/make/lysdoc-targets.make
+++ b/make/lysdoc-targets.make
@@ -16,6 +16,6 @@ local-test:
echo -e '\n\n\n' ; \
(cd $(top-src-dir) && git diff ) ; \
fi > $(outdir)/tree.gittxt
- $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps
$(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts
-dgs-load-lily-fonts --header=texidoc -I
$(top-src-dir)/Documentation/included/ -ddump-profile
-dcheck-internal-types -ddump-signatures -danti-alias-factor=1"
LILYPOND_BOOK_VERBOSE= $(outdir)/collated-files.html
LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
+ $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps
$(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts
-dgs-load-lily-fonts --header=texidoc -I
$(top-src-dir)/Documentation/included/ -ddump-profile
-dcheck-internal-types -ddump-signatures -danti-alias-factor=1"
LILYPOND_BOOK_WARN= $(outdir)/collated-files.html
LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude
source --exclude mf $(top-build-dir)/out/share $(outdir)
Index: python/lilylib.py
diff --git a/python/lilylib.py b/python/lilylib.py
index
7a36a8aaace6ab8cce1b09d8044dc61ced22b38a..7934ec18e12e3e490114b7ea5a1e62367e53c717
100644
--- a/python/lilylib.py
+++ b/python/lilylib.py
@@ -179,7 +179,7 @@ def subprocess_system (cmd,
error_log_file = ''
if redirect_output:
- progress (_ ("Processing %s.ly") % log_file)
+ progress (_ ("Processing %s.ly \n") % log_file)
else:
if be_verbose:
show_progress = 1
@@ -193,9 +193,7 @@ def subprocess_system (cmd,
stdout_setting = subprocess.PIPE
if redirect_output:
- stdout_filename = ' '.join([log_file, '.log'])
- stderr_filename = ' '.join([log_file, '.err.log'])
- stdout_setting = open(stdout_filename, 'w')
+ stderr_filename = ' '.join([log_file, '.log'])
stderr_setting = open(stderr_filename, 'w')
proc = subprocess.Popen (cmd,
@@ -208,9 +206,8 @@ def subprocess_system (cmd,
if redirect_output:
while proc.poll()==None:
- time.sleep(1)
+ time.sleep(0.01)
retval = proc.returncode
- stdout_setting.close()
stderr_setting.close()
else:
if show_progress:
@@ -227,7 +224,7 @@ def subprocess_system (cmd,
print >>sys.stderr, "Child returned", retval
if ignore_error:
- print >>sys.stderr, "Error ignored"
+ print >>sys.stderr, "Error ignored by lilylib"
else:
if not show_progress:
print log[0]
Index: scripts/lilypond-book.py
diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py
index
69156d715e7f4c100f64dd628354a2bbb19adb49..c888e099c4cf90e491be85a00bc767e7ccdace68
100644
--- a/scripts/lilypond-book.py
+++ b/scripts/lilypond-book.py
@@ -380,11 +380,19 @@ def system_in_directory (cmd, directory, logfile):
current = os.getcwd()
os.chdir (directory)
- ly.system(cmd,
+ """NB - ignore_error is deliberately set to the same value
+ as redirect_output - this is not a typo."""
+ retval = ly.system(cmd,
be_verbose=ly.is_verbose (),
redirect_output=global_options.redirect_output,
log_file=logfile,
- progress_p=1)
+ progress_p=1,
+ ignore_error=global_options.redirect_output)
+ if retval != 0:
+ print ("Error trapped by lilypond-book")
+ print ("Please see " + logfile + ".log")
+ sys.exit(1)
+
os.chdir (current)
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel