Skip to content

Fix breakage in maint/build-mdbook

Nick Mathewson requested to merge nickm/rust-derive-adhoc:mdbook-breakage into main

Currently, the build-mdbook script gives an error and fails with:

2024-08-21 08:06:48 [INFO] (mdbook::renderer): Invoking the "null" renderer
2024-08-21 08:06:48 [WARN] (mdbook::renderer): Error writing the RenderContext to the backend, Broken pipe (os error 32)

That's because, for our dummy renderer, we use "true". But apparently this causes a failure, since "true" exits before its stdin is closed, which now causes mdbook to complain.

We can't set the command to cat >/dev/null, since the "command" apparently has to be a single executable.

So, out of all of the mandatory POSIX commands that (when run without arguments) consume stdin and return true, the best choice seemed to be using wc, which only outputs a single line.

One alternative would have been adding a "cat_dev_null" script, and making sure that it was in the path, but that seemed excessive.

Merge request reports