Rewrite ::address (import from dbus_addr) #989
Conversation
|
Thanks! I'll have a look soon. In the meantime, could you please rebase this on top of #976? That one is just waiting for a test case to be added. |
zeenix
left a comment
There was a problem hiding this comment.
You'll need to change some fundamental design here to make it acceptable to me, sorry.
|
I mainly see only 2 blockers here now:
|
I disagree with you on those two points, but if it is what it takes to make progress... |
That's well established. :)
I'm sorry but yeah. You've to keep in mind that I did try my best to explain my reasoning in detail. I regret that I failed to convince you in the end. |
a0f3be2 to
8b9f688
Compare
|
@elmarco is this ready for review? |
yes please |
zeenix
left a comment
There was a problem hiding this comment.
Found a few more things, mostly minor nits.
11f4e9d to
f3e5d25
Compare
zeenix
left a comment
There was a problem hiding this comment.
Let's get it in but please fix the remaining minor things in a follow-up commit. 🙏
|
Seems it needs another rebase, so you might as well fix the minor issues while you rebase. |
Parsing can be done with legacy Address and DBusAddr
Connecting to an address can recursively resolve to a different address to connect to. Because it's an async function, box it.
As requested by Zeeshan.
Some addresses should only be used on specific target OS. This makes the address handling specific to the target, which will make its usage impractical for some use cases (web, configuration etc) As requested by Zeeshan.
As requested by Zeenshan.
| #[derive(Debug, PartialEq, Eq)] | ||
| pub struct Unixexec<'a> { | ||
| path: Cow<'a, OsStr>, | ||
| argv: Vec<(usize, Cow<'a, str>)>, |
There was a problem hiding this comment.
why keep the index in a Vec? Vec and slices are indexed already.
There was a problem hiding this comment.
First, because you may or may not have argv0...
You may also have multiple argvN (since we don't enforce this anymore)
And also the spec says " If a specific argvX is not specified no further argvY for Y > X are taken into account." which may be interepreted as the address may be accepted with argvX missing but further argvY.. in which case you should ignore them for exec, but you may still want to retain them?..
There was a problem hiding this comment.
First, because you may or may not have argv0...
That just means that argv0 needs special treatment (sperate field/getter).
But nm. I didn't remember that args are specified as key=value, with key as argN..
There was a problem hiding this comment.
Unresolving this thread for this part:
First, because you may or may not have argv0...
That just means that argv0 needs special treatment (sperate field/getter).
This is also closer to the spec since arg0 is separate key.
| }; | ||
|
|
||
| pub(crate) async fn connect( | ||
| l: &crate::address::transport::Autolaunch<'_>, |
There was a problem hiding this comment.
I'm sure you can come up with a better name than l.
There was a problem hiding this comment.
autolaunch isn't super long. 😆
⏪️ Revert "Merge pull request #989 from elmarco/address"
Based on the discussion from #982, import dbus_addr as zbus_address and rebase #562 to make use of it.