Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate to the bootstrap process of rust-lang/rust #191

Closed
dalance opened this issue May 7, 2024 · 1 comment · Fixed by #193
Closed

Integrate to the bootstrap process of rust-lang/rust #191

dalance opened this issue May 7, 2024 · 1 comment · Fixed by #193

Comments

@dalance
Copy link
Contributor

dalance commented May 7, 2024

The latest Rust by Example has a Japanese translation resource based on mdbook-i18n-helpers.
But it is not built because rust-lang/rust has the original mdbook build process which doesn't contain mdbook-i18n-helpers.

In my investigation, I found that the following changes are required to build it.

  • Export Preprocessor struct for gettext
    The bootstrap process of rust-lang/rust uses the original rustbook binary to build docs.
    It uses mdbook crate as a library and the normal mdbook plugin system is not used.
    So exporting Preprocessor struct which can be integrated to rustbook at compile time is required.

  • Fix "hidden lifetime parameters in types are deprecated"
    In the rustbook build, the following error is occured, it should be fixed.

error: hidden lifetime parameters in types are deprecated
  --> /home/hatta/work/repos/mdbook-i18n-helpers/i18n-helpers/src/lib.rs:95:34
   |
95 |     fn expand_shortcut_link(tag: Tag) -> Tag {
   |                                  ^^^ expected lifetime parameter
   |
   = note: `-D elided-lifetimes-in-paths` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(elided_lifetimes_in_paths)]`
help: indicate the anonymous lifetime
   |
95 |     fn expand_shortcut_link(tag: Tag<'_>) -> Tag {
   |                                     ++++

I opened rust-lang/rust#124731.
It refers my forked mdbook-i18n-helpers https://github.com/dalance/mdbook-i18n-helpers/tree/export_preprocessor now.

How about the above changes?

@mgeisler
Copy link
Collaborator

Hi @dalance,

Thanks for the descriptive issue!

  • Export Preprocessor struct for gettext
    The bootstrap process of rust-lang/rust uses the original rustbook binary to build docs.
    It uses mdbook crate as a library and the normal mdbook plugin system is not used.
    So exporting Preprocessor struct which can be integrated to rustbook at compile time is required.

So far, we have not paid much attention to the library interface of mdbook-i18n-helpers, but I'm not against making it usable as a library. @kdarkhan has been making similar changes to enable us to do fuzz testing against the binaries.

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 a pull request may close this issue.

2 participants