Open ashokspeelyaal opened 5 months ago
I have "xlsxwriter = "0.6.0".
When I run my Rust code independently it is fine and generating the excel file.
However, we are building all our services as wasm32-wasi target.
so when I run cargo build --target wasm32-wasi
cargo build --target wasm32-wasi
I get this error
` Compiling libxlsxwriter-sys v1.1.5 The following warnings were emitted during compilation:
warning: libxlsxwriter-sys@1.1.5: In file included from third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c:87: warning: libxlsxwriter-sys@1.1.5: third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h:24:10: fatal error: 'stdio.h' file not found warning: libxlsxwriter-sys@1.1.5: #include warning: libxlsxwriter-sys@1.1.5: ^~~~~ warning: libxlsxwriter-sys@1.1.5: 1 error generated.
error: failed to run custom build command for libxlsxwriter-sys v1.1.5
libxlsxwriter-sys v1.1.5
Caused by: process didn't exit successfully: /<userdir>/Development/Workspace/Experiments/Rust/BasicExperiments/target/debug/build/libxlsxwriter-sys-49a12908f841cf26/build-script-build (exit status: 1) --- stdout TARGET = Some("wasm32-wasi") OPT_LEVEL = Some("0") HOST = Some("aarch64-apple-darwin") cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT cargo:warning=In file included from third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c:87: cargo:warning=third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h:24:10: fatal error: 'stdio.h' file not found cargo:warning=#include cargo:warning= ^~~~~ cargo:warning=1 error generated.
/<userdir>/Development/Workspace/Experiments/Rust/BasicExperiments/target/debug/build/libxlsxwriter-sys-49a12908f841cf26/build-script-build
--- stderr
error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-wasi" "-I" "third_party/libxlsxwriter/include" "-I" "third_party/zlib" "-Wall" "-Wextra" "-DUSE_DTOA_LIBRARY" "-o" "//Development/Workspace/Experiments/Rust/BasicExperiments/target/wasm32-wasi/debug/build/libxlsxwriter-sys-6e61de6fd2205bef/out/6b75ae84905220c1-tmpfileplus.o" "-c" "third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c" with args "clang" did not execute successfully (status code exit status: 1).
`
I have the same error, is there a solution?
Please try rust_xlsxwriter which is developed by original libxlsxwriter author. This is pure rust implementation.
I have "xlsxwriter = "0.6.0".
When I run my Rust code independently it is fine and generating the excel file.
However, we are building all our services as wasm32-wasi target.
so when I run
cargo build --target wasm32-wasi
I get this error
` Compiling libxlsxwriter-sys v1.1.5 The following warnings were emitted during compilation:
warning: libxlsxwriter-sys@1.1.5: In file included from third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c:87: warning: libxlsxwriter-sys@1.1.5: third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h:24:10: fatal error: 'stdio.h' file not found warning: libxlsxwriter-sys@1.1.5: #include
warning: libxlsxwriter-sys@1.1.5: ^
~~~~ warning: libxlsxwriter-sys@1.1.5: 1 error generated.error: failed to run custom build command for
libxlsxwriter-sys v1.1.5
Caused by: process didn't exit successfully:
cargo:warning= ^
/<userdir>/Development/Workspace/Experiments/Rust/BasicExperiments/target/debug/build/libxlsxwriter-sys-49a12908f841cf26/build-script-build
(exit status: 1) --- stdout TARGET = Some("wasm32-wasi") OPT_LEVEL = Some("0") HOST = Some("aarch64-apple-darwin") cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_wasm32-wasi CC_wasm32-wasi = None cargo:rerun-if-env-changed=CC_wasm32_wasi CC_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CC TARGET_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None cargo:rerun-if-env-changed=CFLAGS_wasm32-wasi CFLAGS_wasm32-wasi = None cargo:rerun-if-env-changed=CFLAGS_wasm32_wasi CFLAGS_wasm32_wasi = None cargo:rerun-if-env-changed=TARGET_CFLAGS TARGET_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT cargo:warning=In file included from third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c:87: cargo:warning=third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h:24:10: fatal error: 'stdio.h' file not found cargo:warning=#include~~~~ cargo:warning=1 error generated.--- stderr
error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-wasi" "-I" "third_party/libxlsxwriter/include" "-I" "third_party/zlib" "-Wall" "-Wextra" "-DUSE_DTOA_LIBRARY" "-o" "//Development/Workspace/Experiments/Rust/BasicExperiments/target/wasm32-wasi/debug/build/libxlsxwriter-sys-6e61de6fd2205bef/out/6b75ae84905220c1-tmpfileplus.o" "-c" "third_party/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c" with args "clang" did not execute successfully (status code exit status: 1).
`