)]}'
{
  "commit": "0700386f142f0b0d3d0021995970a1b41c36cc92",
  "tree": "454ddf91440d06e39a1ba0937853451c223251d1",
  "parents": [
    "f4aca14e5fbb1e60d1d2f38f1dc41e9292ba95d5"
  ],
  "author": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Wed May 08 19:12:57 2024 +0100"
  },
  "committer": {
    "name": "Andrew Burgess",
    "email": "aburgess@redhat.com",
    "time": "Mon Jun 24 12:14:04 2024 +0100"
  },
  "message": "gdb/doc: fix parallel build of pdf and dvi files\n\nWhen building with \u0027make -j20 -C gdb/doc all-doc\u0027 I often see problems\ncaused from trying to build some dvi files in parallel with some pdf\nfiles.  The problem files are: gdb.dvi and gdb.pdf; stabs.dvi and\nstabs.pdf; and annotate.dvi and annotate.pdf.\n\nThe problem is that building these files create temporary files in the\nlocal directory.  There\u0027s already a race here that two make threads\nmight try to create these files at the same time.\n\nBut it gets worse, to avoid issues where a failed build could leave\nthese temporary files in a corrupted state, and so prevent the next\nbuild from succeeding, the recipe for each of these files deletes all\nthe temporary files first, this obviously causes problems if some\nother thread has already started the build and is relying on these\ntemporary files.\n\nTo work around this problem I propose we start using the --build and\n--build-dir options for texi2dvi (which is the same tool used to\ncreate the pdf files).  These options were added in texinfo 4.9 which\nwas released in June 2007.  We already require using a version of\ntexinfo after 4.9 (I tried to build with 4.13 and the doc build failed\nas some of the texinfo constructs were not understood), so this patch\nhas not changed the minimum required version at all.\n\nThe --build flag allows the temporary files to be placed into a\nsub-directory, and the --build-dir option allows us to control the\nname of that sub-directory.\n\nWhat we do is create a unique sub-directory for each target that\ninvokes texi2dvi, all of the unique sub-directories are created within\na single directory texi2dvi_tmpdir, and so after a complete doc build,\nwe are left with a build tree like this:\n\n  build/gdb/doc/\n  \u0027-- texi2dvi_tmpdir/\n      |-- annotate_dvi/\n      |-- annotate_pdf/\n      |-- gdb_dvi/\n      |-- gdb_pdf/\n      |-- stabs_dvi/\n      \u0027-- stabs_pdf/\n\nI\u0027ve left out all the individual files that live within these\ndirectories for simplicity.\n\nTo avoid corrupted temporary files preventing a future build to\ncomplete, each recipe deletes its associated sub-directory from within\ntexi2dvi_tmpdir/ before it attempts a build, this ensures a fresh\nstart each time.\n\nAnd the mostlyclean target deletes texi2dvi_tmpdir/ and all its\nsub-directories, ensuring that everything is cleaned up.\n\nFor me, with this fix in place, I can now run \u0027make -j20 -C gdb/doc\nall-doc\u0027 without seeing any build problems.\n\nApproved-By: Pedro Alves \u003cpedro@palves.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cfd3b3597fb55f4c7f1d9a4c9a08a95f0ed02cff",
      "old_mode": 33188,
      "old_path": "gdb/doc/Makefile.in",
      "new_id": "cf10868ed058b05a31baee841737024b23c1d24e",
      "new_mode": 33188,
      "new_path": "gdb/doc/Makefile.in"
    }
  ]
}
