Skip to content

Commit 1fa7658

Browse files
committed
Remove fastcomp SDK and fastcomp build rules. NFC
Folks that want to work with fastcomp will now need to use an older checkout of emsdk.
1 parent fb05de5 commit 1fa7658

File tree

3 files changed

+25
-369
lines changed

3 files changed

+25
-369
lines changed

emsdk.py

Lines changed: 17 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ def exe_suffix(filename):
886886

887887
# The directory where the binaries are produced. (relative to the installation
888888
# root directory of the tool)
889-
def fastcomp_build_bin_dir(tool):
889+
def llvm_build_bin_dir(tool):
890890
build_dir = llvm_build_dir(tool)
891891
if WINDOWS and 'Visual Studio' in CMAKE_GENERATOR:
892892
old_llvm_bin_dir = os.path.join(build_dir, 'bin', decide_cmake_build_type(tool))
@@ -1108,92 +1108,6 @@ def xcode_sdk_version():
11081108
return subprocess.checkplatform.mac_ver()[0].split('.')
11091109

11101110

1111-
def build_fastcomp(tool):
1112-
debug_print('build_fastcomp(' + str(tool) + ')')
1113-
fastcomp_root = tool.installation_path()
1114-
fastcomp_src_root = os.path.join(fastcomp_root, 'src')
1115-
# Does this tool want to be git cloned from github?
1116-
if hasattr(tool, 'git_branch'):
1117-
success = git_clone_checkout_and_pull(tool.download_url(), fastcomp_src_root, tool.git_branch)
1118-
if not success:
1119-
return False
1120-
if hasattr(tool, 'clang_url'):
1121-
clang_root = os.path.join(fastcomp_src_root, 'tools/clang')
1122-
success = git_clone_checkout_and_pull(tool.clang_url, clang_root, tool.git_branch)
1123-
if not success:
1124-
return False
1125-
if hasattr(tool, 'lld_url'):
1126-
lld_root = os.path.join(fastcomp_src_root, 'tools/lld')
1127-
success = git_clone_checkout_and_pull(tool.lld_url, lld_root, tool.git_branch)
1128-
if not success:
1129-
return False
1130-
else:
1131-
# Not a git cloned tool, so instead download from git tagged releases
1132-
success = download_and_unzip(tool.download_url(), fastcomp_src_root, filename_prefix='llvm-e')
1133-
if not success:
1134-
return False
1135-
success = download_and_unzip(tool.windows_clang_url if WINDOWS else tool.unix_clang_url, os.path.join(fastcomp_src_root, 'tools/clang'), filename_prefix='clang-e')
1136-
if not success:
1137-
return False
1138-
1139-
args = []
1140-
1141-
cmake_generator = CMAKE_GENERATOR
1142-
if 'Visual Studio 16' in CMAKE_GENERATOR: # VS2019
1143-
# With Visual Studio 16 2019, CMake changed the way they specify target arch.
1144-
# Instead of appending it into the CMake generator line, it is specified
1145-
# with a -A arch parameter.
1146-
args += ['-A', 'x64' if tool.bitness == 64 else 'x86']
1147-
elif 'Visual Studio' in CMAKE_GENERATOR and tool.bitness == 64:
1148-
cmake_generator += ' Win64'
1149-
1150-
build_dir = llvm_build_dir(tool)
1151-
build_root = os.path.join(fastcomp_root, build_dir)
1152-
1153-
build_type = decide_cmake_build_type(tool)
1154-
1155-
# Configure
1156-
tests_arg = 'ON' if BUILD_FOR_TESTING else 'OFF'
1157-
1158-
enable_assertions = ENABLE_LLVM_ASSERTIONS.lower() == 'on' or (ENABLE_LLVM_ASSERTIONS == 'auto' and build_type.lower() != 'release' and build_type.lower() != 'minsizerel')
1159-
1160-
only_supports_wasm = hasattr(tool, 'only_supports_wasm')
1161-
if ARCH == 'x86' or ARCH == 'x86_64':
1162-
targets_to_build = 'X86'
1163-
elif ARCH == 'arm':
1164-
targets_to_build = 'ARM'
1165-
elif ARCH == 'aarch64':
1166-
targets_to_build = 'AArch64'
1167-
else:
1168-
# May have problems with emconfigure
1169-
targets_to_build = ''
1170-
if not only_supports_wasm:
1171-
if targets_to_build != '':
1172-
targets_to_build += ';'
1173-
targets_to_build += 'JSBackend'
1174-
args += ['-DLLVM_TARGETS_TO_BUILD=' + targets_to_build, '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=' + tests_arg, '-DCLANG_INCLUDE_TESTS=' + tests_arg, '-DLLVM_ENABLE_ASSERTIONS=' + ('ON' if enable_assertions else 'OFF')]
1175-
if os.getenv('LLVM_CMAKE_ARGS'):
1176-
extra_args = os.environ['LLVM_CMAKE_ARGS'].split(',')
1177-
print('Passing the following extra arguments to LLVM CMake configuration: ' + str(extra_args))
1178-
args += extra_args
1179-
1180-
# MacOS < 10.13 workaround for LLVM build bug https://github.com/kripken/emscripten/issues/5418:
1181-
# specify HAVE_FUTIMENS=0 in the build if building with target SDK that is older than 10.13.
1182-
if MACOS and ('HAVE_FUTIMENS' not in os.getenv('LLVM_CMAKE_ARGS', '')) and xcode_sdk_version() < ['10', '13']:
1183-
print('Passing -DHAVE_FUTIMENS=0 to LLVM CMake configure to workaround https://github.com/kripken/emscripten/issues/5418. Please update to macOS 10.13 or newer')
1184-
args += ['-DHAVE_FUTIMENS=0']
1185-
1186-
success = cmake_configure(cmake_generator, build_root, fastcomp_src_root, build_type, args)
1187-
if not success:
1188-
return False
1189-
1190-
# Make
1191-
success = make_build(build_root, build_type, 'x64' if tool.bitness == 64 else 'Win32')
1192-
return success
1193-
1194-
1195-
# LLVM git source tree migrated to a single repository instead of multiple
1196-
# ones, build_llvm() builds via that repository structure
11971111
def build_llvm(tool):
11981112
debug_print('build_llvm(' + str(tool) + ')')
11991113
llvm_root = tool.installation_path()
@@ -1758,10 +1672,9 @@ def expand_vars(self, str):
17581672
if '%generator_prefix%' in str:
17591673
str = str.replace('%generator_prefix%', cmake_generator_prefix())
17601674
str = str.replace('%.exe%', '.exe' if WINDOWS else '')
1761-
if '%fastcomp_build_dir%' in str:
1762-
str = str.replace('%fastcomp_build_dir%', llvm_build_dir(self))
1763-
if '%fastcomp_build_bin_dir%' in str:
1764-
str = str.replace('%fastcomp_build_bin_dir%', fastcomp_build_bin_dir(self))
1675+
if '%llvm_build_bin_dir%' in str:
1676+
str = str.replace('%llvm_build_bin_dir%', llvm_build_bin_dir(self))
1677+
17651678
return str
17661679

