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

Update dependency handlebars to v5 for mdman #13238

Closed
ehuss opened this issue Jan 2, 2024 · 2 comments · Fixed by #13249
Closed

Update dependency handlebars to v5 for mdman #13238

ehuss opened this issue Jan 2, 2024 · 2 comments · Fixed by #13249
Assignees
Labels
A-cli-help Area: built-in command-line help C-cleanup Category: cleanup within the codebase E-easy Experience: Easy P-low Priority: Low S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@ehuss
Copy link
Contributor

ehuss commented Jan 2, 2024

Problem

Renovate bot found a newer version available for dependency handlebars in #13231. handlebars is used by mdman for templatizing and generating man pages.

However, the new version has some API changes that need to be fixed:

Build failure. Click to See details

error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
   --> crates/mdman/src/hbs.rs:177:9
    |
177 |     d: &Decorator<'_, '_>,
    |         ^^^^^^^^^     -- help: remove this lifetime argument
    |         |
    |         expected 1 lifetime argument
    |
note: struct defined here, with 1 lifetime parameter: `'rc`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/handlebars-5.0.0/src/render.rs:452:12
    |
452 | pub struct Decorator<'rc> {
    |            ^^^^^^^^^ ---

error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
   --> crates/mdman/src/hbs.rs:45:13
    |
45  |         h: &Helper<'reg, 'rc>,
    |             ^^^^^^       --- help: remove this lifetime argument
    |             |
    |             expected 1 lifetime argument
    |
note: struct defined here, with 1 lifetime parameter: `'rc`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/handlebars-5.0.0/src/render.rs:306:12
    |
306 | pub struct Helper<'rc> {
    |            ^^^^^^ ---

error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
   --> crates/mdman/src/hbs.rs:86:13
    |
86  |         h: &Helper<'reg, 'rc>,
    |             ^^^^^^       --- help: remove this lifetime argument
    |             |
    |             expected 1 lifetime argument
    |
note: struct defined here, with 1 lifetime parameter: `'rc`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/handlebars-5.0.0/src/render.rs:306:12
    |
306 | pub struct Helper<'rc> {
    |            ^^^^^^ ---

error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
   --> crates/mdman/src/hbs.rs:144:13
    |
144 |         h: &Helper<'reg, 'rc>,
    |             ^^^^^^       --- help: remove this lifetime argument
    |             |
    |             expected 1 lifetime argument
    |
note: struct defined here, with 1 lifetime parameter: `'rc`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/handlebars-5.0.0/src/render.rs:306:12
    |
306 | pub struct Helper<'rc> {
    |            ^^^^^^ ---

Steps

  1. Clone rust-lang/cargo
  2. Run cargo build-man
  3. Fix the build failure.

Possible Solution(s)

Look into what have been changed in handlebars and update accordingly.

Version

add15366eaf3f3eb84717d3b8b71902ca36a7c84
@ehuss ehuss added E-easy Experience: Easy C-cleanup Category: cleanup within the codebase S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review A-cli-help Area: built-in command-line help P-low Priority: Low labels Jan 2, 2024
@WeiTheShinobi
Copy link
Contributor

@rustbot claim

bors added a commit that referenced this issue Jan 4, 2024
…epage

Update dependency handlebars to v5 for mdman.

### What does this PR try to resolve?

issue #13238
- update dependency handlebars 4.5.0 -> 5.0.0
- fix code to fit the changes of Handlebars API
- RenderError::new() is deprecated. Use RenderErrorReason instead

### How should we test and review this PR?
pass all tests in /crates/mdman/tests
bors added a commit that referenced this issue Jan 4, 2024
…epage

Update dependency handlebars to v5 for mdman.

### What does this PR try to resolve?

issue #13238
- update dependency handlebars 4.5.0 -> 5.0.0
- fix code to fit the changes of Handlebars API
- RenderError::new() is deprecated. Use RenderErrorReason instead

### How should we test and review this PR?
pass all tests in /crates/mdman/tests
@weihanglo
Copy link
Member

Resolved by #13249.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-help Area: built-in command-line help C-cleanup Category: cleanup within the codebase E-easy Experience: Easy P-low Priority: Low S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants