Skip to content

Try to fix parallel docs builds with collision avoidance per a2x-shared files#1152

Closed
jimklimov wants to merge 12 commits intonetworkupstools:masterfrom
jimklimov:fix-makefile-parall-docs
Closed

Try to fix parallel docs builds with collision avoidance per a2x-shared files#1152
jimklimov wants to merge 12 commits intonetworkupstools:masterfrom
jimklimov:fix-makefile-parall-docs

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Oct 30, 2021

Despite all the best efforts regarding dependency definitions, parallel builds and/or distchecks of NUT tend to fail. One toxic chain of events was linked to documentation -- the a2x program tends to write and otherwise manipulate same-named files in the current directory, so build threads conflict with each other. A number of different workarounds was applied to reduce the chance of such conflicts (at a cost to build speed in some cases), although it seems problematic to rule them out completely: seems there is no portable feature for varied make implementations to force running some targets sequentially.

…docs that can collide on a2x implem detail (repopulated file in work dir)
… build them one after another to avoid a2x collisions when processing same source in parallel
…finished building (successfully) so we know if any parallel branches overlap
…ilding all types regardless of enablement by configure script; also add "make man" support
… conflict about a2x, and add collision-avoidance
…figurable (e.g. larger for many small manpage files vs few big html docs)
…VOIDANCE that should be both faster and safer

...but alas - it suffers for texts that include each other
(not resolved in the copy), and for shifted paths made with
"make dist(check)".
@jimklimov jimklimov marked this pull request as draft October 31, 2021 07:34
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Oct 31, 2021

UPDATE: Seems related to earlier efforts and discussions at #505, #418. One of those suggests just adding a hint to make with a .NOTPARALLEL: pseudo-target at the end of the Makefile. Not sure this is portable, but given how other prospective ways (e.g. subdirs) failed or are too complex, that hack is at least worth trying. At worst, GNU make would be safe for parallel builds, and those who do not accept this hint - won't.

Note: finding a safe way to add parallelism is better. Docs builds are the major time consumer in CI jobs and developer workflows at least (where ccache helps for most other sources).

@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Oct 31, 2021

It seems current a2x and asciidoc (9.0.0rc2 on my test system) can both be coerced into using output directories and so (checking) to not-conflict. Will explore that and maybe post an alternative PR if it seems a fruitful approach.

@jimklimov jimklimov changed the title Try to fix parallel docs builds Try to fix parallel docs builds with collision avoidance per a2x-shared files Nov 1, 2021
@jimklimov jimklimov closed this Nov 1, 2021
@jimklimov
Copy link
Copy Markdown
Member Author

Closed due to functional and better solution in #1154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant