pelican-plugins / search

Pelican plugin that adds site search capability
47 stars 9 forks source link

Use wasm Stork to build the index? #19

Open maphew opened 1 year ago

maphew commented 1 year ago

Maybe this is a stupid question born of ignorance, but is there a way to use the wasm version of Stork to build the search index instead of having to compile an executable for the local platform?

Issue

Why: on Windows installing Stork requires downloading ~7 GB of Visual Studio build tools and installing 'Desktop development with C++' kit, on top of Rustup (recipe).

Running wasm locally is reportedly possible: https://blog.devgenius.io/running-wasm-binaries-in-on-your-local-system-69694e100083, though this example also requries a local compiler so, yeah, nothing gained. However that was over 2 years ago so maybe there are other ways?

maphew commented 1 year ago

Possible avenues:

maphew commented 1 year ago

well I can report the naive approach doesn't work! ;-)

» winget install wasmer
» refreshenv
» set STORKVERSION="v1.5.0"
» wget https://files.stork-search.net/releases/%STORKVERSION%/stork.wasm

» wasmer run stork.wasm
error: failed to run `stork.wasm`
╰─▶ 1: Error while importing "wbg"."__wbg_new_693216e109162396": unknown import. Expected Function(FunctionType { params: [], results: [I32] })
justinmayer commented 1 year ago

Good to know! Thanks for trying. I agree it'd be nice not to have to rely on platform-specific binaries. I suspect the Stork Discussions forum might be a good place to ask James about this, since he'll certainly know more about the feasibility than I do. 😊