Title: distutils: allow overriding of the RANLIB command on macOS (darwin)
Type: compile error Stage: patch review
Components: Cross-Build, Distutils Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, Alexandru Ardelean, Jakub Piotr Cłapa, dstufft, eric.araujo, isuruf, ned.deily
Priority: normal Keywords: patch

Created on 2019-08-22 11:37 by Jakub Piotr Cłapa, last changed 2019-12-09 09:43 by ned.deily.

Pull Requests
URL Status Linked Edit
PR 15387 open python-dev, 2019-08-22 11:38
Messages (4)
msg350185 - (view) Author: Jakub Piotr Cłapa (Jakub Piotr Cłapa) * Date: 2019-08-22 11:37
On a macOS hosts the system ranlib does not understand ELF
files so using the "ranlib" command causes errors during cross-compilations.

The simplest way to fix it is to pass the RANLIB parameter provided to through to the distutils compiler machinery. This is analogous to the way the C/C++ cross-compiler is configured.

This change (in a GitHub PR) was required to proceed with crosscompiling numpy. It should help with other packages too (if they use distutils and need ranlib).
msg350978 - (view) Author: Alexandru Ardelean (Alexandru Ardelean) * Date: 2019-09-02 10:24
ping here :)
any thoughts/feedback?

the fix looks interesting, and I'm also interested in seeing a resolution for this
msg355909 - (view) Author: Isuru Fernando (isuruf) * Date: 2019-11-03 21:50
This is an issue even without cross-compilations as there is an environment variable for the archiver and therefore the archiver and ranlib can be from 2 different toolchains and leads to error. Ran into this issue in python 3.8 on macOS with an lto build
msg358062 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-12-09 09:43
Thank you for the PR. I did a quick look at it and added some comments to the PR including wondering whether the root cause of the problematic behavior is elsewhere in Distutils.
Date User Action Args
2019-12-09 09:43:10ned.deilysetnosy: + ned.deily
messages: + msg358062
2019-11-03 21:50:05isurufsetnosy: + isuruf
messages: + msg355909
2019-09-02 10:24:55Alexandru Ardeleansetnosy: + Alexandru Ardelean
messages: + msg350978
2019-08-23 18:48:18ned.deilysetnosy: + eric.araujo, dstufft
components: + Distutils
2019-08-22 11:38:50python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15096
2019-08-22 11:37:17Jakub Piotr Cłapacreate