Skip to content

OSX C++ linking workaround in distutils breaks other packages #76579

Closed

Description

@esuarezsantana
BPO 32398
Nosy @ronaldoussoren, @ned-deily, @merwok, @bitdancer, @dstufft, @csabella, @esuarezsantana
PRs
  • bpo-32398: Remove OSX c++ linking workaround in distutils. #4965
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-05-23.00:32:10.044>
    created_at = <Date 2017-12-21.17:22:59.107>
    labels = ['OS-mac', 'type-bug', 'library']
    title = 'OSX C++ linking workaround in distutils breaks other packages'
    updated_at = <Date 2020-05-23.00:32:10.043>
    user = 'https://github.com/esuarezsantana'

    bugs.python.org fields:

    activity = <Date 2020-05-23.00:32:10.043>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-23.00:32:10.044>
    closer = 'cheryl.sabella'
    components = ['Distutils', 'macOS']
    creation = <Date 2017-12-21.17:22:59.107>
    creator = 'esuarezsantana'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32398
    keywords = []
    message_count = 6.0
    messages = ['308887', '308889', '308891', '308892', '308991', '369676']
    nosy_count = 7.0
    nosy_names = ['ronaldoussoren', 'ned.deily', 'eric.araujo', 'r.david.murray', 'dstufft', 'cheryl.sabella', 'esuarezsantana']
    pr_nums = ['4965']
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32398'
    versions = ['Python 3.6']

    Activity

    1. esuarezsantana commented on Dec 21, 2017

      esuarezsantanamannequin
      MannequinAuthor

      When compiling GDAL with python support, under certain build chain environment variables, next error may appear when building and linking python extensions (https://www.mail-archive.com/freebsd-ports@freebsd.org/msg41030.html):

      /bin/sh: -d: invalid option

      See the Github PR for proposed solution.

    2. added
      stdlib
      type-bug
      on Dec 21, 2017
    3. bitdancer commented on Dec 21, 2017

      @bitdancer
      Member

      Please describe the problem and your proposed solution in more detail and in terms of CPython, so that it can be discussed by the relevant experts. GDAL is a third party product and only relevant as an example, so it would also be good to come up with a better title for the issues ;)

    4. changed the title [-]GDAL compilation error[/-] [+]OSX C++ linking workaround in distutils breaks other packages[/+] on Dec 21, 2017
    5. esuarezsantana commented on Dec 21, 2017

      esuarezsantanamannequin
      MannequinAuthor

      When compiling GDAL with python support, before Lib/distutils/unixccompiler.py:180,

      self.compiler_cxx = ['/bin/sh', '/usr/x86_64-pc-linux-gnu/bin/libtool', '--mode=compile', '--tag=CXX', 'x86_64-pc-linux-gnu-c++']
      linker = ['x86_64-pc-linux-gnu-cc', '-pthread', '-shared', '-march=native', '-pipe', '-O2', '-Wall', '-Wdeclaration-after-statement', '-Wextra', '-Winit-self', '-Wunused-parameter', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wformat', '-Werror=format-security', '-Wno-format-nonliteral', '-Wlogical-op', '-Wshadow', '-Werror=vla', '-Wdeclaration-after-statement', '-Wnull-dereference', '-Wduplicated-cond', '-DOGR_ENABLED', '-march=native', '-pipe', '-O2', '-I/var/tmp/paludis/build/sci-libs-gdal-2.1.1/work/gdal-2.1.1/port', '-DGDAL_COMPILATION']

      and after the workaround code:

      linker = ['/bin/sh', '-pthread', '-shared', '-march=native', '-pipe', '-O2', '-Wall', '-Wdeclaration-after-statement', '-Wextra', '-Winit-self', '-Wunused-parameter', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wformat', '-Werror=format-security', '-Wno-format-nonliteral', '-Wlogical-op', '-Wshadow', '-Werror=vla', '-Wdeclaration-after-statement', '-Wnull-dereference', '-Wduplicated-cond', '-DOGR_ENABLED', '-march=native', '-pipe', '-O2', '-I/var/tmp/paludis/build/sci-libs-gdal-2.1.1/work/gdal-2.1.1/port', '-DGDAL_COMPILATION']

      which leads to next error:

      /bin/sh: -d: invalid option

      Some fixes to compilation (https://www.michael-joost.de/gdal_install.html) have been found, but anyway the existing workaround:

      1. ...is a hack about OSX but there is no platform checking,

      2. ...assumes linker and compiler commands have similar structure and
        environment settings (no documentation reference found about that), and

      3. ...assumes env, if used, does not come with any modifier.

      My proposal is to remove the workaround and delegate right environmental variables to packagers.

    6. bitdancer commented on Dec 21, 2017

      @bitdancer
      Member

      I doubt we can make the change this way for backward compatibility reasons. That doesn't mean the situation can't be improved, though.

    7. ronaldoussoren commented on Dec 24, 2017

      @ronaldoussoren
      Contributor

      As I mentioned on the pull request it is not clear to me what the actual issue is.

      What are the settings for building that cause problems? In particular, what are the compiler/linker related variables in Python's Makefile (and _sysconfigdata.py)?

      With the currently available information I'm -1 w.r.t accepting the attached pull request.

    8. csabella commented on May 23, 2020

      @csabella
      Contributor

      I'm going to close this as the OP hasn't responded in over 2 years and Ronald was -1 on the solution. If the OP or someone else experiences this same problem, either this issue or a new one can be opened to address it. Thank you!

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      OS-macstdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions