-
Notifications
You must be signed in to change notification settings - Fork 2
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
AS generates invalid .wast
#120
Comments
It works on my machine with AssemblyScript npm install
npm run build
wat2wasm bin/main.debug.wast --no-canonicalize-leb128s --disable-bulk-memory -v |
@tolauwae did you also use no optimisation? (i.e., remove the |
I used the debug profile of the template which doesn't optimize. And it works. What is your exact |
full command
Something crucial I forgot to mention I also tried to use the template since it may not have the compilation error but I fail to properly configure it. Can you please confirm whether the following steps are correct:
|
There is no need to recompile with |
Compiled file with your command also works for me. |
Quickly tried it myself and AS doesn't seem to work right now in the plugin. Don't know what broke.
You don't have to change this. It should work regardless, but doesn't strangely. I tried it without changing any code on the main branch. |
It wasn't working on my machine because the plugin used the globally installed |
In other words, I still can't replicate your issue. The |
Nevermind. I must not have run it exactly the same. I get the error now as well. |
So I found the problem, the To be honest I do not see immediately how that option relates to valid wast, especially because the invalid wast type was already previously reported and fixed by the maintainers of asc (see AssemblyScript/assemblyscript#310). I will push my fix as part of this PR #122. However, I now encountered another problem for which I still need to create a new issue (depending on the answer to this comment TOPLLab/WARDuino#197 (comment)) and for which the fix maybe should be included also in the same PR. |
To compile ASC without any optimisation I removed the `03s` argument
To compile ASC without any optimisation I removed the `03s` argument
* Use locally installed `asc` instead of global * fix #120 and compile AS without optimisation To compile ASC without any optimisation I removed the `03s` argument * fix regex to only be true for source maps AssemblyScript compiler can generate lines that contain the `@` symbol but have nothing to do with the source mapping (e.g., '000287d: 6e67 2e55 5446 382e 656e 636f 6465 4076 ng.UTF8.encode@v') which causes `extractLineInfo` to fail on those lines. This commit modifies the regex to only be true for lines that start with `@ {` which ensures that `extractLineInfo` is applied to real source map lines. * 🔨 Use AS source map directly --------- Co-authored-by: Carlos Rojas <carlosj.rojascastillo@gmail.com>
I wrote an AssemnlyScript application (see
mirror-led.ts
andconfig.ts
in zip) that cannot be compiled towasm
. In particular,wat2wasm
fails to compile the obtainedwast
file towasm
due to several type errors. Some of the errors that I get are:upload.wast:612:6: error: type mismatch in if true branch, expected [i32] but got []
, andupload.wast:7658:4: error: type mismatch at end of function, expected [] but got [i32, i32]
. All the files generated byasc
can be found in the directory output of the zip.This compilation issue comes as a surprise because the
asc
generates alongside theWast
file also awasm
file indicating that no type error occurred in the process. So this may mean that ourwat2wasm
is behind some language features.This type error issue only manifest when compiling via asc without any optimisation. Since we also want to debug without optimisation I will have to further investigate this issue.
src_files.zip
The text was updated successfully, but these errors were encountered: