From 589b6cc59cbab4c6d78d441b4623d2364081b22d Mon Sep 17 00:00:00 2001 From: onsdagens Date: Mon, 1 Jul 2024 12:27:35 +0200 Subject: [PATCH 1/6] temp fix for build fail on windows --- Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1ffb1a49..13d3d604 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,11 @@ optional = true optional = true version = "0.23.0" +[dependencies.winapi] +optional = true +version = "0.3.9" +features = ["winuser"] + [dependencies.eframe] optional = true version = "0.23.0" @@ -43,7 +48,7 @@ version = "0.23.0" default = ["gui-egui"] components = [] gui-vizia = ["vizia", "components"] -gui-egui = ["egui", "eframe", "epaint", "components"] +gui-egui = ["egui", "eframe", "epaint", "winapi", "components"] [profile.dev] debug = 1 # faster build, still allows for stack back trace From 0c370d2e895c7cd629a87fb4029c3c1b3098b9e7 Mon Sep 17 00:00:00 2001 From: onsdagens Date: Mon, 1 Jul 2024 12:32:35 +0200 Subject: [PATCH 2/6] add windows, macOS targets to CI --- .github/workflows/rust.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6107f558..6d6d89b0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,7 +2,7 @@ name: Rust on: push: - branches: ["master", "egui_generic"] + branches: ["master", "ci"] pull_request: branches: ["master"] @@ -12,6 +12,10 @@ env: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin] steps: - uses: actions/checkout@v3 - name: Update runner From 58525a4f99f2c5a97964b73e19d451845aaae262 Mon Sep 17 00:00:00 2001 From: onsdagens Date: Mon, 1 Jul 2024 13:36:09 +0200 Subject: [PATCH 3/6] point vizia to a fork while we wait for PR to land --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 13d3d604..931055e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,10 @@ typetag = "0.2.10" [dependencies.vizia] -git = "https://github.com/vizia/vizia.git" -# path = "../vizia" +#git = "https://github.com/vizia/vizia.git" +git = "https://github.com/onsdagens/vizia.git" +#rev = "2e0e55ba3d67b7d4a8a7e8dd2324a8eda549c578" +#path = "../vizia" optional = true [dependencies.egui] From 20824f4776d7e51e82b90efdd446be86c56d4759 Mon Sep 17 00:00:00 2001 From: onsdagens Date: Tue, 2 Jul 2024 11:07:37 +0200 Subject: [PATCH 4/6] repoint vizia to upstream --- Cargo.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 931055e8..ae098d90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,9 +23,7 @@ typetag = "0.2.10" [dependencies.vizia] -#git = "https://github.com/vizia/vizia.git" -git = "https://github.com/onsdagens/vizia.git" -#rev = "2e0e55ba3d67b7d4a8a7e8dd2324a8eda549c578" +git = "https://github.com/vizia/vizia.git" #path = "../vizia" optional = true From 26b78901c26be8ca879bdf67b5fc8a9cef9df544 Mon Sep 17 00:00:00 2001 From: pawdzi-7 Date: Wed, 3 Jul 2024 11:03:43 +0200 Subject: [PATCH 5/6] clippy --- src/common.rs | 2 +- src/gui_egui/editor.rs | 2 +- src/gui_egui/editor_wire_mode.rs | 2 +- src/gui_vizia/components/probe_edit.rs | 2 +- src/gui_vizia/gui.rs | 2 +- src/gui_vizia/popup.rs | 2 -- src/simulator.rs | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/common.rs b/src/common.rs index 03f556b2..69f1fa9d 100644 --- a/src/common.rs +++ b/src/common.rs @@ -156,7 +156,7 @@ pub trait EguiComponent: Component { } fn set_id_tmp(&self, context: &mut EguiExtra) { - context.id_tmp = self.get_id_ports().0.clone(); + context.id_tmp.clone_from(&self.get_id_ports().0); } } diff --git a/src/gui_egui/editor.rs b/src/gui_egui/editor.rs index ecee55f8..cb88ccb5 100644 --- a/src/gui_egui/editor.rs +++ b/src/gui_egui/editor.rs @@ -410,7 +410,7 @@ pub fn get_component(components: &Components, comp: CloseToComponent) -> Option< for (i, c) in components.iter().enumerate() { // doing std::ptr::eq doesn't work and this works so I'm going to keep it // even if clippy errors on it - #[allow(clippy::vtable_address_comparisons)] + #[allow(ambiguous_wide_pointer_comparisons)] if Rc::ptr_eq(c, &comp.comp) { drop(comp); return Some(i); diff --git a/src/gui_egui/editor_wire_mode.rs b/src/gui_egui/editor_wire_mode.rs index b30872ad..70b79559 100644 --- a/src/gui_egui/editor_wire_mode.rs +++ b/src/gui_egui/editor_wire_mode.rs @@ -98,7 +98,7 @@ pub fn last_click(e: &mut Editor, closest_uw: CloseToComponent) { pos_v.append(&mut v); // Now actually set the input of the wired component - #[allow(clippy::vtable_address_comparisons)] + #[allow(ambiguous_wide_pointer_comparisons)] if !Rc::ptr_eq(&in_c.comp, &out_c.comp) { let comp = if is_input_in_comp_start { out_c } else { in_c }; e.components.push(Rc::new(Wire { diff --git a/src/gui_vizia/components/probe_edit.rs b/src/gui_vizia/components/probe_edit.rs index 396ad5d4..481bf8d1 100644 --- a/src/gui_vizia/components/probe_edit.rs +++ b/src/gui_vizia/components/probe_edit.rs @@ -34,7 +34,7 @@ impl ViziaComponent for ProbeEdit { //cx.emit(ProbeEditViewSetter::EditableText(text)); }, ) - .on_submit(move |ex, text, enter| { + .on_submit(move |_, text, enter| { trace!("submit: text {} enter {}", text, enter); //ex.emit(ProbeEditViewSetter::EditableText(text)); }) diff --git a/src/gui_vizia/gui.rs b/src/gui_vizia/gui.rs index d606765f..7f401d69 100644 --- a/src/gui_vizia/gui.rs +++ b/src/gui_vizia/gui.rs @@ -128,7 +128,7 @@ pub fn gui(cs: ComponentStore, path: &PathBuf) { let path = path.to_owned(); simulator.save_dot(&path); - Application::new(move |cx| { + let _ = Application::new(move |cx| { cx.add_stylesheet(include_style!("src/gui_vizia/style.css")) .expect("Failed to add stylesheet"); diff --git a/src/gui_vizia/popup.rs b/src/gui_vizia/popup.rs index 9cfdd4fc..915e18c7 100644 --- a/src/gui_vizia/popup.rs +++ b/src/gui_vizia/popup.rs @@ -6,8 +6,6 @@ use vizia::prelude::*; use log::*; -use crate::gui_vizia::popup::popup_data_derived_lenses::is_open; - pub fn build_popup(cx: &mut Context, id_ports: (Id, Ports)) -> Handle<'_, Popup> { trace!("build_popup"); PopupData::default().build(cx); diff --git a/src/simulator.rs b/src/simulator.rs index 4eb87f6b..0312d61b 100644 --- a/src/simulator.rs +++ b/src/simulator.rs @@ -230,7 +230,7 @@ impl Simulator { .get(&(id.into(), field.into())) .unwrap_or_else(|| panic!("Component {}, field {} not found.", id, field)); let start_index = self.get_id_start_index(id); - let val: SignalValue = value.try_into().unwrap(); + let val: SignalValue = value.into(); //trace!("id:{}, field:{}, value:{:?}", id,field, SignalValue::try_from(val).unwrap()); self.set_value(start_index + index, val); } From 09401a6ea173ff1c90d13466522049221dd675dc Mon Sep 17 00:00:00 2001 From: pawdzi-7 Date: Wed, 3 Jul 2024 11:08:47 +0200 Subject: [PATCH 6/6] bump actions, clippy-check is abandoned, so point it to a fork --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6d6d89b0..b0513bd0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,7 +17,7 @@ jobs: matrix: target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Update runner run: sudo apt-get update - name: Install dependencies @@ -28,11 +28,11 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --verbose - - uses: actions-rs/clippy-check@v1 + - uses: clechasseur/rs-clippy-check@v3 with: token: ${{ secrets.GITHUB_TOKEN }} args: --no-default-features --features gui-vizia - - uses: actions-rs/clippy-check@v1 + - uses: clechasseur/rs-clippy-check@v3 with: token: ${{ secrets.GITHUB_TOKEN }} args: --no-default-features --features gui-egui @@ -41,7 +41,7 @@ jobs: rustfmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2