mosys giving an application error when command not supported |
|||||
Issue descriptionCrOS Version: 10809.0.0 Chromebook: minnie, but I believe it affects many other devices. What steps will reproduce the problem? (1) In developer mode on the command shell execute "mosys platform sku". What is the expected result? Should get error message "Command not supported on this platform". What happens instead? Get error message "Application error: Subcommand execution finished with error -1" Proper behavior verified on 10806.0.0. Was unable to directly test 10807.0.0 and 10808.0.0. Crosland shows two CLs in mosys for these versions. https://crosland.corp.google.com/log/10806.0.0..10809.0.0 cros_config_struct: Add logging for the x86 case https://chromium-review.googlesource.com/1107004 rust: Fix rust slice to C array logic https://chromium-review.googlesource.com/1110276
,
Aug 22
My internship is ending, so I'm going to assign this to Alec.
,
Aug 22
Technically speaking, I think that "Command not supported on this platform" was a lie because Mosys had no way of actually knowing that: all it knows is that the command failed to execute.
,
Aug 22
Oooo I like that! From now on all my code shall read:
try {
whoKnowsWhatThisWillDo();
} catch() {
console.log('Command not supported on this platform');
}
,
Aug 22
Are you suggesting that mosys is working as intended then?
,
Aug 22
Sorry that was more of a general joke about errors in code, not specific to this bug Stephen. As Samantha said, it's difficult to tell in Mosys what is an error and what is an invalid command because of the way commands dispatch is handled.
,
Sep 17
I don't work on Mosys so I don't think I'm the right person to own this. We might also want to mark it wont-fix (the way Mosys is structured means this isn't obviously incorrect behaviour).
,
Sep 17
How hard is it to change mosys to understand the different between an unsupported command and a general application error? At a minimum, can we change the error message to indicate that the error could be that the issued command is not supported?
,
Sep 17
I thought the code would have changed from when I last looked at it, but I still see the same dispatch code and C code (rather than rust). I'm happy to do something here, but would like Jason to tell me what to do so I fit in with the future direction (and more importantly what not to do!)
,
Sep 17
Mosys is being transitioned to the Build team but I can still provide some guidance. There's 3 issues here: 1. "Application error" is too aggressive as messaging for perfectly valid exit reasons 2. Subcommand returning a -1 shouldn't be reported to be command failure; it might be an unsupported command 3. Subcommands returning -1 for both unsupported and actual errors Fixing (3) is a lot of work and one of the Mosys architectural issues that needs to be addressed but we probably don't have time for now. Fixing (1) is super easy. Just change this one line: https://chromium.googlesource.com/chromiumos/platform/mosys/+/master/src/main.rs#61 . Probably, the best thing to do is to not prefix with anything at all because the err struct always has an clear message: https://chromium.googlesource.com/chromiumos/platform/mosys/+/master/src/lib.rs#408 Fixing (2) is a little harder. That's happening here: https://chromium.googlesource.com/chromiumos/platform/mosys/+/master/src/lib.rs#303 when the command returns anything other than 0. The old C code did this: https://chromium.googlesource.com/chromiumos/platform/mosys/+/d1ae3d1ff9aaf7ce38aa2055c26d2b58e4a9a50e/mosys.c#296 which was just print "Command not supported on this platform" when any kind of non-zero return from any command. This output isn't true because the root cause might be a real error, not a lack of platform support. An alternative message might be to just state the facts: "$COMMAND_NAME returned $RETURN_CODE" since we can't really editorialize about the reason.
,
Sep 18
over to Greg to see about shaking it out
,
Sep 18
From what I recall on doing some of the nautilus/soraka unibuild conversions is that one of the error messages was non-unibuild and the other unibuild. Mosys is going to go under heavy modifications once we get some better test scaffolding and safety nets in place. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by samanthamiller@chromium.org
, Aug 20