-
Hello, I'm trying to compile my project using rust-skia to WASM with the target I'm unable to compile the library which fails with the following error: ➜ skia ✗ cargo build --target wasm32-unknown-emscripten
Compiling skia-bindings v0.62.0
error: failed to run custom build command for `skia-bindings v0.62.0`
Caused by:
process didn't exit successfully: `/Users/<user>/<project path>/target/debug/build/skia-bindings-982c2a3f63c7ad35/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=DOCS_RS
cargo:rerun-if-env-changed=SKIA_DEBUG
HOST: aarch64-apple-darwin
cargo:rerun-if-env-changed=SKIA_SOURCE_DIR
cargo:rerun-if-env-changed=FORCE_SKIA_BUILD
cargo:rerun-if-env-changed=FORCE_SKIA_BINARIES_DOWNLOAD
TRYING TO DOWNLOAD AND INSTALL SKIA BINARIES: 0.62.0/8cf4841aefdb295709e9-wasm32-unknown-emscripten-freetype-textlayout-webpd
cargo:rerun-if-env-changed=SKIA_BINARIES_URL
FROM: https://github.com/rust-skia/skia-binaries/releases/download/0.62.0/skia-binaries-8cf4841aefdb295709e9-wasm32-unknown-emscripten-freetype-textlayout-webpd.tar.gz
DOWNLOAD AND INSTALL FAILED: https://github.com/rust-skia/skia-binaries/releases/download/0.62.0/skia-binaries-8cf4841aefdb295709e9-wasm32-unknown-emscripten-freetype-textlayout-webpd.tar.gz: status code 404
STARTING A FULL BUILD
cargo:rerun-if-env-changed=CLANGCC
cargo:rerun-if-env-changed=CC
cargo:rerun-if-env-changed=CLANGCXX
cargo:rerun-if-env-changed=CXX
HOST: aarch64-apple-darwin
cargo:rerun-if-env-changed=OPT_LEVEL
cargo:rerun-if-env-changed=SKIA_USE_SYSTEM_LIBRARIES
cargo:rerun-if-env-changed=SDKTARGETSYSROOT
cargo:rerun-if-env-changed=SDKROOT
HOST: aarch64-apple-darwin
cargo:rerun-if-env-changed=SKIA_NINJA_COMMAND
cargo:rerun-if-env-changed=SKIA_GN_COMMAND
Probing 'python'
Probing 'python3'
Python 3 found: "python3"
Synchronizing Skia dependencies
Skipping "bin".
skia/third_party/externals/brotli @ 6d03dfbedda1615c4cba1211f8d81735575209c8
skia/third_party/externals/expat @ 441f98d02deafd9b090aea568282b28f66a50e36
...rd_party/externals/d3d12allocator @ 169895d529dfce00390a20e69c2f516066fe7a3b
...ird_party/externals/libjpeg-turbo @ ed683925e4897a84b3bffc5c1414c85b97a129a3
skia/third_party/externals/wuffs @ a0041ac0310b3156b963e2f2bea09245f25ec073
skia/third_party/externals/libwebp @ fd7b5d48464475408d32d2611bdb6947d4246b97
skia/third_party/externals/freetype @ d857bd535b6c7e877f262a9b61ed21ee11b35dab
skia/third_party/externals/icu @ a0718d4f121727e30b8d52c7a189ebf5ab52421f
skia/third_party/externals/zlib @ c876c8f87101c5a75f6014b0f832499afeb65b73
skia/third_party/externals/harfbuzz @ 09a266236147497bd8149240062c31c16fbc81e3
...y/externals/vulkanmemoryallocator @ 7de5cc00de50e71a3aab22dea52fbb7ff4efceb6
skia/third_party/externals/libpng @ 386707c6d19b974ca2e3db7f5c61873813c6fe44
...third_party/externals/spirv-cross @ 09e60d74f6a1c8deed2c02c998661b2ec7dd712e
Skia args: is_official_build=true is_debug=false skia_enable_svg=false skia_enable_gpu=false skia_enable_skottie=false skia_enable_pdf=true skia_use_gl=false skia_use_egl=false skia_use_x11=false skia_use_system_libpng=false skia_use_libwebp_encode=false skia_use_libwebp_decode=true skia_use_system_zlib=false skia_use_xps=false skia_use_dng_sdk=false cc="clang" cxx="clang++" skia_enable_skshaper=true skia_use_icu=true skia_use_system_icu=false skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true skia_use_system_harfbuzz=false skia_use_sfntly=false skia_enable_skparagraph=true skia_use_system_libwebp=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_expat=true skia_use_system_expat=false cc="emcc" cxx="em++" skia_gl_standard="webgl" skia_use_freetype=true skia_use_system_freetype2=false skia_use_webgl=false target_cpu="wasm" skia_enable_fontmgr_custom_embedded=false skia_enable_fontmgr_custom_empty=true extra_cflags=["-O0","--target=wasm32-unknown-emscripten"] extra_asmflags=["--target=wasm32-unknown-emscripten"]
Done. Made 95 targets from 48 files in 39ms
ninja: Entering directory `/Users/<user>/<project path>/target/wasm32-unknown-emscripten/debug/build/skia-bindings-aa5bf92bc261fb49/out/skia'
[1/195] link libbrotli.a
FAILED: libbrotli.a
python3 "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/gn/rm.py" "libbrotli.a" && ar rcs libbrotli.a @libbrotli.a.rsp
ar: libbrotli.a: error reading obj/third_party/externals/brotli/c/common/libbrotli.platform.o: invalid operation
[2/195] link libharfbuzz.a
FAILED: libharfbuzz.a
python3 "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/gn/rm.py" "libharfbuzz.a" && ar rcs libharfbuzz.a @libharfbuzz.a.rsp
ar: libharfbuzz.a: error reading obj/third_party/externals/harfbuzz/src/libharfbuzz.hb-ot-shaper-syllabic.o: invalid operation
[3/195] link libicu.a
FAILED: libicu.a
python3 "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/gn/rm.py" "libicu.a" && ar rcs libicu.a @libicu.a.rsp
ar: libicu.a: error reading obj/third_party/externals/icu/source/common/libicu.bytestrie.o: invalid operation
[4/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jfdctfst.c
[5/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jmemnobs.c
[6/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jidctred.c
[7/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jidctfst.c
[8/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jfdctint.c
[9/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jfdctflt.c
[10/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jidctflt.c
[11/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jmemmgr.c
[12/195] compile ../../../../../../../../../../../.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/skia/third_party/externals/libjpeg-turbo/jidctint.c
ninja: build stopped: subcommand failed.
--- stderr
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at '`ninja` returned an error, please check the output for details.', /Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/skia-bindings-0.62.0/build_support/skia/config.rs:338:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace The Cargo.toml file is using: skia-safe = { version = "0.62.0", features = ["textlayout", "embed-freetype", "webp-decode"] } I'm using the ➜ skia ✗ /opt/homebrew/opt/binutils/bin/ar rcs libbrotli.a @libbrotli.a.rsp
/opt/homebrew/opt/binutils/bin/ar: libbrotli.a: error reading obj/third_party/externals/brotli/c/common/libbrotli.platform.o: invalid operation My emscripten version is 3.1.46: ➜ skia ✗ em++ --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.46 (19607820c447a13fd8d0b7680c56148427d6e1b8) but I have the same issue with 3.1.1 Thank you Edit: If I try without the responsefile (related: bkaradzic/GENie#498 (comment)) with the /usr/bin/ar -rcs libbrotli.a obj/third_party/externals/brotli/c/common/libbrotli.constants.o obj/third_party/externals/brotli/c/common/libbrotli.context.o obj/third_party/externals/brotli/c/common/libbrotli.dictionary.o obj/third_party/externals/brotli/c/common/libbrotli.platform.o obj/third_party/externals/brotli/c/common/libbrotli.shared_dictionary.o obj/third_party/externals/brotli/c/common/libbrotli.transform.o obj/third_party/externals/brotli/c/dec/libbrotli.bit_reader.o obj/third_party/externals/brotli/c/dec/libbrotli.decode.o obj/third_party/externals/brotli/c/dec/libbrotli.huffman.o obj/third_party/externals/brotli/c/dec/libbrotli.state.o
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: libbrotli.a the table of contents is empty (no object file members in the library define global symbols) But the exit code is 0 instead of 1 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I was able to fix the #!/bin/bash
OPTIONS=$1
OUTPUT=$2
INPUT=$3
if [[ $INPUT = @* ]]
then
INPUT="${INPUT:1}"
INPUT=$(cat $INPUT)
fi
/usr/bin/ar $OPTIONS $OUTPUT $INPUT I needed to update my skia-safe = { version = "0.62.0", features = ["textlayout", "embed-freetype", "webp-decode", "embed-icudtl"], default-features = false }
skia-bindings = { version = "*", default-features = false } But now the compilation is failing with: error: failed to build archive: 'libskparagraph.Decorations.o': section too large |
Beta Was this translation helpful? Give feedback.
-
Successfully compiled by using export PATH="/opt/homebrew/Cellar/llvm/17.0.1/bin:$PATH" note: still need the |
Beta Was this translation helpful? Give feedback.
Successfully compiled by using
llvm-ar
andllvm-clang
(related: rust-bitcoin/rust-secp256k1#283 (comment)) from thellvm
brew formula, adding this to my zsh profile:note: still need the
ar.sh
file to handle responsefile becausellvm-ar
doesn't support it