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

Hash mismatch on linux with matching hashes #1932

Closed
TaeHagen opened this issue May 11, 2024 · 5 comments
Closed

Hash mismatch on linux with matching hashes #1932

TaeHagen opened this issue May 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@TaeHagen
Copy link

Describe the bug

Bad state: Content hash on Dart side (-1867643805) is different from Rust side (1953154019), indicating out-of-sync code. This may happen when, for example, the Dart code is hot-restarted/hot-reloaded without recompiling Rust code. (Note: This is just a sanity check. Even if content hash does not change, the code may still change and needs to be recompiled)

However, the content hash in both the generated dart and rust source are the same -1867643805

Steps to reproduce

no clue why this happens

Logs

logs are too long for post

Expected behavior

No response

Generated binding code

No response

OS

No response

Version of flutter_rust_bridge_codegen

No response

Flutter info

No response

Version of clang++

No response

Additional context

Is the new rust library somehow not being used? I ran flutter clean, still same problem

@TaeHagen TaeHagen added the bug Something isn't working label May 11, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented May 12, 2024

Is the new rust library somehow not being used?

I suspect so. What about trying to delete the whole target directory in rust, which contains all compiled Rust files.

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label May 12, 2024
@TaeHagen
Copy link
Author

I did that, and now it works! I can't believe I didn't think of that 🤦. I suspect that would have resolved my other bug report that fixed itself upon wiping. You might want to document that as a troubleshooting step, or add it to the error message. Thank you!

@fzyzcjy
Copy link
Owner

fzyzcjy commented May 12, 2024

(For potential future readers: The other issue is #1863)

@fzyzcjy
Copy link
Owner

fzyzcjy commented May 12, 2024

You are welcome, and happy to see that this checker does catch the problem in #1863!

You might want to document that as a troubleshooting step, or add it to the error message.

Looks reasonable, and feel free to PR to change the https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/website/docs/manual/troubleshooting.md :)

@fzyzcjy
Copy link
Owner

fzyzcjy commented May 26, 2024

Close since fixed. Feel free to reopen if needed!

@fzyzcjy fzyzcjy closed this as completed May 26, 2024
@fzyzcjy fzyzcjy removed the awaiting Waiting for responses, PR, further discussions, upstream release, etc label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants