Skip to content

Commit 2f59b94

Browse files
committed
Double-publish the binaries
1 parent 8d2efe6 commit 2f59b94

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.github/workflows/windows.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ jobs:
5151
vcvars:
5252
- 'vcvars32.bat'
5353
- 'vcvars64.bat'
54-
# The 'shared-' prefix is no longer needed (i.e., both 'shared-pgo' and 'pgo' resolve to the
55-
# same profile). However, we're double-publishing under both names during the transition
56-
# period.
5754
profile:
58-
- 'shared-pgo'
5955
- 'pgo'
6056
needs: pythonbuild
6157
runs-on: 'windows-2019'

cpython-windows/build.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,8 @@ def build_cpython(
13841384
openssl_archive,
13851385
libffi_archive,
13861386
openssl_entry: str,
1387-
):
1388-
pgo = profile in ("pgo", "shared-pgo")
1387+
) -> pathlib.Path:
1388+
pgo = profile == "pgo"
13891389

13901390
msbuild = find_msbuild(msvc_version)
13911391
log("found MSBuild at %s" % msbuild)
@@ -1719,7 +1719,7 @@ def build_cpython(
17191719

17201720
crt_features = ["vcruntime:140"]
17211721

1722-
if profile in ("pgo", "shared-pgo"):
1722+
if profile == "pgo":
17231723
optimizations = "pgo"
17241724
else:
17251725
optimizations = "noopt"
@@ -1812,7 +1812,7 @@ def fetch_strawberry_perl() -> pathlib.Path:
18121812
return strawberryperl
18131813

18141814

1815-
def main():
1815+
def main() -> None:
18161816
BUILD.mkdir(exist_ok=True)
18171817

18181818
parser = argparse.ArgumentParser()
@@ -1836,8 +1836,7 @@ def main():
18361836
)
18371837
parser.add_argument(
18381838
"--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"},
18411840
default="noopt",
18421841
help="How to compile Python",
18431842
)
@@ -1916,12 +1915,23 @@ def main():
19161915
else:
19171916
release_tag = release_tag_from_git()
19181917

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(
19201920
tar_path,
19211921
DIST,
19221922
"%s-%s" % (tar_path.stem, release_tag),
19231923
)
19241924

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+
19251935

19261936
if __name__ == "__main__":
19271937
sys.exit(main())

src/release.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ pub static RELEASE_TRIPLES: Lazy<BTreeMap<&'static str, TripleRelease>> = Lazy::
6464
},
6565
);
6666

67-
// The 'shared-' prefix is no longer needed (i.e., both 'shared-pgo' and 'pgo' resolve to the
68-
// same profile). However, we're double-publishing under both names during the transition
69-
// period.
67+
// The 'shared-' prefix is no longer needed, but we're double-publishing under both names during
68+
// the transition period.
7069
h.insert(
7170
"i686-pc-windows-msvc-shared",
7271
TripleRelease {

0 commit comments

Comments
 (0)