From 90c0112cd396ede3a9b2e0ef14ad39af45ea106f Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sat, 15 Dec 2018 20:18:38 +0100 Subject: [PATCH 1/3] Let all anvil features compile standalone --- anvil/Cargo.toml | 2 +- anvil/src/winit.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/anvil/Cargo.toml b/anvil/Cargo.toml index 536a207..90565a4 100644 --- a/anvil/Cargo.toml +++ b/anvil/Cargo.toml @@ -17,7 +17,7 @@ xkbcommon = "0.2.1" [dependencies.smithay] path = ".." default-features = false -features = [ "renderer_glium" ] +features = [ "renderer_glium", "backend_egl" ] [build-dependencies] gl_generator = "0.9" diff --git a/anvil/src/winit.rs b/anvil/src/winit.rs index a78640a..6d9e511 100644 --- a/anvil/src/winit.rs +++ b/anvil/src/winit.rs @@ -24,6 +24,7 @@ use shell::init_shell; pub fn run_winit(display: &mut Display, event_loop: &mut EventLoop<()>, log: Logger) -> Result<(), ()> { let (renderer, mut input) = winit::init(log.clone()).map_err(|_| ())?; + #[cfg(feature = "egl")] let egl_display = Rc::new(RefCell::new( if let Ok(egl_display) = renderer.bind_wl_display(&display) { info!(log, "EGL hardware-acceleration enabled"); @@ -34,7 +35,10 @@ pub fn run_winit(display: &mut Display, event_loop: &mut EventLoop<()>, log: Log )); let (w, h) = renderer.get_framebuffer_dimensions(); + #[cfg(feature = "egl")] let drawer = GliumDrawer::init(renderer, egl_display, log.clone()); + #[cfg(not(feature = "egl"))] + let drawer = GliumDrawer::init(renderer, log.clone()); let name = display.add_socket_auto().unwrap().into_string().unwrap(); info!(log, "Listening on wayland socket"; "name" => name.clone()); From 41044eabecde7811123529191af770436c59b848 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sat, 15 Dec 2018 20:27:37 +0100 Subject: [PATCH 2/3] Test anvil features --- .travis.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 284b692..2158034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,13 @@ env: # test all features simultaneously - FEATURES="all" # test our house compositor - - FEATURES="anvil" + - FEATURES="anvil" ANVIL_FEATURES="" + - FEATURES="anvil" ANVIL_FEATURES="egl" + - FEATURES="anvil" ANVIL_FEATURES="winit" + - FEATURES="anvil" ANVIL_FEATURES="udev" + - FEATURES="anvil" ANVIL_FEATURES="logind" + - FEATURES="anvil" ANVIL_FEATURES="default" + - FEATURES="anvil" ANVIL_FEATURES="all" matrix: include: @@ -91,7 +97,17 @@ script: vagga cargo-$TRAVIS_RUST_VERSION clippy --all-features -- -D warnings ;; "anvil") - vagga cargo-$TRAVIS_RUST_VERSION test -p anvil --all-features + cd anvil + case $ANVIL_FEATURES in + "all") + vagga cargo-$TRAVIS_RUST_VERSION test --all-features + ;; + "default") + vagga cargo-$TRAVIS_RUST_VERSION test + ;; + *) + vagga cargo-$TRAVIS_RUST_VERSION check --no-default-features --features "$ANVIL_FEATURES" + esac ;; *) vagga cargo-$TRAVIS_RUST_VERSION check --tests --no-default-features --features "$FEATURES" && From 43eaeb80bd74d47d0f44e1c7db18abf0a94fc316 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sat, 15 Dec 2018 20:33:36 +0100 Subject: [PATCH 3/3] Do not wait for nightly builds to succeed --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2158034..bcdaf7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,7 @@ env: - FEATURES="anvil" ANVIL_FEATURES="all" matrix: + fast_finish: true include: # special features for lint & fmt - rust: stable