argmin
argmin copied to clipboard
Support `wasm32-unknown-unknown` without `wasm-bindgen`
Thank you for making this software available. I think numerical packages in pure Rust are really important.
This PR allows for succesfully building armin with
$ cargo build -p argmin --no-default-features --target wasm32-unknown-unknown
As a bit of background, the wasm (synonym: WebAssembly) situation is a bit complication right now. As I understand it, most wasm targets assume that Javascript is available too. So that's why getrandom/js often works. However, more and more wasm targets are moving away from Javascript. Wasmtime, for example, is a wasm runtime that does not support Javascript. This is useful for example for plugin systems like is used by Typst or Zellij. Both allow developers to write plugins which then can be used by users. But to not compromise the whole system, the plugins are sandboxed by default. So these plugins typically are not allowed to access the filesystem, or other system interfaces; also not via JS bindgen.
But I think it would be very nice if we could argmin in these barebone environments. To do so, this PR suggests to fix the build.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.12%. Comparing base (
b35808a) to head (9a45f2c). Report is 15 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #583 +/- ##
==========================================
- Coverage 92.13% 92.12% -0.02%
==========================================
Files 177 177
Lines 23672 23672
==========================================
- Hits 21810 21807 -3
- Misses 1862 1865 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@stefan-k My apologies for the failing CI jobs in 68cf721 and dc43934.
I now tested this PR in my own fork (https://github.com/rikhuijzer/argmin/pull/1) and CI should pass now. I also added a test that explicitly tests this wasm32-unknown-unknown without wasm-bindgen.
My compliments by the way for the CI testing setup. The tests are very thorough.
@rikhuijzer Apologies that I didn't address this earlier. Strangely, the CI runs are gone and even more strangely, triggering the CI doesn't work either.
Edit: now they are running. Let's hope for the best.
@rikhuijzer Hooray, the CI still passes (more or less, I'll fix the clippy lints later). Thanks a lot for addressing this issue and apologies again for the long wait.
@rikhuijzer Hooray, the CI still passes (more or less, I'll fix the clippy lints later). Thanks a lot for addressing this issue and apologies again for the long wait.
Thank you. I'm happy to see it got merged 👍 I've abandoned my use-case for now but probably someone else will benefit from it one day