From 481a72fda6c32968ac531ecafd68a1e0888bac30 Mon Sep 17 00:00:00 2001 From: Daniel Z <5725958+dzil123@users.noreply.github.com> Date: Thu, 29 Apr 2021 20:19:11 -0700 Subject: [PATCH 1/8] Disable winit default features --- imgui-winit-support/Cargo.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index ccbef07..80e444e 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -11,12 +11,11 @@ categories = ["gui"] [dependencies] imgui = { version = "0.7.0", path = "../imgui" } -winit-19 = { version = ">= 0.16, < 0.20", package = "winit", optional = true } -winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true } -winit-22 = { version = "0.22", package = "winit", optional = true } -winit-23 = { version = "0.23", package = "winit", optional = true } -winit-24 = { version = "0.24", package = "winit", optional = true } -winit-25 = { version = "0.25", package = "winit", optional = true } +winit-19 = { version = ">= 0.16, < 0.20", package = "winit", default-features = false, optional = true } +winit-20 = { version = ">= 0.20, < 0.22", package = "winit", default-features = false, optional = true } +winit-22 = { version = "0.22", package = "winit", default-features = false, optional = true } +winit-23 = { version = "0.23", package = "winit", default-features = false, optional = true } +winit-24 = { version = "0.24", package = "winit", default-features = false, optional = true } [features] default = ["winit-25"] From b3cf8ca4a6f9558ae57bf7c99455cbc94d99342d Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Thu, 29 Apr 2021 21:51:05 -0700 Subject: [PATCH 2/8] Re-enable winit default features during CI --- .github/workflows/ci.yml | 8 ++++---- imgui-winit-support/Cargo.toml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f81ab1..733933a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,8 +51,8 @@ jobs: - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 --all-targets - - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23 --all-targets - - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24 --all-targets + - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default --all-targets + - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default --all-targets rustfmt: name: Check rustfmt runs-on: ubuntu-latest @@ -138,8 +138,8 @@ jobs: - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 - - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23 - - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24 + - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default + - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default # Run unreasonably slow tests under release, but only the crates that have # them, and don't bother doing this on most platforms. - run: cargo test -p imgui --release -- --ignored diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 80e444e..7358841 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -11,9 +11,9 @@ categories = ["gui"] [dependencies] imgui = { version = "0.7.0", path = "../imgui" } -winit-19 = { version = ">= 0.16, < 0.20", package = "winit", default-features = false, optional = true } -winit-20 = { version = ">= 0.20, < 0.22", package = "winit", default-features = false, optional = true } -winit-22 = { version = "0.22", package = "winit", default-features = false, optional = true } +winit-19 = { version = ">= 0.16, < 0.20", package = "winit", optional = true } +winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true } +winit-22 = { version = "0.22", package = "winit", optional = true } winit-23 = { version = "0.23", package = "winit", default-features = false, optional = true } winit-24 = { version = "0.24", package = "winit", default-features = false, optional = true } From 43e2381c9301820c3ed0e85fe7a1e159f220580c Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Thu, 29 Apr 2021 23:00:21 -0700 Subject: [PATCH 3/8] Workaround for CI clippy --all-features --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 733933a..2bc12ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: ${{ runner.os }}-target-lint- - run: cargo clippy --workspace --all-targets # supported winit versions - - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets + - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --features winit-19 --features winit-20 --features winit-22 --features winit-23/default --features winit-24/default --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 --all-targets From 9d34370989219811e8dd2a63b269d37613ff96ea Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Fri, 30 Apr 2021 02:13:35 -0700 Subject: [PATCH 4/8] Create dummy feature to fix clippy --all-features --- .github/workflows/ci.yml | 2 +- imgui-winit-support/Cargo.toml | 3 ++- xtask/src/main.rs | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bc12ba..733933a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: ${{ runner.os }}-target-lint- - run: cargo clippy --workspace --all-targets # supported winit versions - - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --features winit-19 --features winit-20 --features winit-22 --features winit-23/default --features winit-24/default --all-targets + - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-19 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-20 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 --all-targets diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 7358841..4ddf28a 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -18,7 +18,8 @@ winit-23 = { version = "0.23", package = "winit", default-features = false, opti winit-24 = { version = "0.24", package = "winit", default-features = false, optional = true } [features] -default = ["winit-25"] +default = ["winit-24"] +test = ["winit-23/default", "winit-24/default"] # This is phrased as a negative (unlike most features) so that it needs to be # explicitly disabled (and `default-features = false` won't do it). To avoid diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 59149cd..30e3772 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -41,7 +41,13 @@ fn lint_all() -> Result<()> { "cargo clippy --manifest-path imgui-winit-support/Cargo.toml --all-features --all-targets" ) .run()?; - let winits = &["winit-19", "winit-20", "winit-22", "winit-23", "winit-24"]; + let winits = &[ + "winit-19", + "winit-20", + "winit-22", + "winit-23/default", + "winit-24/default", + ]; for &winit in winits { xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; } @@ -52,7 +58,13 @@ fn lint_all() -> Result<()> { fn test_all() -> Result<()> { xshell::cmd!("cargo test --workspace --all-targets").run()?; xshell::cmd!("cargo test --workspace --doc").run()?; - let winits = &["winit-19", "winit-20", "winit-22", "winit-23", "winit-24"]; + let winits = &[ + "winit-19", + "winit-20", + "winit-22", + "winit-23/default", + "winit-24/default", + ]; for &winit in winits { xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; } From b378477d641224e0542ddbab32ac09732fb8e128 Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Mon, 24 May 2021 03:26:18 -0700 Subject: [PATCH 5/8] Add winit 0.25 to CI and xtask --- .github/workflows/ci.yml | 2 ++ imgui-winit-support/Cargo.toml | 5 +++-- xtask/src/main.rs | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 733933a..5b7653f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,7 @@ jobs: - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default --all-targets - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default --all-targets + - run: cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-25/default --all-targets rustfmt: name: Check rustfmt runs-on: ubuntu-latest @@ -140,6 +141,7 @@ jobs: - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-22 - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-23/default - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-24/default + - run: cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features winit-25/default # Run unreasonably slow tests under release, but only the crates that have # them, and don't bother doing this on most platforms. - run: cargo test -p imgui --release -- --ignored diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 4ddf28a..9a5e2c4 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -16,10 +16,11 @@ winit-20 = { version = ">= 0.20, < 0.22", package = "winit", optional = true } winit-22 = { version = "0.22", package = "winit", optional = true } winit-23 = { version = "0.23", package = "winit", default-features = false, optional = true } winit-24 = { version = "0.24", package = "winit", default-features = false, optional = true } +winit-25 = { version = "0.25", package = "winit", default-features = false, optional = true } [features] -default = ["winit-24"] -test = ["winit-23/default", "winit-24/default"] +default = ["winit-24"] # TODO: Change to winit-25 when glutin has upgraded to it +test = ["winit-23/default", "winit-24/default", "winit-25/default"] # This is phrased as a negative (unlike most features) so that it needs to be # explicitly disabled (and `default-features = false` won't do it). To avoid diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 30e3772..dd10cce 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -47,6 +47,7 @@ fn lint_all() -> Result<()> { "winit-22", "winit-23/default", "winit-24/default", + "winit-25/default", ]; for &winit in winits { xshell::cmd!("cargo clippy --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; @@ -64,6 +65,7 @@ fn test_all() -> Result<()> { "winit-22", "winit-23/default", "winit-24/default", + "winit-25/default", ]; for &winit in winits { xshell::cmd!("cargo test --manifest-path imgui-winit-support/Cargo.toml --no-default-features --features {winit} --all-targets").run()?; From 610b2dc6ce1b9ca39706595576b182894b4acc7c Mon Sep 17 00:00:00 2001 From: dzil123 <5725958+dzil123@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:33:05 -0700 Subject: [PATCH 6/8] Enable winit default features by default, to avoid breakage --- imgui-winit-support/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 9a5e2c4..78e02d9 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -19,7 +19,7 @@ winit-24 = { version = "0.24", package = "winit", default-features = false, opti winit-25 = { version = "0.25", package = "winit", default-features = false, optional = true } [features] -default = ["winit-24"] # TODO: Change to winit-25 when glutin has upgraded to it +default = ["winit-25/default"] test = ["winit-23/default", "winit-24/default", "winit-25/default"] # This is phrased as a negative (unlike most features) so that it needs to be From a57227d4cbc14cdf7330be04d8995941e1425b97 Mon Sep 17 00:00:00 2001 From: Jack Spira Date: Sun, 5 Sep 2021 23:32:54 -0700 Subject: [PATCH 7/8] fmt --- imgui-winit-support/src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/imgui-winit-support/src/lib.rs b/imgui-winit-support/src/lib.rs index e08a7ff..cc6d44f 100644 --- a/imgui-winit-support/src/lib.rs +++ b/imgui-winit-support/src/lib.rs @@ -194,15 +194,13 @@ use winit::{ TouchPhase, VirtualKeyCode, Window, WindowEvent, }; -#[cfg( - any( - feature = "winit-25", - feature = "winit-24", - feature = "winit-23", - feature = "winit-22", - feature = "winit-20" - ) -)] +#[cfg(any( + feature = "winit-25", + feature = "winit-24", + feature = "winit-23", + feature = "winit-22", + feature = "winit-20" +))] use winit::{ error::ExternalError, event::{ From e8412180d869cb2ae0df7e3889c14074990d5010 Mon Sep 17 00:00:00 2001 From: Jack Spira Date: Sun, 5 Sep 2021 23:38:23 -0700 Subject: [PATCH 8/8] updated changelog --- CHANGELOG.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 18a6507..6c9b1b3 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -2,6 +2,9 @@ ## [Unreleased] +- Removed automatically adding default features for `imgui-winit-support` +with the exception of the current default winit feature/dep version. Additionally, that version was updated to 0.25. If you want to not have the default features of winit with 0.25, set `default-features = false` and add `winit-25` as a normal feature. Thank you to @dzil123 for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/477)! + - Added an `imgui-glow-renderer` which targets `glow 0.10`. Before release, this will be updated to target current `0.11` glow when further features are added. Thank you to @jmaargh for the work [implementing this here](https://github.com/imgui-rs/imgui-rs/pull/495)! - BREAKING: Reworked `.range` calls on `Slider`, `VerticalSlider`, and `Drag` to simply take two min and max values, and requires that they are provided in the constructor.