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

FlockElement and WaitFlockUnlock not implemented for File for wasm32-unknown-unknown build target #4

Open
bicarlsen opened this issue Oct 15, 2022 · 3 comments

Comments

@bicarlsen
Copy link

When using cluFlock on a wasm32-unknown-unknown build target I receive the errors

error[E0277]: the trait bound `File: FlockElement` is not satisfied.
error[E0277]: the trait bound `File: WaitFlockUnlock` is not satisfied. 

Context

I am using the settings_manager crate in a Tauri application. settings_manager depends on cluFlock. When building the application, which depends on settings_manager, to a wasm32-unknown-unknown target I receive the errors. However, when building to other targets (specifically x86_64-unknown-linux-gnu) everything builds fine.

Dependency graph
cluFlock <- settings_manager <- Tauri application

I wasn't sure what the most useful info to provide here was, so tried to give an overview. If there is anything else that would be useful, please let me know.

@bicarlsen bicarlsen changed the title FlockElement not implemented for File on wasm32-unknown-unknown architecture FlockElement and WaitFlockUnlock not implemented for File on wasm32-unknown-unknown architecture Oct 15, 2022
@bicarlsen bicarlsen changed the title FlockElement and WaitFlockUnlock not implemented for File on wasm32-unknown-unknown architecture FlockElement and WaitFlockUnlock not implemented for File for wasm32-unknown-unknown build target Oct 15, 2022
@denisandroid
Copy link
Member

Thanks for reaching out, please post a minimal example with the settings_manager library for the Tauri platform in order to reproduce the bug and fix it.

At the moment, I have no idea about the implementation of flock for the wasm32-unknown-unknown platform, since under linux these are specific calls from libc, under windows from winapi, and under wasm I have no idea.

@bicarlsen
Copy link
Author

To recreate the errors:

  1. Create a new Tauri app
    a. Select Cargo as the package manager
    b. Select Yew as the UI template
  2. In the workspace's Cargo.toml (top level), add dependencies
    a. getrandom = { version="0.2", features = ["js"] }
    b. settings_manager = "0.0.1"
  3. Run the app with cargo tauri dev, this should reproduce the errors.

@bicarlsen
Copy link
Author

bicarlsen commented Oct 25, 2022

To implement this, could we use the mkdir strategy for web_sys::File? Something similar to Node's proper-lockfile.

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

2 participants