@@ -34,6 +34,7 @@ TOOL_VERSIONS = {
3434 "x86_64-apple-darwin" : "8d06bec08db8cdd0f64f4f05ee892cf2fcbc58cfb1dd69da2caab78fac420238" ,
3535 "x86_64-unknown-linux-gnu" : "aec8c4c53373b90be7e2131093caa26063be6d9d826f599c935c0e1042af3355" ,
3636 },
37+ "strip_prefix" : "python" ,
3738 },
3839 "3.8.12" : {
3940 "url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -43,6 +44,7 @@ TOOL_VERSIONS = {
4344 "x86_64-pc-windows-msvc" : "924f9fd51ff6ccc533ed8e96c5461768da5781eb3dfc11d846f9e300fab44eda" ,
4445 "x86_64-unknown-linux-gnu" : "5be9c6d61e238b90dfd94755051c0d3a2d8023ebffdb4b0fa4e8fedd09a6cab6" ,
4546 },
47+ "strip_prefix" : "python" ,
4648 },
4749 "3.9.10" : {
4850 "url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -52,6 +54,7 @@ TOOL_VERSIONS = {
5254 "x86_64-pc-windows-msvc" : "5bc65ce023614bf496a6748e41dca934b70fc5fac6dfacc46aa8dbcad772afc2" ,
5355 "x86_64-unknown-linux-gnu" : "455089cc576bd9a58db45e919d1fc867ecdbb0208067dffc845cc9bbf0701b70" ,
5456 },
57+ "strip_prefix" : "python" ,
5558 },
5659 "3.10.2" : {
5760 "url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -61,6 +64,7 @@ TOOL_VERSIONS = {
6164 "x86_64-pc-windows-msvc" : "a293c5838dd9c8438a84372fb95dda9752df63928a8a2ae516438f187f89567d" ,
6265 "x86_64-unknown-linux-gnu" : "9b64eca2a94f7aff9409ad70bdaa7fbbf8148692662e764401883957943620dd" ,
6366 },
67+ "strip_prefix" : "python" ,
6468 },
6569}
6670
@@ -118,21 +122,25 @@ def get_release_url(platform, python_version, base_url = DEFAULT_RELEASE_BASE_UR
118122 tool_versions: A dict listing the interpreter versions, their SHAs and URL
119123
120124 Returns:
121- filename and url pair
125+ A tuple of ( filename, url, and archive strip prefix)
122126 """
123127
124128 url = tool_versions [python_version ]["url" ]
125129
126130 if type (url ) == type ({}):
127131 url = url [platform ]
128132
133+ strip_prefix = tool_versions [python_version ].get ("strip_prefix" , None )
134+ if type (strip_prefix ) == type ({}):
135+ strip_prefix = strip_prefix [platform ]
136+
129137 release_filename = url .format (
130138 platform = platform ,
131139 python_version = python_version ,
132140 build = "static-install_only" if (WINDOWS_NAME in platform ) else "install_only" ,
133141 )
134142 url = "/" .join ([base_url , release_filename ])
135- return (release_filename , url )
143+ return (release_filename , url , strip_prefix )
136144
137145def print_toolchains_checksums (name ):
138146 native .genrule (
0 commit comments