Skip to content

Provide consistent deprecated behavior and reduce downstream breakage #49708

@keith-zephyr

Description

@keith-zephyr

Need consistent behavior for deprecated objects
The behavior of builds varies based on the type object that is deprecated and also varies based on the toolchain used.

For example, adding a label property to the qemu_x86.dts file results in a warning when running west:

$ west build -b qemu_x86 samples/hello_world
...
'label' is marked as deprecated in 'properties:' in /workdir/zephyr/dts/bindings/mtd/zephyr,emu-eeprom.yaml for node /eeprom1.
...
[138/138] Linking C executable zephyr/zephyr.elf

But running the same thing under twister, results in a build failure, because warnings are promoted to errors:

./scripts/twister -T samples/hello_world/ -p qemu_x86 -v -i --clobber
...
devicetree error: 'label' is marked as deprecated in 'properties:' in /workdir/zephyr/dts/bindings/mtd/zephyr,emu-eeprom.yaml for node /eeprom1.
...
-- Configuring incomplete, errors occurred!

This also demonstrates how deprecation can break downstream users. Any downstream projects that promote warnings to errors see their downstream builds fail. This forces downstream repos to immediately fix deprecation errors, or disable the warnings-as-errors flags.

Proposal
If this can be supported by the tooling, it would helpful if deprecated objects only generated an informational message during the first TBD months. At some later point, the deprecated message would be switched to the current behavior to generate a warning. And then as a final step, the deprecated object is removed completely.

Metadata

Metadata

Assignees

Labels

RFCRequest For Comments: want input from the communityarea: Build System

Type

Projects

Status

No status

Status

In Progress

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions