Merge lp:~alan-griffiths/miral/pre_init-CommandLineOption into lp:miral
| Status: | Merged |
|---|---|
| Approved by: | Gerry Boland on 2017-08-16 |
| Approved revision: | 578 |
| Merged at revision: | 577 |
| Proposed branch: | lp:~alan-griffiths/miral/pre_init-CommandLineOption |
| Merge into: | lp:miral |
| Diff against target: |
120 lines (+27/-4) 6 files modified
debian/changelog (+1/-0) debian/libmiral2.symbols (+1/-0) include/miral/command_line_option.h (+10/-1) miral-shell/shell_main.cpp (+2/-2) miral/command_line_option.cpp (+12/-1) miral/symbols.map (+1/-0) |
| To merge this branch: | bzr merge lp:~alan-griffiths/miral/pre_init-CommandLineOption |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gerry Boland | 2017-08-16 | Abstain on 2017-08-16 | |
| Alberto Aguirre | Approve on 2017-08-16 | ||
| Mir CI Bot | continuous-integration | Approve on 2017-08-16 | |
|
Review via email:
|
|||
Commit Message
Enable CommandLineOptions to be processed before server initialization
Description of the Change
Enable CommandLineOptions to be processed before server initialization
The need for this became apparent in discussion with Yunit developers. Vis:
https:/
It ought to be generally useful.
| Gerry Boland (gerboland) wrote : | # |
I never realized command line args were processed so late in initialization. Is there a reason we want them to be processed post-init at all?
| Alan Griffiths (alan-griffiths) wrote : | # |
> I never realized command line args were processed so late in initialization.
> Is there a reason we want them to be processed post-init at all?
Good question.
I guess before starting MirAL I "usually" used post_init as that ensures that Mir "structural" objects are accessible. And that default fed into the initial version of CommandLineOption. But, for MirAL users, access to these objects is less relevant.
OTOH I'm reluctant to change the default behaviour even if I *think* no users will be affected.
| Gerry Boland (gerboland) wrote : | # |
I understand your concern, but IMO current behaviour does break the principle of least surprise, and now having both pre-init and post-init command line parsing strikes me as making that situation worse.
My vote is to change behaviour and document clearly in the changelog.
| Joseph Wakeling (webdrake) wrote : | # |
For the record, I can confirm that the feature addresses the concern discussed in https:/
As for the question of default behaviour: (i) the flexibility to choose between pre- and post-init handling of command line options seems useful in principle and (ii) I'd rather not have a breaking change in a minor release.
| Alberto Aguirre (albaguirre) wrote : | # |
Unfortunately being a library, we sometimes have to carry some cruft before it can be removed (i.e. removing post-init), so LGTM.
| Gerry Boland (gerboland) wrote : | # |
Well I'm not proposing any api removal, just a behaviour change. But seems I'm out voted, so I abstain!
| Joseph Wakeling (webdrake) wrote : | # |
FWIW I would be happy for the default behaviour to change in a new major release. Would be reluctant to lose the ability to specify post-init handling of command line options, though (just for flexibility).

PASSED: Continuous integration, rev:578 /mir-jenkins. ubuntu. com/job/ miral-ci/ 64/ /mir-jenkins. ubuntu. com/job/ build-miral/ 106 /mir-jenkins. ubuntu. com/job/ build-0- fetch/5086 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= artful/ 5075 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 5075 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/5075 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= artful/ 110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= artful/ 110/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= xenial/ 110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= xenial/ 110/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= zesty/110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= zesty/110/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= artful/ 110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= artful/ 110/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= xenial/ 110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= xenial/ 110/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= zesty/110 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= zesty/110/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ miral-ci/ 64/rebuild
https:/