Code Monkey home page Code Monkey logo

Comments (10)

ASMfreaK avatar ASMfreaK commented on June 7, 2024 2

I'll make a PR with solution and some other improvements

from tinysearch.

ASMfreaK avatar ASMfreaK commented on June 7, 2024 1

The thing that worked for me:

  1. Clone tinysearch repo somewhere:
git clone https://github.com/tinysearch/tinysearch.git
  1. Go to bin inside repo:
cd tinysearch/bin
  1. Run cargo install from it:
cargo install --path .

from tinysearch.

mre avatar mre commented on June 7, 2024

The engine code gets extracted into a temp dir. It's just another cargo project that gets compiled with wasm-pack. That's why the Cargo.toml is needed. Looks like the Cargo.toml isn't properly included in the binary for some reason.

// The search engine code gets statically included into the binary.
// During indexation (when running tinysearch), this will be compiled to WASM.
include!(concat!(env!("OUT_DIR"), "/engine.rs"));

I thought we fixed that already.

from tinysearch.

ms-ati avatar ms-ati commented on June 7, 2024

Hi @mre thanks for all this work. Would you be interested if I were to contribute Github Action tests which would provide regression testing against these issues, by fully building and running and verifying on each PR? Apologies if this exists but is in some way not yet sufficient coverage, I’d also be happy to help address in that case as well.

from tinysearch.

mre avatar mre commented on June 7, 2024

Yeah that would be nice. Sorry for the limited availability at the moment, but your help would be much appreciated.
@Jieiku fyi. Not sure if you could look into that.
The Github action (https://github.com/leonhfr/tinysearch-action) is maintained by @leonhfr.

from tinysearch.

ASMfreaK avatar ASMfreaK commented on June 7, 2024

I have the same issue. I think it is caused by cargo install tinysearch not including the right assets (needed for engine.rs). The issue is cause by these lines:

.dir("../engine", Compression::Gzip)
.dir("../shared", Compression::Gzip)

It is also caused by cargo install getting sources not from github, but from crates.io. Here is the listing from cargo's build folder for tinysearch:

$ tree ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tinysearch-0.7.0/
~/.cargo/registry/src/github.com-1ecc6299db9ec823/tinysearch-0.7.0/
├── assets
│   ├── demo.html
│   └── stopwords
├── build.rs
├── Cargo.lock
├── Cargo.toml
├── Cargo.toml.orig
└── src
    ├── index.rs
    ├── main.rs
    └── storage.rs

2 directories, 9 files

For some reason the lines mentioned previously were NOT failing the build script and therefore the build.

from tinysearch.

mre avatar mre commented on June 7, 2024

@ASMfreaK if you can provide a fix for that and create a pull request I'd be extremely thankful. Thanks for the investigation! 😊

from tinysearch.

davehorner avatar davehorner commented on June 7, 2024

std::env::var is correct in build scripts according to some reading i did. format!("{}{}",std::env::var("OUT_DIR").unwrap()

c:\working\website\tinysearch>tinysearch dave.json
Unpacking tinysearch WASM engine into temporary directory "C:\\Users\\dhorner\\AppData\\Local\\Temp\\.tmpSvFk54"
Starting unpack
Copying index into crate
Compiling WASM module using wasm-pack
 INFO 2023-03-04T19:06:50Z: wasm_pack::command: Running build command...
Error: crate directory is missing a `Cargo.toml` file; is `C:\Users\dhorner\AppData\Local\Temp\.tmpSvFk54\engine` the wrong directory?
Error: failed to execute "wasm-pack" "build" "C:\\Users\\dhorner\\AppData\\Local\\Temp\\.tmpSvFk54\\engine" "--target" "web" "--release" "--out-dir" "\\\\?\\C:\\working\\website\\tinysearch\\wasm_output"
status: exit code: 1

Not sure my contribution is a solution after all.

from tinysearch.

Jieiku avatar Jieiku commented on June 7, 2024

This is exactly the problem I get if I try to install via cargo, but building from git seems to work fine.

here I get the same error: #151 (comment)

here everything works if I build from git: #151 (comment)

from tinysearch.

mre avatar mre commented on June 7, 2024

This is resolved now.

The reason why it broke was a limitation by cargo: it does not allow including one crate inside another one. This is done to avoid unwanted complexity and is a sane default. In our case, however, it leads to the situation that the engine crate was missing from the tinysearch crate on crates.io.
See also #170 (comment).

The latest tinysearch 0.8.2 fixes this issue. Apologies for the long delay to produce a fix.

from tinysearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.