bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.06k stars 100 forks source link

Statically link to the C runtime in MSVC #670

Closed saulecabrera closed 3 weeks ago

saulecabrera commented 3 weeks ago

Description of the change

Javy version 1.4.0 statically linked to the C runtime. Such version was built with Rust 1.75.

Javy version 2.0.0, built with Rust 1.79.0, which doesn't perform static linking by default. This commit adds a directive to preserve the same behavior as in v 1.4.0.

Checklist

saulecabrera commented 3 weeks ago

Testing

The best way to test this change at this time is to download the Windows executable available in my fork and make sure that it runs correctly e.g. javy --version.

I considered adding a CI step, but unfortunately there are several considerations:

  1. All Windows runners are pre-provisioned with Visual C++, and apparently: (i) there's no way to uninstall it (ii) there's no way to configure GitHub Actions to provide a fresh runner, without any dependencies. Additionally the GitHub Actions team is not planning on supporting this feature.. The recommended way to modify Windows runners is through Chocolatey, but as far as I investigated, it can't be used uninstall Visual C++ (not surprising).
  2. The recommended approach, as per the link in the previous point is to introduce a custom runner. Which we could adopt if we wanted to, and if we do, my suggestion would be to do it a follow up PR. But generally speaking, the change in this PR is probably enough. If this issue were to happen again, there's a very easy fix that users can apply, which is installing Visual C++.