"lalrpop_mod" error

I've a workspace with this source tree:

  • crates
    • parser
      • parser
        • css_parser.rs
        • css.lalrpop
        • ...
      • lib.rs
    • ...
  • Cargo.toml (workspace)

css_parser.rs contents:

use lalrpop_util::lalrpop_mod;

lalrpop_mod!(pub css, "/crates/parser/parser/css.rs");

I've tried different ways of writing this macro call, but I keep getting:

couldn't read C:\...\as3parser\target\debug\build\as3_parser-d8abfab424abcc27\out/crates/parser/parser/css.rs:
The system cannot find the path specified.

When you build the project, look for css.rs in target. Then adjust the path so it points there.

Edit: you could run tree "C:\...\as3parser\target\debug\build\as3_parser-d8abfab424abcc27\out" in a cmd prompt to see what's inside.

1 Like

Hm, there's no css.rs in target after a recursive search. (It'd be difficult too, since there are debug and release directories).

I'm currently getting an auto generated css.rs from LALRPOP in the same directory as css_parser.rs.


I've run that tree command you mentioned and got empty output.

That sounds like a very badly behaved proc macro from lalrpop. Could you share the full code or at least your dependencies and any calls to macros from the lalrpop crate?

Or do you have your own build script?

Since it's an open-source project, I'll share the repository, although quite a bit large:

It does have that build script:

fn main() {
    lalrpop::process_root().unwrap();
}

Sorry, I had not provided a MRP

You can configure the generator to use a different output folder. I've submitted a pull request with the needed changes: fix build script by jendrikw · Pull Request #1 · hydroper/as3parser · GitHub

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.