Project

General

Profile

Actions

Bug #22065

closed

`make rdoc` fails with `invalid byte sequence in US-ASCII` on Ruby 4.0.4 under C locale

Bug #22065: `make rdoc` fails with `invalid byte sequence in US-ASCII` on Ruby 4.0.4 under C locale

Added by hsbt (Hiroshi SHIBATA) about 19 hours ago. Updated about 19 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:125467]

Description

Building Ruby 4.0.4 in an environment where Encoding.default_external is US-ASCII (e.g. a Docker container with LC_ALL=C) fails while documenting object.c:

(ArgumentError) invalid byte sequence in US-ASCII
.bundle/gems/rdoc-7.0.3/lib/rdoc/parser/c.rb:575:in 'String#scan'
	from .../parser/c.rb:600:in 'RDoc::Parser::C#find_body'
	from .../parser/c.rb:1025:in 'RDoc::Parser::C#handle_method'

https://github.com/ruby/all-ruby/actions/runs/25707463525/job/75480556963#step:5:1816

4.0.3 is not affected.

The trigger is 2b22593ac1 (backport of master a2531ba293), which introduced two U+2192 characters in class.c comments. RDoc couldn't parse that.

master branch is unaffected because the RDoc-side bug was fixed in ruby/rdoc#1657 (commit 911b122a) and pulled into Ruby master via 3f75e99961. The bump was not backported to ruby_4_0, which still ships RDoc 7.0.3.

Workaround: build with LC_ALL=C.UTF-8 or use --disable-install-doc option.

Four resolutions are under discussion with @k0kubun (Takashi Kokubun)

  1. replace with -> in class.c and backport it.
  2. bump the bundled RDoc to 7.2.0 in Ruby 4.0.5
  3. Release RDoc 7.0.4 containing 911b122a and then bump in Ruby 4.0.5
  4. Treat the C locale or build option as a user-side configuration issue and document the workaround.
Actions

Also available in: PDF Atom