17671680
# Return true if this tool requires building from source, and false if this is a precompiled tool.
@@ -2007,7 +1920,7 @@ def install_sdk(self):
20071920

20081921
if getattr(self, 'custom_install_script', None) == 'emscripten_npm_install':
20091922
# upstream tools have hardcoded paths that are not stored in emsdk_manifest.json registry
2010-
install_path = 'upstream' if 'releases-upstream' in self.version else 'fastcomp'
1923+
install_path = 'upstream'
20111924
emscripten_dir = os.path.join(EMSDK_PATH, install_path, 'emscripten')
20121925
# Older versions of the sdk did not include the node_modules directory
20131926
# and require `npm ci` to be run post-install
@@ -2033,9 +1946,7 @@ def install_tool(self):
20331946
print("Installing tool '" + str(self) + "'..")
20341947
url = self.download_url()
20351948

2036-
if hasattr(self, 'custom_install_script') and self.custom_install_script == 'build_fastcomp':
2037-
success = build_fastcomp(self)
2038-
elif hasattr(self, 'custom_install_script') and self.custom_install_script == 'build_llvm':
1949+
if hasattr(self, 'custom_install_script') and self.custom_install_script == 'build_llvm':
20391950
success = build_llvm(self)
20401951
elif hasattr(self, 'custom_install_script') and self.custom_install_script == 'build_ninja':
20411952
success = build_ninja(self)
@@ -2056,8 +1967,8 @@ def install_tool(self):
20561967
success = emscripten_post_install(self)
20571968
elif self.custom_install_script == 'emscripten_npm_install':
20581969
success = emscripten_npm_install(self, self.installation_path())
2059-
elif self.custom_install_script in ('build_fastcomp', 'build_llvm', 'build_ninja', 'build_ccache'):
2060-
# 'build_fastcomp' is a special one that does the download on its
1970+
elif self.custom_install_script in ('build_llvm', 'build_ninja', 'build_ccache'):
1971+
# 'build_llvm' is a special one that does the download on its
20611972
# own, others do the download manually.
20621973
pass
20631974
elif self.custom_install_script == 'build_binaryen':
@@ -2344,25 +2255,22 @@ def get_installed_sdk_version():
23442255
# Get a list of tags for emscripten-releases.
23452256
def load_releases_tags():
23462257
tags = []
2347-
tags_fastcomp = []
23482258
info = load_releases_info()
23492259

