Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error[E0425]: cannot find value JS_EVAL_FLAG_ASYNC in module qjs #30

Closed
yo000 opened this issue Oct 12, 2024 · 5 comments
Closed

error[E0425]: cannot find value JS_EVAL_FLAG_ASYNC in module qjs #30

yo000 opened this issue Oct 12, 2024 · 5 comments
Assignees

Comments

@yo000
Copy link
Contributor

yo000 commented Oct 12, 2024

Hello,

When compiling under FreeBSD 14, rust 1.81, I got these errors :

   Compiling rquickjs-core v0.6.0
error[E0425]: cannot find value `JS_EVAL_FLAG_ASYNC` in module `qjs`
  --> /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-core-0.6.0/src/context/ctx.rs:49:26
   |
49 |             flag |= qjs::JS_EVAL_FLAG_ASYNC;
   |                          ^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `JS_EVAL_FLAG_STRICT`
   |
  ::: /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.0/src/bindings/x86_64-unknown-freebsd.rs:30:1
   |
30 | pub const JS_EVAL_FLAG_STRICT: u32 = 8;
   | ---------------------------------- similarly named constant `JS_EVAL_FLAG_STRICT` defined here
   
error[E0425]: cannot find value `JS_ATOM_null` in module `qjs`
  --> /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-core-0.6.0/src/value/atom/predefined.rs:12:17
   |
12 |     Null = qjs::JS_ATOM_null as u32, // must be first
   |                 ^^^^^^^^^^^^ help: a constant with a similar name exists: `JS_ATOM_NULL`
   |
  ::: /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.0/src/bindings/x86_64-unknown-freebsd.rs:34:1
   |
34 | pub const JS_ATOM_NULL: u32 = 0;
   | --------------------------- similarly named constant `JS_ATOM_NULL` defined here
   
error[E0425]: cannot find value `JS_ATOM_false` in module `qjs`
  --> /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-core-0.6.0/src/value/atom/predefined.rs:14:18
   |
14 |     False = qjs::JS_ATOM_false as u32,
   |                  ^^^^^^^^^^^^^ not found in `qjs`
   

And so on. I'm a total noob with rust ; Am I missing a lib or something?

@yo000
Copy link
Contributor Author

yo000 commented Nov 10, 2024

Back on this, to say I finally got it compiling under FreeBSD. Msg above is not the first errror you would see, I already made "adjustments" in code to land there. Without touching anything, the first compile error is :

error[E0061]: this function takes 6 arguments but 5 arguments were supplied
    --> /home/invidious/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rquickjs-sys-0.6.0/src/inlines/common.rs:174:5
     |
174  |     JS_SetPropertyInternal(ctx, this_obj, prop, val, JS_PROP_THROW as i32)
     |     ^^^^^^^^^^^^^^^^^^^^^^                           -------------------- argument #5 of type `JSValue` is missing
     |
note: function defined here
    --> /usr/home/invidious/inv_sig_helper/target/release/build/rquickjs-sys-76dc9acef9f2c377/out/bindings.rs:1494:12
     |
1494 |     pub fn JS_SetPropertyInternal(
     |            ^^^^^^^^^^^^^^^^^^^^^^
help: provide the argument
     |
174  |     JS_SetPropertyInternal(ctx, this_obj, prop, val, /* JSValue */, JS_PROP_THROW as i32)
     |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0061`.
error: could not compile `rquickjs-sys` (lib) due to 1 previous error

I made it to compile under FreeBSD 14.1, rust 1.81, llvm 18 with the following commands :

git clone https://github.com/iv-org/inv_sig_helper.git
sudo pkg install rust llvm18
cd inv_sig_helper
sed -i .bak 's/0.6.0/0.6.1/' Cargo.toml
sed -i .bak 's!features=\["futures"!features=\["bindgen", "futures"!' Cargo.toml
cargo clean
cargo build --release

Hope it helps

@unixfox
Copy link
Member

unixfox commented Nov 10, 2024

hey, I'm sorry we can't help you with freebsd. But I can share to you that we are going to replace inv_sig_helper soon.

there is a new program written in deno (javascript) here: https://github.com/iv-org/invidious-companion - iv-org/invidious#4985

and I think there is support on freebsd for deno: https://www.freshports.org/www/deno/

@yo000
Copy link
Contributor Author

yo000 commented Nov 16, 2024

Nice, BTW inv_sig_helper is running well with the above commands.

I tried invidious_companion : It builds successfully, but I got errors using it, and wrote an issue there : iv-org/invidious-companion#12

I think we can close this issue

@yo000
Copy link
Contributor Author

yo000 commented Nov 16, 2024

Builds and run nice with

git clone https://github.com/iv-org/inv_sig_helper.git
sudo pkg install rust llvm18
cd inv_sig_helper
sed -i .bak 's/0.6.0/0.6.1/' Cargo.toml
sed -i .bak 's!features=\["futures"!features=\["bindgen", "futures"!' Cargo.toml
cargo clean
cargo build --release

@yo000 yo000 closed this as completed Nov 16, 2024
@unixfox
Copy link
Member

unixfox commented Nov 16, 2024

Maybe you can open a PR for these modifications:

sed -i .bak 's/0.6.0/0.6.1/' Cargo.toml
sed -i .bak 's!features=\["futures"!features=\["bindgen", "futures"!' Cargo.toml

So that these changes are integrated upstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants