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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error running maplibre-demo #242

Open
dr-kristau opened this issue Jan 18, 2023 · 6 comments
Open

Compile error running maplibre-demo #242

dr-kristau opened this issue Jan 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@dr-kristau
Copy link

Running cargo run -p maplibre-demo on my Fedora system throws a compile error

馃 Expected Behavior

I expect to be able to compile the maplibre-demo running cargo run -p maplibre-demo

馃槸 Current Behavior

I obtain the following when running cargo run -p maplibre-demo

[xxxx@xxxx maplibre-rs]$ cargo run -p maplibre-demo
   Compiling value-bag v1.0.0-alpha.9
   Compiling thiserror v1.0.38
   Compiling serde v1.0.152
   Compiling futures-util v0.3.25
   Compiling tracing v0.1.37
   Compiling wayland-sys v0.29.5
   Compiling flate2 v1.0.25
   Compiling mime_guess v2.0.4
error: failed to run custom build command for `wayland-sys v0.29.5`

Caused by:
  process didn't exit successfully: `/home/xxxx/maplibre-rs/target/debug/build/wayland-sys-5ca4e819db47c1d1/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=WAYLAND_CLIENT_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=WAYLAND_CLIENT_STATIC
  cargo:rerun-if-env-changed=WAYLAND_CLIENT_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: `"pkg-config" "--libs" "--cflags" "wayland-client"` did not exit successfully: exit status: 1
  error: could not find system library 'wayland-client' required by the 'wayland-sys' crate

  --- stderr
  Package wayland-client was not found in the pkg-config search path.
  Perhaps you should add the directory containing `wayland-client.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'wayland-client', required by 'virtual:world', not found
  ', /home/xxxx/.cargo/registry/src/github.com-1ecc6299db9ec823/wayland-sys-0.29.5/build.rs:10:47
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

馃實 Your Environment

  • Desktop
    • Operating System: Fedora Linux 37 (Workstation Edition)
    • Display Server: x11
@dr-kristau dr-kristau added the bug Something isn't working label Jan 18, 2023
@maxammann
Copy link
Collaborator

On ubuntu you will need to install libwayland-dev and libxkbcommon-dev.

There is no documentation about it yet I think.

@dr-kristau
Copy link
Author

thanks @maxammann

On Fedora I had to install wayland-devel and protobuf-compiler to get the demo to build. Unfortunately, when I ran $ maplibre-demo headed it threw an error:

[2023-01-19T15:19:15Z INFO  wgpu_hal::gles::egl] Enabling EGL debug output
libEGL warning: egl: failed to create dri2 screen
[2023-01-19T15:19:15Z ERROR wgpu_hal::gles::egl] EGL 'eglInitialize' code 0x3001: DRI2: failed to create screen

This error is quite usual on my machine due to its age, and probably has nothing to do with maplibre.

@nyurik
Copy link
Member

nyurik commented Jan 21, 2023

yes, i just ran into the same issue, and had to check the CI script. We need to document native deps early on, maybe in a table for different distros.

@nyurik
Copy link
Member

nyurik commented Jan 21, 2023

P.S. i wonder if we can get rid of protobuf compiler - there is a rust-only implementation afaik

@maxammann
Copy link
Collaborator

The actual code generation code is already rust. There is still the dependency to the protoc dependency which we will not get rid of.

@maxammann
Copy link
Collaborator

We maybe should setup a nix-shell environment.

That way all dependencies are declared and all use the same version that could work well for Rust on Linux and macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants