Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building wasm32-wasi target #56

Open
ashokspeelyaal opened this issue Mar 29, 2024 · 2 comments
Open

Error building wasm32-wasi target #56

ashokspeelyaal opened this issue Mar 29, 2024 · 2 comments

Comments

@ashokspeelyaal
Copy link

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 <stdio.h>
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: /<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 <stdio.h>
cargo:warning= ^~~~~~~~~
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).

`

@benjamingb
Copy link

I have the same error, is there a solution?

@informationsea
Copy link
Owner

Please try rust_xlsxwriter which is developed by original libxlsxwriter author. This is pure rust implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants