This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Linker flags starting with -h breaks setup.py (regression)
Type: compile error Stage: resolved
Components: Build Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: andrei.avk, christian.heimes, kj, methane, miss-islington, ned.deily, ux
Priority: normal Keywords: patch

Created on 2021-09-16 14:56 by ux, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29031 merged andrei.avk, 2021-10-18 14:32
PR 29037 merged miss-islington, 2021-10-18 18:27
Messages (7)
msg401951 - (view) Author: ux (ux) Date: 2021-09-16 14:56
Hi,

Since 3.8 (included), the following build command fails:

    LDFLAGS=-headerpad_max_install_names ./configure
    make

With the following error:

    setup.py: error: argument -h/--help: ignored explicit argument 'eaderpad_max_install_names'


A quick hack in setup.py "fixes" the issue:

-                options, _ = parser.parse_known_args(env_val.split())
+                options, _ = parser.parse_known_args([x for x in env_val.split() if not x.startswith('-h')])

Another workaround as a user is to do use `LDFLAGS=-Wl,-headerpad_max_install_names`.
msg404194 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-10-18 16:09
@ux, could you please provide more information? What platform are you on, and what compiler version produces this error?
msg404195 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-10-18 16:10
Inada: adding you as you merged the patch that made the switch optparse->argparse.
msg404206 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-10-18 18:26
New changeset 6a533a423869e28d9086cf4d79029f59e9eec916 by andrei kulakov in branch 'main':
bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)
https://github.com/python/cpython/commit/6a533a423869e28d9086cf4d79029f59e9eec916
msg404209 - (view) Author: miss-islington (miss-islington) Date: 2021-10-18 18:49
New changeset b1949e0b58714724a3105cad3ad1b61384688da7 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031) (GH-29037)
https://github.com/python/cpython/commit/b1949e0b58714724a3105cad3ad1b61384688da7
msg404211 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-10-18 19:12
Thanks for the report, @ux, and thanks for the PR, Andrei! I've backported the fix for release in 3.10.1 but I think it's pretty late in 3.9's release cycle and we've lived this long with the issue.
msg404212 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-10-18 19:16
I agree re: 3.9, thanks Ned!
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89384
2021-10-18 19:16:45andrei.avksetmessages: + msg404212
2021-10-18 19:12:35ned.deilysetstatus: open -> closed
versions: - Python 3.8, Python 3.9
messages: + msg404211

resolution: fixed
stage: patch review -> resolved
2021-10-18 18:49:36miss-islingtonsetmessages: + msg404209
2021-10-18 18:27:18miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27308
2021-10-18 18:26:30ned.deilysetmessages: + msg404206
2021-10-18 16:10:54andrei.avksetnosy: + methane
messages: + msg404195
2021-10-18 16:09:44kjsetnosy: + christian.heimes
messages: + msg404194
2021-10-18 15:51:27ned.deilysetnosy: + ned.deily
2021-10-18 14:54:26andrei.avksetnosy: + kj
2021-10-18 14:32:40andrei.avksetkeywords: + patch
nosy: + andrei.avk

pull_requests: + pull_request27303
stage: patch review
2021-09-16 14:56:43uxcreate