23502260
for version, sha in sorted(info['releases'].items(), key=lambda x: version_key(x[0])):
23512261
tags.append(sha)
2352-
# Only include versions older than 1.39.0 in fastcomp releases
2353-
if version_key(version) < (2, 0, 0):
2354-
tags_fastcomp.append(sha)
23552262

23562263
if extra_release_tag:
23572264
tags.append(extra_release_tag)
23582265

23592266
# Explicitly add the currently installed SDK version. This could be a custom
2360-
# version (installed explicitly) so it might not be part of the main list loaded above.
2267+
# version (installed explicitly) so it might not be part of the main list
2268+
# loaded above.
23612269
installed = get_installed_sdk_version()
23622270
if installed and installed not in tags:
23632271
tags.append(installed)
23642272

2365-
return tags, tags_fastcomp
2273+
return tags
23662274

23672275

23682276
def load_releases_versions():
@@ -2390,7 +2298,7 @@ def load_sdk_manifest():
23902298
llvm_precompiled_tags_64bit = load_file_index_list('llvm-tags-64bit.txt')
23912299
llvm_precompiled_tags = llvm_precompiled_tags_32bit + llvm_precompiled_tags_64bit
23922300
binaryen_tags = load_legacy_binaryen_tags()
2393-
releases_tags, releases_tags_fastcomp = load_releases_tags()
2301+
releases_tags = load_releases_tags()
23942302

23952303
def dependencies_exist(sdk):
23962304
for tool_name in sdk.uses:
@@ -2474,8 +2382,6 @@ def expand_category_param(param, category_list, t, is_sdk):
24742382
expand_category_param('%precompiled_tag64%', llvm_precompiled_tags_64bit, t, is_sdk=False)
24752383
elif '%binaryen_tag%' in t.version:
24762384
expand_category_param('%binaryen_tag%', binaryen_tags, t, is_sdk=False)
2477-
elif '%releases-tag%' in t.version and 'fastcomp' in t.version:
2478-
expand_category_param('%releases-tag%', releases_tags_fastcomp, t, is_sdk=False)
24792385
elif '%releases-tag%' in t.version:
24802386
expand_category_param('%releases-tag%', releases_tags, t, is_sdk=False)
24812387
else:
@@ -2496,8 +2402,6 @@ def expand_category_param(param, category_list, t, is_sdk):
24962402
expand_category_param('%precompiled_tag32%', llvm_precompiled_tags_32bit, sdk, is_sdk=True)
24972403
elif '%precompiled_tag64%' in sdk.version:
24982404
expand_category_param('%precompiled_tag64%', llvm_precompiled_tags_64bit, sdk, is_sdk=True)
2499-
elif '%releases-tag%' in sdk.version and 'fastcomp' in sdk.version:
2500-
expand_category_param('%releases-tag%', releases_tags_fastcomp, sdk, is_sdk=True)
25012405
elif '%releases-tag%' in sdk.version:
25022406
expand_category_param('%releases-tag%', releases_tags, sdk, is_sdk=True)
25032407
else:
@@ -2780,16 +2684,12 @@ def error_on_missing_tool(name):
27802684
exit_with_error("tool or SDK not found: '%s'" % name)
27812685

