DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
434 stars 59 forks source link

Errors on FreeBSD: JS_ATOM_... #249

Closed yonas closed 2 months ago

yonas commented 5 months ago

A couple dozen screens full of the JS_ATOM_... errors.

$ cargo build --release                                                                                                                                                                                              
    Updating crates.io index                                                                                                                                                                                         
   Compiling libc v0.2.152                                                                                                                                                                                           
   Compiling cc v1.0.83                                                                                                                                                                                              
   Compiling rquickjs-sys v0.4.2 (/git/rquickjs/sys)                                                                                                                                                           
warning: rquickjs-sys@0.4.2: /git/rquickjs/target/release/build/rquickjs-sys-7f2ff08eccaa9f10/out/quickjs.c:10853:30: warning: implicit conversion from 'long' to 'double' changes value from 92233720368547758
07 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]                                                                                                                                                    
warning: rquickjs-sys@0.4.2:                 else if (d > INT64_MAX)                                                                                                                                                 
warning: rquickjs-sys@0.4.2:                            ~ ^~~~~~~~~                                                                                                                                                  
warning: rquickjs-sys@0.4.2: /usr/include/x86/_stdint.h:86:19: note: expanded from macro 'INT64_MAX'                                                                                                                 
warning: rquickjs-sys@0.4.2: #define INT64_MAX       0x7fffffffffffffff                                                                                                                                              
warning: rquickjs-sys@0.4.2:                         ^~~~~~~~~~~~~~~~~~                                                                                                                                              
warning: rquickjs-sys@0.4.2: /git/rquickjs/target/release/build/rquickjs-sys-7f2ff08eccaa9f10/out/quickjs.c:54237:25: warning: implicit conversion from 'long' to 'double' changes value from 92233720368547758
07 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]                                                                                                                                                    
warning: rquickjs-sys@0.4.2:     if (isnan(d) || d > INT64_MAX)                                                                                                                                                      
warning: rquickjs-sys@0.4.2:                       ~ ^~~~~~~~~                                                                                                                                                       
warning: rquickjs-sys@0.4.2: /usr/include/x86/_stdint.h:86:19: note: expanded from macro 'INT64_MAX'                                                                                                                 
warning: rquickjs-sys@0.4.2: #define INT64_MAX       0x7fffffffffffffff                                                                                                                                              
warning: rquickjs-sys@0.4.2:                         ^~~~~~~~~~~~~~~~~~                                                                                                                                              
warning: rquickjs-sys@0.4.2: 2 warnings generated.                                                                                                                                                                   
   Compiling rquickjs-core v0.4.2 (/git/rquickjs/core)                                                                                                                                                         
error[E0425]: cannot find function, tuple struct or tuple variant `JS_FreeUnevaluatedModules` in module `qjs`                                                                                                        
   --> core/src/context/ctx.rs:421:14                                                                                                                                                                                
    |                                                                                                                                                                                                                
421 |         qjs::JS_FreeUnevaluatedModules(self.ctx.as_ptr())                                                                                                                                                      
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `qjs`                                                                                                                                                      

error[E0425]: cannot find value `JS_ATOM_null` in module `qjs`                                                                                                                                                       
  --> core/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`
   |
  ::: /git/rquickjs/sys/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`
  --> core/src/value/atom/predefined.rs:14:18
   |
14 |     False = qjs::JS_ATOM_false as u32,
   |                  ^^^^^^^^^^^^^ not found in `qjs`

error[E0425]: cannot find value `JS_ATOM_true` in module `qjs`
  --> core/src/value/atom/predefined.rs:16:17
   |

....

OS: FreeBSD 14.0 checkout: e92bf7a

yonas commented 5 months ago

Use Vagrant for automated FreeBSD testing. An example can be found here: https://github.com/tetratelabs/wazero/pull/671/files

DelSkayn commented 2 months ago

This issue is fixed since the bindings have been removed.