Skip to content

ci(book): bump mdbook to 0.5.4 and mdbook-i18n-helpers to 0.4.0; drop the onig_sys GCC 15 workaround - #1725

Merged
dekobon merged 2 commits into
mainfrom
fix/1724-mdbook-0.5
Oct 30, 2026
Merged

dekobon merged 2 commits into
mainfrom
fix/1724-mdbook-0.5

Conversation

@dekobon

@dekobon dekobon commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Closes #1724.

What

mdBook 0.4.40 + mdbook-i18n-helpers 0.3.6 → 0.5.4 + 0.4.0, in pages.yml, the Makefile book targets, the Dockerfile, the deploy script and docs/development/translations.md together. The -std=gnu17 CFLAGS override from 36a9dec is gone.

Two commits: the toolchain bump, and a separate make book-po-update refresh of ja.po (990 fuzzy / 309 new / 203 obsolete — ten commits of English doc drift since 2026-10-21, not toolchain churn; msgmerge against the old toolchain's pot yields a byte-identical file).

The part the issue did not anticipate

Helpers 0.4.0's lockfile has no onig_sys at all: upstream switched syntect to the pure-Rust fancy-regex (google/mdbook-i18n-helpers#267). That removes the GCC 15 problem, but under fancy-regex the shell/YAML/TOML grammars drop lines from consecutive # comment runs (google/mdbook-i18n-helpers#321, open):

```bash / # a1 / # a2 / # a3 extracted
0.4.40 + 0.3.6 (previous CI) # a1\n# a2\n# a3\n
0.5.4 + 0.4.0 --locked (issue's plan) # a1\n, # a3\n — # a2 dropped
0.5.4 + 0.4.0 --locked --features syntect/regex-onig # a1\n# a2\n# a3\n

On this book the --locked-only pot loses 90 translated entries and eleven /ja/ pages fall back to English. With Oniguruma the pot is byte-identical (modulo POT-Creation-Date) to the previous toolchain's. So the helper is installed with --features syntect/regex-onig; the two onig crates resolve fresh under --locked (69.9.3, which carries oniguruma's GCC 15 fix) while everything else stays pinned.

Both builds report the same --version, so new utils/check-xgettext-backend.sh tells them apart behaviourally on a four-line book; make book-pot and the build-book job both run it before extracting anything. Verified to reject the fancy build, a stub emitting two split entries, and a missing helper; to accept both Oniguruma builds.

Other things 0.5 exposed

  • -d is now cwd-relative. The workflow's -d book/ja would have written to ./book/ja and shipped a Pages artifact with no /ja/ tree, silently. Fixed in the workflow and make book-ja; the workflow now also asserts the /ja/ tree exists and carries a known translation across its pages (a missing/mis-built gettext preprocessor is optional and yields English under lang="ja" with no error).
  • book.toml unchanged. 0 heading-id changes in either language; fragment-link breakage unchanged (3 en / 8 ja, pre-existing); 0 non-punctuation text differences in English. Visible deltas: 0.5's smart-punctuation default (kept), and \| inside table code spans now renders correctly on /ja/.

Not verified locally

GCC 15 / C23 compilation of onig_sys 69.9.3 — host is aarch64/GCC 11, x86 emulation of rustup crashed. Inferred from the oniguruma HISTORY entry in the vendored tree. The build mdBook job on this PR is the first real test. If it fails, the fallback is a scoped CFLAGS override again; a tooling lockfile is not available to cargo install.

Review

Three astra-review rounds plus one independent review (8 findings total, all fixed; round three clean). make pre-commit green. Evidence (pots, fixture, both toolchains' en/ja builds, probe scripts): ~/bca-evidence/1724/.

The 0.3.6 helper's lockfile pinned onig_sys 69.8.1, whose vendored
oniguruma predates its GCC 15 / C23 fix (HISTORY 2024-11-18, #312)
and stopped compiling on ubuntu-latest (26.04). 36a9dec covered it
with CFLAGS=-std=gnu17 on the install step; this moves both pins to
the current lines and drops the override.

Helpers 0.4.0 is installed with `--features syntect/regex-onig`, and
that flag is the substance of the change. 0.4.0 switched syntect to
the pure-Rust fancy-regex engine (google/mdbook-i18n-helpers#267),
under which the shell / YAML / TOML grammars mis-walk consecutive `#`
comments: a two-line run keeps only its first line, a three-line run
its first and third (google/mdbook-i18n-helpers#321). Measured on
this book with `--locked` alone: the pot loses 90 translated entries
and eleven /ja/ pages fall back to English. With Oniguruma the pot is
byte-identical (modulo POT-Creation-Date) to the 0.4.40 + 0.3.6 one.
The feature's onig / onig_sys crates are absent from the published
lockfile, so they resolve fresh under --locked (69.9.3 today) while
every other dependency stays pinned.

The two builds report the same --version, so the new
utils/check-xgettext-backend.sh tells them apart by behaviour on a
four-line book; `make book-pot` and the Pages workflow both run it
before extracting anything. The workflow also asserts the Japanese
tree exists and carries a known translation, since a missing or
mis-built gettext preprocessor is `optional` and yields English pages
under lang="ja" with no error.

mdbook 0.5 resolves `-d` against the cwd rather than the book root,
so the Japanese build in both the workflow and `make book-ja` now
names big-code-analysis-book/book/ja in full; the former `-d book/ja`
would have written to ./book/ja and shipped an artifact with no /ja/.
Rendered output otherwise differs in two visible ways — 0.5's
smart-punctuation default, and `\|` inside a table code span now
rendering as `|` on /ja/ — while heading ids, fragment links and
every fenced code block are unchanged in both languages
(~/bca-evidence/1724/).

GCC 15 compilation of onig_sys 69.9.3 is inferred from the oniguruma
HISTORY entry, not reproduced locally (aarch64 host); the Pages
workflow run on this change is the first real test.

Refs #1724
`make book-po-update` with the new toolchain. The English book moved
in ten commits since the 2026-10-21 refresh (4,230 insertions under
big-code-analysis-book/src), and this is that drift: 2613 translated,
990 fuzzy, 309 untranslated, 203 obsolete. None of it is the toolchain
— msgmerge against the 0.4.40 + 0.3.6 pot gives a byte-identical file
(modulo POT-Creation-Date) — and the rendered /ja/ site is unchanged
by it, since every entry msgmerge marked fuzzy had already stopped
matching its paragraph and was falling back to English.

Refs #1724
@dekobon

dekobon commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

The one thing I could not verify locally is now verified in CI. The build mdBook job on this PR (run 41142624729, ubuntu-26.04) was a cold install — no rust-cache hit carried a prebuilt helper — and its log shows:

Downloaded onig_sys v69.9.3
 Compiling onig_sys v69.9.3
  Finished `release` profile [optimized] target(s) in 40.40s

with no CFLAGS override, so oniguruma 6.9.10's C23 fix does compile under GCC 15. Every new step passed on the first run: the backend probe (check-xgettext-backend: ok — consecutive comment lines extract as one block), both book builds, and the /ja/ translation sentinel. The whole Pages workflow (including bca self-scan) is green.

@dekobon
dekobon merged commit 4785e89 into main Oct 30, 2026
54 checks passed
@dekobon
dekobon deleted the fix/1724-mdbook-0.5 branch October 30, 2026 23:40

This branch was successfully deployed

1 active deployment
github-pages — 4785e89d Deployed Oct 30, 2026 by dekobon via deploy to GitHub Pages #884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(book): bump mdbook to 0.5 and mdbook-i18n-helpers to 0.4; drop the onig_sys GCC 15 workaround

1 participant