Ccache build error with 21.02.0-rc1 -- which fix is likely?

When attempting to rebuild 21.02.0 for an EA7500 V1 target on a RHEL8 host I fail quite quickly due to a known build failure with tools/ccache.

The root cause is that the MANUAL.adoc source file contains non-ascii characters. Curiously this only happens during the OpenWRT build -- if I generate the docs manually using host tools and makefile it works fine so I think the difference is LANG=C -vs- LANG=C.utf8.

https://bugs.gentoo.org/762814

I was wondering which "fix" would be most likely for the eventual 21.02 release ?

  • Backport patch to replace smart quotes with normal quotes ? ( have only tested rejected version )
  • Once again revert to ccache 3.7.1 ?
  • Change build system to use utf8 LANG ? ( Seems too brave for me ).
  • Host change ??? Seems like official build servers work for some reason.

My goal is to set up a build environment as close as possible to the 21.02 stable release once it exists. Oh dang. Should have used branch instead of tag urgh ...

Updated: I messed up the link to actual patch. It does work but does not apply cleanly -- there is an extra sentence added since 4.1.

Error text without patch:
[ 71%] Generating MANUAL.xml
asciidoc: FAILED: MANUAL.adoc: line 523: unexpected error:
asciidoc: ------------------------------------------------------------
Traceback (most recent call last):
<snip>
    self.f.write((line or '') + self.newline)
UnicodeEncodeError: 'ascii' codec can't encode character '\u201c' in position 54: ordinal not in range(128)
[ 72%] Generating ccache.1
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/etc/asciidoc/docbook-xsl/manpage.xsl" "/home/devvm/dev/openwrt/openwrt/build_dir/host/ccache-4.1/doc/MANUAL.xml" returned non-zero exit status 6
make[6]: *** [doc/CMakeFiles/doc-man-page.dir/build.make:80: doc/ccache.1] Error 1
make[6]: Leaving directory '/home/devvm/dev/openwrt/openwrt/build_dir/host/ccache-4.1'
make[5]: *** [CMakeFiles/Makefile2:387: doc/CMakeFiles/doc-man-page.dir/all] Error 2
make[5]: Leaving directory '/home/devvm/dev/openwrt/openwrt/build_dir/host/ccache-4.1'
make[4]: *** [Makefile:182: all] Error 2
make[4]: Leaving directory '/home/devvm/dev/openwrt/openwrt/build_dir/host/ccache-4.1'
make[3]: *** [Makefile:40: /home/devvm/dev/openwrt/openwrt/build_dir/host/ccache-4.1/.built] Error 2
make[3]: Leaving directory '/home/devvm/dev/openwrt/openwrt/tools/ccache'
time: tools/ccache/compile#53.85#6.91#62.00
    ERROR: tools/ccache failed to build.