Skip to content

move from proc-macro-error2 to manyhow (fix RUSTSEC-2026-0173)#333

Open
FBranca wants to merge 2 commits into
eclipse-biscuit:mainfrom
FBranca:proc-macro-error2-to-manyhow
Open

move from proc-macro-error2 to manyhow (fix RUSTSEC-2026-0173)#333
FBranca wants to merge 2 commits into
eclipse-biscuit:mainfrom
FBranca:proc-macro-error2-to-manyhow

Conversation

@FBranca

@FBranca FBranca commented Jun 8, 2026

Copy link
Copy Markdown

See #332

proc-macro-error2 is no longer maintained, manyhow seems to be a good remplacement.

@divarvel

divarvel commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the update! Could you please:

  • sign the eclipse eca? (Instructions in the contributing.md file)
  • show the new output for compilation errors
  • provide an overview of the new crate dependencies? (Just to make sure the licenses are ok)

@FBranca FBranca force-pushed the proc-macro-error2-to-manyhow branch from f9a767b to 3550e99 Compare June 8, 2026 09:55
@FBranca

FBranca commented Jun 8, 2026

Copy link
Copy Markdown
Author

Here is sample of output error on a biscuit! proc macro :

datalog parsing error: ParseErrors { errors: [ParseError { input: "bad_input\n ", message: None }] }

The manyhow crate introduce only one new transitive dependency : smallvec using a MIT / Apache v2 license.

├── manyhow v0.11.4
│   ├── manyhow-macros v0.11.4 (proc-macro)
│   │   ├── proc-macro-utils v0.10.0
│   │   │   ├── proc-macro2 v1.0.106 (*)
│   │   │   ├── quote v1.0.45 (*)
│   │   │   └── smallvec v1.15.1
│   │   ├── proc-macro2 v1.0.106 (*)
│   │   └── quote v1.0.45 (*)
│   ├── proc-macro2 v1.0.106 (*)
│   ├── quote v1.0.45 (*)
│   └── syn v2.0.117 (*) 

I'm struggling to get the ECDA recognized by github

@divarvel

divarvel commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Could you provide a diff for errors, especially with a semantic error like an unbound variable?

@avandecreme

Copy link
Copy Markdown

Could you provide a diff for errors, especially with a semantic error like an unbound variable?

Just a suggestion, but I found trybuild really nice for this: https://docs.rs/trybuild/latest/trybuild/ (you can look at https://github.com/avandecreme/enum_convert to see an example usage)

@FBranca FBranca force-pushed the proc-macro-error2-to-manyhow branch from 3550e99 to 3126afc Compare June 9, 2026 06:47
@FBranca

FBranca commented Jun 9, 2026

Copy link
Copy Markdown
Author

I retried linking my github account to eclipse this morning and this time it worked like a charm on the first try.

Following the advice of @avandecreme I also added some tests using trybuild, but this comes with many dependencies :

└── trybuild v1.0.116
    ├── glob v0.3.3
    ├── serde v1.0.228
    │   └── serde_core v1.0.228
    ├── serde_derive v1.0.228 (proc-macro)
    │   ├── proc-macro2 v1.0.106
    │   │   └── unicode-ident v1.0.24
    │   ├── quote v1.0.45
    │   │   └── proc-macro2 v1.0.106 (*)
    │   └── syn v2.0.117
    │       ├── proc-macro2 v1.0.106 (*)
    │       ├── quote v1.0.45 (*)
    │       └── unicode-ident v1.0.24
    ├── serde_json v1.0.150
    │   ├── itoa v1.0.18
    │   ├── memchr v2.8.1
    │   ├── serde_core v1.0.228
    │   └── zmij v1.0.21
    ├── target-triple v1.0.0
    ├── termcolor v1.4.1
    └── toml v1.1.2+spec-1.1.0
        ├── serde_core v1.0.228
        ├── serde_spanned v1.1.1
        │   └── serde_core v1.0.228
        ├── toml_datetime v1.1.1+spec-1.1.0
        │   └── serde_core v1.0.228
        ├── toml_parser v1.1.2+spec-1.1.0
        │   └── winnow v1.0.3
        ├── toml_writer v1.1.1+spec-1.1.0
        └── winnow v1.0.3

and a diff between a cargo license before and after adding the trybuild crate is even more impressive
cargo-license-diff-after-trybuild.txt

Of course there're all dev-dependencies.

For now I pushed this on another branch that you can see here : https://github.com/FBranca/biscuit-rust/tree/proc-macro-error2-to-manyhow-with-trybuild

This shows no change in error messages on tested error cases.

For an unbound variable :

error: datalog parsing error: ParseErrors { errors: [ParseError { input: "\n        can_view($file, $unused) <- right($file, \"read\")", message: Some("the rule contains variables that are not bound by predicates in the rule's body: $unused") }] }
  --> tests/error_message/authorizer_macro.rs:26:13
   |
26 |       let _ = authorizer!(r#"
   |  _____________^
27 | |         can_view($file, $unused) <- right($file, "read");
28 | |         allow if file($f), operation($op), right($f, $op);
29 | |     "#);
   | |_______^
   |
   = note: this error originates in the macro `authorizer` (in Nightly builds, run with -Z macro-backtrace for more info)

Tell me if the added dependencies are OK. If so I'll include the commit in this merge request.

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.

3 participants