Incidencia #48702

specenum generator: Initial implementation

Abrir Fecha: 2023-09-23 06:01 Última actualización: 2023-09-26 05:42

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Hito:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
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.

Ticket History (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
Comentario

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
Comentario

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
Comentario

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
  • Propietario Update from (Ninguno) to alienvalkyrie
  • Resolución Update from Ninguno to Accepted
  • Hito Update from (Ninguno) to 3.3.0
Comentario

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
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Entrar