@@ -1384,8 +1384,8 @@ def build_cpython(
1384
1384
openssl_archive ,
1385
1385
libffi_archive ,
1386
1386
openssl_entry : str ,
1387
- ):
1388
- pgo = profile in ( "pgo" , "shared-pgo" )
1387
+ ) -> pathlib . Path :
1388
+ pgo = profile == "pgo"
1389
1389
1390
1390
msbuild = find_msbuild (msvc_version )
1391
1391
log ("found MSBuild at %s" % msbuild )
@@ -1719,7 +1719,7 @@ def build_cpython(
1719
1719
1720
1720
crt_features = ["vcruntime:140" ]
1721
1721
1722
- if profile in ( "pgo" , "shared-pgo" ) :
1722
+ if profile == "pgo" :
1723
1723
optimizations = "pgo"
1724
1724
else :
1725
1725
optimizations = "noopt"
@@ -1812,7 +1812,7 @@ def fetch_strawberry_perl() -> pathlib.Path:
1812
1812
return strawberryperl
1813
1813
1814
1814
1815
- def main ():
1815
+ def main () -> None :
1816
1816
BUILD .mkdir (exist_ok = True )
1817
1817
1818
1818
parser = argparse .ArgumentParser ()
@@ -1836,8 +1836,7 @@ def main():
1836
1836
)
1837
1837
parser .add_argument (
1838
1838
"--profile" ,
1839
- # 'shared-pgo' is an alias for 'pgo'; 'shared-noopt' is an alias for 'noopt'.
1840
- choices = {"noopt" , "pgo" , "shared-noopt" , "shared-pgo" },
1839
+ choices = {"noopt" , "pgo" },
1841
1840
default = "noopt" ,
1842
1841
help = "How to compile Python" ,
1843
1842
)
@@ -1916,12 +1915,23 @@ def main():
1916
1915
else :
1917
1916
release_tag = release_tag_from_git ()
1918
1917
1919
- compress_python_archive (
1918
+ # Create, e.g., `cpython-3.10.13+20240224-x86_64-pc-windows-msvc-pgo.tar.zst`.
1919
+ dest_path = compress_python_archive (
1920
1920
tar_path ,
1921
1921
DIST ,
1922
1922
"%s-%s" % (tar_path .stem , release_tag ),
1923
1923
)
1924
1924
1925
+ # Copy to, e.g., `cpython-3.10.13+20240224-x86_64-pc-windows-msvc-shared-pgo.tar.zst`.
1926
+ # The 'shared-' prefix is no longer needed, but we're double-publishing under
1927
+ # both names during the transition period.
1928
+ filename : str = dest_path .name
1929
+ if not filename .endswith ("-%s-%s.tar.zst" % (args .profile , release_tag )):
1930
+ raise ValueError ("expected filename to end with profile: %s" % filename )
1931
+ filename = filename .removesuffix ("-%s-%s.tar.zst" % (args .profile , release_tag ))
1932
+ filename = filename + "-shared-%s-%s.tar.zst" % (args .profile , release_tag )
1933
+ shutil .copy2 (dest_path , dest_path .with_name (filename ))
1934
+
1925
1935
1926
1936
if __name__ == "__main__" :
1927
1937
sys .exit (main ())
0 commit comments