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

_decimal failed to build with system libmpdec 2.5 #85474

Closed
felixonmars mannequin opened this issue Jul 15, 2020 · 9 comments
Closed

_decimal failed to build with system libmpdec 2.5 #85474

felixonmars mannequin opened this issue Jul 15, 2020 · 9 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@felixonmars
Copy link
Mannequin

felixonmars mannequin commented Jul 15, 2020

BPO 41302
Nosy @doko42, @skrah, @felixonmars, @miss-islington
PRs
  • bpo-41302: Fix build with system libmpdec #21481
  • [3.9] bpo-41302: Fix build with system libmpdec (GH-21481) #21486
  • [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 #21488
  • 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 = 'https://github.com/skrah'
    closed_at = <Date 2020-07-15.20:30:40.352>
    created_at = <Date 2020-07-15.10:54:56.624>
    labels = ['extension-modules', 'build', '3.8', '3.9', '3.10']
    title = '_decimal failed to build with system libmpdec 2.5'
    updated_at = <Date 2020-07-15.20:30:40.351>
    user = 'https://github.com/felixonmars'

    bugs.python.org fields:

    activity = <Date 2020-07-15.20:30:40.351>
    actor = 'skrah'
    assignee = 'skrah'
    closed = True
    closed_date = <Date 2020-07-15.20:30:40.352>
    closer = 'skrah'
    components = ['Extension Modules']
    creation = <Date 2020-07-15.10:54:56.624>
    creator = 'felixonmars'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41302
    keywords = ['patch']
    message_count = 9.0
    messages = ['373676', '373677', '373679', '373682', '373691', '373692', '373721', '373722', '373723']
    nosy_count = 4.0
    nosy_names = ['doko', 'skrah', 'felixonmars', 'miss-islington']
    pr_nums = ['21481', '21486', '21488']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue41302'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @felixonmars
    Copy link
    Mannequin Author

    felixonmars mannequin commented Jul 15, 2020

    In bpo-40874, mpdecimal.h in the vendored libmpdec has defines of UNUSED while the standalone released version of mpdecimal 2.5.0 doesn't. This breaks _decimal module build with system libmpdec due to UNUSED is undefined.

    Errors are like:

    cpython/Modules/_decimal/_decimal.c:277:36: error: expected ‘;’, ‘,’ or ‘)’ before ‘UNUSED’
    277 | dec_traphandler(mpd_context_t *ctx UNUSED) /* GCOV_NOT_REACHED */
    | ^~~~~~

    Reproducible in both 3.8 branch and master (didn't test 3.9, but should be affected too).

    @felixonmars felixonmars mannequin added 3.8 only security fixes 3.10 only security fixes 3.9 only security fixes extension-modules C modules in the Modules dir build The build process and cross-build labels Jul 15, 2020
    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    Thank you for the report, I'll add the define or remove UNUSED in 3.9
    and 3.10.

    3.8 is still supposed to use libmpdec-2.4.2, though it would be
    harmless to use libmpdec-2.5.0.

    Are you planning to use libmpdec-2.5.0 with 3.8?

    @skrah skrah mannequin removed the 3.8 only security fixes label Jul 15, 2020
    @skrah skrah mannequin self-assigned this Jul 15, 2020
    @skrah skrah mannequin removed the 3.8 only security fixes label Jul 15, 2020
    @skrah skrah mannequin self-assigned this Jul 15, 2020
    @felixonmars
    Copy link
    Mannequin Author

    felixonmars mannequin commented Jul 15, 2020

    Yes, I am currently defining it manually as a workaround for building 3.8.4 in Arch.

    Also opened #65680 for this :)

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    New changeset 015efdb by Felix Yan in branch 'master':
    bpo-41302: Fix build with system libmpdec (GH-21481)
    015efdb

    @miss-islington
    Copy link
    Contributor

    New changeset 8ca63f9 by Miss Islington (bot) in branch '3.9':
    bpo-41302: Fix build with system libmpdec (GH-21481)
    8ca63f9

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    Thanks for the patch!

    The integrated libmpdec-2.4.2 in Python 3.8 still has a couple of
    UNUSED, so the simple approach of moving the define would not work.
    It would be easy to replace the few instances of UNUSED with void
    casts like in 2.5.0.

    Strictly speaking though, this would be a feature for 3.8 and not
    a build fix.

    On the other hand, if Debian also plans to use 2.5.0 with 3.8,
    there would be a stronger case for this build feature.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    I'm going to reclassify this as a build fix for 3.8. 3.8 promises:

    #if !defined(MPD_VERSION_HEX) || MPD_VERSION_HEX < 0x02040100
      #error "libmpdec version >= 2.4.1 required"
    #endif

    So it seems reasonable to support at least two or three consecutive
    system libmpdec versions, otherwise the >= is pointless.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    New changeset 16eea45 by Felix Yan in branch '3.8':
    [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 (GH-21488)
    16eea45

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jul 15, 2020

    Closing, thanks for all the patches!

    @skrah skrah mannequin added the 3.8 only security fixes label Jul 15, 2020
    @skrah skrah mannequin closed this as completed Jul 15, 2020
    @skrah skrah mannequin added the 3.8 only security fixes label Jul 15, 2020
    @skrah skrah mannequin closed this as completed Jul 15, 2020
    @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.8 only security fixes 3.9 only security fixes 3.10 only security fixes build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant