Gnulib's clean-temp module defaults to using _O_TEMPORARY on mingw, which has the effect of deleting a file the first time it is closed. This resulted in a testsuite failure in 146.diversions, with m4 complaining that it could not create a temporary file for holding a diversion. In reality, m4 was trying to rename the file, but because mingw does not allow renaming an open file, we have to close it first - but closing it first deleted the file.
For now, we will just work around the gnulib issue by disabling the use of _O_TEMPORARY. This was probably introduced in commit da5f6db (1.4.13), although my testing environment was painfully slow to confirm this, so I did not call out a 'regression since xyz' in the NEWS entry. * gl/lib/clean-temp.c.diff: New file. Signed-off-by: Eric Blake <[email protected]> --- This patch fixes 'make && make -C checks test' on mingw, but there is still a test failure in 'make check' in the gnulib directory that will require yet another gnulib update in the near future. ChangeLog | 6 ++++++ NEWS | 3 +++ gl/lib/clean-temp.c.diff | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 gl/lib/clean-temp.c.diff diff --git a/ChangeLog b/ChangeLog index b5bb9e2..3e08dba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-03-11 Eric Blake <[email protected]> + + build: fix large diversions on mingw + * gl/lib/clean-temp.c.diff: New file. + * NEWS: Mention the fix. + 2013-03-08 Gary V. Vaughan <[email protected]> bootstrap: remove reintroduced CVS cruft. diff --git a/NEWS b/NEWS index 25c12ea..2240772 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ GNU M4 NEWS - User visible changes. ** Fix compilation with newer glibc headers. +** Fix a failure with diverting large amounts of text on mingw (does + not affect platforms that can rename an open file). + ** A number of portability improvements inherited from gnulib. diff --git a/gl/lib/clean-temp.c.diff b/gl/lib/clean-temp.c.diff new file mode 100644 index 0000000..2eafde6 --- /dev/null +++ b/gl/lib/clean-temp.c.diff @@ -0,0 +1,14 @@ +diff --git i/lib/clean-temp.c w/lib/clean-temp.c +index 40ec02f..1053312 100644 +--- i/lib/clean-temp.c ++++ w/lib/clean-temp.c +@@ -582,6 +582,9 @@ static bool + supports_delete_on_close () + { + static int known; /* 1 = yes, -1 = no, 0 = unknown */ ++ /* M4 wants to close and later reopen a temporary file, so ++ delete-on-close must not be used. */ ++ known = -1; + if (!known) + { + OSVERSIONINFO v; -- 1.8.1.4 _______________________________________________ M4-patches mailing list [email protected] https://lists.gnu.org/mailman/listinfo/m4-patches
