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

dts: gen_defines.py bails out on new path property type #22197

Closed
b0661 opened this issue Jan 25, 2020 · 0 comments · Fixed by #22211
Closed

dts: gen_defines.py bails out on new path property type #22197

b0661 opened this issue Jan 25, 2020 · 0 comments · Fixed by #22211
Assignees
Labels
area: Devicetree bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@b0661
Copy link
Collaborator

b0661 commented Jan 25, 2020

Describe the bug

gen_defines.py when provided with a property of type 'path' (introduced in #21625) bails out with:

Traceback (most recent call last):
  File "/zephyr/scripts/dts/gen_defines.py", line 810, in <module>
    main()
  File "/zephyr/scripts/dts/gen_defines.py", line 57, in main
    write_props(node)
  File "/zephyr/scripts/dts/gen_defines.py", line 220, in write_props
    write_phandle_val_list(prop)
  File "/zephyr/scripts/dts/gen_defines.py", line 562, in write_phandle_val_list
    for i, entry in enumerate(prop.val):
TypeError: 'Node' object is not iterable
CMake Error at /zephyr/cmake/dts.cmake:207 (message):
  new extractor failed with return code: 1
Call Stack (most recent call first):
  /zephyr/cmake/app/boilerplate.cmake:460 (include)
  CMakeLists.txt:22 (include)

To Reproduce
See above.

Expected behavior

gen_defines.py to handle 'path' type properties properly.

The assumption in

else: # prop.type == "phandle-array"
is not valid anymore. There is now also a 'path' type property.

Impact
Annoyance

Screenshots or console output
N/A

Environment (please complete the following information):

Additional context
N/A

@b0661 b0661 added bug The issue is a bug, or the PR is fixing a bug area: Devicetree labels Jan 25, 2020
ulfalizer added a commit to ulfalizer/zephyr that referenced this issue Jan 27, 2020
'type: path' was added to edtlib for completeness in commit 23a5b49
("dts: edtlib: Add 'type: path' for path references"). gen_defines.py
crashes if it's ever used though, because it gets confused for a
'type: phandle-array'.

Ignore 'type: path' properties in gen_defines.py, like how
'type: phandle' and 'type: phandles' are currently ignored too.

(Note that gen_defines.py is only one possible user of edtlib.)

Fixes: zephyrproject-rtos#22197

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
@jhedberg jhedberg added the priority: low Low impact/importance bug label Jan 28, 2020
galak pushed a commit that referenced this issue Jan 28, 2020
'type: path' was added to edtlib for completeness in commit 23a5b49
("dts: edtlib: Add 'type: path' for path references"). gen_defines.py
crashes if it's ever used though, because it gets confused for a
'type: phandle-array'.

Ignore 'type: path' properties in gen_defines.py, like how
'type: phandle' and 'type: phandles' are currently ignored too.

(Note that gen_defines.py is only one possible user of edtlib.)

Fixes: #22197

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants