containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.51k stars 214 forks source link

test/system: Unbreak the manual page checks with GNU roff >= 1.23 #1398

Closed debarshiray closed 11 months ago

debarshiray commented 11 months ago

GNU roff 1.23 stopped remapping unescaped Hyphen-Minus (ie., - or 0x2D) characters in the input to Hyphen-Minus in the output. Instead, it follows the specified behaviour of converting unescaped Hyphen-Minus characters in the input to Hyphen (ie., ‐ or 0x2010) in the output. To get Hyphen-Minus characters in the output, one needs to escape the Hyphen-Minus with a backslash (ie., -) in the input [1].

Therefore, the command line options documented in the manuals are no longer prefixed with the Hyphen-Minus character that's needed to ctually use them. This breaks copying and pasting from the manuals and searching within them.

Unfortunately, escaping the Hyphen-Minus characters in Markdown doesn't have the intended effect of having Hyphen-Minus in the generated manual pages [2]. Therefore, this is worked around by having the tests check for both Hyphen-Minus and Hyphen.

Note that some operating system distributions, like Debian, have reverted this change from GNU roff, but others haven't. So, unless it can be guaranteed that the manuals will always have Hyphen-Minus regardless of which GNU roff version or variant is being used, the tests need to check for both.

[1] https://lwn.net/Articles/947941/ https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00001.html https://git.savannah.gnu.org/cgit/groff.git/tree/PROBLEMS?h=1.23.0#n82

[2] https://github.com/cpuguy83/go-md2man/issues/101

softwarefactory-project-zuul[bot] commented 11 months ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/b9258e83dd8347fbaeebe86b87c4a2cb

:heavy_check_mark: unit-test SUCCESS in 8m 43s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 52s :heavy_check_mark: unit-test-restricted SUCCESS in 8m 24s :heavy_check_mark: system-test-fedora-rawhide SUCCESS in 29m 15s :x: system-test-fedora-39 FAILURE in 28m 27s :heavy_check_mark: system-test-fedora-38 SUCCESS in 28m 46s :heavy_check_mark: system-test-fedora-37 SUCCESS in 28m 21s

debarshiray commented 11 months ago

This will get fixed once go-md2man 2.0.3 makes it into Fedora 39:

fedora-39 | not ok 3 help: Command 'help' in 189ms
fedora-39 | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 479,
fedora-39 | #  in test file test/system/002-help.bats, line 48)
fedora-39 | #   `assert_line --index 0 --partial "toolbox(1)"' failed
fedora-39 | # /usr/bin/man
fedora-39 | #
fedora-39 | # -- line does not contain substring --
fedora-39 | # index     : 0
fedora-39 | # substring : toolbox(1)
fedora-39 | # line      : troff:<standard input>:33: warning: cannot select font 'C'
fedora-39 | # --
fedora-39 | #

It's currently stuck because of the Fedora 39 Final Freeze.