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

distutils cannot find Build Tools 2017 since 3.7.2 #79880

Closed
schlamar mannequin opened this issue Jan 9, 2019 · 10 comments
Closed

distutils cannot find Build Tools 2017 since 3.7.2 #79880

schlamar mannequin opened this issue Jan 9, 2019 · 10 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@schlamar
Copy link
Mannequin

schlamar mannequin commented Jan 9, 2019

BPO 35699
Nosy @ned-deily, @merwok, @schlamar, @zooba, @dstufft, @uranusjr, @pablogsal, @miss-islington
PRs
  • bpo-35699: fix distuils cannot detect Build Tools 2017 anymore #11495
  • bpo-35699: fix distuils cannot detect Build Tools 2017 anymore #11495
  • bpo-35699: fix distuils cannot detect Build Tools 2017 anymore #11495
  • [3.7] bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495) #11626
  • [3.7] bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495) #11626
  • [3.7] bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495) #11626
  • 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 2019-01-21.05:30:55.319>
    created_at = <Date 2019-01-09.12:53:53.412>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'distutils cannot find Build Tools 2017 since 3.7.2'
    updated_at = <Date 2019-01-21.21:58:10.521>
    user = 'https://github.com/schlamar'

    bugs.python.org fields:

    activity = <Date 2019-01-21.21:58:10.521>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-01-21.05:30:55.319>
    closer = 'ned.deily'
    components = ['Distutils']
    creation = <Date 2019-01-09.12:53:53.412>
    creator = 'schlamar'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35699
    keywords = ['patch', 'patch', 'patch']
    message_count = 10.0
    messages = ['333312', '333351', '333365', '334079', '334097', '334098', '334111', '334150', '334166', '334186']
    nosy_count = 8.0
    nosy_names = ['ned.deily', 'eric.araujo', 'schlamar', 'steve.dower', 'dstufft', 'uranusjr', 'pablogsal', 'miss-islington']
    pr_nums = ['11495', '11495', '11495', '11626', '11626', '11626']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35699'
    versions = ['Python 3.7', 'Python 3.8']

    @schlamar
    Copy link
    Mannequin Author

    schlamar mannequin commented Jan 9, 2019

    vshwere.exe doesn't return Build Tools 2017 per default. This means Build Tools 2017 are not detected by distutils in 3.7.2 and you get the famous "Microsoft Visual C++ 14.0 is required" error.

    Please see microsoft/vswhere#125 for more details.

    The solution is to add

    "-products", "*",
    

    to the vswhere.exe call.

    This is a regression of https://bugs.python.org/issue35067.

    @schlamar schlamar mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 9, 2019
    @zooba
    Copy link
    Member

    zooba commented Jan 9, 2019

    Excellent catch! Are you interested in creating a PR?

    Also, I don't recall whether we are handling multiple installs or not, but if we are not I would rather explicitly list the products that may include compilers than using "*" (since there are and will be more products that do not). If we're checking for installed packages as well and iterating over all results then "*" will be fine.

    @schlamar
    Copy link
    Mannequin Author

    schlamar mannequin commented Jan 10, 2019

    We are passing arguments

    -latest (Return only the newest version and last installed.)

    and

    "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",

    So this should handle the cases multiple installs and different products without compilers.

    I try to get a PR ready.

    @zooba
    Copy link
    Member

    zooba commented Jan 20, 2019

    Reminder to myself (or permission for anyone else) to merge this. My phone won't let me actually click the github merge button, unfortunately, but this seems good to go.

    @ned-deily
    Copy link
    Member

    New changeset b2dc4a3 by Ned Deily (Marc Schlaich) in branch 'master':
    bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495)
    b2dc4a3

    @miss-islington
    Copy link
    Contributor

    New changeset 2fa53cf by Miss Islington (bot) in branch '3.7':
    bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495)
    2fa53cf

    @ned-deily
    Copy link
    Member

    Merged on behalf of Steve. Thanks, Marc!

    @zooba
    Copy link
    Member

    zooba commented Jan 21, 2019

    There is one buildbot (https://buildbot.python.org/all/#builders/40/builds/1524) that started randomly failing unrelated tests with this change - usually one of zipapp, pkgutil, or zipimport. I don't have any idea what the relationship here is, unless the distutils tests have stopped skipping on those machines and are affecting some sort of global state (which they shouldn't, and the other tests shouldn't be relying on, but here we are).

    I haven't looked at the actual tests (from my phone) yet. Anyone have any better ideas?

    @uranusjr
    Copy link
    Mannequin

    uranusjr mannequin commented Jan 21, 2019

    I read a few of the logs, and all errors roots in the same place, when the test case tries to remove the tempdir during teardown/cleanup. The Windows (and other platforms not supporting directory fds) implementation of rmtree can have race conditions if files are added while the directory being walked, causing the error.

    I don’t know the case of CPython, but Pipenv has a similar problem when running concurrent tests with subprocesses. We never solved it (but simply wrap the rmtree call inside a try block and look away).

    @pablogsal
    Copy link
    Member

    @Steve, we are investigating and tracking this issue here:

    https://bugs.python.org/issue35795

    According to the buildbot owner "directory tree removal needs to go through support.rmtree, not any of the stdlib methods for doing so. In a nutshell, the tests need to be changed to do this".

    Not sure why this has happened now

    @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.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants