-
Notifications
You must be signed in to change notification settings - Fork 307
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
[Bug] ffigen tries to write to working-directory #494
Comments
flutter_rust_bridge is doing nothing but invoking ffigen. So could you please try to invoke |
Can you give me some pointers on how to "invoke ffigen directly"? |
Just run commands in a shell... |
Well yeah obviously, but which command with which parameters? At the moment I'm using Of course it's very easy to see what get's called by
|
Thus I guess: Well indeed you also need to put contents into that auto-generated temporary config file. |
And what content's should I put there? The config file created by
UPDATE: so by googling a bit I found I can watch the
So I guess my next step is to process this output and copy every line that contains the String CREATE or MODIFY and copy away the resulting file for manual inspection afterwards. Tomorrow. Now I'm tired and I gotta sleep. |
Well, maybe modify frb_codegen and force it not to delete it... Or use your method of "copying it before it is deleted" which sounds promising! Third method, if I remember correctly, when you enable RUST_LOG=debug, the config prints out automatically. (Notice your RUST_LOG=debug is wrong in the first post in this issue) |
I've set But now I've came up with this bash-script to copy those temp files away before deletion:
which I was able to use to copy the config file's content away, which is:
After replacing the path of the deleted file
Instead running ffigen from my repository path (where it has write access) gives:
The content of the header file that makes ffigen produce that error:
|
is wrong.
|
Great! Now it is a ffigen problem, so you have a reproducible sample and can file an issue there :) |
Oh, thanks for catching that mistake with setting the variables. I wonder why it works for my REPO_DIR variable. Okey, so next I should file an issue @ https://github.com/dart-lang/ffigen/issues about ffigen trying to write to the current working directory with my given example header file, did I understand that correctly? |
Yes. I cannot fix ffigen bugs, surely :) |
Okey, so after reading some more I found a different workaround for that stdbool.h not found error @ dart-lang/native#338
With that I don't have to run ffigen from / but can stay at my repository path, where it's no problem when ffigen tries to write to the working directory. |
You are welcomed to make a PR to documentation as well :) |
okey, here's a documentation PR: |
does your "laugh"-smiley-reaction mean I did something stupid? |
Surely no! It means you did a good job and I smiled :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Describe the bug
I need to run flutter_rust_bridge_codegen with working directory = / (root folder) to work around http://cjycode.com/flutter_rust_bridge/troubleshooting.html?highlight=std#the-generated-store_dart_post_cobject-has-the-wrong-signature--stdargh-file-not-found-in-linux #108 #472
But it seems in some cases (api.rs pub struct with pub const in impl block), flutter_rust_bridge_codegen tries to write to the working directory, which results in a permission denied error.
Codegen logs with
RUST_LOG=debug
env variableTo Reproduce
No response
Expected behavior
No response
Generated binding code
No response
OS
Manjaro (~Arch) Linux
Version of
flutter_rust_bridge_codegen
1.30.0
Flutter info
Version of
clang++
No response
Version of
ffigen
No response
Additional context
see also: #486
The text was updated successfully, but these errors were encountered: