将WASM与数据融合使用

发布于 2025-02-06 17:22:52 字数 5182 浏览 3 评论 0原文

我非常初学者使用Rust,但我正在尝试创建一个项目来实现WebAssembly,并使用称为Data-Fusion的库,问题是汇编失败了:

error: failed to run custom build command for `zstd-sys v1.6.3+zstd.1.5.2`

完整错误:

    The following warnings were emitted during compilation:

warning: In file included from zstd/lib/common/entropy_common.c:18:
warning: In file included from zstd/lib/common/mem.h:24:
warning: zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
warning: #include <string.h>
warning:          ^~~~~~~~~~
warning: 1 error generated.
warning: In file included from zstd/lib/common/fse_decompress.c:20:
warning: In file included from zstd/lib/common/bitstream.h:29:
warning: In file included from zstd/lib/common/mem.h:24:
warning: zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
warning: #include <string.h>
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `zstd-sys v1.6.3+zstd.1.5.2`

Caused by:
  process didn't exit successfully: `/Users/pedro/rust/wasmpack-ounity/helloworld/target/release/build/zstd-sys-da1f85a3ac3fe2ed/build-script-build` (exit status: 1)
  --- stdout
  cargo:rustc-cfg=feature="std"
  TARGET = Some("wasm32-unknown-unknown")
  HOST = Some("x86_64-apple-darwin")
  CC_wasm32-unknown-unknown = None
  CC_wasm32_unknown_unknown = None
  TARGET_CC = None
  CC = Some("/usr/local/opt/llvm/bin/clang")
  CFLAGS_wasm32-unknown-unknown = None
  CFLAGS_wasm32_unknown_unknown = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  running: "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c"
  cargo:warning=In file included from zstd/lib/common/entropy_common.c:18:
  cargo:warning=In file included from zstd/lib/common/mem.h:24:
  cargo:warning=zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
  cargo:warning=#include <string.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
  running: "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/fse_decompress.o" "-c" "zstd/lib/common/fse_decompress.c"
  cargo:warning=In file included from zstd/lib/common/fse_decompress.c:20:
  cargo:warning=In file included from zstd/lib/common/bitstream.h:29:
  cargo:warning=In file included from zstd/lib/common/mem.h:24:
  cargo:warning=zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
  cargo:warning=#include <string.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr


  error occurred: Command "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: liblz4/lib/lz4.c:178:10: fatal error: 'stdlib.h' file not found
warning: #include <stdlib.h>   /* malloc, calloc, free */
warning:          ^~~~~~~~~~
warning: 1 error generated.
warning: liblz4/lib/lz4frame.c:74:10: fatal error: 'stdlib.h' file not found
warning: #include <stdlib.h>   /* malloc, calloc, free */
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: build failed
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

存在依赖关系问题,我试图包括' ZSTD-SYS =“ 1.6.3+ZSTD.1.5.2”作为依赖关系,但错误仍然存​​在。

github repo

I am very beginner using Rust but I am trying to create a project to implement Webassembly and using a library called data-fusion, the problem is the compilation fails with the message:

error: failed to run custom build command for `zstd-sys v1.6.3+zstd.1.5.2`

FULL ERROR:

    The following warnings were emitted during compilation:

warning: In file included from zstd/lib/common/entropy_common.c:18:
warning: In file included from zstd/lib/common/mem.h:24:
warning: zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
warning: #include <string.h>
warning:          ^~~~~~~~~~
warning: 1 error generated.
warning: In file included from zstd/lib/common/fse_decompress.c:20:
warning: In file included from zstd/lib/common/bitstream.h:29:
warning: In file included from zstd/lib/common/mem.h:24:
warning: zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
warning: #include <string.h>
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `zstd-sys v1.6.3+zstd.1.5.2`

Caused by:
  process didn't exit successfully: `/Users/pedro/rust/wasmpack-ounity/helloworld/target/release/build/zstd-sys-da1f85a3ac3fe2ed/build-script-build` (exit status: 1)
  --- stdout
  cargo:rustc-cfg=feature="std"
  TARGET = Some("wasm32-unknown-unknown")
  HOST = Some("x86_64-apple-darwin")
  CC_wasm32-unknown-unknown = None
  CC_wasm32_unknown_unknown = None
  TARGET_CC = None
  CC = Some("/usr/local/opt/llvm/bin/clang")
  CFLAGS_wasm32-unknown-unknown = None
  CFLAGS_wasm32_unknown_unknown = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  running: "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c"
  cargo:warning=In file included from zstd/lib/common/entropy_common.c:18:
  cargo:warning=In file included from zstd/lib/common/mem.h:24:
  cargo:warning=zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
  cargo:warning=#include <string.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1
  running: "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/fse_decompress.o" "-c" "zstd/lib/common/fse_decompress.c"
  cargo:warning=In file included from zstd/lib/common/fse_decompress.c:20:
  cargo:warning=In file included from zstd/lib/common/bitstream.h:29:
  cargo:warning=In file included from zstd/lib/common/mem.h:24:
  cargo:warning=zstd/lib/common/zstd_deps.h:29:10: fatal error: 'string.h' file not found
  cargo:warning=#include <string.h>
  cargo:warning=         ^~~~~~~~~~
  cargo:warning=1 error generated.
  exit status: 1

  --- stderr


  error occurred: Command "/usr/local/opt/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-I" "zstd/lib/" "-I" "zstd/lib/common" "-I" "zstd/lib/legacy" "-fvisibility=hidden" "-DZSTD_LIB_DEPRECATED=0" "-DXXH_PRIVATE_API=" "-DZSTDLIB_VISIBILITY=" "-DZDICTLIB_VISIBILITY=" "-DZSTDERRORLIB_VISIBILITY=" "-DZSTD_LEGACY_SUPPORT=1" "-o" "/Users/pedro/rust/wasmpack-ounity/helloworld/target/wasm32-unknown-unknown/release/build/zstd-sys-9d373a088b510333/out/zstd/lib/common/entropy_common.o" "-c" "zstd/lib/common/entropy_common.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: liblz4/lib/lz4.c:178:10: fatal error: 'stdlib.h' file not found
warning: #include <stdlib.h>   /* malloc, calloc, free */
warning:          ^~~~~~~~~~
warning: 1 error generated.
warning: liblz4/lib/lz4frame.c:74:10: fatal error: 'stdlib.h' file not found
warning: #include <stdlib.h>   /* malloc, calloc, free */
warning:          ^~~~~~~~~~
warning: 1 error generated.

error: build failed
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

There is a dependency problem, I tried to include 'zstd-sys = "1.6.3+zstd.1.5.2"' as dependency but error persists.

github repo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最舍不得你 2025-02-13 17:22:52

调用本机库的板条箱(即用C编写的库),例如 ZSTD 库,无法使用库在WebAssembly中。通常,这些板条箱用-sys邮政修复。我不熟悉数据融合板条箱,但我猜它不支持WebAssembly。

Crates that invoke native libraries (i.e. libraries written in C), such as the zstd library, cannot be used in WebAssembly. Usually these crates are postfixed with -sys. I'm not familiar with the data-fusion crate, but I'm guessing that it does not support WebAssembly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文