Skip to content

Add fallible TBLIS dynamic loading - #4

Draft
shinaoka wants to merge 1 commit into
RESTGroup:mainfrom
shinaoka:codex/fallible-dyload
Draft

Add fallible TBLIS dynamic loading#4
shinaoka wants to merge 1 commit into
RESTGroup:mainfrom
shinaoka:codex/fallible-dyload

Conversation

@shinaoka

Copy link
Copy Markdown

Summary

  • add try_dyload_lib() for callers that need to handle an unavailable TBLIS shared library without panicking
  • add a structured DyLoadError for library-discovery and required-symbol failures
  • keep dyload_lib() as the backward-compatible panic-on-failure wrapper
  • leave failed attempts uncached so callers can update loader environment variables and retry

Motivation

Dynamic library absence is a normal runtime condition for applications that treat TBLIS as an optional provider. The current dyload_lib() API reports discovery failures only through panic!, forcing downstream libraries to use catch_unwind for ordinary availability probing. It also makes that probing incompatible with panic = "abort" applications.

This change preserves the existing API while providing a normal Result path.

Validation

  • cargo test -p tblis-ffi --no-default-features --features dynamic_loading --lib
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --features dynamic_loading -- -D warnings
  • cargo clippy --all-targets -- -D warnings
  • cargo check -p tblis-ffi --no-default-features

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