thlorenz / rid

Rust integrated Dart framework providing an easy way to build Flutter apps with Rust.
64 stars 4 forks source link

Build 'dart run ffigen' issue #48

Closed Roms1383 closed 2 years ago

Roms1383 commented 2 years ago

Hi there ! I'm trying to use rid on my personal project and ran into an issue while building:

Screen Shot 2564-10-18 at 14 53 04

My local environment is:

dev-machine

I'm running rid inside a cargo workspace, which I setup as specified :

../../contributions/rid/rid-template-flutter/setup.sh agent

where agent is the name of the crate.

p.s: right after running setup.sh both path to rid and rid-build were incorrectly set in Cargo.toml but I fixed it already.

I already have all the required stuff like Rust, Flutter, Android SDK, etc.


I don't really know where I should set this llvm-path, so I've already tried:

brew install llvm

followed by:

echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc

as suggested online, without success.


Some help would be appreciated :)

Roms1383 commented 2 years ago

p.s: in the meantime I'm gonna go through the videos once more to see what I've missed, but I'd gladly write down some installation documentation if it can help other people to get up and running fast, since going through the videos again and again is a bit time-consuming.

Roms1383 commented 2 years ago

given my llvm location:

Screen Shot 2564-10-18 at 19 58 35

I've tried the llvm-path configuration option like so:

// ./agent/plugin/pubspec.yaml
# ...
dependencies:
  ffi: ^1.0.0
  ffigen:
    version: 4.0.0-dev.2
    llvm-path:
      - '/opt/homebrew/opt/llvm'
      # or
      # - '/opt/homebrew/opt/llvm/lib'
      # - '/opt/homebrew/opt/llvm/bin'
# ...

but then I get:

Screen Shot 2564-10-18 at 19 55 28
thlorenz commented 2 years ago

Thanks for reporting Looks like once #42 is merged this should be fixed. For now you can try to switch to that version. cc @mz2

thlorenz commented 2 years ago

I just merged it, so if you pull latest master it should work. Please LMK if you still have problems and we'll look into fixing it.

Roms1383 commented 2 years ago

Oh actually I pulled your latest changes and got it running without any crash! 👌 Also, I locally updated ffigen like so: ffigen: ^4.1.0 but I checked and it does work with 4.0.0-dev.2 as well. Thanks!

thlorenz commented 2 years ago

Awesome, I wasn't aware ffigen: ^4.1.0 was released. We should switch to that at some point. But we'd have to update this everywhere, including .github/workflow, the examples and tests.

LMK if you wanna do a PR with that, otherwise I'll do take care of it at some point.

Roms1383 commented 2 years ago

Done in #49 👌