Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Error when using lucet-runtime #73

@lostman

Description

@lostman

I tried the example from:
https://github.com/fastly/lucet/blob/master/lucet-runtime/src/lib.rs

use lucet_runtime::{DlModule, Limits, MmapRegion, Region};

fn main() {
    let module = DlModule::load("hello.so").unwrap();
    let region = MmapRegion::create(1, &Limits::default()).unwrap();
    let mut inst = region
        .new_instance_builder(module)
        .build()
        .unwrap();
    inst.run(b"_start", &[]).unwrap();
}

However, I'm getting an error:

$ ./target/debug/lucet-example
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: DlError(Custom { kind: Other, error: StringError("/stuff/lucet-example/hello.so: undefined symbol: lucet_vmctx_grow_memory") })', src/libcore/result.rs:997:5

I can run the module with lucet-wasi

$ ../lucet/target/release/lucet-wasi hello.so
Hello world!

After some poking around I managed to get this to work by adding lucet-example crate to lucet workspace.

Could you clarify why is this happening and what is a proper way to depend on lucet-runtime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions