It would be great if neon bindings would work inside a workspace.
Currently it appears you can build, but since the target is at the top level of the workspace, neon can't locate the generated .so file.
@jgrund Curious, do you mean yarn workspaces or cargo workspaces? I'm guessing yarn?
Cargo workspaces. Here is an example repo where I'm using neon in a workspace: https://github.com/intel-hpdd/rust-libzfs/
This is very much top of mind! There's the beginnings of a discussion of using workspaces in the cargo wrapper RFC. I don't think that RFC is 100% nailed yet, but would love your thoughts about it if you have a chance to read it. I will also run through it again and make sure examples like yours are doable.
Labeling as needs RFC because it should be addressed by the cargo wrapper RFC once it's in a shape we all like (i.e., it doesn't need a separate RFC from that).
Just chiming in to say that I would really absolutely love being able to use use neon inside cargo workspaces.
@retep998 My use case for workspaces is pretty simple. I wanted to be able to build from the root as well as use RLS in VS Code (which requires the root of the project be a Rust project). If your use case is similar, there is a workaround. Create a .cargo/config file that sets the target to native/target.
mkdir -p .cargo
cat >> .cargo/config << EOF
[build]
target-dir = "native/target"
EOF
This should also support multiple Rust crates. However, it would only allow for a single Neon library. If you needed multiple Neon libraries, it might work to symlink.
@kjvalencik This sort of works. It can now find the .so file.
But I receive: Error: libstd-e39317eb74365d3c.so: cannot open shared object file: No such file or directory
When i try to require the .node file
Should this be closed now that https://github.com/neon-bindings/neon/pull/442 is resolved?
@amilajack I think it should remain open because it still does not support multiple neon modules in a workspace.
@kjvalencik limits in support is only about multiple neon modules in a workspace? if the workspace has a neon module, a lib and a cli is it supported currently?
@jhg. Yes, that should work perfectly.
Most helpful comment
@jhg. Yes, that should work perfectly.