Initial WebAssembly support.
Fixes #168.
I meant for this to be a draft. I will be pushing or force-pushing to it over the coming days / weeks.
This is a more interesting build error, haven't looked into it yet, requires changes I haven't pushed yet to get to this point:
eventtxt.c:162:3: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
EVENT_CLOCK_MAKE(val, low, high);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./clock.h:162:35: note: expanded from macro 'EVENT_CLOCK_MAKE'
((lvalue) = ((EventClock)(high) << 32) + ((EventClock)(low) & (0xfffffffful)))
^ ~~
1 error generated.
This is a more interesting build error
Are you not getting a 64-bit unsigned long long? https://github.com/Ravenbrook/mps/blob/142999bd7b0d265ea793817d662047953e4e13ab/code/clock.h#L111
That's line 111, the error was on line 162, which is the mps_clock_t code path ... mps_clock_t is mps_word_t
Ah yes. Looks like a 64-bit assumption has crept in here https://github.com/Ravenbrook/mps/blob/142999bd7b0d265ea793817d662047953e4e13ab/code/clock.h#L156-L162
but since https://github.com/Ravenbrook/mps/blob/142999bd7b0d265ea793817d662047953e4e13ab/code/mps.h#L77
we could switch here on MPS_WORD_WIDTH or define MPS_CLOCK_WIDTH to be MPS_WORD_WIDTH and switch on that.
EVENT_CLOCK_MAKE is only used in https://github.com/Ravenbrook/mps/blob/142999bd7b0d265ea793817d662047953e4e13ab/code/eventtxt.c#L152-L166 which is intended to only be run on the same platform as the MPS that generated the telemetry, though we might be able to make it more flexible.
JPH+RB: This needs CI before merging but currently not a high priority to merge, not currently impacting customers. Assigning importance "optional".
JPH+RB: This needs CI before merging but currently not a high priority to merge
FWIW, it does have some CI... but needs more. But there was an issue with the CI for it because it was building the threaded tests as well ...