emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.76k stars 1.5k forks source link

Wayland dependencies are pulled in for eframe, even when `wayland` feature is disabled. #4538

Open crumblingstatue opened 1 month ago

crumblingstatue commented 1 month ago

Describe the bug When depending on eframe with default features disabled, and only x11 and glow enabled, eframe is pulling in wayland dependencies.

To Reproduce Create a new project, and depend on eframe with default features disabled.

[package]
name = "myeframetest"
version = "0.1.0"
edition = "2021"

[dependencies]
eframe = { git = "https://github.com/emilk/egui.git", default-features = false, features = ["glow", "x11"] }

Expected behavior

No wayland dependencies in Cargo.lock

What happens Cargo.lock has several wayland dependencies.

crumblingstatue commented 1 month ago

These lines seem to be the culprits responsible:

diff --git a/Cargo.toml b/Cargo.toml
index a42033c0..3288d1c7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -71,8 +71,8 @@ bytemuck = "1.7.2"
 criterion = { version = "0.5.1", default-features = false }
 document-features = " 0.2.8"
 glow = "0.13"
-glutin = "0.31"
-glutin-winit = "0.4"
+glutin = { version = "0.31", default-features = false }
+glutin-winit = { version = "0.4", default-features = false }
 image = { version = "0.25", default-features = false }
 log = { version = "0.4", features = ["std"] }
 nohash-hasher = "0.2"
diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml
index 6354b7a4..6046e65e 100644
--- a/crates/egui-winit/Cargo.toml
+++ b/crates/egui-winit/Cargo.toml
@@ -40,7 +40,7 @@ bytemuck = ["egui/bytemuck"]

 ## Enable cut/copy/paste to OS clipboard.
 ## If disabled a clipboard will be simulated so you can still copy/paste within the egui app.
-clipboard = ["arboard", "smithay-clipboard"] # Unconditional dependency on smithay-clipboard
+clipboard = ["arboard"]

 ## Enable opening links in a browser when an egui hyperlink is clicked.
 links = ["webbrowser"]