The GitHub Actions job "CI" on tvm-ffi.git/rust-macro-ergonomics has succeeded.
Run started by GitHub user lucifer1004 (triggered by lucifer1004).

Head commit for run:
23959513f90e90a8f0699d864898224074f6f814 / Zihua Wu 
<[email protected]>
[FIX][RUST] use $crate:: in tvm_ffi_dll_export_typed_func! and ensure!

Three small bugs in the Rust ergonomics that prevented the macros from
being usable from downstream cdylibs:

1. `ensure!` expanded to `crate::bail!`, which resolves to the *caller*
   crate at expansion site rather than `tvm_ffi`. Switched to
   `$crate::bail!` so the path resolves correctly in any crate.

2. `tvm_ffi_dll_export_typed_func!` referenced `tvm_ffi_sys::TVMFFIAny`
   without a `$crate::` prefix, forcing every downstream crate to add
   `tvm-ffi-sys` to its own `[dependencies]`. Switched to
   `$crate::tvm_ffi_sys::TVMFFIAny`; downstream now only needs `tvm-ffi`.

3. The generated `pub unsafe extern "C" fn __tvm_ffi_<name>` had no
   `#[no_mangle]`, so the linker stripped the symbol from cdylibs and
   `Module::GetFunction` could not find it. Added `#[unsafe(no_mangle)]`
   (supported in 2021 + 2024 editions on rustc >= 1.82).

Verified by building a downstream cdylib that only depends on `tvm-ffi`
(no `tvm-ffi-sys` direct dep), loading it via `tvm_ffi.load_module(...)`,
and calling exported scalar + Tensor functions from Python.

Report URL: https://github.com/apache/tvm-ffi/actions/runs/25897979446

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to