maplibre / maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Apache License 2.0
1.34k stars 77 forks source link

maplibre-demo: Problem when building for web #234

Closed Dunrar closed 1 year ago

Dunrar commented 1 year ago

When building for web, I encounter an error.

🤔 Expected Behavior

The build should finish with no problems.

😯 Current Behavior

This is the error message:

   Compiling web v0.1.0 (/home/myuser/Projects/maplibre-rs/web)
error: failed to run custom build command for `web v0.1.0 (/home/myuser/Projects/maplibre-rs/web)`

Caused by:
  process didn't exit successfully: `/home/myuser/Projects/maplibre-rs/target/wasm-dev/build/web-9ac762a1a95b882a/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=./flatbuffer

  --- stderr
  thread 'main' panicked at 'flatc: Custom { kind: NotFound, error: "failed to spawn `\"flatc\" \"--version\"`: No such file or directory (os error 2)" }', web/build.rs:25:6
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/42325c525b9d3885847a3f803abe53c562d289da/library/std/src/panicking.rs:575:5
     1: core::panicking::panic_fmt
               at /rustc/42325c525b9d3885847a3f803abe53c562d289da/library/core/src/panicking.rs:65:14
     2: core::result::unwrap_failed
               at /rustc/42325c525b9d3885847a3f803abe53c562d289da/library/core/src/result.rs:1791:5
     3: core::result::Result<T,E>::expect
               at /rustc/42325c525b9d3885847a3f803abe53c562d289da/library/core/src/result.rs:1070:23
     4: build_script_build::main
               at ./build.rs:13:5
     5: core::ops::function::FnOnce::call_once
               at /rustc/42325c525b9d3885847a3f803abe53c562d289da/library/core/src/ops/function.rs:510:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Failed to start building: Failed to execute cargo build
error: Recipe `web-lib` failed on line 91 with exit code 1

🌍 Your Environment

maxammann commented 1 year ago

FlatBuffers compiler was recently added as a dependency (flatc).

I did not yet update the documentation. Let's use this issue to update the docs and explain how to fix this.

I think you can just execute pacman -S flatbuffers

Dunrar commented 1 year ago

Thanks, after also installing wasm-bindgen, it builds. Firefox Nightly doesn't display anything, but most WebGPU demos don't work either, so the fault probably lies there.