Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36353: fix -R option of build_ext for OSX #12418

Closed
wants to merge 3 commits into from

Conversation

tovrstra
Copy link

@tovrstra tovrstra commented Mar 18, 2019

For users who would like a workaround for this bug, make the following modification to your setup.py (tested with Cython and setuptools, but should also work in other situations):

from Cython.Distutils.build_ext import new_build_ext as build_ext
# alternative:
# from distutils.command import build_ext

class my_build_ext(build_ext):
    """Workaround for rpath bug in distutils for OSX."""

    def finalize_options(self):
        super().finalize_options()
        # Special treatment of rpath in case of OSX, to work around python
        # distutils bug 36353. This constructs proper rpath arguments for clang.
        # See https://bugs.python.org/issue36353
        if sys.platform[:6] == "darwin":
            for path in self.rpath:
                for ext in self.extensions:
                    ext.extra_link_args.append("-Wl,-rpath," + path)
            self.rpath[:] = []

setup(
    cmdclass={'build_ext': my_build_ext}
    # ...
)

https://bugs.python.org/issue36353

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@csabella csabella requested a review from skrah October 20, 2019 18:43
acolinisi pushed a commit to acolinisi/setuptools that referenced this pull request Mar 29, 2021
Fix -R option of build_ext for OSX

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418
acolinisi pushed a commit to acolinisi/setuptools that referenced this pull request Mar 29, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 4, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 7, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 25, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 25, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 25, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 25, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 25, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Contributor: Toon Verstraelen <Toon.Verstraelen@UGent.be>
Signed-off-by: Alexei Colin <acolin@isi.edu>
acolinisi pushed a commit to acolinisi/distutils that referenced this pull request Apr 27, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Contributor: Toon Verstraelen <Toon.Verstraelen@UGent.be>
Signed-off-by: Alexei Colin <acolin@isi.edu>
@iritkatriel
Copy link
Member

Closing this PR following the closure of its b.p.o issue (https://bugs.python.org/issue36353)

@tovrstra tovrstra deleted the fix-issue-36353 branch May 31, 2021 08:02
jaraco pushed a commit to pypa/setuptools that referenced this pull request Jul 4, 2021
Fix -R option of build_ext for macOS (darwin)

Resolves this old bug against distutils that expired due to PIP 632:
https://bugs.python.org/issue36353

Applies patch originally submitted to CPython:
python/cpython#12418

Contributor: Toon Verstraelen <Toon.Verstraelen@UGent.be>
Signed-off-by: Alexei Colin <acolin@isi.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants