Code Monkey home page Code Monkey logo

Comments (19)

blakehawkins avatar blakehawkins commented on May 27, 2024 1

0.6.2 release is not working for me either, but current head of master branch works

I think that this fixed it.

@mre I recommend to make a new cargo release 0.6.3

from tinysearch.

mre avatar mre commented on May 27, 2024 1

I created a pull request here: #154.
If someone could test this and report back I'd be very thankful.

from tinysearch.

mre avatar mre commented on May 27, 2024 1

Can you try again using cargo install tinysearch? I think that's what people have problems with.

from tinysearch.

mre avatar mre commented on May 27, 2024 1

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.

mre avatar mre commented on May 27, 2024

Huh, it looks like the engine is not statically included inside the tinysearch binary. Maybe I broke something during the last release... 🤔

from tinysearch.

blackary avatar blackary commented on May 27, 2024

Any updates on this?

from tinysearch.

mre avatar mre commented on May 27, 2024

@blackary did you run into the same issues? Any additional output you could provide to narrow this down a little? Sorry for the late response.

from tinysearch.

blackary avatar blackary commented on May 27, 2024

@mre Nothing much to add -- I used my own index.js, and got pretty much the same response:

tinysearch index.js
Unpacking tinysearch WASM engine into temporary directory "/var/folders/1r/hd1d6v0s7hx68wnb2y1_9pd40000gn/T/.tmpt9tVy4"
Start unpack
Copying index into crate
Error: No such file or directory (os error 2)

from tinysearch.

siuying avatar siuying commented on May 27, 2024

@mre I saw same error messages when installing the cargo. When building from source, I see error message Error: failed to run "wasm-pack", and later Error: wasm32-unknown-unknown target not found. After I install both I can use this copy of tinysearch, but if I reinstall tinysearch from cargo I'd still get the same error.

from tinysearch.

expilo avatar expilo commented on May 27, 2024

Same issue here.
OS: Ubuntu 21.10
wasm-pack 0.10.1
tinysearch 0.6.2

from tinysearch.

AlexMikhalev avatar AlexMikhalev commented on May 27, 2024

Bump:

./target/release/tinysearch fixtures/index.json
Unpacking tinysearch WASM engine into temporary directory "/tmp/.tmpZTOX8N"
Starting unpack
Copying "../engine/src/lib.rs"
Copying "../engine/Cargo.toml"
Copying "../shared/.gitignore"
Copying "../engine/.gitignore"
Copying "../shared/src/lib.rs"
Copying "../shared/Cargo.toml"
Copying index into crate
Error: Invalid cross-device link (os error 18)

tinysearch from master git log -1

Author: Matthias <[email protected]>
Date:   Thu Sep 9 13:30:31 2021 +0200

    Update FUNDING.yml

wasm-pack 0.10.1
Ubuntu 21.10 (PopOS!)
binaryen is version (91-1) from apt.

from tinysearch.

mre avatar mre commented on May 27, 2024

Oh! Sorry, I forgot to release 0.6.3 with the patch. Apologies.
Released v0.6.3 now. Also added some pre-built binaries to make installation a little easier and quicker. If anyone could test it and report back that would be very helpful. At least on my homepage it works with that version.

from tinysearch.

blakehawkins avatar blakehawkins commented on May 27, 2024

0.6.3 is not working for me:

...
Starting unpack
Name: /home/blake/workspace/myproject/storage
Name: /home/blake/workspace/myproject/.gitignore
Name: /home/blake/workspace/myproject/.sass-cache
Name: /home/blake/workspace/myproject/docker-compose.yml
Name: /home/blake/workspace/myproject/README.md
Name: /home/blake/workspace/myproject/.git
Name: /home/blake/workspace/myproject/assets
Name: /home/blake/workspace/myproject/Gemfile.lock
Name: /home/blake/workspace/myproject/404.md
Name: /home/blake/workspace/myproject/Gemfile
Name: /home/blake/workspace/myproject/_config.yml
Name: /home/blake/workspace/myproject/.github
Name: /home/blake/workspace/myproject/_pages
Name: /home/blake/workspace/myproject/CNAME
Name: /home/blake/workspace/myproject/_layouts
Name: /home/blake/workspace/myproject/_sass
Name: /home/blake/workspace/myproject/index.md
Name: /home/blake/workspace/myproject/images
Name: /home/blake/workspace/myproject/tmp
Name: /home/blake/workspace/myproject/_site
Name: /home/blake/workspace/myproject/_includes
Error: Engine directory could not be created at /tmp/.tmpZGQ8M1/engine

