From patchwork Fri Oct 3 17:01:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 396316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id E659914017E for ; Sat, 4 Oct 2014 03:02:14 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 63005962CD; Fri, 3 Oct 2014 17:02:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QX3IkvxkbRGK; Fri, 3 Oct 2014 17:02:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 86753962CF; Fri, 3 Oct 2014 17:02:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 1DC791C2239 for ; Fri, 3 Oct 2014 17:02:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B21D92EA3 for ; Fri, 3 Oct 2014 17:02:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v4IP220QxtIS for ; Fri, 3 Oct 2014 17:02:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2B0D192E51 for ; Fri, 3 Oct 2014 17:02:07 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id d1so2763782wiv.6 for ; Fri, 03 Oct 2014 10:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8bVmWtdITi/zUqOtYR8KZEi9OPASbrMjxl7F4TirNkQ=; b=Z79oFyvbEIfAJfDW9PknRxhAJLiE31AQnKsDle9NJjGS73OvXzAEeD4Z5D26O1+QYS DnP/EmDrGFwf0WcjEDfLHqtr4ZXKk8nVN5nF/sOQuRQKiz9kIR94jQB+ohLvF1tFDnI0 ebx7eYJtOhwwWaBBScZoLkXpLPikVQLDkH513rGDPmWAkuoEe0Hjr2SY2jsX8/sAP2NC 5+mbnD7N7GSh7NXyCZRmy8e567ZmcPPecFNeLECAGcP1jsFAQlQpk2szaMw4LX2Roqv6 4Wl/9wCA9m62KRnUbbjY8CaQczs5XFMlBf4u5lKb5QfpoclOK+9i6n2eOCt1TmqzqMTl B+5w== X-Received: by 10.180.76.209 with SMTP id m17mr13955048wiw.78.1412355725728; Fri, 03 Oct 2014 10:02:05 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id be1sm2661427wib.4.2014.10.03.10.02.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Oct 2014 10:02:04 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 3 Oct 2014 19:01:37 +0200 Message-Id: <856520695a3495437999bea891e3257f888c2a47.1412355549.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas De Schampheleire , "Yann E. MORIN" Subject: [Buildroot] [PATCH 03/25 v7] gendoc infra: disable pdf manual generation if xsltproc is buggy X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Samuel Martin The PDF manual generation reaches the default xsltproc's template recursion limit when processing the target package list; this makes the PDF manual generation fail [1-3]. This limit can be raised with the '--maxvars' option. Unfortunately, this option is not correctly handled in the latest xsltproc/libxslt release (1.1.28), but this bug is already fixed in the libxslt repository [4]. This patch disables the PDF manual generation (makes it warn with a meaningful error message) when the xsltproc program found in the PATH does not support the --maxvars option. So, one can still generate the PDF manual if he/she extends PATH with the location of a working xsltproc, by running: $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual-pdf [1] http://lists.busybox.net/pipermail/buildroot/2014-August/104390.html [2] http://lists.busybox.net/pipermail/buildroot/2014-August/104418.html [3] http://lists.busybox.net/pipermail/buildroot/2014-August/104421.html [4] https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c Reported-by: Thomas Petazzoni Cc: Thomas De Schampheleire Signed-off-by: Samuel Martin [yann.morin.1998@free.fr: move the assignment block out of GENDOC_INNER, no need to retest for each type of each document: it's always the same answer; make it a warning as per Thomas DS. suggestion] Signed-off-by: "Yann E. MORIN" --- Changes v5 -> v6: - make it a warning, not an error (Thomas DS) --- docs/manual/manual.mk | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk index 03e3a0b..e9078f1 100644 --- a/docs/manual/manual.mk +++ b/docs/manual/manual.mk @@ -41,6 +41,20 @@ manual-check-dependencies-lists: exit 1; \ fi +# PDF manual generation is broken because of a bug in xsltproc program provided +# by libxslt <=1.1.28, which does not honor an option we need to set. +# Fortunately, this bug is already fixed upstream: +# https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c +# +# So, bail out when trying to build the pdf manual using a buggy version of the +# xsltproc program. +# +# So, to overcome this issue and being able to build the pdf manual, you can +# build xsltproc from it source repository, then run: +# $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual +MANUAL_XSLTPROC_IS_BROKEN = \ + $(shell xsltproc --maxvars 0 >/dev/null 2>/dev/null || echo y) + ################################################################################ # GENDOC_INNER -- generates the make targets needed to build a specific type of # asciidoc documentation. @@ -83,6 +97,14 @@ define MANUAL_$(2)_INSTALL_CMDS endef endif +ifeq ($(4)-$$(MANUAL_XSLTPROC_IS_BROKEN),pdf-y) +$$(O)/docs/$(1)/$(1).$(4): + $$(warning PDF manual generation is disabled because of a bug in \ + xsltproc. To be able to generate the PDF manual, you should \ + build xsltproc from the libxslt sources >=1.1.29 and pass it \ + to make through the command line: \ + 'PATH=/path/to/custom-xsltproc/bin:$$$${PATH} make manual-pdf') +else $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \ $$($$(call UPPERCASE,$(1))_SOURCES) \ manual-check-dependencies \ @@ -96,6 +118,7 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt \ $$(BUILD_DIR)/docs/$(1)/$(1).txt # install the generated manual $$(MANUAL_$(2)_INSTALL_CMDS) +endif endef ################################################################################ @@ -111,8 +134,11 @@ $(call GENDOC_INNER,$(pkgname),xhtml,html,html,HTML,\ --xsltproc-opts "--stringparam toc.section.depth 1") $(call GENDOC_INNER,$(pkgname),chunked,split-html,chunked,split HTML,\ --xsltproc-opts "--stringparam toc.section.depth 1") +# dblatex needs to pass the '--maxvars ...' option to xsltproc to prevent it +# from reaching the template recursion limit when processing the (long) target +# package table and bailing out. $(call GENDOC_INNER,$(pkgname),pdf,pdf,pdf,PDF,\ - --dblatex-opts "-P latex.output.revhistory=0") + --dblatex-opts "-P latex.output.revhistory=0 -x '--maxvars 100000'") $(call GENDOC_INNER,$(pkgname),text,text,text,text) $(call GENDOC_INNER,$(pkgname),epub,epub,epub,ePUB) clean: $(pkgname)-clean