-
Notifications
You must be signed in to change notification settings - Fork 24
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
Upgrade to uniffi @0.24 #13
Upgrade to uniffi @0.24 #13
Conversation
Preliminary list of features for 0.24 from https://github.com/mozilla/uniffi-rs/blob/main/CHANGELOG.md:
|
I am back working on this, will update the issue description to document my progress as I go along. |
great thank you!!! |
I saw a commit name "test compile". Is it ready? Could I already test on my own code please? |
no it is not yet ready, sorry |
I see, failing tests are not acceptable 😅 Even so, the generators must target tagged versions to maintain cohesion. We have faced this problem before in Alternatively we could ask upstream guys to cherry-pick the patch into upstream 0.24 release. |
I would suggest we ask how long out a new tagged version is, and if it is too long we use the fork option for now |
I raised the question in uniffi chat room. There aren't plans for a release, but they aren't against the idea. No clear timeline yet. |
Okay, @arg0d if you could just prepare your fork, I am happy to update the branch to that. |
Updated. Also made library mode code reusable for external generators, |
I just discovered the hard way that merging with override config is very useful for configuring upstream test crates 😅 I also see upstream Swift generator has an option |
Created mozilla/uniffi-rs#1788 |
Very curious about your ideas here, because I need to find a way to pass this into the config of the fixture dependencies. |
I can't really think of any better solution for
I'm going add the config merge logic to NordSecurity fork, and try to convince Mozilla guys to accept the change. |
https://github.com/mozilla/uniffi-rs/commits/v0.25.0 tags are there now |
Do you want to jump straight into 0.25, or finish this as 0.24? I'm thinking to finish this as 0.24, and work on 0.25 as a separate PR. 0.25 is very new, it might have issues. I think both options will require some changes. 0.24 doesn't have trait methods, and 0.25 has reworked async functions. |
+1 to finishing and landing 0.24, as it's a huge improvement over mainline for me at least. |
The issue with finishing on |
bindgen/src/gen_go/mod.rs
Outdated
pub fn enum_variant_name(nm: &str) -> Result<String, askama::Error> { | ||
Ok(oracle().enum_variant_name(nm)) | ||
} | ||
|
||
pub fn default_type(type_: &Option<Type>) -> Result<String, askama::Error> { | ||
let res = match type_ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Before I implemented the default value simply using var
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had issues with this, I don't remember which types, but some of the newer ones didn't end up producing the correct defaults. It might have been the external ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you observe these issues? In tests, or in your own project? I ran the tests and everything passed.
diff --git a/bindgen/templates/AsyncTypesTemplate.go b/bindgen/templates/AsyncTypesTemplate.go
index 0359737..2bafaa4 100644
--- a/bindgen/templates/AsyncTypesTemplate.go
+++ b/bindgen/templates/AsyncTypesTemplate.go
@@ -28,9 +28,10 @@ func {{ result_type|future_callback }}(
if err != nil {
{%- match result_type.return_type -%}
{%- when Some with (return_type) -%}
+ var _uniffiDefaultValue {{ return_type|type_name }}
// {{ format!("{:?}", result_type.return_type) }}
done <- {{ result_type|future_chan_type }} {
- val: {{ result_type.return_type|default_type }},
+ val: _uniffiDefaultValue,
err: err,
}
{%- else %}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In tests, but it might be other changes that made this obsolete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use var
if there are no problems with it, it seems like it would also fix #21.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
If you decided to use 0.25, please use v0.25.0-1 tag from our fork. |
I will try and get back to this towards the end of the week |
FYI: I'm going on vacation for a week, be back on Dec 08. |
enjoy, will hopefully have some more code for you to review when you come back |
Oops, I meant until Nov 8, will be back next week :D |
Dez 8 would be an awesome extended holiday 🤣 |
Started work on upgrading to 0.25 here #26 |
This reverts commit 97cdb48. This can't be upgraded yet because uniffi-bindgen-go doesn't work with it yet. Needs to wait on NordSecurity/uniffi-bindgen-go#13
Closed in favor of #26. |
Started work on this.
Feature Work
arithmetic_test.go
callbacks_test.go
chronological_test.go
coverall_test.go
custom_types_test.go
destroy_test.go
errors_test.go
ext_types_test.go
fixture_callbacks_test.go
foreign_executor_test.go
futures_test.go
geometry_test.go
compile onlylarge_enum_test.go
objects_test.go
proc_macro_test.go
rondpoint_test.go
simple_fns_test.go
simple_iface_test.go
sprites_test.go
todolist_test.go
trait_methods_test.go
type_limits_test.go
--library
flag instead of UDLbytes
typeasync
functionsCleanup
Look into moving thenot possible, due to the need of the.h
file back into the generated go file.c
filecgo.Handle
for callback handling #18Ref #12