[MacPorts] #61282: python39 @3.9.0, python38 @3.8.7, python37 @3.7.10, python36 @3.6.13: +universal does not work

MacPorts noreply at macports.org
Thu Mar 4 08:11:25 UTC 2021


#61282: python39 @3.9.0, python38 @3.8.7, python37 @3.7.10, python36 @3.6.13:
+universal does not work
-------------------------------------------------+-------------------------
  Reporter:  ryandesign                          |      Owner:  jmroot
      Type:  defect                              |     Status:  assigned
  Priority:  Normal                              |  Milestone:
 Component:  ports                               |    Version:  2.6.99
Resolution:                                      |   Keywords:
      Port:  python39, python38, python37,       |
  python36                                       |
-------------------------------------------------+-------------------------

Comment (by ryandesign):

 It looks like python's build system must do some kind of word wrapping
 when it creates the file _sysconfigdata!__darwin_darwin.py. The Portfile
 uses `reinplace` to remove `-arch` flags from
 _sysconfigdata!__darwin_darwin.py (see #39669 where that was first added)
 but because my `CFLAGS` are longer, some of the `-arch` flags happen to
 end up broken across multiple lines due to the word wrapping, so
 `reinplace` doesn't remove all of them. (Even in the default build, it
 doesn't remove all of them—look at `CONFIGURE_CFLAGS`, `PY_CORE_CFLAGS`,
 and `PY_STDMODULE_CFLAGS`.) Here's the diff between how that file got
 generated in a standard "vanilla" build and how it got generated with
 `-Werror=implicit-function-declaration` added:

 {{{#!diff
 ---
 vanilla/python39-3.9.2_0+universal.darwin_17.i386-x86_64/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_sysconfigdata__darwin_darwin.py
 2021-03-04 01:51:52.000000000 -0600
 +++
 imp/python39-3.9.2_0+universal.darwin_17.i386-x86_64/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_sysconfigdata__darwin_darwin.py
 2021-03-04 01:21:55.000000000 -0600
 @@ -25,13 +25,15 @@
   'CCSHARED': '',
   'CFLAGS': '-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-
 common '
             '-dynamic -DNDEBUG -g -fwrapv -O3 -Wall   '
 -           '-pipe -Os  ',
 +           '-pipe -Os -Werror=implicit-function-declaration  -arch '
 +           'i386',
   'CFLAGSFORSHARED': '',
   'CFLAGS_ALIASING': '-fno-strict-aliasing',
   'CFLAGS_NODIST': '',
   'CONFIGFILES': 'configure configure.ac acconfig.h pyconfig.h.in '
                  'Makefile.pre.in',
 - 'CONFIGURE_CFLAGS': '  -pipe -Os  -arch '
 + 'CONFIGURE_CFLAGS': '  -pipe -Os '
 +                     '-Werror=implicit-function-declaration  -arch '
                       'i386',
   'CONFIGURE_CFLAGS_NODIST': '-std=c99 -Wextra -Wno-unused-result '
                              '-Wno-unused-parameter '
 @@ -50,7 +52,8 @@
                  "'--with-computed-gotos' '--with-ensurepip=no' "
                  "'--with-system-expat' '--with-system-ffi' "
                  "'--enable-universalsdk=/' 'CC=/usr/bin/clang'
 'CFLAGS=-pipe "
 -                "-Os  ' 'LDFLAGS=-L/opt/local/lib "
 +                '-Os -Werror=implicit-function-declaration  -arch '
 +                "i386' 'LDFLAGS=-L/opt/local/lib "
                  "-Wl,-headerpad_max_install_names  ' "
                  "'CPPFLAGS=-I/opt/local/include'",
   'CONFINCLUDEDIR':
 '/opt/local/Library/Frameworks/Python.framework/Versions/3.9/include',
 @@ -649,8 +652,9 @@
   'PY_BUILTIN_MODULE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                               '-Wunreachable-code -fno-common -dynamic
 -DNDEBUG '
                               '-g -fwrapv -O3 -Wall   '
 -                             '-pipe -Os   -std=c99 '
 -                             '-Wextra -Wno-unused-result -Wno-unused-
 parameter '
 +                             '-pipe -Os -Werror=implicit-function-
 declaration '
 +                             '  -std=c99 -Wextra '
 +                             '-Wno-unused-result -Wno-unused-parameter '
                               '-Wno-missing-field-initializers '
                               '-Wstrict-prototypes '
                               '-Werror=implicit-function-declaration '
 @@ -659,7 +663,8 @@
                               '-DPy_BUILD_CORE_BUILTIN',
   'PY_CFLAGS': '-Wno-unused-result -Wsign-compare -Wunreachable-code '
                '-fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall  '
 -              ' -pipe -Os  ',
 +              ' -pipe -Os -Werror=implicit-function-declaration '
 +              ' ',
   'PY_CFLAGS_NODIST': '-std=c99 -Wextra -Wno-unused-result '
                       '-Wno-unused-parameter -Wno-missing-field-
 initializers '
                       '-Wstrict-prototypes '
 @@ -668,12 +673,13 @@
   'PY_COERCE_C_LOCALE': 1,
   'PY_CORE_CFLAGS': '-Wno-unused-result -Wsign-compare -Wunreachable-code
 '
                     '-fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall
 -arch '
 -                   'x86_64  -pipe -Os   '
 -                   '-std=c99 -Wextra -Wno-unused-result -Wno-unused-
 parameter '
 -                   '-Wno-missing-field-initializers -Wstrict-prototypes '
 -                   '-Werror=implicit-function-declaration
 -fvisibility=hidden  '
 -                   '-I./Include/internal -I. -I./Include
 -I/opt/local/include '
 -                   '-DPy_BUILD_CORE',
 +                   'x86_64  -pipe -Os '
 +                   '-Werror=implicit-function-declaration  -arch '
 +                   'i386 -std=c99 -Wextra -Wno-unused-result '
 +                   '-Wno-unused-parameter -Wno-missing-field-initializers
 '
 +                   '-Wstrict-prototypes -Werror=implicit-function-
 declaration '
 +                   '-fvisibility=hidden  -I./Include/internal -I.
 -I./Include '
 +                   '-I/opt/local/include -DPy_BUILD_CORE',
   'PY_CORE_LDFLAGS': '  -L/opt/local/lib '
                      '-Wl,-headerpad_max_install_names  ',
   'PY_CPPFLAGS': '-I. -I./Include -I/opt/local/include',
 @@ -685,8 +691,9 @@
   'PY_SSL_DEFAULT_CIPHER_STRING': 0,
   'PY_STDMODULE_CFLAGS': '-Wno-unused-result -Wsign-compare -Wunreachable-
 code '
                          '-fno-common -dynamic -DNDEBUG -g -fwrapv -O3
 -Wall '
 -                        '  -pipe -Os  -arch '
 -                        'i386 -std=c99 -Wextra -Wno-unused-result '
 +                        '  -pipe -Os '
 +                        '-Werror=implicit-function-declaration  '
 +                        ' -std=c99 -Wextra -Wno-unused-result '
                          '-Wno-unused-parameter -Wno-missing-field-
 initializers '
                          '-Wstrict-prototypes '
                          '-Werror=implicit-function-declaration '
 }}}

 I suspect that that's what's causing the problem. Or if not, it should be
 fixed anyway, perhaps by disabling the word wrapping or by doing the
 `-arch` flag removal before that file gets generated (perhaps in whatever
 script builds it—that might then be suitable to send upstream).

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


More information about the macports-tickets mailing list