[MacPorts] #59925: pypy @7.3.0: reinplace /MACOSX_DEPLOYMENT_TARGET/s/10\.\([0-9]*\)/10.7/ didn't change anything

MacPorts noreply at macports.org
Tue Jan 7 16:14:41 UTC 2020


#59925: pypy @7.3.0: reinplace /MACOSX_DEPLOYMENT_TARGET/s/10\.\([0-9]*\)/10.7/
didn't change anything
------------------------+----------------------
 Reporter:  ryandesign  |      Owner:  danchr
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.6.2
 Keywords:  lion        |       Port:  pypy
------------------------+----------------------
 On Lion only,
 [https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/13336/steps
 /install-port/logs/stdio this warning appears]:

 {{{
 Warning: reinplace /MACOSX_DEPLOYMENT_TARGET/s/10\.\([0-9]*\)/10.7/ didn't
 change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_pypy/pypy/work/pypy2.7-v7.3.0-src
 /lib-python/2.7/distutils/sysconfig_pypy.py
 }}}

 This is because the file sysconfig_pypy.py starts out specifying a
 deployment target of 10.7, so changing it to 10.7 again does nothing.

 This was caused by [460f1b130da2390b624240a135f572aca13de9e0/macports-
 ports]. Going back to the method used before that commit—doing the
 reinplace only if the current deployment target is not the deployment
 target already mentioned in the file—is one possible fix.

 If you do it that way, then note that you don't need the escaped
 parentheses in the regular expression. They capture the number between
 them, but you're not using the captured value in the replacement
 expression.

 You could also use `\d` as a shorthand for `[0-9]` in the regular
 expression. (Since the Portfile requires one additional level of escaping
 for Tcl, that would be `\\d` in the Portfile.)

 Also, you probably want to match one or more digits, not zero or more
 digits. That's `+` instead of `*`, but that also requires invoking
 reinplace with the `-E` flag to turn on extended regular expressions. So
 ultimately it would be:

 {{{
     if {${python.branch} == "2.7" && ${macosx_deployment_target} !=
 "10.7"} {
         reinplace -E
 "/MACOSX_DEPLOYMENT_TARGET/s/10\\.\\d+/${macosx_deployment_target}/" \
             lib-python/2.7/distutils/sysconfig_pypy.py
     }
 }}}


 Alternately, do it the way we usually do: first with a patchfile that
 changes the hardcoded 10.7 to a placeholder like
 `@MACOSX_DEPLOYMENT_TARGET@` and then a reinplace that changes
 `@MACOSX_DEPLOYMENT_TARGET@` to the current deployment target. This has
 the added benefit of ensuring that if the source file changes
 significantly in some future version, the patch will fail to apply which
 will generate an error which will give you the opportunity to investigate
 if you need to change something for the new version.


 Or even just remove all mention of MACOSX_DEPLOYMENT_TARGET from the build
 system. MacPorts already sets the right value for MACOSX_DEPLOYMENT_TARGET
 in the environment.

-- 
Ticket URL: <https://trac.macports.org/ticket/59925>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list