Skip to content

Commit 9fed19c

Browse files
authored
Fix wabt setup script (#7655)
On Linux we use "ubuntu" as the platform string when searching for a wabt release tarball and search for a file that ends with "-ubuntu.tar.gz". However wabt release tarballs mention Ubuntu version as well, e.g. the current release name is "wabt-1.0.37-ubuntu-20.04.tar.gz". The current check with `endswith` does not match the current release tarball names. Update the name matching to use the regex `^wabt-.*-ubuntu-.*.tar.gz$`, which matches version numbers after the "ubuntu" part.
1 parent 21a915f commit 9fed19c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

third_party/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ def wabt_determine_platform():
184184

185185

186186
def wabt_determine_release(platform):
187+
platform_regex = re.compile(r"^wabt-.*-ubuntu-.*.tar.gz$")
187188
data = fetch_json('https://api.github.com/repos/WebAssembly/wabt/releases/latest')
188189
for asset in data['assets']:
189-
if asset['name'].endswith('-' + platform + '.tar.gz'):
190+
if platform_regex.match(asset['name']):
190191
return asset['browser_download_url']
191192
print('Cannot determine release')
192193
return ''

0 commit comments

Comments
 (0)