Skip to content

Conversation

@bertschinger
Copy link
Contributor

This demonstrates integrating Rust into the MarFS code by creating a Rust program that verifies a MarFS config.

This is still a work in progress. There is no integration in terms of the build system yet. make still only builds the C code.

To build the Rust code, do:

$ make && cargo build --manifest-path rust_src/Cargo.toml

This will make FFI with Rust easier, as Rust expects the config
flags to be unsigned types.
This makes it easier to catch all new files when adding new code
such as the new Rust code.
The purpose of these Rust wrappers is to create an API for the marfs
config that does not expose pthread_mutex_t to the Rust side.
These functions end up being defined in multiple object files. Those
object files get linked together into the Rust binary that statically
links various MarFS libraries. This resulted in the linker giving
"multiple definition" errors for these symbols.

Designate these functions 'static' so that they are not defined in
multiple shared object files.
This is an initial work-in-progress config verify command
that demonstrates the use of Rust bindings to call the C MarFS
functions from Rust code.
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

Successfully merging this pull request may close these issues.

1 participant