Navigation Menu

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

VS2008, quick hack for distutils.msvccompiler #45796

Closed
tiran opened this issue Nov 17, 2007 · 15 comments
Closed

VS2008, quick hack for distutils.msvccompiler #45796

tiran opened this issue Nov 17, 2007 · 15 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@tiran
Copy link
Member

tiran commented Nov 17, 2007

BPO 1455
Nosy @loewis, @mhammond, @amauryfa, @tiran
Files
  • py3k_vs2008_hack.patch
  • py3k_vs2008_2.patch
  • py3k_vs2008_3.patch
  • py3k_vs2008_4.patch
  • norm.py
  • 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/tiran'
    closed_at = <Date 2007-12-03.14:35:51.148>
    created_at = <Date 2007-11-17.13:48:13.193>
    labels = ['type-feature', 'library']
    title = 'VS2008, quick hack for distutils.msvccompiler'
    updated_at = <Date 2008-01-06.22:29:45.077>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2008-01-06.22:29:45.077>
    actor = 'admin'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2007-12-03.14:35:51.148>
    closer = 'christian.heimes'
    components = ['Distutils']
    creation = <Date 2007-11-17.13:48:13.193>
    creator = 'christian.heimes'
    dependencies = []
    files = ['8766', '8768', '8781', '8813', '8994']
    hgrepos = []
    issue_num = 1455
    keywords = ['patch']
    message_count = 15.0
    messages = ['57599', '57600', '57601', '57602', '57603', '57606', '57610', '57660', '57703', '57709', '57873', '58127', '58802', '58850', '59058']
    nosy_count = 5.0
    nosy_names = ['loewis', 'mhammond', 'amaury.forgeotdarc', 'christian.heimes', 'weck']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1455'
    versions = ['Python 3.0']

    @tiran
    Copy link
    Member Author

    tiran commented Nov 17, 2007

    I've come up with a quick hack to support VS 2008. VS 2008 Standard
    Edition doesn't store the include and lib dirs in the registry any more.
    However I came up with a nice way to get the env settings from the
    vcvarsall.bat. How do you like it?

    Do we need support for VS6 and VS7.1 or can I remove the code from the
    module?

    @tiran tiran added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Nov 17, 2007
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Nov 17, 2007

    There is always the debate whether distutils might be repackaged and
    backported to older Python releases, therefore people hesitate to remove
    support for older versions.

    As for finding it in the registry: are you sure it has no registry
    settings anymore? I find that hard to believe.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Nov 17, 2007

    As another note: you shouldn't remove support code for Itanium. Even
    though no Itanium binaries will be produced at the releases, I see no
    reason to rip the code out - people with Itanium machines should still
    be able to build Python, with some effort.

    @tiran
    Copy link
    Member Author

    tiran commented Nov 17, 2007

    Neither VS8 Professional nor VS9 Beta 2 Standard are storing the lib and
    include directories in the registry. I've searched in HKCU and HKLM. The
    best I could find was the path to a XML file in My Documents that
    contains the information.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Nov 17, 2007

    Ok. Running vsvars is fine, then.

    The change to get_build_architecture is broken in another way: as it
    parses the architecture out of sys.version, you still get Intel, not x86
    (unless you also change PC/pyconfig.h - which may break code that relies
    on the specific format of sys.version)

    Otherwise, the patch looks fine.

    @tiran
    Copy link
    Member Author

    tiran commented Nov 17, 2007

    Ok, I'll take it from here. I'm going to wait until it's decided to use
    VS 2008 as the new default compiler.

    @tiran tiran assigned tiran and unassigned loewis Nov 17, 2007
    @tiran
    Copy link
    Member Author

    tiran commented Nov 18, 2007

    UPDATES:

    • Cleanup and rewrite of the registry related code
    • Moved search code to find_vcvarsall().
    • Added fallback using the VS90COMNTOOL env var for Express edition

    @tiran
    Copy link
    Member Author

    tiran commented Nov 19, 2007

    Updated compiler and linker args from the project command lines.

    @weck
    Copy link
    Mannequin

    weck mannequin commented Nov 20, 2007

    Why don't use "Visual Studio 200x Command Prompt" to get a shell window
    with correct environment settings?

    In this way msvccompiler.py can get LIB, INCLUDE, LIBPATH, PATH with
    os.environ.get.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Nov 20, 2007

    It's tedious to require users to invoke such a shell, and it would
    produce an endless flood of support requests if we made that a
    requirement. So requiring to build in such a shell is absolutely
    unacceptable.

    @tiran
    Copy link
    Member Author

    tiran commented Nov 27, 2007

    I've created another patch to add VS 2008 support to distutils. The new
    patch requires you to copy the msvccompiler.py first:

    $ cd Lib/distutils
    $ svn copy msvccompiler.py msvc9compiler.py
    $ cd ../..
    $ patch -p0 < py3k_vs2008_4.patch

    Martin, if you are going to build Python 3.0a2 with VS 2008 then this
    patch should be applied. I've tested it with VS 2008 and it *may* be
    compatible with VS 2005, too.

    @tiran
    Copy link
    Member Author

    tiran commented Dec 3, 2007

    I've applied the patch to the trunk in r59290 together with a fix for
    the cygwin compiler. distutils now support VS 2005 and VS 2008 (both
    tested) and cygwin (only tested for msvcr80).

    @tiran tiran closed this as completed Dec 3, 2007
    @weck
    Copy link
    Mannequin

    weck mannequin commented Dec 19, 2007

    I succeed in building python26 with msvc 2005. I create a tool to
    convert pcbuild9 to pcbuild8.

    1. delete pcbuild8
    2. copy pcbuild9 to pcbuild8
    3. run norm.py in pcbuild8, norm.py will change the format flag.

    @amauryfa
    Copy link
    Member

    I already do the same: pcbuild9 is easy to convert to vs2005, and the
    project is much better than the current pcbuild8.

    What do the others think? Should we update pcbuild8 with the content of
    pcbuild9, with the few changes proposed by weck? Or simply remove
    pcbuild8 and propose vs2005 users to run the attached script?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 31, 2007

    This issue is closed, and didn't really deal with VS 2005 at all, so we
    should avoid tracking any further changes in it.

    I personally don't care about the PCbuild8 folder at all. It can be
    removed, updated, replaced with that script - whatever people like most.
    You might want to ask Kristjan Jonsson (who created it originally) about
    its fate.

    @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
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants