Closed FrankC01 closed 3 years ago
This is how far we get after cloning repo and submodule.
Set up the include environment variable. export C_INCLUDE_PATH=/usr/include/:/usr/include/x86_64-linux-gnu
Add the following to lib.rs.
.arg("no-ui"); if target.contains("wasi") { configure.arg("no-asm"); configure.arg("no-sock"); configure.arg("no-afalgeng"); } configure.arg("-DOPENSSL_NO_SOCK"); configure.arg("-DOPENSSL_NO_DGRAM"); configure.arg("-DNO_SYSLOG"); // not supposed to be set externally
Run the following command from the root. cargo run --manifest-path ./testcrate/Cargo.toml --target wasm32-wasi --features="package"
We get the following errors.
--- stderr ***** Deprecated options: no-ui apps/apps.c:2707:5: error: invalid output constraint '=c' in asm FD_ZERO(&asyncfds); ^ /usr/include/sys/select.h:88:26: note: expanded from macro 'FD_ZERO'
^
/usr/include/bits/select.h:37:8: note: expanded from macro '__FD_ZERO' : "=c" (d0), "=D" (d1) \ ^ 1 error generated. make[1]: [Makefile:688: apps/apps.o] Error 1 make[1]: Waiting for unfinished jobs.... make: *** [Makefile:177: build_libs] Error 2 thread 'main' panicked at '
Error building OpenSSL: Command: "make" "build_libs" Exit status: exit code: 2
Able to get it to build with --target wasm32-wasi
:
export C_INCLUDE_PATH=/usr/include/wasm32-wasi:/usr/include/:/usr/include/x86_64-linux-gnu
Set in src/lib.rs
configure.arg("-DOPENSSL_NO_SOCK");
configure.arg("-D_WASI_EMULATED_MMAN");
configure.arg("-DOPENSSL_NO_DGRAM");
configure.arg("-DNO_SYSLOG"); // not supposed to be set externally
Not sure of the steps to do this?