Skip to content

Better handling for msvc env when compiling cpp extensions#38862

Closed
peterjc123 wants to merge 2 commits intopytorch:masterfrom
peterjc123:better_handling_for_vc_env_when_compiling_cpp_extensions
Closed

Better handling for msvc env when compiling cpp extensions#38862
peterjc123 wants to merge 2 commits intopytorch:masterfrom
peterjc123:better_handling_for_vc_env_when_compiling_cpp_extensions

Conversation

@peterjc123
Copy link
Copy Markdown
Collaborator

Fixes #38861 (comment).

  1. Error out if msvc env is activated but DISTUTILS_USE_SDK is not set.
  2. Attempt to activate msvc env before running ninja build

1. Error out if msvc env is activated but `DISTUTILS_USE_SDK` is not set.
2. Attempt to activate msvc env before running ninja build
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 21, 2020

💊 CI failures summary and remediations

As of commit b0670df (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 4 times.

Copy link
Copy Markdown
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterjc123 I know this stuff is hard to test, but I guarantee you it will bitrot if we don't exercise this somehow in Windows CI

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@peterjc123
Copy link
Copy Markdown
Collaborator Author

@ezyang I'll apply to the same logic to tools/build_pytorch_libs.py so that it will be easier to find out what's wrong there.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@ezyang merged this pull request in a40049f.

@peterjc123 peterjc123 deleted the better_handling_for_vc_env_when_compiling_cpp_extensions branch May 27, 2020 07:12
@gchanan
Copy link
Copy Markdown
Contributor

gchanan commented May 28, 2020

@peterjc123 is this fixing a regression (so we should add it to 1.5.1)? It doesn't seem like it, but I wanted to double check.

@peterjc123
Copy link
Copy Markdown
Collaborator Author

@gchanan Using ninja to build c++ extensions is added in v1.5.0 and this pr fixes the problem that users attempt to trigger a extension build without activating the VC environment, which is an allowed behavior in pre-v1.5.0 builds. So maybe it can be considered as a regression to some extent.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…8862)

Summary:
Fixes pytorch#38861 (comment).
1. Error out if msvc env is activated but `DISTUTILS_USE_SDK` is not set.
2. Attempt to activate msvc env before running ninja build
Pull Request resolved: pytorch#38862

Differential Revision: D21686343

Pulled By: ezyang

fbshipit-source-id: 38b366654e2d0376dbdd21276689772b78e9718e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSVC compiler is not found when compiling CUDA extensions without ninja

6 participants