-
Notifications
You must be signed in to change notification settings - Fork 234
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
Provide more external type information to FfiType::RustBuffer
#2195
Changes from all commits
a524879
fecb169
f75fc47
310aa55
294bee7
b792ff2
1af5330
1561db3
87948d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,8 @@ fn get_cargo_metadata() -> Metadata { | |
|
||
fn get_cargo_build_messages() -> Vec<Message> { | ||
let mut child = Command::new(env!("CARGO")) | ||
.arg("build") | ||
.arg("test") | ||
.arg("--no-run") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was already |
||
.arg("--message-format=json") | ||
.stdout(Stdio::piped()) | ||
.spawn() | ||
|
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.
This makes a lot of sense to me, but I know that @mhammond has some plans for external types. Would this change conflict with them?
Hopefully at some point we can consolidate
module_path
andnamespace
, but it makes sense to me to have 2 fields for now sinceType::External
also have 2 fields.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 do want to kill
Type::External
and replace it with the actual type but that's my problem :)I don't get why we need both
namespace
andmodule_path
though? If the name is to the Rust ffi functionnamespace
might be problematic - that's not known by the udl/scaffolding, so gets fixed for the binding generation - meaning rust code generated from udl might have a different value than the bindings get.ExternalFfiMetadata
or similar is probably a better name so it's not confused as auniffi_meta
struct.Not that you should add it now, but I wonder if you will ever strike a
RustArcPtr
ever needing a fq-name too?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.
The
namespace
andmodule_path
are needed to generate the qualified type path forRustBuffer
in Java. Themodule_path
is used to get the crate to look up inconfig.external_packages
, and thenamespace
is needed for the default if nothing is found.I haven't yet needed a fully qualified
RustArcPtr
and looking at how it's used I don't think I will, but it's certainly possible.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.
Right, same as us :) But yeah, that
namespace
probably isn't going to work in many cases - in the case it does (eg, "single crate with udl") namespace is probably module path anyway. But yeah, I'm totally fine with carrying that all around, I just long for a time when it's less muddy.