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

Windows Support #8

Open
jc324 opened this issue Apr 9, 2022 · 6 comments
Open

Windows Support #8

jc324 opened this issue Apr 9, 2022 · 6 comments

Comments

@jc324
Copy link

jc324 commented Apr 9, 2022

Hi,

Cool library. I would like to suggest windows support, that would be really helpful. So far, I'm just manually patching loader.dart with this:

if (Platform.isWindows) {
  Logger('membrane').info('Opening native library example.dll');
  return DynamicLibrary.open('example.dll');
}

Thanks.

@jc324
Copy link
Author

jc324 commented Apr 9, 2022

I'm not sure how membrane automatically moves the shared libs to the root of the dart package, but it'd also be great to get the Windows DLLs moved.

@The-Mr-L
Copy link

The-Mr-L commented Apr 9, 2022

And I just tried the example on windows 10 x64 and got errors like this

#[async_dart(namespace = "locations")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, 
found `i32`

@jerel
Copy link
Owner

jerel commented Apr 10, 2022

The moving of the so/dylib/dll is usually done via something like xtask. Membrane doesn't automatically do the moving for you so you can choose how you want it done as part of your build process.

I don't have access to a Windows machine to develop on but if it mostly Just Works™️ and needs the loader addition then I'm happy to accept that. Would you want to open a pull request?

So @jc324 is it working for you on Windows but not working at all for @LambdaMan2K? Is there a difference in OS versions or something?

@The-Mr-L
Copy link

The-Mr-L commented Apr 10, 2022

well I just tried the example and it wont compile do to wrong input somehow. it seems strange if this runs for others :)

@jc324
Copy link
Author

jc324 commented Apr 10, 2022

I'm running it on Windows 11, maybe that makes a difference, idk. In example/src/application.rs these two functions work:

#[async_dart(namespace = "accounts")]
pub fn contacts() -> impl Stream<Item = Result<data::Contact, data::Error>> {
  futures::stream::iter(vec![Ok(data::Contact::default())])
}

#[async_dart(namespace = "accounts")]
pub async fn contact(user_id: String) -> Result<data::Contact, data::Error> {
  Ok(data::Contact {
    id: user_id.parse().unwrap(),
    ..data::Contact::default()
  })
}

Most of the rest fail with the error mentioned by @LambdaMan2K.

#[async_dart(namespace = "locations")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, 
found `i32`

There also seems to be an error on the dart side when calling a rust function that accepts Vec<String> as an arg.

@jc324
Copy link
Author

jc324 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants