[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: mir Status: Fix Committed => Fix Released ** Changed in: mir Milestone: phone-v1-freeze => None -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: mir Status: Fix Released => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: unity8 (Ubuntu) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: mir Assignee: (unassigned) => Michael Terry (mterry) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: unity8 (Ubuntu) Status: Confirmed => Fix Committed ** Changed in: mir Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Fix committed into lp:~mir-team/mir/development-branch at revision None, scheduled for release in mir, milestone Unknown ** Changed in: mir Status: Triaged => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
> To be clear program_options may be private, but it is passed to parse_options() which could be overridden so that you can parse argv yourself. Yes, you have access to the stated options. And you can access argv/argc yourself (if you save them, since they are private in DefaultServerConfiguration). But you still have the problem that you can't change the contents of the ProgramOption class. The only fix I can think of is to override the_options() to create our own class to replace ProgramOption (say, UnityMirOption), *but* still call the DefaultServerConfiguration version so that we can access program_options in parse_options(), which we would override to do our non-aborting parsing. We'd still have to reproduce a lot of parsing code that happens in that call manually, because it happens in non-class functions. Additionally, we could either reproduce the environment/file parsing that ProgramOption has or let it parse the environment/file but then iterate over its contents and grab each set option and stuff them into our UnityMirOption version. So I think it's possible to fix as-is. But super awkward. If we're looking at the long term, surely we can do better. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Branch linked: lp:~mterry/mir/dev-unregistered-options -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Changed in: unity-mir Status: Incomplete => Opinion ** Changed in: mir Milestone: None => phone-v1-freeze ** Changed in: unity-mir Milestone: None => phone-v1-freeze ** Changed in: unity8 (Ubuntu) Milestone: None => ubuntu-13.10 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
needs a quick fix at least to unblock AP tests. currently available is this MP https://code.launchpad.net/~mterry/mir/unregistered-options/+merge/188125 (which needs to be retargeted to dev branch) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
To be clear program_options may be private, but it is passed to parse_options() which could be overridden so that you can parse argv yourself. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Branch linked: lp:~mterry/mir/unregistered-options -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
(Sorry, misspoke. Obviously we could have access to argv or argc if we need them, they pass through our constructor. What I meant was that program_options is private, which holds the results of calls to add_option(), which is not virtual. Thus we can't reasonably parse argv ourselves. We need to either strip argv before passing to Mir or modify Mir itself.) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Nope... argv and argc are private. I'm beginning to think this needs to be solved at the Mir level. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Oh, but I guess we can't do that either, because parse_arguments() is only in mir::options::ProgramOption rather than mir::options::Option. So it's not something we could pass back with an overridden parse_arguments(). So we'd have to override both the_options() and parse_options(), duplicating a fair bit of code in the process. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Looks like unity-mir would really need to re-implement mir::options::ProgramOption and pass our own version back in an overridden version of the_options(). ProgramOption actually makes the call to parse_command_line() internally, its variable_maps instance that holds all the parsed options is private, and it doesn't expose any other way to set the options. So that's where the action is. Unfortunately, we'd have to just copy the chunks of code for parse_environment() and parse_file(). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: unity8 (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
In principle I don't think it is a good idea to ignore unrecognised arguments on the command line - that only leads to confusion when users misspell something. Having two separate parts of the program parsing them is the real problem Mir was coded on the misguided assumption that boost.Options was good enough for all client code. I think a better solution would be to decouple the creation of the options object from the initialisation of DefaultServerConfiguration. That way options can be passed directly to DefaultServerConfiguration without any reference to the command line. Clearly we'd continue to provide a default option parser. (Maybe this could return the arguments it doesn't interpret?) There is a precedent for manipulating the "arguments" to get around this - the following comes from the Mir test framework: int main(int argc, char** argv) { ::argc = std::remove_if( argv, argv+argc, [](char const* arg) { return !strncmp(arg, "--gtest_", 8); }) - argv; ::argv = const_cast(argv); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Well I'd request by default that Mir, as a library, only listens for the command line arguments it recognises, and ignores all others. Qt are GTK libraries which do this. While the Mir default behaviour can be overridden by unity-mir, I think it makes more sense for the change to be in Mir itself. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Relevant boost code to allow unknown options: http://www.boost.org/doc/libs/1_54_0/doc/html/program_options/howto.html#idp123440592 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
Existing Mir code uses mir::report_exception() to print exceptions out nicely. Discussed with Michał, the request on Mir is that it can ignore options it doesn't understand so Qt can be initialised with the option list after Mir has scanned it. ** Changed in: mir Importance: Undecided => Medium ** Changed in: mir Status: Incomplete => Triaged -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
This should be possible to solve since Mir revision 1069. You can override DefaultServerConfiguration::parse_options() and parse the arguments yourself without throwing an exception. You would need to copy some code from src/server/default_server_configuration.cpp to do this and keep the environment parsing. It's not clear to me if the API should be easier than this however. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1226227] Re: libmirserver parses arguments and fails if it's not something it understands
** Project changed: unity8 => unity-mir -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1226227 Title: libmirserver parses arguments and fails if it's not something it understands To manage notifications about this bug go to: https://bugs.launchpad.net/mir/+bug/1226227/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs