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

Setup keep_trailing_newline=True in python jinja templates #23235

Merged

Conversation

andy31415
Copy link
Contributor

We codegen C++ headers and sources and for headers, the final newline can be important.

This adds keep_trailing_newline to jinja codegen.

I also made it so that the unit tests for codegen can easily update their outputs and re-generated all files.

@github-actions
Copy link

PR #23235: Size comparison from 11606ea to c4d56d3

Decreases (3 builds for bl702, qpg)
platform target config section 11606ea c4d56d3 change % change
bl702 lighting-app bl702 (read/write) 1188691 1188675 -16 -0.0
.debug_info 37905413 37905412 -1 -0.0
.text 957058 957056 -2 -0.0
bl702+rpc .debug_info 41812027 41812026 -1 -0.0
.text 1030504 1030502 -2 -0.0
qpg lock-app qpg6105+debug (read/write) 1113712 1113704 -8 -0.0
.text 560808 560800 -8 -0.0
Full report (6 builds for bl702, linux, qpg)
platform target config section 11606ea c4d56d3 change % change
bl702 lighting-app bl702 0 0 0 0.0
(read only) 3262 3262 0 0.0
(read/write) 1188691 1188675 -16 -0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 67102 67102 0 0.0
.bss_psram 29696 29696 0 0.0
.comment 48 48 0 0.0
.data 4272 4272 0 0.0
.debug_abbrev 1506865 1506865 0 0.0
.debug_aranges 133136 133136 0 0.0
.debug_frame 486600 486600 0 0.0
.debug_info 37905413 37905412 -1 -0.0
.debug_line 5256822 5256822 0 0.0
.debug_loc 3367145 3367145 0 0.0
.debug_ranges 359376 359376 0 0.0
.debug_str 3457811 3457811 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 116744 116744 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 565071 565071 0 0.0
.symtab 171664 171664 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 957058 957056 -2 -0.0
bl702+rpc 0 0 0 0.0
(read only) 3262 3262 0 0.0
(read/write) 1284355 1284355 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75150 75150 0 0.0
.bss_psram 29936 29936 0 0.0
.comment 48 48 0 0.0
.data 4800 4800 0 0.0
.debug_abbrev 1644410 1644410 0 0.0
.debug_aranges 140640 140640 0 0.0
.debug_frame 511972 511972 0 0.0
.debug_info 41812027 41812026 -1 -0.0
.debug_line 5631353 5631353 0 0.0
.debug_loc 3559792 3559792 0 0.0
.debug_ranges 381832 381832 0 0.0
.debug_str 3853711 3853711 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 130136 130136 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 624244 624244 0 0.0
.symtab 189472 189472 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 1030504 1030502 -2 -0.0
linux chip-tool-ipv6only arm64 (read only) 10429476 10429476 0 0.0
(read/write) 706353 706353 0 0.0
.bss 33953 33953 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 650632 650632 0 0.0
.dynamic 560 560 0 0.0
.got 13896 13896 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 518132 518132 0 0.0
.text 8255780 8255780 0 0.0
thermostat-no-ble arm64 (read only) 2390524 2390524 0 0.0
(read/write) 143633 143633 0 0.0
.bss 55377 55377 0 0.0
.data 1816 1816 0 0.0
.data.rel.ro 77256 77256 0 0.0
.dynamic 560 560 0 0.0
.got 5176 5176 0 0.0
.init 24 24 0 0.0
.init_array 440 440 0 0.0
.rodata 144436 144436 0 0.0
.text 2003184 2003184 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1148632 1148632 0 0.0
.bss 110556 110556 0 0.0
.data 832 832 0 0.0
.text 595732 595732 0 0.0
lock-app qpg6105+debug (read/write) 1113712 1113704 -8 -0.0
.bss 106372 106372 0 0.0
.data 836 836 0 0.0
.text 560808 560800 -8 -0.0

@andy31415 andy31415 merged commit 4e17011 into project-chip:master Oct 18, 2022
adbridge pushed a commit to ARM-software/connectedhomeip that referenced this pull request Nov 18, 2022
…-chip#23235)

* Keep trailing newlins in codegen

* Add option to auto-regenerate golden data

* Re-generate test outputs after skip whitespace changes

* Restyle
adbridge pushed a commit to ARM-software/connectedhomeip that referenced this pull request Nov 18, 2022
…-chip#23235)

* Keep trailing newlins in codegen

* Add option to auto-regenerate golden data

* Re-generate test outputs after skip whitespace changes

* Restyle
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.

None yet

2 participants