I think this would look like the following:
- Add a
MYSQL_ADD_RUST_PLUGIN macro
- Macro should check that
cargo is available, possibly validate version (not sure what our MSRV is here but I think 1.65 is probably reasonable)
- Dynamic:
cargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=cdylib
- Static:
cargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=staticlib -- --cfg make_static_lib
--release or based on whether it's a debug build
- Output is in
rust/target/debug/ or rust/target/release (can also rename)
Not sure how to handle C code dependency and communicate that with the build system for dynamic, but for static I think it would just work
I think this would look like the following:
MYSQL_ADD_RUST_PLUGINmacrocargois available, possibly validate version (not sure what our MSRV is here but I think 1.65 is probably reasonable)cargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=cdylibcargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=staticlib -- --cfg make_static_lib--releaseor based on whether it's a debug buildrust/target/debug/orrust/target/release(can also rename)Not sure how to handle C code dependency and communicate that with the build system for dynamic, but for static I think it would just work