[MacPorts] #57539: legacysupport-1.0: Let ports specify what symbols they need

MacPorts noreply at macports.org
Fri Apr 8 06:40:05 UTC 2022


#57539: legacysupport-1.0: Let ports specify what symbols they need
----------------------------+--------------------
  Reporter:  ryandesign     |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:
Resolution:                 |   Keywords:
      Port:  legacysupport  |
----------------------------+--------------------

Comment (by barracuda156):

 Replying to [comment:9 cjones051073]:
 > Replying to [comment:8 ryandesign]:
 > > Replying to [comment:7 cjones051073]:
 > > > I only added {{{legacysupport.newest_darwin_requires_legacy}}} to
 act in corner cases where it is really needed.
 > >
 > > Hmm. Did such a problem actually occur? What were the circumstances?
 >
 > bladeRF, for instance. That port had some specific home-grown work
 arounds for clock_gettime that conflicted (as they did not use quite the
 right types) with those I added in the library. So I needed to turn this
 off for 10.7 and above.
 >
 > >
 > > > The majority of ports only need to add the PortGroup and that is it,
 nothing else, and I was aiming at keeping it simple like that. Requiring
 that ports that use it also have to list the specific functions they are
 going to use just seems like over engineering things a bit, to me.
 > >
 > > I guess I just don't like unnecessary dependencies.
 >
 > Also please bear in mind the library does not allow individual features
 to be turned on or off. There can only be one library on any given system
 so it has to satisfy what *all* ports might require.
 >
 > This means, in practise there are only 3 different states, that are
 determined on a Darwin level, not a feature level.
 >
 > - 10.6 or older. Has everything in the library.
 > - 10.7 to 10.11. Has clock_gettime only.
 > - 10.12+ Has nothing.
 >
 > Thats the only states possible.
 >
 > Say we added an option to allow individual ports to list the features
 they wanted. As explained above this would *not* actually map to what the
 library provided. Say a port said it needed 'strnlen' only. This would
 mean, on 10.6 and older it would get everything, not just the requested
 feature. For me this is misleading, and why I am not really in favour of
 adding what you suggest. I think the current option, that does it at the
 Darwin level, is actually clearer and not misleading, because its the only
 option that properly maps to what the library actually can or can not
 provide.

 Does it have CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID?
 These are supposed to be a part of CLOCK_GETTIME, however I try to build
 gstreamer1 now, and it fails:

 {{{
  ../gstreamer-1.20.1/plugins/tracers/gstrusage.c
 ../gstreamer-1.20.1/plugins/tracers/gstrusage.c: In function 'do_stats':
 ../gstreamer-1.20.1/plugins/tracers/gstrusage.c:172:25: error:
 'CLOCK_PROCESS_CPUTIME_ID' undeclared (first use in this function)
   172 |     if (!clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &now)) {
       |                         ^~~~~~~~~~~~~~~~~~~~~~~~
 ../gstreamer-1.20.1/plugins/tracers/gstrusage.c:172:25: note: each
 undeclared identifier is reported only once for each function it appears
 in
 ../gstreamer-1.20.1/plugins/tracers/gstrusage.c:184:25: error:
 'CLOCK_THREAD_CPUTIME_ID' undeclared (first use in this function)
   184 |     if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &now)) {
       |
 }}}

 The following added to Portfile:
 {{{
 PortGroup                       legacysupport 1.1
 legacysupport.newest_darwin_requires_legacy 15
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/57539#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list