Closed cipherchabon closed 3 years ago
Update:
I was able to resolve the above error by modifying in the rid-build/src/ffigen/run_ffigen.rs
file the value for FFIGEN_RUNNER
from "dart" to "flutter pub".
const FFIGEN_RUNNER: &str = "flutter pub";
But now I have the following problem:
2021-08-25 17:55:48,565 INFO [rid_build] Injecting Swift code into plugin
2021-08-25 17:55:48,566 DEBUG [rid_build::ffigen::run_ffigen] Running '"flutter pub" "run" "ffigen" "--config" "/tmp/.tmp43kuXV/ffigen_config.yaml"' thread 'main' panicked at 'Build failed: No such file or directory (os error 2)', rid_build.rs:30:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Any help would be greatly appreciated. Thank you.
@cypherchabon if you made any progress with this after the changes I provided to the examples, please update here so we can resolve this issue.
With the last changes you made in the examples, you can run only the dart one without problems.
However with the examples for Flutter I still have the situation raised in the issue.
The error is this:
thread 'main' panicked at 'Build failed: No such file or directory (os error 2)', rid_build.rs:29:26
And line 29 is this:
let tmp_dir = tempdir().context("Failed to create tmpdir")?;
It seems to be a problem with tempfile
.
Ah wow I hope it's not a permissions problem.
Could you file an issue with the tempfile
crate? Maybe they can help and/or fix the problem.
@MGlolenstine did you run into these issues as well (I think I remember you're on Linux as well)?
@cypherchabon realizing this is now trying to address two issues. Could you please file a separate issue for the tempfile
problem so we can just focus on the flutter run
vs. dart run
part here?
Update:
I was able to resolve the above error by modifying in the
rid-build/src/ffigen/run_ffigen.rs
file the value forFFIGEN_RUNNER
from "dart" to "flutter pub".const FFIGEN_RUNNER: &str = "flutter pub";
You shouldn't have to change the code to get rid to work properly, so we need to find a solution that works for all cases.
Afaik @MGlolenstine found dart run
to work better than pub run
for instance (see this commit in a related rid-examples
PR.
I'd like to figure out some way that works in all cases or at least automatically figure out which command to use in a specific scenario.
But now I have the following problem:
2021-08-25 17:55:48,565 INFO [rid_build] Injecting Swift code into plugin 2021-08-25 17:55:48,566 DEBUG [rid_build::ffigen::run_ffigen] Running '"flutter pub" "run" "ffigen" "--config" "/tmp/.tmp43kuXV/ffigen_config.yaml"' thread 'main' panicked at 'Build failed: No such file or directory (os error 2)', rid_build.rs:30:26 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Any help would be greatly appreciated. Thank you.
I assume this is still an issue after the changes to examples?
Is this caused by the tempfile
problem? If so let's link this comment in the separate issue that we should create.
I haven't encountered this issue myself (the file permission one), but "dart run" is available when installing the flutter, where "pub run" is deprecated and getting removed, so I think we should be switching to the specialised commands ("dart run" and "flutter run").
I will try recreating the issue and try to debug it.
@cypherchabon realizing this is now trying to address two issues. Could you please file a separate issue for the
tempfile
problem so we can just focus on theflutter run
vs.dart run
part here?
I made two separate issues and close this one.
I am following the guide step by step, and when I run sh/bindgen I get this error: