From a320a99e2b0957561959103f7cdaa59a0c2c1963 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 29 Sep 2023 09:30:04 +0200 Subject: [PATCH 1/2] gh-108494: Document how to add a project in PCbuild/readme.txt --- PCbuild/readme.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 199aacdf7687ed..d34486f1a6ea62 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -293,3 +293,23 @@ project, with some projects overriding certain specific values. The GUI doesn't always reflect the correct settings and may confuse the user with false information, especially for settings that automatically adapt for different configurations. + +Add a new project +----------------- + +For example, add a new _testclinic_limited project to build a new +_testclinic_limited extension, the file Modules/_testclinic_limited.c: + +* In PCbuild/, copy _asyncio.vcxproj to _testclinic_limited.vcxproj, + replace RootNamespace value with `_testclinic_limited`, replace + `_asyncio.c` with `_testclinic_limited.c`. +* Open Visual Studio, open PCbuild\pcbuild.sln solution, add the + PCbuild\_testclinic_limited.vcxproj project to the solution ("add existing + project). +* Add a dependency on the python project to the new _testclinic_limited + project. +* Save and exit Visual Studio. +* Add `;_testclinic_limited` to `` in + PCbuild\pcbuild.proj. +* Build Python from scratch (clean the solution) to check that the new project + is built successfully. From c0a05b41cab77e454fe74fa868ec39290116b31b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 30 Sep 2023 22:56:10 +0200 Subject: [PATCH 2/2] Complete the doc Add _testclinic_limited to Tools/msi/test/test_files.wxs --- PCbuild/readme.txt | 10 +++++++++- Tools/msi/test/test_files.wxs | 18 +++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index d34486f1a6ea62..98b37014907604 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -300,7 +300,7 @@ Add a new project For example, add a new _testclinic_limited project to build a new _testclinic_limited extension, the file Modules/_testclinic_limited.c: -* In PCbuild/, copy _asyncio.vcxproj to _testclinic_limited.vcxproj, +* In PCbuild/, copy _testclinic.vcxproj to _testclinic_limited.vcxproj, replace RootNamespace value with `_testclinic_limited`, replace `_asyncio.c` with `_testclinic_limited.c`. * Open Visual Studio, open PCbuild\pcbuild.sln solution, add the @@ -311,5 +311,13 @@ _testclinic_limited extension, the file Modules/_testclinic_limited.c: * Save and exit Visual Studio. * Add `;_testclinic_limited` to `` in PCbuild\pcbuild.proj. +* Update "exts" in Tools\msi\lib\lib_files.wxs file or in + Tools\msi\test\test_files.wxs file (for tests). +* PC\layout\main.py needs updating if you add a test-only extension whose name + doesn't start with "_test". +* Add the extension to PCbuild\readme.txt (this file). * Build Python from scratch (clean the solution) to check that the new project is built successfully. +* Ensure the new .vcxproj and .vcxproj.filters files are added to your commit, + as well as the changes to pcbuild.sln, pcbuild.proj and any other modified + files. diff --git a/Tools/msi/test/test_files.wxs b/Tools/msi/test/test_files.wxs index 87e164cb6759f6..bb9b258692a62f 100644 --- a/Tools/msi/test/test_files.wxs +++ b/Tools/msi/test/test_files.wxs @@ -1,41 +1,41 @@ - + - + - + - + - + - + - + - + - +