cloudflare / wirefilter

An execution engine for Wireshark-like filters
https://blog.cloudflare.com/building-fast-interpreters-in-rust/
MIT License
958 stars 85 forks source link

Compilation error in wirefilter-parser #79

Open bluebear94 opened 2 years ago

bluebear94 commented 2 years ago

I’m trying to run the tests for this crate, but it doesn’t compile on a current Rust version.

$ cargo test --workspace
(other output...)
error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
125 |         parse_range!(node, int_lit)
    |         --------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
150 |         parse_range!(node, ipv4_lit)
    |         ---------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected `;`
   --> wirefilter-parser/src/lib.rs:55:18
    |
55  |             $node.children();
    |                  ^
...
155 |         parse_range!(node, ipv6_lit)
    |         ---------------------------- in this macro invocation
    |
    = note: this error originates in the macro `proc_macro_call` (in Nightly builds, run with -Z macro-backtrace for more info)

rustc version: rustc 1.62.1 (e092d0b6b 2022-07-16)
wirefilter version: commit 1fea9c94

cch0 commented 1 year ago

I know literally nothing about rust but am interested in this project. I also ran into the same errors. The errors went away after I did cargo update which updated dependency versions I think. After that, just saw test failures which are easy to fix.

rustup 1.26.0 (2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.70.0 (90c541806 2023-05-31)`
veeshi commented 1 year ago

The wirefilter library in the engine crate no longer uses the pest based parser in the wirefilter-parser crate, there is a handwritten parser in the wirefilter crate which is a lot better, more performant and with better errors for the wirefilter syntax.

sighup1 commented 8 months ago

@cch0 what did you do to fix the tests?

sighup1 commented 8 months ago

@cch0 I spoke too soon I understand now.