Skip to content

[0.4.x] lv-tool: Fix broken --actor argument - #182

Merged
hartwork merged 2 commits into
0.4.xfrom
0.4.x-lv-tool-fix-actor-argument
Jan 19, 2023
Merged

hartwork merged 2 commits into
0.4.xfrom
0.4.x-lv-tool-fix-actor-argument

Conversation

@hartwork

Copy link
Copy Markdown
Member

0.4.x backport of pull request #181

@hartwork hartwork added the bug label Jan 18, 2023
@hartwork hartwork added this to the 0.4.2 milestone Jan 18, 2023
@hartwork
hartwork requested a review from kaixiong January 18, 2023 18:35
@hartwork
hartwork force-pushed the 0.4.x-lv-tool-fix-actor-argument branch from 72f8c9f to 65540a7 Compare January 18, 2023 18:37

@kaixiong kaixiong left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hartwork Is moving the plugin availability check before parse_args() runs a good idea on the whole?

There's a chance of a buggy plugin that crashes lv-tool when its info() function is called on loading. When this happens, the user would not be able to access any help options.

On the other hand, it would more reliably produce a working default actor to use.

Sorry to only bring this up now. This escaped my review of the same patch for master.

@hartwork

Copy link
Copy Markdown
Member Author

@hartwork Is moving the plugin availability check before parse_args() runs a good idea on the whole?

There's a chance of a buggy plugin that crashes lv-tool when its info() function is called on loading. When this happens, the user would not be able to access any help options.

On the other hand, it would more reliably produce a working default actor to use.

Sorry to only bring this up now. This escaped my review of the same patch for master.

@kaixiong the good news is that the only plugin that can crash the argument parsing then is lv_gltest where we have control. An alternative could be to leave the actor at empty string initially, and apply defaults only if still unset after argument parsing. Should I demo the latter approach in place, what do you think?

@kaixiong

Copy link
Copy Markdown
Member

@kaixiong the good news is that the only plugin that can crash the argument parsing then is lv_gltest where we have control. An alternative could be to leave the actor at empty string initially, and apply defaults only if still unset after argument parsing. Should I demo the latter approach in place, what do you think?

Yeah let's try that. This would be safer with LV's current way of retrieving metadata by calling an external C/C++ function in the same address space.

Regression from e4a6cf5

(related to master commit 65b833b)
@hartwork
hartwork force-pushed the 0.4.x-lv-tool-fix-actor-argument branch from 65540a7 to fe8d449 Compare January 19, 2023 16:21
@hartwork

Copy link
Copy Markdown
Member Author

Yeah let's try that. This would be safer with LV's current way of retrieving metadata by calling an external C/C++ function in the same address space.

@kaixiong pushed

@hartwork
hartwork requested a review from kaixiong January 19, 2023 16:22
@hartwork

Copy link
Copy Markdown
Member Author

Sorry to only bring this up now. This escaped my review of the same patch for master.

@kaixiong PS: No worries, I can forward-port this to master once this is merged.

@kaixiong kaixiong left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hartwork Thanks for the change.

@hartwork
hartwork merged commit 5fcab5d into 0.4.x Jan 19, 2023
@hartwork
hartwork deleted the 0.4.x-lv-tool-fix-actor-argument branch January 19, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants