Add built-in compiler for Fallout2 .ssl files
Description
This PR embeds a WebAssembly-compiled compile.exe into this extension. It is under options flag and it is disabled by default.
Having this compiler as WebAssembly build allow using this extension on non-intel processors, for example on Mac M1 or others.
Notes
Currently it uses compiled files from my repo but I will change it into sfall repo as soon as https://github.com/sfall-team/sslc/pull/14 is merged
Lots of any because I have not found a good typescript definitions for emscripten module (@types/emscripten have no .FS property on the instance)
I have not tested this on Windows but likely it will also work there
Interesting, I haven't considered M1. Does it not run wine? I thought there was some compatilibility layer.
Actually I have no idea, but i had an impression that it was not possible to run x86/x64 apps on M1 Macbooks.
Anyways, even if it is possible then it still requires some setup. Having a embedded cross-platform compiler should be better user experience in my opinion. Maybe later we can enable it by default
CI fails on found npm access token: npm_i_save_dev_types_Slash but it also fails on almost empty PR https://github.com/roginvs/VScode-BGforge-MLS/pull/2
https://github.com/microsoft/vscode-vsce/issues/1153 maybe
Yes, looks like it was a bug in vscode-vsce. Right now all checks passed.
I changed installation script, now it will check hash of downloaded release file. Just more security. With hash check it is not a big difference where this file was downloaded from
So you aren't using an M1? What prompted you to work on this then?
@burner1024
I was making a PR with test scripts into fallout2-ce. In the README file I added some instructions about how to compile https://github.com/fallout2-ce/fallout2-ce/pull/140/files#diff-7e0064f2b1902c3c7083e171e90a0a91df55a38157bf30de762952196392b179 but then I though that having an additional step of installing compile.exe can be annoying.
I am simple user, I want a button which makes everything for me. As user I want to install extension and to have a ready-to-use IDE.
I am simple user, I want a button which makes everything for me. As user I want to install extension and to have a ready-to-use IDE.
Well, the simplest way for that would be to just bundle compile.exe, I guess. But having native cross-platform builds paves the way for future improvements, so that's cool too.
Let's see when the upstream PR gets merged.
Looks like PR into sslc got stuck for a while. Let's hope it will be merged at some point.
I think there is no blockers right now for merging this PR. I tested it locally and it works for me. There is a hash of the package in package-lock.json so npm/pnpm will not allow to install something else which do not have the same hash
I'll look it over soon.
@copilot review this
I'd assign Copilot to review this PR if I had permission to add reviewers. :)
@copilot review this
I'd assign Copilot to review this PR if I had permission to add reviewers. :)
Copilot itself advised me to make that comment to request a review, apparently that didn't work :), so assigned it in GUI.
Updated to use sslc from https://github.com/sfall-team/sslc
Looks like it has trouble working with symlinks.
On my system, Fallout2_Restoration_Project/scripts_src/headers/sfall is a symlink to sfall headers. External compiler works with that, while built-in one doesn't. Also leaves cruft behind.
Linux build works fine too.
@burner1024 Thanks, I will take a look. I have Linux and symlink too but it is relative symlink. I tested now with absolute symlink and I confirm that it needs fixing.
I will try to use NODERAWFS again, very likely it fails to find path because of absolute symlink and because host FS is mounted into subfolder.
About leftover *.tmp: it also happens on Linux build, probably because of https://github.com/sfall-team/sslc/blob/master/compile.c#L239 and https://github.com/sfall-team/sslc/blob/master/compile.c#L261 . I will take a look on this too
@burner1024
- Leftover
.tmpfiles are fixed. Merged in my repo, waiting to be merged insslcrepo - I changed filesystem back to
NODERAWFSbecause we need to mount host FS into the root inside guest. Mounting host into sub-folder caused absolute symlinks to fail. BecauseNODERAWFSdoes not work good on multiple runs we have to spawn new process each time, similar to usingcompile.exe
OK, merged and released, thanks.