diff --git a/crates/main/src/lib.rs b/crates/main/src/lib.rs index f8b6403..1213037 100644 --- a/crates/main/src/lib.rs +++ b/crates/main/src/lib.rs @@ -38,6 +38,7 @@ mod logger; mod module_manifest; pub mod mounted_binary; mod result; +mod sdk_version_embedder; pub use call_parameters::CallParameters; pub use call_parameters::SecurityTetraplet; @@ -59,6 +60,9 @@ pub use result::get_result_size; pub use result::set_result_ptr; pub use result::set_result_size; +pub use module_manifest::MANIFEST_SECTION_NAME; +pub use sdk_version_embedder::VERSION_SECTION_NAME; + #[allow(unused_variables)] pub(crate) fn log>(msg: S) { // logs will be printed only if debug feature is enabled diff --git a/crates/main/src/module_manifest.rs b/crates/main/src/module_manifest.rs index 2dac510..ac8a97b 100644 --- a/crates/main/src/module_manifest.rs +++ b/crates/main/src/module_manifest.rs @@ -14,6 +14,9 @@ * limitations under the License. */ +// TODO: avoid duplication with the link_section when key-value attributes become stable +pub const MANIFEST_SECTION_NAME: &str = "__fluence_wasm_module_manifest"; + #[macro_export] macro_rules! module_manifest { ($authors:expr, $version:expr, $description:expr, $repository:expr) => { diff --git a/src/sdk_version_embedder.rs b/crates/main/src/sdk_version_embedder.rs similarity index 88% rename from src/sdk_version_embedder.rs rename to crates/main/src/sdk_version_embedder.rs index e3463cc..57c2071 100644 --- a/src/sdk_version_embedder.rs +++ b/crates/main/src/sdk_version_embedder.rs @@ -32,6 +32,9 @@ const fn sdk_version() -> [u8; VERSION_SIZE] { version_as_array } +// TODO: avoid duplication with the link_section when key-value attributes become stable +pub const VERSION_SECTION_NAME: &str = "__fluence_sdk_version"; + #[cfg(target_arch = "wasm32")] #[link_section = "__fluence_sdk_version"] #[doc(hidden)] diff --git a/src/lib.rs b/src/lib.rs index c4e8c21..f1de40b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,8 +67,6 @@ )] #![warn(rust_2018_idioms)] -mod sdk_version_embedder; - pub use fluence_sdk_macro::fce; pub use fluence_sdk_main::CallParameters;