raviqqe / melior

The rustic MLIR bindings in Rust
https://raviqqe.github.io/melior/melior/
Apache License 2.0
329 stars 39 forks source link

melior cannot find melior-macro when building from source #542

Closed Moxinilian closed 6 months ago

Moxinilian commented 6 months ago

I'm trying to get started with my fork of melior but I get very bizarre errors: when trying to build melior, for some extremely bizarre reason invoking rustc via cargo will not find the melior-macro crate (while rust-analyzer will!!):

    Checking melior v0.18.1 (/home/theodegioanni/github/melior/melior)
error[E0463]: can't find crate for `melior_macro`
 --> melior/src/ir/attribute/attribute_like.rs:5:5
  |
5 | use melior_macro::attribute_check_functions;
  |     ^^^^^^^^^^^^ can't find crate

generating dozens of similar errors where anything macro-related is expected.

I tried to walk through how the crate is resolved and it seems to somehow have a circular dependency via its dev-dependencies. Could that be related to the issue?

I am applying a patch to a custom mlir-sys and tblgen-alt to support LLVM 19, and I am running the build using cd melior && cargo check, but cargo check -p melior yields similar results.

Moxinilian commented 6 months ago

Okay, my patch of tblgen-rs-alt was botched. I managed to get this going with a horrible hack with LLVM 19 in mlir-sys and LLVM 18 in tblgen-rs-alt.