任务单 #48702

specenum generator: Initial implementation

开放日期: 2023-09-23 06:01 最后更新: 2023-09-26 05:42

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
4

Details

Part of #48675.

Initial step (first subticket) should be possible without build system integration - expect developer to run the script manually, and keep the resulting header under version control. Shouldn't do that for a large number of generated headers, but just for the first.

This ticket is about writing the script with at least the basic functionality and using it to replace the enums in just one or a few headers (to test/showcase), calling it manually when the definition is changed.

任务单历史 (3/10 Histories)

2023-09-23 06:01 Updated by: alienvalkyrie
  • New Ticket "specenum generator: Initial implementation" created
2023-09-23 06:14 Updated by: alienvalkyrie
评论

Made a proof-of-concept patch, migrating the enums of common/terrain.h; depends on #44767 in that it requires Python 3.6. This just has everything in gen_headers (no separate subdirectory yet). Added that to the include directories as well (meson only in this patch since that's what I'm developing with). It also doesn't support all regular specenum features yet.

I tried to keep the enums def format close to the packets.def format, but I'm not happy with it yet; especially when adding more options. Might have to go with two separate bodies; one for the options, then some kind of marker, then enum constants.

2023-09-24 04:23 Updated by: alienvalkyrie
评论

New patch with a better definition format, support for all the specenum things, and moved the current def and generated header (but not the script) to a subdirectory.

Still missing Makefile updates to factor in the new header, because I don't trust my ability to guess how to correctly do that across different directories.

(Edited, 2023-09-24 04:26 Updated by: alienvalkyrie)
2023-09-24 05:43 Updated by: cazfi
评论

Reply To alienvalkyrie

Still missing Makefile updates

Attached partial patch that should help. I hope you only need to add the include path everywhere.

Your .py seems to be missing executable bit. Not intentionally, I assume.

2023-09-24 17:01 Updated by: alienvalkyrie
  • 属主 Update from (无) to alienvalkyrie
  • 处理结果 Update from to Accepted
  • 里程碑 Update from (无) to 3.3.0
评论

Finished patch attached. Autotools build works, script is marked executable. Fixed a minor error in a comment as well.

2023-09-26 05:42 Updated by: alienvalkyrie
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名