Merge lp:~alan-griffiths/mir/MirBlob into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Alan Griffiths on 2015-09-18 |
| Approved revision: | 2907 |
| Merged at revision: | 2946 |
| Proposed branch: | lp:~alan-griffiths/mir/MirBlob |
| Merge into: | lp:mir |
| Diff against target: |
477 lines (+396/-0) 9 files modified
include/client/mir_toolkit/client_types.h (+1/-0) include/client/mir_toolkit/mir_blob.h (+85/-0) include/test/mir/test/display_config_matchers.h (+3/-0) src/client/CMakeLists.txt (+1/-0) src/client/mir_blob.cpp (+229/-0) src/client/symbols.map (+10/-0) tests/acceptance-tests/CMakeLists.txt (+1/-0) tests/acceptance-tests/test_mirblob.cpp (+58/-0) tests/mir_test/display_config_matchers.cpp (+8/-0) |
| To merge this branch: | bzr merge lp:~alan-griffiths/mir/MirBlob |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gerry Boland | 2015-09-10 | Approve on 2015-09-18 | |
| PS Jenkins bot | continuous-integration | Approve on 2015-09-16 | |
| Andreas Pokorny (community) | Approve on 2015-09-14 | ||
| Alexandros Frantzis (community) | 2015-09-02 | Abstain on 2015-09-10 | |
|
Review via email:
|
|||
Commit Message
client API: Add MirBlob - a tool for serializing and deserializing data. Initially just MirDisplayConfi
Description of the Change
client API: Add MirBlob - a tool for serializing and deserializing data. Initially just MirDisplayConfi
| Alexandros Frantzis (afrantzis) wrote : | # |
Looks good code-wise, but I have a few concerns about the general approach. I think it should be up to the users to serialize the data in a way that's convenient for their use case.
By providing the serialization ourselves, we are burdening Mir with complexity and responsibilities that I am not convinced belong there. For example, we are effectively promising that mir_blob_
Furthermore, I don't like that we are enticing users to use a binary, opaque serialization scheme, instead of a textual/editable one. Of course, they can always choose to ignore our functions and do their own serialization, but the lure of the dark side may be difficult to resist :)
Bottom line: I understand that shells may find this useful, but I don't think the convenience is worth the extra burden on the Mir side.
| Alan Griffiths (alan-griffiths) wrote : | # |
Well, we already have the burden of marshalling display configurations for IPC and the protobuf handlers we use are able to provide a lot of the compatibility support you mention.
While there are costs, the alternative is that the display configuration structs get locked in even more tightly to user code - making any changes there (scale anyone?) more risky.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
Compared to our clients mirserver is better suited to keep the blob format compatible or even migrate it when versioned. I never looked how protobuf encodes it, is the current format suited for that? I would have expected some version info..
| Alan Griffiths (alan-griffiths) wrote : | # |
> Compared to our clients mirserver is better suited to keep the blob format
> compatible or even migrate it when versioned. I never looked how protobuf
> encodes it, is the current format suited for that? I would have expected some
> version info..
Protobuf allows us to mark fields as "optional" and test for their existence. When updating this buffer definition we already follow the guidelines for backwards compatibility[1], so I don't this code is a big overhead.
[1] https:/
| Alexandros Frantzis (afrantzis) wrote : | # |
> Protobuf allows us to mark fields as "optional" and test for their existence. When updating this buffer definition we already follow the guidelines for backwards compatibility[1], so I don't this code is a big overhead.
This will work, as long as we stick to protobuf, which is a technology that we may want to replace in the future (at least on the IPC side). We can keep depending on it just for this use case, but perhaps that's an overkill.
| Alan Griffiths (alan-griffiths) wrote : | # |
> > Protobuf allows us to mark fields as "optional" and test for their
> existence. When updating this buffer definition we already follow the
> guidelines for backwards compatibility[1], so I don't this code is a big
> overhead.
>
> This will work, as long as we stick to protobuf, which is a technology that we
> may want to replace in the future (at least on the IPC side). We can keep
> depending on it just for this use case, but perhaps that's an overkill.
That's true but, while we're speculating about hypothetical changes:
1. we could reinstate and move to the Binder based transport we used to have as Binder is now in all kernels we target.
2. we could drop the client API in favour of a Wayland based protocol.
In the first case we can stick with protobuf, in the second, the structure marshaled by this MP becomes irrelevant.
I suggest this is good enough for now and we can deal with "migration" if the need ever occurs.
| Gerry Boland (gerboland) wrote : | # |
Does this need to be built into Mir directly? Could it be a helper library that is Mir data structure aware?
If it serializes settings, it is logical to expect that not just the shell would want to edit those settings.
I'm also interested in the human readability of this blob. I'd rather not see us introducing yet another binary format, especially one based on an internally-used library. It could be JSON or XML or something simple.
| Alan Griffiths (alan-griffiths) wrote : | # |
> Does this need to be built into Mir directly? Could it be a helper library
> that is Mir data structure aware?
What advantage would there be to separating this into a new helper library? It shares code with other functions in libmirclient.
> If it serializes settings, it is logical to expect that not just the shell
> would want to edit those settings.
It is logical that serialization is available to the same code that can (already) edit display configurations through the client API.
> I'm also interested in the human readability of this blob. I'd rather not see
> us introducing yet another binary format, especially one based on an
> internally-used library. It could be JSON or XML or something simple.
I'd not realised human readability was a requirement, OTOH parsing JSON or XML would introduce a new dependency.
| Gerry Boland (gerboland) wrote : | # |
> > Does this need to be built into Mir directly? Could it be a helper library
> > that is Mir data structure aware?
>
> What advantage would there be to separating this into a new helper library? It
> shares code with other functions in libmirclient.
You implying that this API will be available in libmirclient, so any client can serialize/
> > If it serializes settings, it is logical to expect that not just the shell
> > would want to edit those settings.
>
> It is logical that serialization is available to the same code that can
> (already) edit display configurations through the client API.
Above question will clarify that for me.
> > I'm also interested in the human readability of this blob. I'd rather not
> see
> > us introducing yet another binary format, especially one based on an
> > internally-used library. It could be JSON or XML or something simple.
>
> I'd not realised human readability was a requirement, OTOH parsing JSON or XML
> would introduce a new dependency.
Interested, not requiring. There are advantages to human readability of configuration files. It's not my call to say if we should make that a requirement, but I would like it considered.
As the API consumer, I'm perfectly happy.
| Alan Griffiths (alan-griffiths) wrote : | # |
> > > Does this need to be built into Mir directly? Could it be a helper library
> > > that is Mir data structure aware?
> >
> > What advantage would there be to separating this into a new helper library?
> It
> > shares code with other functions in libmirclient.
>
> You implying that this API will be available in libmirclient, so any client
> can serialize/
Yes. Were you wanting something different?
- 2906. By Alan Griffiths on 2015-09-16
-
abort on bad data
- 2907. By Alan Griffiths on 2015-09-16
-
merge lp:mir
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2907
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
> > > > Does this need to be built into Mir directly? Could it be a helper
> library
> > > > that is Mir data structure aware?
> > >
> > > What advantage would there be to separating this into a new helper
> library?
> > It
> > > shares code with other functions in libmirclient.
> >
> > You implying that this API will be available in libmirclient, so any client
> > can serialize/
>
> Yes. Were you wanting something different?
No, that's fine.
| Gerry Boland (gerboland) wrote : | # |
I'm ok with this. Still wary about the binary format, but can deal with that if we need to later

PASSED: Continuous integration, rev:2905 jenkins. qa.ubuntu. com/job/ mir-ci/ 4837/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/3881 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/2788 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/3827 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 986 jenkins. qa.ubuntu. com/job/ mir-wily- amd64-ci/ 986/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 3827 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 3827/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/6555 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 23171
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/4837/ rebuild
http://