Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iced to 0.14.0-dev #586

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Update iced to 0.14.0-dev #586

merged 1 commit into from
Sep 24, 2024

Conversation

englut
Copy link
Contributor

@englut englut commented Sep 23, 2024

Found an issue with touchpad scrolling being reversed, checked out the CHANGELOG for iced, and noticed 0.13.1 fixes the issue that was introduced in 0.13.0:

iced-rs/iced#2583

Updated iced to 0.14.0-dev.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@neilalexander
Copy link
Contributor

FYI on macOS:

error[E0432]: unresolved imports `iced::advanced::graphics::futures::subscription::MacOS`, `iced::advanced::graphics::futures::subscription::PlatformSpecific`
 --> src/url.rs:8:66
  |
8 |     use iced::advanced::graphics::futures::subscription::{Event, MacOS, PlatformSpecific};
  |                                                                  ^^^^^  ^^^^^^^^^^^^^^^^ no `PlatformSpecific` in `subscription`
  |                                                                  |
  |                                                                  no `MacOS` in `subscription`
  |
  = help: consider importing one of these variants instead:
          crate::url::iced::keyboard::key::NativeCode::MacOS
          iced::keyboard::key::NativeCode::MacOS
  = help: consider importing one of these structs instead:
          crate::url::iced::window::settings::PlatformSpecific
          iced::window::settings::PlatformSpecific

error[E0599]: no variant or associated item named `PlatformSpecific` found for enum `iced::advanced::subscription::Event` in the current scope
  --> src/url.rs:35:32
   |
35 |                         Event::PlatformSpecific(event) => match event {
   |                                ^^^^^^^^^^^^^^^^ variant or associated item not found in `Event`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.

@casperstorm
Copy link
Member

@hecrj is cooking on iced, so it moves fast! 🥳
Once we are up-to-date with master we can merge this again.

@englut englut changed the title Update iced to 0.13.1 Update iced to 0.13.0-dev @ 3a9139e64f37f3223be1a417357123c472ce7c27 Sep 23, 2024
@englut englut changed the title Update iced to 0.13.0-dev @ 3a9139e64f37f3223be1a417357123c472ce7c27 Update iced Sep 23, 2024
@englut
Copy link
Contributor Author

englut commented Sep 23, 2024

@casperstorm I've moved iced back to 0.13.0-dev but using commit 3a9139e64f37f3223be1a417357123c472ce7c27. This is the most up-to-date master commit that doesn't introduce breaking changes to our code base.

When trying to bump the commit versions further: MacOS and PlatformSpecific isn't exported (or even showing up in the compiled iced_futures library) via iced::advanced::graphics::futures::subscription. The Event struct that's exported here doesn't have MacOS specific events either. Which makes me think there's some kind of platform build that's excluding these things, I could be wrong though. Maybe you or @tarkah could take a look at this one.

If I switch to 0.14.0-dev there's all sorts of errors that I haven't quite figured out what they mean yet. There's a bunch of mismatched types relating to iced_core::size::Size:

error[E0308]: mismatched types
   --> src/main.rs:230:28
    |
230 |             min_size: Some(window::MIN_SIZE),
    |                       ---- ^^^^^^^^^^^^^^^^ expected `iced::Size`, found `iced_core::size::Size`
    |                       |
    |                       arguments to this enum variant are incorrect
    |
    = note: `iced_core::size::Size` and `iced::Size` have similar names, but are actually distinct types
note: `iced_core::size::Size` is defined in crate `iced_core`
   --> /Users/ming/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_core-0.13.2/src/size.rs:5:1
    |
5   | pub struct Size<T = f32> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
note: `iced::Size` is defined in crate `iced_core`
   --> /Users/ming/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/b78b8bc/core/src/size.rs:5:1
    |
5   | pub struct Size<T = f32> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `iced_core` are being used?
help: the type constructed contains `iced_core::size::Size` due to the type of the argument passed
   --> src/main.rs:230:23
    |
230 |             min_size: Some(window::MIN_SIZE),
    |                       ^^^^^----------------^
    |                            |
    |                            this argument influences the type of `Some`
note: tuple variant defined here
   --> /Users/ming/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:582:5
    |
582 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^

And there's multiple issues relating to iced_core::color::Color:

error[E0277]: the trait bound `iced::Color: From<iced_core::color::Color>` is not satisfied
   --> src/widget/message_content.rs:91:37
    |
90  |   ...                   .color_maybe(
    |                          ----------- required by a bound introduced by this call
91  | / ...                       formatting
92  | | ...                           .fg
93  | | ...                           .and_then(|color| color.into_iced(theme.colors())),
    | |________________________________________________________________________________^ the trait `From<iced_core::color::Color>` is not implemented for `iced::Color`, which is required by `iced_core::color::Color: Into<iced::Color>`
    |
    = help: the following other types implement trait `From<T>`:
              `iced::Color` implements `From<Alpha<palette::rgb::Rgb, f32>>`
              `iced::Color` implements `From<[f32; 3]>`
              `iced::Color` implements `From<[f32; 4]>`
              `iced::Color` implements `From<palette::rgb::Rgb>`
    = note: required for `iced_core::color::Color` to implement `Into<iced::Color>`
note: required by a bound in `iced::advanced::text::Span::<'a, Link, Font>::color_maybe`
   --> /Users/ming/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/b78b8bc/core/src/text.rs:330:53
    |
330 |     pub fn color_maybe(mut self, color: Option<impl Into<Color>>) -> Self {
    |                                                     ^^^^^^^^^^^ required by this bound in `Span::<'a, Link, Font>::color_maybe`

I'm willing to spend more time on this, but I fear I maybe be stabbing in the wrong places. Maybe you or @tarkah may spot some quick fixes for these 🙏

The version of iced I have in my latest push, does build on macOS though. With the 0.13.1 fix and everything 🙏

@hecrj
Copy link
Contributor

hecrj commented Sep 23, 2024

If I switch to 0.14.0-dev there's all sorts of errors that I haven't quite figured out what they mean yet. There's a bunch of mismatched types relating to iced_core::size::Size

Running cargo update should fix it.

@englut
Copy link
Contributor Author

englut commented Sep 23, 2024

If I switch to 0.14.0-dev there's all sorts of errors that I haven't quite figured out what they mean yet. There's a bunch of mismatched types relating to iced_core::size::Size

Running cargo update should fix it.

Still getting those errors even after running cargo clean and cargo update 🙏

The branch I'm using to test 0.14.0-dev: https://github.com/englut/halloy/tree/0.14.0-dev

@hecrj
Copy link
Contributor

hecrj commented Sep 23, 2024

You didn't update iced_core in data/Cargo.toml.

@englut englut changed the title Update iced Update iced to 0.14.0-dev Sep 23, 2024
@englut
Copy link
Contributor Author

englut commented Sep 23, 2024

You didn't update iced_core in data/Cargo.toml.

@hecrj swoops in with the lesson of the day 🙏🫡

Thanks for helping me out! I did a grep for 0.13.0-dev and didn't find anything else 🙏

@casperstorm @tarkah everything builds!

Can someone test on windows to be sure? I only have access to Linux and macOS.

@neilalexander
Copy link
Contributor

Build worked fine on my Apple Silicon Mac now BTW.

@casperstorm casperstorm merged commit 46651c3 into squidowl:main Sep 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants