* doc/Makefile (org.texi, orgguide.texi): Fix parallel build failure. --- Forwarding Gentoo Linux bug #829055 <https://bugs.gentoo.org/829055>. When doing a parallel build (make -j16), a failure was observed when building the Texinfo documentation: make -C doc info make[1]: Entering directory '/var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/doc' emacs -Q -batch --eval '(setq vc-handled-backends nil org-startup-folded nil)' \ --eval '(add-to-list `load-path "../lisp")' \ --eval '(load "../mk/org-fixup.el")' \ --eval '(org-make-manuals)' emacs -Q -batch --eval '(setq vc-handled-backends nil org-startup-folded nil)' \ --eval '(add-to-list `load-path "../lisp")' \ --eval '(load "../mk/org-fixup.el")' \ --eval '(org-make-manuals)' Loading /var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/mk/org-fixup.el (source)... Loading /var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/mk/org-fixup.el (source)... ...lease_9.5/doc/org.texi locked by portage@local... (pid 55): (s, q, p, ?)? Cannot resolve lock conflict in batch mode make[1]: *** [Makefile:31: orgguide.texi] Error 255 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/doc' make: *** [mk/targets.mk:127: info] Error 2 Fix by making org.texi a prerequisite of orgguide.texi, with an empty recipe. doc/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 96fda1445..7f996deae 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -27,12 +27,14 @@ guide:: orgguide.texi org-version.inc ../mk/guidesplit.pl $@/* endif -org.texi orgguide.texi: org-manual.org org-guide.org +org.texi: org-manual.org org-guide.org $(BATCH) \ --eval '(add-to-list '"'"'load-path "../lisp")' \ --eval '(load "../mk/org-fixup.el")' \ --eval '(org-make-manuals)' +orgguide.texi: org.texi + org-version.inc: org.texi @echo "org-version: $(ORGVERSION) ($(GITVERSION))" @echo "@c automatically generated, do not edit" > org-version.inc -- 2.34.1
[-- Attachment #1: Type: text/plain, Size: 2592 bytes --] Ulrich Müller <ulm@gentoo.org> writes: > * doc/Makefile (org.texi, orgguide.texi): Fix parallel build failure. > --- > > Forwarding Gentoo Linux bug #829055 <https://bugs.gentoo.org/829055>. > When doing a parallel build (make -j16), a failure was observed when > building the Texinfo documentation: > > make -C doc info > make[1]: Entering directory '/var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/doc' > emacs -Q -batch --eval '(setq vc-handled-backends nil org-startup-folded nil)' \ > --eval '(add-to-list `load-path "../lisp")' \ > --eval '(load "../mk/org-fixup.el")' \ > --eval '(org-make-manuals)' > emacs -Q -batch --eval '(setq vc-handled-backends nil org-startup-folded nil)' \ > --eval '(add-to-list `load-path "../lisp")' \ > --eval '(load "../mk/org-fixup.el")' \ > --eval '(org-make-manuals)' > Loading /var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/mk/org-fixup.el (source)... > Loading /var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/mk/org-fixup.el (source)... > ...lease_9.5/doc/org.texi locked by portage@local... (pid 55): (s, q, p, ?)? > Cannot resolve lock conflict in batch mode > make[1]: *** [Makefile:31: orgguide.texi] Error 255 > make[1]: *** Waiting for unfinished jobs.... > make[1]: Leaving directory '/var/tmp/portage/app-emacs/org-mode-9.5/work/org-mode-release_9.5/doc' > make: *** [mk/targets.mk:127: info] Error 2 > > Fix by making org.texi a prerequisite of orgguide.texi, with an empty > recipe. > > doc/Makefile | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/doc/Makefile b/doc/Makefile > index 96fda1445..7f996deae 100644 > --- a/doc/Makefile > +++ b/doc/Makefile > @@ -27,12 +27,14 @@ guide:: orgguide.texi org-version.inc > ../mk/guidesplit.pl $@/* > endif > > -org.texi orgguide.texi: org-manual.org org-guide.org > +org.texi: org-manual.org org-guide.org > $(BATCH) \ > --eval '(add-to-list '"'"'load-path "../lisp")' \ > --eval '(load "../mk/org-fixup.el")' \ > --eval '(org-make-manuals)' > > +orgguide.texi: org.texi > + > org-version.inc: org.texi > @echo "org-version: $(ORGVERSION) ($(GITVERSION))" > @echo "@c automatically generated, do not edit" > org-version.inc Thanks for the report and the suggestion. Possibly a split of function org-make-manuals in org-make-manual and org-make-guide and further create two single targets instead of the current double target is more clear. See the patch. WDYT? [-- Attachment #2: 0001-Fix-parallel-make-of-docs.patch --] [-- Type: text/x-diff, Size: 2409 bytes --] From cc89632186d63b2078baf446e44ed1425974be5e Mon Sep 17 00:00:00 2001 From: Marco Wahl <marcowahlsoft@gmail.com> Date: Mon, 20 Dec 2021 22:27:50 +0100 Subject: [PATCH] Fix parallel make of docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/Makefile: Split multiple target "org.texi orgguide.texi". * mk/org-fixup.el (org-make-manual, org-make-guide): New functions. (org-make-manuals): Removed. Reported by Ulrich Müller. https://list.orgmode.org/uee67gr96@gentoo.org/ --- doc/Makefile | 10 ++++++++-- mk/org-fixup.el | 15 ++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 7fb96e65d..5b8639330 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -27,11 +27,17 @@ guide:: orgguide.texi org-version.inc ../mk/guidesplit.pl $@/* endif -org.texi orgguide.texi: org-manual.org org-guide.org +org.texi: org-manual.org org-guide.org $(BATCH) \ --eval '(add-to-list `load-path "../lisp")' \ --eval '(load "../mk/org-fixup.el")' \ - --eval '(org-make-manuals)' + --eval '(org-make-manual)' + +orgguide.texi: org-manual.org org-guide.org + $(BATCH) \ + --eval '(add-to-list `load-path "../lisp")' \ + --eval '(load "../mk/org-fixup.el")' \ + --eval '(org-make-guide)' org-version.inc: org.texi @echo "org-version: $(ORGVERSION) ($(GITVERSION))" diff --git a/mk/org-fixup.el b/mk/org-fixup.el index c0eef23cb..e910f0b52 100644 --- a/mk/org-fixup.el +++ b/mk/org-fixup.el @@ -27,12 +27,17 @@ (require 'autoload) (require 'org-compat "org-compat.el") -(defun org-make-manuals () - "Generate the Texinfo files out of Org manuals." +(defun org-make-manual () + "Generate the Texinfo file out of the Org manual." (require 'ox-texinfo) - (dolist (manual '("../doc/org-manual.org" "../doc/org-guide.org")) - (find-file manual) - (org-texinfo-export-to-texinfo))) + (find-file "../doc/org-manual.org") + (org-texinfo-export-to-texinfo)) + +(defun org-make-guide () + "Generate the Texinfo file out of the Org guide." + (require 'ox-texinfo) + (find-file "../doc/org-guide.org") + (org-texinfo-export-to-texinfo)) (defun org-make-org-version (org-release org-git-version) "Make the file org-version.el in the current directory. -- 2.25.1
>>>>> On Mon, 20 Dec 2021, Marco Wahl wrote: > Possibly a split of function org-make-manuals in org-make-manual and > org-make-guide and further create two single targets instead of the > current double target is more clear. > See the patch. > WDYT? Sure, that's much cleaner. (I didn't dare to change the elisp code because it is also more intrusive.) > -org.texi orgguide.texi: org-manual.org org-guide.org > +org.texi: org-manual.org org-guide.org Shouldn't it have only org-manual.org as prerequisite? > $(BATCH) \ > --eval '(add-to-list `load-path "../lisp")' \ > --eval '(load "../mk/org-fixup.el")' \ > - --eval '(org-make-manuals)' > + --eval '(org-make-manual)' > + > +orgguide.texi: org-manual.org org-guide.org Similar here, only org-guide.org? > + $(BATCH) \ > + --eval '(add-to-list `load-path "../lisp")' \ > + --eval '(load "../mk/org-fixup.el")' \ > + --eval '(org-make-guide)'
Ulrich Mueller <ulm@gentoo.org> writes:
>>>>>> On Mon, 20 Dec 2021, Marco Wahl wrote:
>
>> Possibly a split of function org-make-manuals in org-make-manual and
>> org-make-guide and further create two single targets instead of the
>> current double target is more clear.
>
>> See the patch.
>
>> WDYT?
>
> Sure, that's much cleaner. (I didn't dare to change the elisp code
> because it is also more intrusive.)
>
>> -org.texi orgguide.texi: org-manual.org org-guide.org
>> +org.texi: org-manual.org org-guide.org
>
> Shouldn't it have only org-manual.org as prerequisite?
>
>> $(BATCH) \
>> --eval '(add-to-list `load-path "../lisp")' \
>> --eval '(load "../mk/org-fixup.el")' \
>> - --eval '(org-make-manuals)'
>> + --eval '(org-make-manual)'
>> +
>> +orgguide.texi: org-manual.org org-guide.org
>
> Similar here, only org-guide.org?
>
>> + $(BATCH) \
>> + --eval '(add-to-list `load-path "../lisp")' \
>> + --eval '(load "../mk/org-fixup.el")' \
>> + --eval '(org-make-guide)'
Yes, thanks.
The issue should be fixed with a slightly more defensive change than
stated in the last patch (by keeping function org-make-manuals.)
Thanks again,
--
Marco
On 21/12/2021 04:39, Marco Wahl wrote:
>
> Possibly a split of function org-make-manuals in org-make-manual and
> org-make-guide and further create two single targets instead of the
> current double target is more clear.
Marco, have you considered the following idea (I have not tested it)?
org.texi orgguide.texi:
$(BATCH) \
--eval '(add-to-list `load-path "../lisp")' \
--eval '(load "../mk/org-fixup.el")' \
--eval '(org-to-texi argv)' $<
org.texi: org-manual.org
orgguide.texi: org-guide.org
(defun org-to-texi (org-files)
"Generate the Texinfo files out of Org manuals."
(require 'ox-texinfo)
(dolist (manual org-files)
(find-file manual)
(org-texinfo-export-to-texinfo)))
P.S. Frankly speaking I was surprised that make runs command for every
target, I believed that is a way to specify multiple output files for
recipes. I had to look into info "(make) Multiple Targets" to realize
that I was wrong.
Hi Max!
Max Nikulin <manikulin@gmail.com> writes:
> On 21/12/2021 04:39, Marco Wahl wrote:
>> Possibly a split of function org-make-manuals in org-make-manual and
>> org-make-guide and further create two single targets instead of the
>> current double target is more clear.
>
> Marco, have you considered the following idea (I have not tested it)?
>
> org.texi orgguide.texi:
> $(BATCH) \
> --eval '(add-to-list `load-path "../lisp")' \
> --eval '(load "../mk/org-fixup.el")' \
> --eval '(org-to-texi argv)' $<
> org.texi: org-manual.org
> orgguide.texi: org-guide.org
>
>
> (defun org-to-texi (org-files)
> "Generate the Texinfo files out of Org manuals."
> (require 'ox-texinfo)
> (dolist (manual org-files)
> (find-file manual)
> (org-texinfo-export-to-texinfo)))
>
>
> P.S. Frankly speaking I was surprised that make runs command for every
> target, I believed that is a way to specify multiple output files for
> recipes. I had to look into info "(make) Multiple Targets" to realize
> that I was wrong.
Thanks for the idea. I did not think about the issue this way.
From my point of view using singuar targets for org.texi and
orgguide.texi is the clearest path to go.
I already committed a fix along these lines. (Hopefully it's okay.)
Please let me know if I missed something.
On 21/12/2021 19:48, Marco Wahl wrote: > > From my point of view using singuar targets for org.texi and > orgguide.texi is the clearest path to go. It matter of taste. I do not like code duplication. > I already committed a fix along these lines. (Hopefully it's okay.) Thank you for the fix. > Please let me know if I missed something. I do not see any really serious issues. However there are room for improvements %: %.texi org-version.inc $(MAKEINFO) --no-split $< -o $@.info likely should be %.info: %.texi org-version.inc $(MAKEINFO) --no-split $< -o $@ Org files have #+setupfile: doc-setup.org but there is no dependency on doc-setup.org in the Makefile I would prefer to see names of output files specified in the Makefile rather than in org files: #+export_file_name: orgguide.texi Ideally it should be a function with input org file and output texi file names as arguments. Currently it is a bit puzzling while reading the Makefile and .el, it is unclear why name of output files are different. Since nobody complained before, such issues are not urgent.
Max Nikulin <manikulin@gmail.com> writes:
> On 21/12/2021 19:48, Marco Wahl wrote:
>>
>> From my point of view using singuar targets for org.texi and
>> orgguide.texi is the clearest path to go.
>
> It matter of taste. I do not like code duplication.
>
>> I already committed a fix along these lines. (Hopefully it's okay.)
>
> Thank you for the fix.
>
>> Please let me know if I missed something.
>
> I do not see any really serious issues. However there are room for
> improvements
>
> %: %.texi org-version.inc
> $(MAKEINFO) --no-split $< -o $@.info
>
> likely should be
>
> %.info: %.texi org-version.inc
> $(MAKEINFO) --no-split $< -o $@
>
> Org files have
>
> #+setupfile: doc-setup.org
>
> but there is no dependency on doc-setup.org in the Makefile
>
> I would prefer to see names of output files specified in the Makefile
> rather than in org files:
>
> #+export_file_name: orgguide.texi
>
> Ideally it should be a function with input org file and output texi file
> names as arguments. Currently it is a bit puzzling while reading the
> Makefile and .el, it is unclear why name of output files are different.
>
> Since nobody complained before, such issues are not urgent.
I think so too.
If someone finds the muse to deal with any of these issues she might
give it a go, please.