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

Allow python 2.7 to compile with Visual Studio 2013 #66157

Closed
ZacharyTurner mannequin opened this issue Jul 11, 2014 · 6 comments
Closed

Allow python 2.7 to compile with Visual Studio 2013 #66157

ZacharyTurner mannequin opened this issue Jul 11, 2014 · 6 comments
Assignees
Labels
build The build process and cross-build OS-windows

Comments

@ZacharyTurner
Copy link
Mannequin

ZacharyTurner mannequin commented Jul 11, 2014

BPO 21958
Nosy @tjguk, @zware, @zooba
Files
  • python.patch: Patch
  • 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/zware'
    closed_at = <Date 2014-07-25.19:57:03.920>
    created_at = <Date 2014-07-11.17:20:04.285>
    labels = ['build', 'OS-windows']
    title = 'Allow python 2.7 to compile with Visual Studio 2013'
    updated_at = <Date 2014-07-25.19:57:03.918>
    user = 'https://bugs.python.org/ZacharyTurner'

    bugs.python.org fields:

    activity = <Date 2014-07-25.19:57:03.918>
    actor = 'zach.ware'
    assignee = 'zach.ware'
    closed = True
    closed_date = <Date 2014-07-25.19:57:03.920>
    closer = 'zach.ware'
    components = ['Windows']
    creation = <Date 2014-07-11.17:20:04.285>
    creator = 'Zachary.Turner'
    dependencies = []
    files = ['35925']
    hgrepos = []
    issue_num = 21958
    keywords = ['patch']
    message_count = 6.0
    messages = ['222766', '222802', '222807', '222821', '223990', '223991']
    nosy_count = 5.0
    nosy_names = ['tim.golden', 'python-dev', 'zach.ware', 'steve.dower', 'Zachary.Turner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue21958'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @ZacharyTurner
    Copy link
    Mannequin Author

    ZacharyTurner mannequin commented Jul 11, 2014

    VS2013 and beyond implement C99 math functions. Of interest to Python is the function round(). Python conditionally provides its own implementation of round() based on whether or not HAVE_ROUND is defined, but in no case is HAVE_ROUND ever defined. This leads to a huge spew of warnings when compiling with VS2013, and presumably it also leads to undefined behavior.

    The attached patch conditionally defines HAVE_ROUND based on _MSC_VER, and additionally provides a VS2013 port in the form of a set of native VS2013 solution and project files.

    This patch is based against tip of 2.7 release branch. The same fix may or may not still be needed in 3.x

    @ZacharyTurner ZacharyTurner mannequin added OS-windows build The build process and cross-build labels Jul 11, 2014
    @zooba
    Copy link
    Member

    zooba commented Jul 11, 2014

    The fix is certainly needed in default, though I already have it in my fork for porting to VC14.

    I'm okay with the HAVE_ROUND change, but I think the VS2013 project files are better off kept separate. We won't be rebuilding 2.x with a newer compiler, so they don't belong in hg.python.org.

    @zware
    Copy link
    Member

    zware commented Jul 11, 2014

    Agreed.

    @ZacharyTurner
    Copy link
    Mannequin Author

    ZacharyTurner mannequin commented Jul 12, 2014

    That's fine with me, the HAVE_ROUND is the important change anyway. Do I need to re-upload a new patch, or are you able to just delete the VS2013 project files portion of the patch and apply the HAVE_ROUND portion? And do I push the patch myself or does someone need to push it on my behalf?

    Thanks

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 25, 2014

    New changeset cb2e1b3a395f by Zachary Ware in branch '2.7':
    Issue bpo-21958: Define HAVE_ROUND when building with VS 2013 and above.
    http://hg.python.org/cpython/rev/cb2e1b3a395f

    New changeset 1c35cefd25b7 by Zachary Ware in branch '3.4':
    Issue bpo-21958: Define HAVE_ROUND when building with VS 2013 and above.
    http://hg.python.org/cpython/rev/1c35cefd25b7

    New changeset 1f5e8380f791 by Zachary Ware in branch 'default':
    Issue bpo-21958: Merge with 3.4
    http://hg.python.org/cpython/rev/1f5e8380f791

    @zware
    Copy link
    Member

    zware commented Jul 25, 2014

    Thanks for the patch, I've committed it. For future reference, the devguide should answer any questions you may have about how to contribute to Python, or you can ask on any of the various mailing lists (where you'll either get an answer or be pointed to a list better suited to the question). In this particular case, I just removed the VS2013 build files myself, and only particular people (those with a Python logo next to their name on the tracker, like myself or Steve) are allowed to push to hg.python.org.

    Also, if you haven't already, please take a moment to sign a contributor agreement (https://www.python.org/psf/contrib/). In this case, the patch was fairly trivial and almost a direct copy from elsewhere in the source tree, so I went ahead and pushed it. For larger or more involved patches, the PSF will require a contributor agreement to be on file before your patch can be accepted.

    Thanks again for your contribution!

    @zware zware closed this as completed Jul 25, 2014
    @zware zware self-assigned this Jul 25, 2014
    @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
    build The build process and cross-build OS-windows
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants