8000 Refine Windows build section, explain config & add how to run by CAM-Gerlach · Pull Request #989 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Refine Windows build section, explain config & add how to run #989

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

Merged
merged 4 commits into from
Nov 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
8000 Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move WSL note to the top of the section where it is more easily noticed
  • Loading branch information
CAM-Gerlach committed Nov 22, 2022
commit c45525f519e12150ba68a5a7250f78b4e744c475
16 changes: 8 additions & 8 deletions getting-started/setup-building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ still build properly).
Windows
-------

.. note:: If you are using the Windows Subsystem for Linux (WSL),
:ref:`clone the repository <checkout>` from a native Windows shell program
like PowerShell or the ``cmd.exe`` command prompt,
and use a build of Git targeted for Windows,
e.g. the `Git for Windows download from the official Git website`_.
Otherwise, Visual Studio will not be able to find all the project's files
and will fail the build.
Comment on lines +248 to +254
Copy link
Member

Choose a reason for hiding this comment

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

This note doesn't make a whole lot of sense.

If you're using WSL, you aren't going to be building with Visual Studio. You'll be using autoconf/make/GCC, just like on Linux, because WSL is Linux. So you need to apt/yum/etc. install all your tools and dependencies (and if you're trying to clone to a Windows directory and share the source tree with Windows, you need to modify your EOL settings or it'll clone with CRLF and everything in Linux will barf).

If you're using VS, you are by definition building for Windows, so you will want to install Git for Windows (probably as part of VS), clone on Windows, and run on Windows. No WSL involved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah; I'm guessing maybe the original intent behind this note was to address users running into problems due to using Git through WSL but wanting to build natively for Windows, but that's not at all clear from the note and I'm not sure how common that is. Should we revise it to just state that using running WSL should build for WSL and/or Windows separately (using the respective compiler/Git)? Or just remove it?

Copy link
Member
@zooba zooba Nov 23, 2022

Choose a reason for hiding this comment

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

Probably just clarify the note down to (essentially) WSL != Windows and if you're in WSL then <link to Linux section>


For a concise step by step summary of building Python on Windows,
you can read `Victor Stinner's guide`_.

Expand Down Expand Up @@ -300,14 +308,6 @@ from the dropdown menus in the toolbar.
See the `PCBuild readme`_ for more details on what other software is necessary
and how to build.

.. note:: If you are using the Windows Subsystem for Linux (WSL),
:ref:`clone the repository <checkout>` from a native Windows shell program
like PowerShell or the ``cmd.exe`` command prompt,
and use a build of Git targeted for Windows,
e.g. the `Git for Windows download from the official Git website`_.
Otherwise, Visual Studio will not be able to find all the project's files
and will fail the build.

.. _Victor Stinner's guide: https://cpython-core-tutorial.readthedocs.io/en/latest/build_cpython_windows.html
.. _Visual Studio: https://visualstudio.microsoft.com/
.. _PCBuild readme: https://github.com/python/cpython/blob/main/PCbuild/readme.txt
Expand Down
0