You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to follow the examples shown here to make plugins for rust using the C FFI. Unlike the simple example here, the plugins in my use case take some rust structs as &mut Struct and work on that or modify them. Furthermore, the struct are like nodes in a tree so they have references to other structs like their parent and children.
The plugin system was working great when everything was in the same workspace and compiled together. But once I separated the core library to make plugins externally (I'd think that's how people will develop the plugin, and share it.) then suddently I get seg fault when trying to access the struct parent and other components. I think it's because the internal layout of the struct is not same on different compilation events, so checking rustc version and core version didn't help.
Since there are such few information and tutorials on this. I wanted to ask you if you ever did the separate compilation thing. And also is there any actual well-used programs that use this plugin system? If yes, that'd help me immensely while trying to develop mine.
My plan was to develop a plugin system where people can develop and share the .so plugins. But ideally the plugins will be open source and compiled by the user. But having to put all plugins in the same workspace and compiling the program again everytime would be useless, as in that case just adding the "plugins" in the main program's source code with build.rs or something would make it safe.
The text was updated successfully, but these errors were encountered:
Hi,
I tried to follow the examples shown here to make plugins for rust using the C FFI. Unlike the simple example here, the plugins in my use case take some rust structs as
&mut Struct
and work on that or modify them. Furthermore, the struct are like nodes in a tree so they have references to other structs like their parent and children.The plugin system was working great when everything was in the same workspace and compiled together. But once I separated the
core
library to make plugins externally (I'd think that's how people will develop the plugin, and share it.) then suddently I get seg fault when trying to access the struct parent and other components. I think it's because the internal layout of the struct is not same on different compilation events, so checking rustc version and core version didn't help.Since there are such few information and tutorials on this. I wanted to ask you if you ever did the separate compilation thing. And also is there any actual well-used programs that use this plugin system? If yes, that'd help me immensely while trying to develop mine.
My plan was to develop a plugin system where people can develop and share the .so plugins. But ideally the plugins will be open source and compiled by the user. But having to put all plugins in the same workspace and compiling the program again everytime would be useless, as in that case just adding the "plugins" in the main program's source code with
build.rs
or something would make it safe.The text was updated successfully, but these errors were encountered: