Closed lukaszcz closed 1 year ago
I can't reproduce this issue. What version of node are you running on your machine? I'm running v18.7.0 and CI is running v16.17.0 on Mac and linux agents.
If you compile the test file manually what is the signature of the _validate_tx
function? so we can try to figure out what the illegal type is (the _validate_tx
function should only involve the I64
Wasm type):
$ cd tests/positive/MiniC/AlwaysValidVP
$ juvix compile -r standalone Input.juvix
$ wasmer inspect Input.wasm
Type: wasm
Size: 1.4 KB
Imports:
Functions:
Memories:
Tables:
Globals:
Exports:
Functions:
"encodeBool": [I32] -> [I64]
"_validate_tx": [I64, I64, I64, I64, I64, I64, I64, I64] -> [I64]
Memories:
"memory": not shared (2 pages..)
Tables:
Globals:
I'll check this next week. It only fails on my Ubuntu laptop, works fine on the Mac.
When I try juvix compile -r standalone Input.juvix
I get:
/home/heliax/Documents/juvix/tests/positive/MiniC/AlwaysValidVP/.juvix-build/Input.c:55:16: warning: unknown attribute 'export_name' ignored [-Wunknown-attributes]
__attribute__((export_name("encodeBool")))
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/heliax/Documents/juvix/tests/positive/MiniC/AlwaysValidVP/.juvix-build/Input.c:57:16: warning: unknown attribute 'export_name' ignored [-Wunknown-attributes]
__attribute__((export_name("_validate_tx")))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
/usr/bin/ld: /lib/x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm sorry for the delay in replying to this!
Now that the native target is the default you need to pass the -t wasm
flag to the compiler for the Wasm files, the native target assumes that a main function is defined in the root module.
juvix compile -t wasm -r standalone Input.juvix
Inspecting gives:
Type: wasm
Size: 2.1 KB
Imports:
Functions:
Memories:
Tables:
Globals:
Exports:
Functions:
"encodeBool": [I32] -> [I64]
"_validate_tx": [I64, I64, I64, I64, I64, I64, I64, I64] -> [I64]
Memories:
"memory": not shared (2 pages..)
Tables:
Globals:
which seems exactly the same as your inspecting output. Still, the test fails.
The test fails on my machine and no hint is provided as to how to make it go through. If this is not real bug, then what should I do to make the test suite go through?
I get: