Closed temeddix closed 1 year ago
I made a vec_to_dart_native_external_typed_data
function to avoid code duplication. Also, I added CI tests with cargo features enabled, which uses cargo fmt
and clippy
, that also tells you about an error.
Could we take a moment to think about how would be able to test something like that in our Mocked DartVM vm.rs
?
@fzyzcjy did you figure out a way to do End to End testing with Memory checks using real Dart VM And Rust?
@fzyzcjy did you figure out a way to do End to End testing with Memory checks using real Dart VM And Rust?
Check the valgrind section in my ci.yaml. However, I just checked memory leaks, and do not check invalid memory accesses, because Dart seems to violate so many valgrind operations...
@fzyzcjy did you figure out a way to do End to End testing with Memory checks using real Dart VM And Rust?
Check the valgrind section in my ci.yaml. However, I just checked memory leaks, and do not check invalid memory accesses, because Dart seems to violate so many valgrind operations...
Related: dart-lang/sdk#47346
Fair enough. @temeddix are you open to make a PR that introduce these kind of checks into our code and then we merge it here into your PR? I want to make sure that we do not introduce any other memory bugs because of a new feature we added.
I'm not familiar with valgrind tests, but I'll try to apply those in a few days :) I'll refer to flutter_rust_bridge repo.
I dug into the valgrind test code of flutter_rust_bridge
for some time, and unfortunately, it is too complicated for me to make that work here.
In flutter_rust_bridge
, Github CI calls a justfile command, and that justfile command calls many other justfile commands, some of which call the .sh
bash commands in the Dart folder, which calls a Python code, which executes valgrind. This logic is not simple enough for me to fully understand properly.
Apart from this 'deep call stack', there's no Dart example like flutter_rust_bridge
in this repo. There are only Rust files here, which means many Dart codes for testing the library's features should be added. I'm not sure if I can understand all the features of this library and organize it into a testing Dart file. This complexity deserves a whole new PR :|
In my opinion, we could focus on fixing the bug and adding CI for Rust linting error in this PR.
Fair enough. Okay I guess I will go an merge this PR.
I am sorry to tell that I left out one of the most important changes when I was making the previous #39 PR.
self
should be passed toManuallyDrop
instead ofself.0
, because this one doesn't have aZeroCopyBuffer
wrapper. I apologize for the mistake.