Opened 15 months ago

Last modified 15 months ago

#68038 assigned enhancement

pg meson: add formal support for 'buildtype'; potentially support adding variant 'debug'

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: portgroup Cc: lukaso (Lukas Oberhuber)
Port: pg-meson

Description

Presently, Meson-based ports have to explicitly add a configure argument for the build type, which can be one of the following options [as of 2023-08]:

  • custom
  • debug
  • debugoptimized
  • minsize
  • plain
  • release

That's typically done either via --buildtype=xxx, or -Dbuildtype=xxx.

At a minimum, we should provide a formal option for that - say, meson.buildtype - with a reasonable default. (debugoptimized is often the preferred choice for a non-debug build, as it provides the best of both worlds: debug symbols, combined with optimization.)

In addition, we should consider adding support for auto-creation of variant debug, if the latter isn't already defined in the portfile. For such a case, the build type should default to debug. (Though it should also be overridable via another formal option, to ensure authors don't have to resort to creating their own variant.)

All of this can be implemented with minimal changes to pg meson, and the logic is very straightforward. So it should introduce minimal risk. It's also extremely easy to test, via a selection of Meson-based ports.

Finally, for cases where debug support has been added via pg debug, that should be removed in favor of the above. Thankfully there are only a small number of such ports, however.

Change History (2)

comment:1 Changed 15 months ago by mascguy (Christopher Nielsen)

Lukas, in terms of an ETA, we don't plan to rush this. And it will be done via a PR, to ensure folks have plenty of opportunity for feedback. (We'll also CC you on the latter, from the outset.)

comment:2 Changed 15 months ago by lukaso (Lukas Oberhuber)

Thanks. Since I have a few shadow ports in my repo, would be great to know how to do this there when the time is right.

Note: See TracTickets for help on using tickets.