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

Linker flags starting with -h breaks setup.py (regression) #89384

Closed
ux mannequin opened this issue Sep 16, 2021 · 7 comments
Closed

Linker flags starting with -h breaks setup.py (regression) #89384

ux mannequin opened this issue Sep 16, 2021 · 7 comments
Labels
3.10 only security fixes 3.11 only security fixes build The build process and cross-build

Comments

@ux
Copy link
Mannequin

ux mannequin commented Sep 16, 2021

BPO 45221
Nosy @tiran, @ned-deily, @methane, @miss-islington, @Fidget-Spinner, @akulakov
PRs
  • bpo-45221: Fix handling of LDFLAGS and CPPFLAGS in setup.py #29031
  • [3.10] bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031) #29037
  • 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 2021-10-18.19:12:35.513>
    created_at = <Date 2021-09-16.14:56:43.686>
    labels = ['build', '3.10', '3.11']
    title = 'Linker flags starting with -h breaks setup.py (regression)'
    updated_at = <Date 2021-10-18.19:16:45.848>
    user = 'https://bugs.python.org/ux'

    bugs.python.org fields:

    activity = <Date 2021-10-18.19:16:45.848>
    actor = 'andrei.avk'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-18.19:12:35.513>
    closer = 'ned.deily'
    components = ['Build']
    creation = <Date 2021-09-16.14:56:43.686>
    creator = 'ux'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45221
    keywords = ['patch']
    message_count = 7.0
    messages = ['401951', '404194', '404195', '404206', '404209', '404211', '404212']
    nosy_count = 7.0
    nosy_names = ['christian.heimes', 'ned.deily', 'methane', 'miss-islington', 'kj', 'andrei.avk', 'ux']
    pr_nums = ['29031', '29037']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue45221'
    versions = ['Python 3.10', 'Python 3.11']

    @ux
    Copy link
    Mannequin Author

    ux mannequin commented Sep 16, 2021

    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.

    @ux ux mannequin added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes build The build process and cross-build labels Sep 16, 2021
    @Fidget-Spinner
    Copy link
    Member

    @ux, could you please provide more information? What platform are you on, and what compiler version produces this error?

    @akulakov
    Copy link
    Contributor

    Inada: adding you as you merged the patch that made the switch optparse->argparse.

    @ned-deily
    Copy link
    Member

    New changeset 6a533a4 by andrei kulakov in branch 'main':
    bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)
    6a533a4

    @miss-islington
    Copy link
    Contributor

    New changeset b1949e0 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)
    b1949e0

    @ned-deily
    Copy link
    Member

    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.

    @ned-deily ned-deily removed 3.8 only security fixes 3.9 only security fixes labels Oct 18, 2021
    @ned-deily ned-deily removed 3.8 only security fixes 3.9 only security fixes labels Oct 18, 2021
    @akulakov
    Copy link
    Contributor

    I agree re: 3.9, thanks Ned!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants