git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/8] doc: add an asciidoc helper

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 13, 2021, 15:17 UTC
Message-ID
<87bl9esls8.fsf@evledraar.gmail.com>
In-Reply-To
<20210512222803.508446-3-felipe.contreras@gmail.com>
On Wed, May 12 2021, Felipe Contreras wrote:
Show 22 quoted lines
> The hacks to deal with interrupted builds is scattered throughout the
> Makefile, but not everywhere (it's not done for techical/ and articles).
>
> It originally comes from f9dae0d3e6 (Documentation/Makefile: fix
> interrupted builds of user-manual.xml, 2010-04-21), however, that
> description is not correct.
>
> asciidoc does actually remove the output file in case of an exception,
> but there was a bug that handled keyboard interruptions through a
> different path, and thus in that particular case the file is not
> removed[1].
>
> We shouldn't overly complicate the Makefile due to bugs in asciidoc.
>
> In order to keep the Makefile clean this commit creates an asciidoc
> wrapper that does the job of tracking the intermediary output.
>
> Once asciidoc is fixed this helper can be safely removed and there would
> be minimal changes elsewhere.
>
> It's written for bash, but could easily be modified for something more
> portable.

Both this and your first patch could just be made to use the .DELETE_ON_ERROR flag instead, although that's a bigger change.

I had this and a related series for that recently:
https://lore.kernel.org/git/patch-4.6-2ff6359c273-20210329T161723Z-avarab@gmail.com/

I don't think anyone had an objection to using that, I didn't pursue it because I was trying to make (among other things) AIX development less annoying, but Junio didn't like the -o $@+ && mv $@+ $@ pattern for object files, so I gave up on pursuing it.

But if you're trying to address this "maybe it errors" issue then .DELETE_ON_ERROR is a better solution.

I think if we use that we should also undo your changes to use "-o file" and instead pipe to the file ourselves, otherwise we'll probably have cases where the program that fails and GNU make will race to delete the file (but I haven't tested that case).

Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 19 in “doc: asciidoc cleanups”
  1. 0/8 doc: asciidoc cleanupsFelipe Contreras, May 12, 2021
  2. 3/8 doc: disable asciidoc-helper for asciidoctorFelipe Contreras, May 12, 2021
  3. 2/8 doc: add an asciidoc helperFelipe Contreras, May 12, 2021
  4. Ævar Arnfjörð BjarmasonMay 13, 2021
  5. Felipe ContrerasMay 13, 2021
  6. Junio C HamanoMay 13, 2021
  7. 1/8 doc: standardize asciidoc callsFelipe Contreras, May 12, 2021
  8. 4/8 doc: simplify the handling of interruptionsFelipe Contreras, May 12, 2021
  9. Junio C HamanoMay 13, 2021
  10. Felipe ContrerasMay 13, 2021
  11. 5/8 doc: remove redundant rmFelipe Contreras, May 12, 2021
  12. Ævar Arnfjörð BjarmasonMay 13, 2021
  13. Felipe ContrerasMay 13, 2021
  14. 8/8 doc: join xml and man rulesFelipe Contreras, May 12, 2021
  15. Martin ÅgrenMay 13, 2021
  16. Felipe ContrerasMay 13, 2021
  17. 7/8 doc: improve asciidoc dependenciesFelipe Contreras, May 12, 2021
  18. Martin ÅgrenMay 13, 2021
  19. 6/8 doc: refactor common dependenciesFelipe Contreras, May 12, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.