ylwrap needs a "mkdir -p"?

"G. Branden Robinson" <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.printing.groff.general
Message-ID <20251208085005.be4b4ws4hcjknfan@illithid>
[please keep the groff list CCed]

Hi folks,

While compiling groff recently I had a failure.

  YACC     src/preproc/pic/pic.cpp
/.../src/GIT/groff/build/../src/preproc/pic/pic.ypp:93.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
   93 | %expect 2
      | ^~~~~~~
/.../src/GIT/groff/build/../src/preproc/pic/pic.ypp:1456.11-1461.17: warning: rule useless in parser due to conflicts [-Wother]
 1456 |         | ORDINAL LAST object_type relative_path
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
updating src/preproc/pic/pic.output
mv: cannot move 'tmp-pic.output' to '../src/preproc/pic/pic.output': No such file or directory
../build-aux/ylwrap: line 206: ../src/preproc/pic/pic.cpp: No such file or directory
updating src/preproc/pic/pic.hpp
mv: cannot move 'tmp-pic.hpp' to '../src/preproc/pic/pic.hpp': No such file or directory
make[2]: *** [Makefile:11822: src/preproc/pic/pic.cpp] Error 1
make[2]: Leaving directory '/.../src/GIT/groff/build'
make[1]: *** [Makefile:13256: check-recursive] Error 1
make[1]: Leaving directory '/.../src/GIT/groff/build'
make: *** [Makefile:15773: check] Error 2

This looked shockingly like another problem that just came up recently.

https://savannah.gnu.org/bugs/?67754

I checked to see if the build/src/preproc/pic directory existed in my
build tree, and sure enough it didn't.  (I've made one of my build
scripts use `--disable-dependency-tracking` to smoke out this sort of
problem.)

Applying the following "conceptual" patch to "build-aux/ylwrap" resolved
the problem.

$ diff -u build-aux/ylwrap{.old,}
--- build-aux/ylwrap.old        2025-12-08 02:43:03.133977418 -0600
+++ build-aux/ylwrap    2025-12-08 02:39:46.346813071 -0600
@@ -216,6 +216,11 @@
           rm -f "$target"
         else
           echo "updating $to"
+          if ! test -d "${realtarget%/*}"
+          then
+            echo "GBR: creating ${realtarget%/*}" >&2
+            mkdir -p  ${realtarget%/*}
+          fi
           mv -f "$target" "$realtarget"
         fi
       fi

Trying "make" again with the patch applied got a satisfactory outcome.

make[2]: Entering directory '/.../src/GIT/groff/build'
  YACC     src/preproc/pic/pic.cpp
/.../src/GIT/groff/build/../src/preproc/pic/pic.ypp:93.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
   93 | %expect 2
      | ^~~~~~~
/.../src/GIT/groff/build/../src/preproc/pic/pic.ypp:1456.11-1461.17: warning: rule useless in parser due to conflicts [-Wother]
 1456 |         | ORDINAL LAST object_type relative_path
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
updating src/preproc/pic/pic.output
GBR: creating ../src/preproc/pic
updating src/preproc/pic/pic.hpp
  CXX      src/preproc/pic/pic-pic.o

I hope this is enough info for someone with more expertise to craft a
more proper patch.  (I don't know to access a thread-safe mkdir(1),
detected by Autoconf, from the "ylwrap" script.)

I furthermore have a question: how do I patch "build-aux/ylwrap" in situ
so that I can hobble along until gnulib has an official fix?

Regards,
Branden
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmk2kTYACgkQ0Z6cfXEm
bc7yog/+MpL/qq6G5hrL4R/t3oxFq+Ulk86q5iTEfL/sDLRXQEFYMlgNl8DMkSSc
6nCnjcQP4fvLdkWlWg+lxcTMJ9nl8MUeGLQt2HKm6WiZbf7fIxa0ssgEOWZeeOHr
w4qpOfdZS8trCP8FNZWVbfwP0c2AH44qms1ZOo46ksKWs/loV7ydEbaYBAoZ6+Du
otl8+A5C333Cwg/vl4gJEQJhofKujVUwouWP2+M086NhwOQTk5RitiOyzls2KV19
7kmB50Lq8KVNfiMm3Y7PXQztv/kfqqcY6+4u1NCKwZIYYAOhhqUhefE6VB2/fwy6
sgjS5lu+F1CEb8AV74a/NT6r4t1/uI6OKNATTEQLEh8ZNSQNbvlNQxBR5k5+4C2L
8DfluWFjMfdFy6MFi6ljg2X/bYMb6tXbcUbQByaks7601LK6hd44/86ZsU1bLwof
ZJgEkNMrrQm1zEN5B9lOFq31Qrdiglg5BqfKd3eqIZK4inRzcqz0+g1D2jaehZhL
Ov28SduhgmqLgTg+HZ4KdPdgZAOGv/tKwZPNCgOawZY+HgIFxOXbOz73Oh+1KpT0
z1xt/1Gyer4APDzpJExV5sCdsoWiIWHZ//e8DI7gI4aDWwnyfG446V/Kj5piILQU
TwKb5RaZ45PqmcVWnJ2Dr4Juw22cvoNQT4ulbXr9Ef5hS19llaI=
=b5s0
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.