27822686

2783-
def exit_with_fastcomp_error():
2784-
exit_with_error('the fastcomp backend is not getting new builds or releases. Please use the upstream llvm backend or use an older version than 2.0.0 (such as 1.40.1).')
2785-
2786-
27872687
def expand_sdk_name(name, activating):
27882688
if 'upstream-master' in name:
27892689
errlog('upstream-master SDK has been renamed upstream-main')
27902690
name = name.replace('upstream-master', 'upstream-main')
2791-
if name in ('latest-fastcomp', 'latest-releases-fastcomp', 'tot-fastcomp', 'sdk-nightly-latest'):
2792-
exit_with_fastcomp_error()
2691+
if 'fastcomp' in name:
2692+
exit_with_error('the fastcomp backend is no longer supported. Please use an older version of emsdk (for example 3.1.29) if you want to install the old fastcomp-based SDK')
27932693
if name in ('tot', 'sdk-tot', 'tot-upstream'):
27942694
if activating:
27952695
# When we are activating a tot release, assume that the currently
@@ -2806,37 +2706,24 @@ def expand_sdk_name(name, activating):
28062706

28072707
# check if it's a release handled by an emscripten-releases version,
28082708
# and if so use that by using the right hash. we support a few notations,
2809-
# x.y.z[-(upstream|fastcomp_])
2810-
# sdk-x.y.z[-(upstream|fastcomp_])-64bit
2709+
# x.y.z[-upstream]
2710+
# sdk-x.y.z[-upstream]-64bit
28112711
# TODO: support short notation for old builds too?
2812-
backend = None
2712+
backend = 'upstream'
28132713
fullname = name
28142714
if '-upstream' in fullname:
28152715
fullname = name.replace('-upstream', '')
2816-
backend = 'upstream'
2817-
elif '-fastcomp' in fullname:
2818-
fullname = fullname.replace('-fastcomp', '')
2819-
backend = 'fastcomp'
28202716
version = fullname.replace('sdk-', '').replace('releases-', '').replace('-64bit', '').replace('tag-', '')
28212717
sdk = 'sdk-' if not name.startswith('releases-') else ''
28222718
releases_info = load_releases_info()['releases']
28232719
release_hash = get_release_hash(version, releases_info)
28242720
if release_hash:
28252721
# Known release hash
2826-
if backend == 'fastcomp' and version_key(version) >= (2, 0, 0):
2827-
exit_with_fastcomp_error()
2828-
if backend is None:
2829-
if version_key(version) >= (1, 39, 0):
2830-
backend = 'upstream'
2831-
else:
2832-
backend = 'fastcomp'
28332722
full_name = '%sreleases-%s-%s-64bit' % (sdk, backend, release_hash)
28342723
print("Resolving SDK version '%s' to '%s'" % (version, full_name))
28352724
return full_name
28362725

28372726
if len(version) == 40:
2838-
if backend is None:
2839-
backend = 'upstream'
28402727
global extra_release_tag
28412728
extra_release_tag = version
28422729
return '%sreleases-%s-%s-64bit' % (sdk, backend, version)

0 commit comments

Comments
 (0)