Open abrown opened 1 year ago
@abrown 😢. The renaming definitely exposes this. It was coded to be the same basename as the wasm file (benchmark.wasm) and be minimally invasive into some of the other logic, but now we need to go ahead and propagate the name of the so. A proper change.
When running a native benchmark that is not named
benchmark.so
, the native engine will fail due to this hard-coded address:https://github.com/bytecodealliance/sightglass/blob/04546548e60dcce4b6691f8ddb75442c4d251ad9/engines/native/libengine/src/lib.rs#L285
Previously this was just a paper cut, only affecting in-development benchmarks (one would expect the native engine to open
your-benchmark-path.so
but it would not) but now that multiple benchmarks can live in a single directory, the path given to thesightglass-cli benchmark
command should be the one communicated to the native engine. (Some thoughts: (a) add a new field to theWasmBenchConfig
passed in to the native engine inwasm_bench_create
, (b) hack thewasm_bytes
passed towasm_bench_compile
to contain something likeNATIVE_PATH###/path/passed/to/sightglass.so
instead of the bytes of the shared library, which are useless.)