Closed michaeljmcd closed 4 months ago
Thanks for filing an issue! We'll get back to you as soon as we can with a response.
@michaeljmcd it looks like lex/flex is generating some code that is creating that issue.
There was a gap in our testing, in that we only tested javascript on Linux.
While I look at updating our tests, maybe you will find it works if you add -Wno-error=sign-conversion
to src/js/target.mk
.
e.g. https://github.com/ianfhunter/GNOLL/blob/b9be54bd3065834db465c3120ffef6185a513156/src/js/target.mk
If I pull the mac-js branch and build, I still get a build error:
lex.yy.c:1534:38: error: comparison of integers of different signs: 'yy_size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
1534 | if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@michaeljmcd I'm having some issues setting up a mac machine, but you can try pull the latest version of that branch now. I just tried to disable all warning-to-error elevations so we (hopefully) don't have to go back and forth
The JavaScript file builds off latest, but something seems off when I attempt to invoke it from the command line.
$ ./build/dice 3d20
Result:
37;%
$ node build/js/a.out.js 3d20
Result:
$ node --version
v21.7.1
I'm not sure if the lack of a result is based on an invocation error or something in the build.
This appears to be the same in linux. I'll have to take a deeper look at it and get back to you Thanks for debugging with me
@michaeljmcd I think it should print the right result now. The old code wrote to the file system before printing out the result. However, it seems Emscripten doesn't save file changes. I've updated it to just print directly.
Latest works for me. I do see what looks like a debugging statement in the output at the end.
$ node build/js/a.out.js "3d20+1"
Trying to roll '3d20+1'
12;
ErrorCheck: No Errors.
👍 Great. I've eliminated that debug statement in that branch + I'll be merging the changes to main soon
Running
make javascript
on macOS fails with errors like the following.To reproduce, I used the following steps:
The last command errors as above, full log file attached as log.txt.
Expected behavior
JavaScript to build fully on macOS.
Environment (please complete the following information):
Additional context
Building from main.