From 6f010d0ecd0d3d11cd5425c7cffc02d3b7220e29 Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Thu, 9 Jul 2026 10:32:19 +0530 Subject: [PATCH 1/4] docs: clarify custom build output directory in PCbuild/readme.txt --- PCbuild/readme.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 7c5eab2eb75a1d..9c8bceada8cfdd 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -105,6 +105,17 @@ the 32-bit Win32 platform. It accepts several arguments to change this behavior, try `build.bat -h` to learn more. +Custom Output Directory +----------------------- + +If you want to move the build outputs to a different directory, do not use the standard MSBuild `/p:OutDir=` property, as CPython has many assumptions about where the source repository is relative to the built files. +Instead, you can override the output directory by setting `Py_OutDir` (for example, `build.bat "/p:Py_OutDir=C:\MyOutput"`). + +However, be aware that the compiled binaries probably won't run directly from that location. If you want to make an install-shaped layout without creating the installer, build CPython normally first, and then use the `PC/layout` script with the runtime you just built: + python.bat PC/layout -- +Use `-h` with that command to see all available options for customizing the layout. + + C Runtime --------- From 757f9d39fa0df08dfd15707fc815d0ede316c311 Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Thu, 9 Jul 2026 10:37:27 +0530 Subject: [PATCH 2/4] docs: add news entry for 118860 --- .../next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst diff --git a/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst b/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst new file mode 100644 index 00000000000000..49018956438c9f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst @@ -0,0 +1 @@ +Clarify the use of ``Py_OutDir`` and ``PC/layout`` for customizing the build output directory in ``PCbuild/readme.txt``. From d2c81d9d2c77ec700d1784f971a375eeeab90f64 Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Thu, 9 Jul 2026 18:21:15 +0530 Subject: [PATCH 3/4] Apply reviewer feedback --- .../next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst diff --git a/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst b/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst deleted file mode 100644 index 49018956438c9f..00000000000000 --- a/Misc/NEWS.d/next/Build/2026-07-09-10-37-00.gh-issue-118860.abc123.rst +++ /dev/null @@ -1 +0,0 @@ -Clarify the use of ``Py_OutDir`` and ``PC/layout`` for customizing the build output directory in ``PCbuild/readme.txt``. From 1f573ad8d61c383a5483e88c6c665e424c334bff Mon Sep 17 00:00:00 2001 From: pranavchoudhary-tech Date: Thu, 9 Jul 2026 18:21:25 +0530 Subject: [PATCH 4/4] Apply text wrapping and environment variable suggestion --- PCbuild/readme.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 9c8bceada8cfdd..72fbbba4c100e2 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -108,12 +108,21 @@ this behavior, try `build.bat -h` to learn more. Custom Output Directory ----------------------- -If you want to move the build outputs to a different directory, do not use the standard MSBuild `/p:OutDir=` property, as CPython has many assumptions about where the source repository is relative to the built files. -Instead, you can override the output directory by setting `Py_OutDir` (for example, `build.bat "/p:Py_OutDir=C:\MyOutput"`). - -However, be aware that the compiled binaries probably won't run directly from that location. If you want to make an install-shaped layout without creating the installer, build CPython normally first, and then use the `PC/layout` script with the runtime you just built: +If you want to move the build outputs to a different directory, do not use the +standard MSBuild `/p:OutDir=` property, as CPython has many assumptions about +where the source repository is relative to the built files. Instead, you can +override the output directory by setting `Py_OutDir` as an environment +variable or by passing it to build.bat (for example, +`build.bat "/p:Py_OutDir=C:\MyOutput"`). + +However, be aware that the compiled binaries probably won't run directly from +that location. If you want to make an install-shaped layout without creating the +installer, build CPython normally first, and then use the `PC/layout` script +with the runtime you just built, or using the `--build` and `--source` options +to specify the directories: python.bat PC/layout -- -Use `-h` with that command to see all available options for customizing the layout. +Use `-h` with that command to see all available options for customizing the +layout. C Runtime