Is it possible that the cargo publish release is missing this binary data?

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

I don't see any of

println!("Copying {:?}", file);

Edit: I forgot to specify that I used cargo install tinysearch, not prebuilt binary from tags page

from tinysearch.

mre avatar mre commented on May 27, 2024

Could be, yeah. Reading through the source code of includedir, it writes the output to an out_file:
https://github.com/tilpner/includedir/blob/6a81c906e233649af1acec9835fe0a034b9274e2/codegen/src/lib.rs#L118-L149
Limited time right now, but maybe this file has to be included somewhere to make it into the release build?

At least the pre-built binary seems to work for my blog:
https://github.com/mre/endler.dev/runs/4657973699?check_suite_focus=true#step:11:16

Same for 0.6.3 installed with cargo install:
https://github.com/mre/endler.dev/runs/4718539058?check_suite_focus=true#step:11:18

Can you try one of the pre-built binaries for comparison?
And if you have an idea where the binary data has to be added to make it work, that would also be greatly appreciated.

from tinysearch.

mre avatar mre commented on May 27, 2024

This is where it fails for you:

tinysearch/bin/src/main.rs

Lines 93 to 102 in 18b0dc5

let engine_dir = temp_dir.path().join("engine");
if !engine_dir.exists() {
for path in fs::read_dir(out_path)? {
println!("Name: {}", path.unwrap().path().display())
}
bail!(
"Engine directory could not be created at {}",
engine_dir.display()
);
}

It tries to unpack the engine code and if that directory doesn't exist after that, it means there was an error.

So I wonder what's above

...
Starting unpack
Name: /home/blake/workspace/myproject/storage
Name: /home/blake/workspace/myproject/.gitignore
...

in your output. This is where it unpacks the engine code and prints the path.
Is this running locally or inside Github Actions? If it's local, can you check that the path exists and looks fine? If not, is the directory writeable?

from tinysearch.

blakehawkins avatar blakehawkins commented on May 27, 2024

@mre thanks for taking a look.

So I wonder what's above

It's just:

Unpacking tinysearch WASM engine into temporary directory "/tmp/.tmp3fYKc5"
Starting unpack
Name: /home/blake/workspace/myproject/storage
...

Is this running locally or inside Github Actions?

Local.

If it's local, can you check that the path exists and looks fine?

The temp directory doesn't exist, but /tmp/ is writeable:

$ file /tmp/
/tmp/: sticky, directory
$ file /tmp/.tmp3fYKc5/
/tmp/.tmp3fYKc5/: cannot open `/tmp/.tmp3fYKc5/' (No such file or directory)
$ [ -w /tmp/ ]
$ echo $?
0

The weird thing for me is still that there are none of these:

println!("Copying {:?}", file);

from tinysearch.

keyneom avatar keyneom commented on May 27, 2024

I'm running into the same issue locally:

Unpacking tinysearch WASM engine into temporary directory "/tmp/.tmpVHlnPa"
Starting unpack
Name: [absolute path]/public/search/tinysearch_engine.js
Name: [absolute path]/public/search/tinysearch_engine_bg.wasm
Error: Engine directory could not be created at /tmp/.tmpVHlnPa/engine

I've tried downloading the source and building tinysearch locally (both debug and release mode) and both the locally built versions seemed to run successfully. Only when using the cargo installed version of tinysearch do I get the error above.

from tinysearch.

Jieiku avatar Jieiku commented on May 27, 2024

I just tested from a fresh install today, no issues.

from tinysearch.

Jieiku avatar Jieiku commented on May 27, 2024

see here: #151 (comment)

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.