Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 19 additions & 26 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2328,34 +2328,27 @@ def get_emscripten_releases_tot():
recent_releases = git_recent_commits(sdk_path('releases'))
# The recent releases are the latest hashes in the git repo. There
# may not be a build for the most recent ones yet; find the last
# that does.
arch = ''
if ARCH == 'arm64':
arch = '-arm64'

def make_url(ext):
return emscripten_releases_download_url_template % (
os_name_short(),
release,
arch,
ext,
)

for release in recent_releases:
make_url('tar.xz' if not WINDOWS else 'zip')
# that has uploaded binaries for all TOT platforms.
all_platforms = [
('linux', '', 'tar.xz'),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include the linux-arm64 build here but currently we are only uploading those builds for LTO releases.

See https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/src/build.py#1132

Should we lift this restriction? @dschuff ?

('mac', '', 'tar.xz'),
('mac', '-arm64', 'tar.xz'),
('win', '', 'zip'),
]

def check_binary(release, os_name, arch, ext):
url = emscripten_releases_download_url_template % (os_name, release, arch, ext)
try:
urlopen(make_url('tar.xz' if not WINDOWS else 'zip'))
urlopen(url)
return True
except Exception:
if not WINDOWS:
# Try the old `.tbz2` name
# TODO:remove this once tot builds are all using xz
try:
urlopen(make_url('tbz2'))
except Exception:
continue
else:
continue
return release
return False

for release in recent_releases:
if all(check_binary(release, os_name, arch, ext) for os_name, arch, ext in all_platforms):
return release

# No recent release has binaries for all platforms
exit_with_error('failed to find build of any recent emsdk revision')


Expand Down