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

Latest main is behind breaking changes on gdext #7

Closed
chamons opened this issue Jan 8, 2024 · 2 comments · Fixed by #8
Closed

Latest main is behind breaking changes on gdext #7

chamons opened this issue Jan 8, 2024 · 2 comments · Fixed by #8

Comments

@chamons
Copy link

chamons commented Jan 8, 2024

There was a large change godot-rust/gdext#501 that required a lot of code changes.

Adding a dependency on gd-rehearse causes it to fail with:

error[E0599]: no method named `get_tree` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:186:40
    |
186 |         let mut scene_tree = self.base.get_tree().unwrap();
    |                                        ^^^^^^^^ method not found in `Base<Node>`

error[E0599]: no method named `callable` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:187:62
    |
187 |         scene_tree.connect("physics_frame".into(), self.base.callable("test_run"));
    |                                                              ^^^^^^^^ method not found in `Base<Node>`

error[E0599]: no method named `queue_free` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:293:19
    |
293 |         self.base.queue_free();
    |                   ^^^^^^^^^^ method not found in `Base<Node>`

error[E0599]: no method named `get_tree` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:295:14
    |
294 | /         self.base
295 | |             .get_tree()
    | |             -^^^^^^^^ method not found in `Base<Node>`
    | |_____________|
    | 

error[E0599]: no method named `clone` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:304:35
    |
304 |             scene_tree: self.base.clone().upcast(),
    |                                   ^^^^^ method not found in `Base<Node>`

error[E0599]: no method named `clone` found for struct `Base` in the current scope
   --> /Users/donblas/.cargo/git/checkouts/gd-rehearse-6d17cc79ce0f25e9/4841f7b/gd-rehearse-defs/src/runner/class.rs:335:35
    |
335 |             scene_tree: self.base.clone().upcast(),
    |                                   ^^^^^ method not found in `Base<Node>`
@Bromeon
Copy link
Collaborator

Bromeon commented Jan 8, 2024

Most of these can be updated with self.base() and self.base_mut().

The part that's a bit more complex is self.base.clone.upcast(); related discussion in godot-rust/gdext#557. In particular, Base::to_gd() is not a public API, so using it is at your own risk. We need to come up with a stable API for this use case, see discussion.

@StatisMike StatisMike mentioned this issue Jan 8, 2024
@StatisMike
Copy link
Owner

StatisMike commented Jan 8, 2024

@Bromeon In the case of self.base.clone().upcast(), the self.base().clone() seems to work nicely. Possibly the upcast() was unnecessary altogether.

@chamons Changes like that are unfortunately currently prone to happen, as gdext is in rapid development. Will try to keep up to date, but there may be some delay. Added badge to Readme pointing to latest gdext commit with which the crate was built and its tests ran last.

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 a pull request may close this issue.

3 participants