Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Example Project Build Failure #29

Closed
RossMurr4y opened this issue Nov 20, 2021 · 3 comments
Closed

Example Project Build Failure #29

RossMurr4y opened this issue Nov 20, 2021 · 3 comments

Comments

@RossMurr4y
Copy link

RossMurr4y commented Nov 20, 2021

Description

I've just run rustup update and tried to build the example_project but receive an error on build.

Error

godot-egui/example_project on ξ‚  main [!?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.56.1 on ☁️  (ap-southeast-2) 
❯ cargo build
   Compiling egui_demo_lib v0.15.0
   Compiling godot_egui v0.1.8 (/Users/rossmurray/dev/egui_test/godot-egui/godot_egui)
error[E0277]: the trait bound `Arc<Style>: From<egui::style::Style>` is not satisfied
   --> godot_egui/src/lib.rs:230:47
    |
230 | ...                   self.egui_ctx.set_style(style);
    |                                     ^^^^^^^^^ the trait `From<egui::style::Style>` is not implemented for `Arc<Style>`
    |
    = help: the following implementations were found:
              <Arc<B> as From<Cow<'a, B>>>
              <Arc<CStr> as From<&CStr>>
              <Arc<CStr> as From<CString>>
              <Arc<OsStr> as From<&OsStr>>
            and 9 others
    = note: required because of the requirements on the impl of `Into<Arc<Style>>` for `egui::style::Style`

error[E0308]: mismatched types
   --> godot_egui/src/lib.rs:231:57
    |
231 | ...                   self.egui_ctx.set_fonts(font_definitions);
    |                                               ^^^^^^^^^^^^^^^^ expected struct `FontDefinitions`, found struct `epaint::text::fonts::FontDefinitions`
    |
    = note: perhaps two different versions of crate `epaint` are being used?

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `godot_egui` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

Context

godot-egui/example_project on ξ‚  main [!?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.56.1 on ☁️  (ap-southeast-2) 
❯ rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/rossmurray/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin
1.54.0-x86_64-apple-darwin

installed targets for active toolchain
--------------------------------------

thumbv7em-none-eabihf
x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.56.1 (59eed8a2a 2021-11-01)

godot-egui/example_project on ξ‚  main [!?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.56.1 on ☁️  (ap-southeast-2) took 45s 
❯ rustc --version
rustc 1.56.1 (59eed8a2a 2021-11-01)

godot-egui/example_project on ξ‚  main [!?] is πŸ“¦ v0.1.0 via πŸ¦€ v1.56.1 on ☁️  (ap-southeast-2) 
❯ cargo --version
cargo 1.56.0 (4ed5d137b 2021-10-04)

Fix

I was able to get it built by bumping the versions of egui and egui_demo_lib in the Cargo.toml:

[dependencies]
gdnative = "0.9.3"
egui = "0.15.0"
egui_demo_lib = "0.15.0"
godot_egui = { path = "../godot_egui" }

I was then able to cargo build with only a few deprecation messages received, and the project loaded and ran fine within Godot from that point.

@RossMurr4y
Copy link
Author

Normally I'd submit a PR but in this case I'm not confident that my fix would work for all cases - I tried a few different things and may have ended up with an accidentally working version. I figure I'd just report it and leave it to those who know best :)

@jacobsky
Copy link
Collaborator

jacobsky commented Jul 5, 2022

This issue is probably related to godot-theme, initially it was using a very naive serialization solution which caused this kind of issue to occur. In the latest version (along with the pending #33 ) this should be resolved.

@jacobsky
Copy link
Collaborator

jacobsky commented Jul 5, 2022

#33 has been merged. So this issue should be resolved.

@jacobsky jacobsky closed this as completed Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants