8000 gh-80789: Implement build-time pip bundling in ``ensurepip`` by webknjaz · Pull Request #12791 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-80789: Implement build-time pip bundling in ensurepip #12791

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

Closed
Closed
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.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use case-insensitive comparison @ win build script
  • Loading branch information
webknjaz committed Aug 28, 2023
commit f4bf361c42ae67cb59566f75c466617f56995df1
10 changes: 5 additions & 5 deletions PCbuild/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ echo on
/p:UseTestMarker=%UseTestMarker% %GITProperty%^
%1 %2 %3 %4 %5 %6 %7 %8 %9

if "%platf%"=="Win32" set prefix=%dir%win32
if "%platf%"=="x64" set prefix=%dir%amd64
if "%platf%"=="ARM64" set prefix=%dir%arm64
if "%platf%"=="ARM" set prefix=%dir%arm32
if /I "%platf%" == "Win32" set prefix=%dir%win32
if /I "%platf%" == "x64" set prefix=%dir%amd64
if /I "%platf%" == "ARM64" set prefix=%dir%arm64
if /I "%platf%" == "ARM" set prefix=%dir%arm32
set suffix=
if "%conf%"=="Debug" set suffix=_d
if /I "%conf%" == "Debug" set suffix=_d
set built_python_exe=%prefix%\python%suffix%.exe
call "%built_python_exe%" -m ensurepip.bundle -v
Copy link
Member

Choose a reason for hiding this comment

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

There's a handy "%dir%\..\python.bat" that you can use instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it guaranteed to locate the built interpreter version? I was a bit lost and haven't found how this file is generated to check it myself..

Copy link
Member

Choose a reason for hiding this comment

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

Yes; see

<Target Name="GeneratePythonBat" AfterTargets="AfterBuild">
<PropertyGroup>
<_Content>@rem This script invokes the most recently built Python with all arguments
@rem passed through to the interpreter. This file is generated by the
@rem build process and any changes *will* be thrown away by the next
@rem rebuild.
@rem This is only meant as a convenience for developing CPython
@rem and using it outside of that context is ill-advised.
@echo Running $(Configuration)^|$(Platform) interpreter...
@setlocal
@set PYTHONHOME=$(PySourcePath)
@"$(OutDir)python$(PyDebugExt).exe" %*
</_Content>
<_ExistingContent Condition="Exists('$(PySourcePath)python.bat')">$([System.IO.File]::ReadAllText('$(PySourcePath)python.bat'))</_ExistingContent>
</PropertyGroup>
<WriteLinesToFile File="$(PySourcePath)python.bat" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" />
</Target>

(Note that %dir%\..\python.bat and %dir%\find_python.bat are very different :). You want the former, which is also used in the PGO section several lines up.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied the suggested change. Marking this thread as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zware could you take a look at https://dev.azure.com/Python/cpython/_build/results?buildId=136036&view=logs&j=91c152bd-7320-5194-b252-1404e56e2478&t=c7e99cd8-4756-5292-d34b-246ff5fc615f&l=764 — any idea why it might be failing? I don't see how it might be related to the PR, but OTOH, it doesn't crash on main

Copy link
Member

Choose a reason for hiding this comment

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

That particular build is apparently trying to run an arm64 build on what is apparently an amd64 runner, which isn't going to work out well :)


Expand Down
0