Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef crashes when building .zap file without -r #20421

Closed
rwells1703 opened this issue Jul 7, 2022 · 0 comments · Fixed by #20436
Closed

Chef crashes when building .zap file without -r #20421

rwells1703 opened this issue Jul 7, 2022 · 0 comments · Fixed by #20436

Comments

@rwells1703
Copy link
Contributor

Problem

Using chef tool on linux (commit 126f6b2) crashes when building an .zap file generated from zap tool. This only occurs when the Pigweed RPC (-r) flag is not specified in the chef.py command line options.

This is due to the options.do_rpc value being None by default. During building, this value is converted to an integer, which crashes due to int() not being able to take input as NoneType.

$ ./chef.py -zb -d my-device -t linux

image

Proposed Solution

Converting to an integer is unnecessary, as we are embedding the options.do_rpc value in a Python fstring. Removing this function call fixes the functionality of the -r flag to enable/disable RPC.

Although removing the int() call fixes the issue on its own, this means that the value of CONFIG_ENABLE_PW_RPC is either "1" or "None" which is a little inconsistent. To correct this, set the value to "1" if options.do_rpc is enabled, else set the value to "0" if not, ie. when options.do_rpc == None:
image

Result

$ ./chef.py -zb -d my-device -t linux

image

$ ./chef.py -zbr -d my-device -t linux

image

@rwells1703 rwells1703 changed the title Chef tool crashes when building .zap file without -r Chef crashes when building .zap file without -r Jul 7, 2022
rwells1703 added a commit to Cascoda/connectedhomeip that referenced this issue Jul 7, 2022
woody-apple added a commit that referenced this issue Jul 7, 2022
Co-authored-by: Richard Wells <rwells1703@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant