prove-rs / z3.rs

Rust bindings for the Z3 solver.
337 stars 105 forks source link

Add an environment variable `EMSCRIPTEN_ROOT` for emscripten installed with brew and add supports for other wasm targets. #276

Closed TheVeryDarkness closed 9 months ago

TheVeryDarkness commented 9 months ago

Homebrew only provides emscripten but not a full emsdk, so brew users may need an extra environment variable EMSCRIPTEN_ROOT.

In the past versions, emscripten is considered only when the target is wasm32-unknown-emscripten, but it may be needed for other wasm targets. I add supports for other wasm32 targets. And missing emscripten won't cause a panic for non *-emscripten targets.

And we can test it on wasm32 targets if vcpkg-rs supports them later. Related PR has been merged but has not been published to crates.io.

waywardmonkeys commented 9 months ago

Since this is only used for getting a sysroot for running clang to generate the enum bindings, perhaps we can solve this in an even simpler way... Could we just copy a couple of files into an z3-sys/ext/wasm-sysroot to give a minimal stdbool.h, stdint.h and stdio.h?

Actually, I think I can submit a PR to upstream to remove in the include of stdiio.h from here...

TheVeryDarkness commented 9 months ago

Would it be possible to rebase this against current master and eliminate a bunch of the commits so that I can see what a clean history might look like?

Oh, I'm sorry. Let me take a glance at git rebase.

TheVeryDarkness commented 9 months ago

Since this is only used for getting a sysroot for running clang to generate the enum bindings, perhaps we can solve this in an even simpler way... Could we just copy a couple of files into an z3-sys/ext/wasm-sysroot to give a minimal stdbool.h, stdint.h and stdio.h?

Actually, I think I can submit a PR to upstream to remove in the include of stdiio.h from here...

Yep, I think those ways should be better.

waywardmonkeys commented 9 months ago

I'm going to close this and will do the wasm-sysroot changes this weekend. Thanks for bringing this up!

(Also, I got a change merged upstream already to remove the inclusion of stdio.h)

TheVeryDarkness commented 9 months ago

I'm going to close this and will do the wasm-sysroot changes this weekend. Thanks for bringing this up!

(Also, I got a change merged upstream already to remove the inclusion of stdio.h)

Sounds great :)