@@ -34,6 +34,7 @@ TOOL_VERSIONS = {
34
34
"x86_64-apple-darwin" : "8d06bec08db8cdd0f64f4f05ee892cf2fcbc58cfb1dd69da2caab78fac420238" ,
35
35
"x86_64-unknown-linux-gnu" : "aec8c4c53373b90be7e2131093caa26063be6d9d826f599c935c0e1042af3355" ,
36
36
},
37
+ "strip_prefix" : "python" ,
37
38
},
38
39
"3.8.12" : {
39
40
"url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -43,6 +44,7 @@ TOOL_VERSIONS = {
43
44
"x86_64-pc-windows-msvc" : "924f9fd51ff6ccc533ed8e96c5461768da5781eb3dfc11d846f9e300fab44eda" ,
44
45
"x86_64-unknown-linux-gnu" : "5be9c6d61e238b90dfd94755051c0d3a2d8023ebffdb4b0fa4e8fedd09a6cab6" ,
45
46
},
47
+ "strip_prefix" : "python" ,
46
48
},
47
49
"3.9.10" : {
48
50
"url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -52,6 +54,7 @@ TOOL_VERSIONS = {
52
54
"x86_64-pc-windows-msvc" : "5bc65ce023614bf496a6748e41dca934b70fc5fac6dfacc46aa8dbcad772afc2" ,
53
55
"x86_64-unknown-linux-gnu" : "455089cc576bd9a58db45e919d1fc867ecdbb0208067dffc845cc9bbf0701b70" ,
54
56
},
57
+ "strip_prefix" : "python" ,
55
58
},
56
59
"3.10.2" : {
57
60
"url" : "20220227/cpython-{python_version}+20220227-{platform}-{build}.tar.gz" ,
@@ -61,6 +64,7 @@ TOOL_VERSIONS = {
61
64
"x86_64-pc-windows-msvc" : "a293c5838dd9c8438a84372fb95dda9752df63928a8a2ae516438f187f89567d" ,
62
65
"x86_64-unknown-linux-gnu" : "9b64eca2a94f7aff9409ad70bdaa7fbbf8148692662e764401883957943620dd" ,
63
66
},
67
+ "strip_prefix" : "python" ,
64
68
},
65
69
}
66
70
@@ -118,21 +122,25 @@ def get_release_url(platform, python_version, base_url = DEFAULT_RELEASE_BASE_UR
118
122
tool_versions: A dict listing the interpreter versions, their SHAs and URL
119
123
120
124
Returns:
121
- filename and url pair
125
+ A tuple of ( filename, url, and archive strip prefix)
122
126
"""
123
127
124
128
url = tool_versions [python_version ]["url" ]
125
129
126
130
if type (url ) == type ({}):
127
131
url = url [platform ]
128
132
133
+ strip_prefix = tool_versions [python_version ].get ("strip_prefix" , None )
134
+ if type (strip_prefix ) == type ({}):
135
+ strip_prefix = strip_prefix [platform ]
136
+
129
137
release_filename = url .format (
130
138
platform = platform ,
131
139
python_version = python_version ,
132
140
build = "static-install_only" if (WINDOWS_NAME in platform ) else "install_only" ,
133
141
)
134
142
url = "/" .join ([base_url , release_filename ])
135
- return (release_filename , url )
143
+ return (release_filename , url , strip_prefix )
136
144
137
145
def print_toolchains_checksums (name ):
138
146
native .genrule (
0 commit comments