Skip to content

Emit good error message, if model package is not a dynamic library #847

@hannobraun

Description

@hannobraun

As of now, this is what happens when you try to load a model (via fj-app -m path/to/model) that doesn't build a dynamic library:

thread 'main' panicked at 'Error reloading model: LibLoading(DlOpen { desc: "target/debug/liberror.so: cannot open shared object file: No such file or directory" })', crates/fj-host/src/lib.rs:279:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This should result in a nice error message that explains what it wrong and how to fix it. The fix would be to add the following to the model's Cargo.toml:

[lib]
crate-type = ["cdylib"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementNew features and improvements to existing features

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions