pub fn configure()Expand description
Configure the link line for a mysql-handler engine cdylib.
Call this from build.rs. The helper performs three steps:
- Shim staticlib. When the
mysql-handlercrate’s build script producedlibha_rusty_shim.a, it exports the output directory viaDEP_HA_RUSTY_SHIM_STATICLIB_DIR(Cargo’slinksmetadata bridge). The helper emitsrustc-link-searchandrustc-link-lib=static=ha_rusty_shimso the cdylib picks the staticlib up. - C++ runtime. On Apple targets the helper links
c++; on Linux,stdc++. Other targets are skipped — engines targeting them must wire their own runtime. - macOS dynamic lookup. On Apple targets, the helper adds
-Wl,-undefined,dynamic_lookupso the C++ symbols defined inside mysqld (the loading host) are resolved at plugin-load time rather than at link time.
When DEP_HA_RUSTY_SHIM_STATICLIB_DIR is unset — that is, the user
has not opted into MYSQL_HANDLER_FROM_SOURCE=1 or
MYSQL_HANDLER_ARCHIVE=<path> for the mysql-handler dependency —
the helper emits a cargo:warning= describing the env vars to set.
The build is not failed; cargo check and IDE workflows still work,
but the produced cdylib will not load into mysqld.
§Panics
Panics if Cargo did not export TARGET. Cargo always exports it
before invoking a build script, so this branch is unreachable in
practice.