From 3f49366b86dc4e2f10fd9e415576f794937a01dd Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 1 Feb 2023 15:27:58 +0100 Subject: [PATCH 1/4] contrib: update the Iced patch for reproducible builds The Iced dependency was updated, and the patch wasn't valid anymore. --- .../guix/patches/gui/iced_default_enum.patch | 74 ++++++++++++------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/contrib/reproducible/guix/patches/gui/iced_default_enum.patch b/contrib/reproducible/guix/patches/gui/iced_default_enum.patch index e040e9aa..7e2ce0fb 100644 --- a/contrib/reproducible/guix/patches/gui/iced_default_enum.patch +++ b/contrib/reproducible/guix/patches/gui/iced_default_enum.patch @@ -55,10 +55,10 @@ index 8ae1cacb..25a3028b 100644 .cloned() .collect(); diff --git a/iced_style/src/theme.rs b/iced_style/src/theme.rs -index d7ebb827..224a04fc 100644 +index 55bfa4ca..e29fde31 100644 --- a/iced_style/src/theme.rs +++ b/iced_style/src/theme.rs -@@ -25,10 +25,9 @@ use iced_core::{Background, Color, Vector}; +@@ -26,10 +26,9 @@ use iced_core::{Background, Color, Vector}; use std::rc::Rc; /// A built-in theme. @@ -70,7 +70,7 @@ index d7ebb827..224a04fc 100644 Light, /// The built-in dark variant. Dark, -@@ -61,6 +60,12 @@ impl Theme { +@@ -62,6 +61,12 @@ impl Theme { } } @@ -83,7 +83,7 @@ index d7ebb827..224a04fc 100644 /// A [`Theme`] with a customized [`Palette`]. #[derive(Debug, Clone, Copy, PartialEq)] pub struct Custom { -@@ -79,15 +84,19 @@ impl Custom { +@@ -80,15 +85,19 @@ impl Custom { } /// The style of an application. @@ -105,7 +105,7 @@ index d7ebb827..224a04fc 100644 impl application::StyleSheet for Theme { type Style = Application; -@@ -119,10 +128,11 @@ impl From application::Appearance> for Application { +@@ -120,10 +129,11 @@ impl From application::Appearance> for Application { } /// The style of a button. @@ -119,7 +119,7 @@ index d7ebb827..224a04fc 100644 Primary, /// The secondary style. Secondary, -@@ -138,6 +148,12 @@ pub enum Button { +@@ -139,6 +149,12 @@ pub enum Button { Custom(Box>), } @@ -132,7 +132,7 @@ index d7ebb827..224a04fc 100644 impl button::StyleSheet for Theme { type Style = Button; -@@ -227,10 +243,11 @@ impl button::StyleSheet for Theme { +@@ -228,10 +244,11 @@ impl button::StyleSheet for Theme { } /// The style of a checkbox. @@ -146,7 +146,7 @@ index d7ebb827..224a04fc 100644 Primary, /// The secondary style. Secondary, -@@ -242,6 +259,12 @@ pub enum Checkbox { +@@ -243,6 +260,12 @@ pub enum Checkbox { Custom(Box>), } @@ -159,7 +159,7 @@ index d7ebb827..224a04fc 100644 impl checkbox::StyleSheet for Theme { type Style = Checkbox; -@@ -339,10 +362,11 @@ fn checkbox_appearance( +@@ -340,10 +363,11 @@ fn checkbox_appearance( } /// The style of a container. @@ -173,7 +173,7 @@ index d7ebb827..224a04fc 100644 Transparent, /// A simple box. Box, -@@ -350,6 +374,12 @@ pub enum Container { +@@ -351,6 +375,12 @@ pub enum Container { Custom(Box>), } @@ -186,7 +186,7 @@ index d7ebb827..224a04fc 100644 impl From container::Appearance> for Container { fn from(f: fn(&Theme) -> container::Appearance) -> Self { Self::Custom(Box::new(f)) -@@ -387,15 +417,19 @@ impl container::StyleSheet for fn(&Theme) -> container::Appearance { +@@ -388,15 +418,19 @@ impl container::StyleSheet for fn(&Theme) -> container::Appearance { } /// The style of a slider. @@ -208,7 +208,7 @@ index d7ebb827..224a04fc 100644 impl slider::StyleSheet for Theme { type Style = Slider; -@@ -468,15 +502,20 @@ impl slider::StyleSheet for Theme { +@@ -469,15 +503,20 @@ impl slider::StyleSheet for Theme { } /// The style of a menu. @@ -231,7 +231,7 @@ index d7ebb827..224a04fc 100644 impl menu::StyleSheet for Theme { type Style = Menu; -@@ -510,10 +549,9 @@ impl From for Menu { +@@ -511,10 +550,9 @@ impl From for Menu { } /// The style of a pick list. @@ -243,7 +243,7 @@ index d7ebb827..224a04fc 100644 Default, /// A custom style. Custom( -@@ -522,6 +560,12 @@ pub enum PickList { +@@ -523,6 +561,12 @@ pub enum PickList { ), } @@ -256,7 +256,7 @@ index d7ebb827..224a04fc 100644 impl pick_list::StyleSheet for Theme { type Style = PickList; -@@ -565,15 +609,19 @@ impl pick_list::StyleSheet for Theme { +@@ -566,15 +610,19 @@ impl pick_list::StyleSheet for Theme { } /// The style of a radio button. @@ -278,7 +278,7 @@ index d7ebb827..224a04fc 100644 impl radio::StyleSheet for Theme { type Style = Radio; -@@ -620,15 +668,19 @@ impl radio::StyleSheet for Theme { +@@ -621,15 +669,19 @@ impl radio::StyleSheet for Theme { } /// The style of a toggler. @@ -300,7 +300,7 @@ index d7ebb827..224a04fc 100644 impl toggler::StyleSheet for Theme { type Style = Toggler; -@@ -687,15 +739,19 @@ impl toggler::StyleSheet for Theme { +@@ -688,15 +740,19 @@ impl toggler::StyleSheet for Theme { } /// The style of a pane grid. @@ -322,7 +322,7 @@ index d7ebb827..224a04fc 100644 impl pane_grid::StyleSheet for Theme { type Style = PaneGrid; -@@ -729,10 +785,11 @@ impl pane_grid::StyleSheet for Theme { +@@ -730,10 +786,11 @@ impl pane_grid::StyleSheet for Theme { } /// The style of a progress bar. @@ -336,7 +336,7 @@ index d7ebb827..224a04fc 100644 Primary, /// The success style. Success, -@@ -742,6 +799,12 @@ pub enum ProgressBar { +@@ -743,6 +800,12 @@ pub enum ProgressBar { Custom(Box>), } @@ -349,7 +349,7 @@ index d7ebb827..224a04fc 100644 impl From progress_bar::Appearance> for ProgressBar { fn from(f: fn(&Theme) -> progress_bar::Appearance) -> Self { Self::Custom(Box::new(f)) -@@ -782,15 +845,22 @@ impl progress_bar::StyleSheet for fn(&Theme) -> progress_bar::Appearance { +@@ -783,15 +846,22 @@ impl progress_bar::StyleSheet for fn(&Theme) -> progress_bar::Appearance { } /// The style of a rule. @@ -374,7 +374,29 @@ index d7ebb827..224a04fc 100644 impl From rule::Appearance> for Rule { fn from(f: fn(&Theme) -> rule::Appearance) -> Self { Self::Custom(Box::new(f)) -@@ -824,15 +894,19 @@ impl rule::StyleSheet for fn(&Theme) -> rule::Appearance { +@@ -827,15 +897,19 @@ impl rule::StyleSheet for fn(&Theme) -> rule::Appearance { + /** + * Svg + */ +-#[derive(Default)] + pub enum Svg { + /// No filtering to the rendered SVG. +- #[default] + Default, + /// A custom style. + Custom(Box>), + } + ++impl Default for Svg { ++ fn default() -> Self { ++ Self::Default ++ } ++} ++ + impl Svg { + /// Creates a custom [`Svg`] style. + pub fn custom_fn(f: fn(&Theme) -> svg::Appearance) -> Self { +@@ -863,15 +937,19 @@ impl svg::StyleSheet for fn(&Theme) -> svg::Appearance { } /// The style of a scrollable. @@ -393,10 +415,10 @@ index d7ebb827..224a04fc 100644 + } +} + - impl scrollable::StyleSheet for Theme { - type Style = Scrollable; - -@@ -889,15 +963,23 @@ impl scrollable::StyleSheet for Theme { + impl Scrollable { + /// Creates a custom [`Scrollable`] theme. + pub fn custom + 'static>( +@@ -961,15 +1039,23 @@ impl scrollable::StyleSheet for Theme { } /// The style of text. @@ -422,7 +444,7 @@ index d7ebb827..224a04fc 100644 impl From for Text { fn from(color: Color) -> Self { Text::Color(color) -@@ -916,15 +998,19 @@ impl text::StyleSheet for Theme { +@@ -988,15 +1074,19 @@ impl text::StyleSheet for Theme { } /// The style of a text input. From 0a1c04db3625608522dba98bc4d2a070853cdd1a Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 2 Feb 2023 12:01:11 +0100 Subject: [PATCH 2/4] contrib: fixup patching in Guix build script --- contrib/reproducible/guix/guix-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/reproducible/guix/guix-build.sh b/contrib/reproducible/guix/guix-build.sh index 128cbcc6..ed62283a 100755 --- a/contrib/reproducible/guix/guix-build.sh +++ b/contrib/reproducible/guix/guix-build.sh @@ -63,7 +63,7 @@ for project_folder in "" "gui"; do PROJECT_PATCHES_ROOT="$PWD/contrib/reproducible/guix/patches/$project_folder" project_needs_patches() { - test $(ls -A1q "$PROJECT_PATCHES_ROOT" |grep patch) + test "$(ls -A1q "$PROJECT_PATCHES_ROOT" |grep patch)" } maybe_create_dir "$PROJECT_OUT_DIR" From b2602e02046c21636c86b71247a1988ee71616bb Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 2 Feb 2023 12:14:31 +0100 Subject: [PATCH 3/4] contrib: use unpublished rustc 1.64 to build the GUI in Guix --- contrib/reproducible/guix/manifest.scm | 33 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/contrib/reproducible/guix/manifest.scm b/contrib/reproducible/guix/manifest.scm index 8bba3395..72ddb0cf 100644 --- a/contrib/reproducible/guix/manifest.scm +++ b/contrib/reproducible/guix/manifest.scm @@ -1,15 +1,28 @@ -(specifications->manifest - (append - (list "rust" - "rust:cargo" - "coreutils" - "patchelf" - "gcc-toolchain@10.3.0") - ;; Additional dependencies for building the GUI - (let ((is_gui (getenv "IS_GUI"))) +(let ((is_gui (getenv "IS_GUI"))) + (concatenate-manifests + (list + (specifications->manifest + (append + (list + "rust:cargo" + "coreutils" + "patchelf" + "gcc-toolchain@10.3.0") + ;; Additional dependencies for building the GUI, and the regular rustc for building + ;; the daemon and CLI. (if (string=? is_gui "1") (list "pkg-config" "eudev" "fontconfig") - '())))) + (list "rust")))) + ;; The GUI MSRV is 1.65. We could patch the requirements for new compiler features but + ;; Iced 0.7 started relying on a lifetime that was treated as a bug until rustc 1.64. I + ;; couldn't find how to fix it therefore we are relying on a Rust toolchain unpublished + ;; by Guix to build the GUI. + (packages->manifest + (if + (string=? is_gui "1") + (list + (@@ (gnu packages rust) rust-1.64)) + '()))))) From 7a3eeb741ea42e3af4d5414e6778bb3fa585f762 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 2 Feb 2023 12:16:40 +0100 Subject: [PATCH 4/4] ci: test the GUI against it's current MSRV To make sure we don't break it unintentionally. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 612fbc14..f8d39d05 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: strategy: matrix: toolchain: - - stable + - 1.65 - nightly os: - ubuntu-latest