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

wgpu depends upon wayland even when building wezterm without the wayland feature #6315

Closed
acook opened this issue Oct 24, 2024 · 4 comments · Fixed by #6342
Closed

wgpu depends upon wayland even when building wezterm without the wayland feature #6315

acook opened this issue Oct 24, 2024 · 4 comments · Fixed by #6342
Labels
bug Something isn't working

Comments

@acook
Copy link
Contributor

acook commented Oct 24, 2024

When doing cargo build --release --no-default-features --features vendored-fonts I get an error building wayland-sys, which shouldn't happen.

I am seeing this issue on the current git main 9ddca7b.

I have tested the last public release 20240203-110809-5046fc22 and I am able to build from source just fine.

Based on some crude git bisecting, it looks like the issue appeared around 09ac8c5.

24702de is the last version I can build currently.

Build Environment (please complete the following information):

  • OS: Linux X11
  • Linux: Linux name 6.10.13-304.current #1 SMP PREEMPT_DYNAMIC 2024-10-06 x86_64 GNU/Linux
  • Compiler: clang 18.1.8 (not sure if this is what you were looking for)
  • Rust version: 1.79
LSB Version:    1.4
Distributor ID: Solus
Description:    Solus
Release:        4.6
Codename:       convergence
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
1.79.0-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

1.79.0-x86_64-unknown-linux-gnu (default)
rustc 1.79.0 (129f3b996 2024-06-10)

Dependencies

Did you run the get-deps script to install required system dependencies? yes
Was it successful? yes

If building from the git repo, did you update the submodules? yes

The build output

git submodule update --init --recursive
cargo clean
cargo build --release --no-default-features --features vendored-fonts
error: failed to run custom build command for `wayland-sys v0.31.5`

Caused by:
  process didn't exit successfully: `/home/user/Source/Clones/wezterm/target/debug/build/wayland-sys-54d8d2a2b5738154/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 /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wayland-sys-0.31.5/build.rs:10:47:
  called `Result::unwrap()` on an `Err` value:
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags wayland-client

  The system library `wayland-client` required by crate `wayland-sys` was not found.
  The file `wayland-client.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `wayland-client.pc`.

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

seems unrelated to this Nix issue: #5367

@acook acook added the bug Something isn't working label Oct 24, 2024
@dani162
Copy link

dani162 commented Oct 24, 2024

You need to install some wayland client lib, see your error log. On other distros this is probably included in the get-deps script file.

The system library `wayland-client` required by crate `wayland-sys` was not found.
  The file `wayland-client.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

@acook
Copy link
Contributor Author

acook commented Oct 24, 2024

I'm not using Wayland and no part of it is installed. --no-default-features is documented as disabling Wayland support. Prior to 09ac8c5 it was possible to fully disable Wayland. But it doesn't seem to fully do that anymore.

@wez
Copy link
Owner

wez commented Oct 31, 2024

I think you will need to find out how to relay/interpret the feature selection down to the wgpu crate (by looking at its available set of features) to tell it not to import the wayland client libraries if you want to build wezterm without them.

@wez wez changed the title wayland-sys fails to build even when Wayland feature not enabled wgpu depends upon wayland even when building wezterm without the wayland feature Oct 31, 2024
@acook
Copy link
Contributor Author

acook commented Oct 31, 2024

I don't think it's wgpu, I don't see a hard dependency on anything Wayland there. It's wayland-backend, which has the wayland-sys dependency.

09ac8c5#diff-8b7cc7bbcc91b1d0b3bb4323aeab9b4999f5e6a78a5d6d62183c28c44e8601bfR85

I have a fix for this I just tested, will submit a PR soon.

@wez wez closed this as completed in #6342 Nov 1, 2024
wez pushed a commit that referenced this issue Nov 1, 2024
* Mark wayland-backend as optional dependency

Fixes #6315

09ac8c5 introduced the `wayland-backend` dependency, but did not mark it as optional, this prevented the build from successfully completing on X11 systems without Wayland development libraries.
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

Successfully merging a pull request may close this issue.

3 participants