diff --git a/Misc/NEWS.d/next/Windows/2021-12-06-14-25-05.bpo-45582.sCqL7u.rst b/Misc/NEWS.d/next/Windows/2021-12-06-14-25-05.bpo-45582.sCqL7u.rst new file mode 100644 index 00000000000000..517015b48add90 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-12-06-14-25-05.bpo-45582.sCqL7u.rst @@ -0,0 +1,5 @@ +When PGO building on Windows, the folder for the instrumented binaries is +now located at the same level as that for the production builds. +(e.g. ``PCbuild/amd64/instrumented`` to ``PCbuild/amd64_instrumented``) +We need to follow ``VPATH``, which is used in new ``getpath.py`` and defined as +``"..\\.."`` in ``pythoncore.vcxproj``, to calculate the correct prefix folder. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 0eaeb6b1229a26..bf3bb904231622 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -158,8 +158,8 @@ public override bool Execute() { - <_PGCFiles Include="$(OutDir)instrumented\$(TargetName)!*.pgc" /> - <_PGDFile Include="$(OutDir)instrumented\$(TargetName).pgd" /> + <_PGCFiles Include="$(OutDir.TrimEnd('\'))_instrumented\$(TargetName)!*.pgc" /> + <_PGDFile Include="$(OutDir.TrimEnd('\'))_instrumented\$(TargetName).pgd" /> <_CopyFiles Include="@(_PGCFiles);@(_PGDFile)" Condition="Exists(%(FullPath))" /> diff --git a/PCbuild/python.props b/PCbuild/python.props index 7b85ad1c94f16e..b30c9db0a19547 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -51,7 +51,7 @@ $(BuildPathArm64) $(PySourcePath)PCbuild\$(ArchName)\ $(BuildPath)\ - $(BuildPath)instrumented\ + $(BuildPath.TrimEnd('\'))_instrumented\ $(EXTERNALS_DIR)