Release 2.0.13 and update bazel toolchain (#694)

This change comes with fairly major change to the bazel toolchain.

- Use pre-built cache that comes with emsdk
- Mark cache as readonly using FROZEN_CACHE
- Pass `--sysroot` to match upstream emscripten change
This commit is contained in:
Sam Clegg
2021-01-29 18:25:41 -08:00
committed by GitHub
parent 2c086de21e
commit cfdcf1315b
6 changed files with 18 additions and 56 deletions

View File

@@ -70,9 +70,8 @@ def _impl(ctx):
cc_target_os = "emscripten"
emscripten_version = ctx.attr.emscripten_version
emscripten_root = "external/emscripten/" + emscripten_version
builtin_sysroot = None
builtin_sysroot = "external/emscripten/emscripten/cache/sysroot"
################################################################
# Tools
@@ -513,14 +512,7 @@ def _impl(ctx):
# Language Features
flag_set(
actions = all_cpp_compile_actions,
flags = [
"-std=gnu++17",
"-nostdinc",
"-Xclang",
"-nobuiltininc",
"-Xclang",
"-nostdsysteminc",
],
flags = ["-std=gnu++17", "-nostdinc", "-nostdinc++",],
),
# Emscripten-specific settings:
@@ -904,30 +896,10 @@ def _impl(ctx):
actions = preprocessor_compile_actions +
[ACTION_NAMES.cc_flags_make_variable],
flags = [
"-isystem",
emscripten_root + "/system/lib/libc/musl/arch/emscripten",
"-isystem",
emscripten_root + "/system/lib/libc/musl/arch/js",
"-isystem",
emscripten_root + "/system/local/include",
"-isystem",
emscripten_root + "/system/include/compat",
"-isystem",
emscripten_root + "/system/include",
"-isystem",
emscripten_root + "/system/include/libcxx",
"-isystem",
emscripten_root + "/system/lib/libcxxabi/include",
"-isystem",
emscripten_root + "/system/lib/compiler-rt/include",
"-isystem",
emscripten_root + "/system/include/libc",
"-isystem",
emscripten_root + "/system/include/gfx",
"-isystem",
emscripten_root + "/system/include/SDL",
"-isystem",
emscripten_root + "/lib/clang/12.0.0/include",
"-iwithsysroot" + "/include/c++/v1",
"-iwithsysroot" + "/include/compat",
"-iwithsysroot" + "/include",
"-isystem", "external/emscripten/lib/clang/12.0.0/include",
],
),
# Inputs and outputs
@@ -1070,18 +1042,10 @@ def _impl(ctx):
features.append(crosstool_default_flags_feature)
cxx_builtin_include_directories = [
emscripten_version + "/system/lib/libc/musl/arch/emscripten",
emscripten_version + "/system/lib/libc/musl/arch/js",
emscripten_version + "/system/local/include",
emscripten_version + "/system/include/compat",
emscripten_version + "/system/include",
emscripten_version + "/system/include/libcxx",
emscripten_version + "/system/lib/compiler-rt/include",
emscripten_version + "/system/lib/libcxxabi/include",
emscripten_version + "/system/include/libc",
emscripten_version + "/system/include/gfx",
emscripten_version + "/system/include/SDL",
emscripten_version + "/lib/clang/12.0.0/include",
"external/emscripten/emscripten/cache/sysroot/include/c++/v1",
"external/emscripten/emscripten/cache/sysroot/include/compat",
"external/emscripten/emscripten/cache/sysroot/include",
"external/emscripten/lib/clang/12.0.0/include",
]
artifact_name_patterns = []

View File

@@ -3,11 +3,10 @@ import platform
ROOT_DIR = os.environ["ROOT_DIR"]
EMSCRIPTEN_ROOT = os.environ["EMSCRIPTEN"]
LLVM_ROOT = ROOT_DIR + "/external/emscripten/bin"
EMSCRIPTEN_NATIVE_OPTIMIZER = LLVM_ROOT + "/optimizer"
BINARYEN_ROOT = ROOT_DIR + "/external/emscripten"
FROZEN_CACHE = True
system = platform.system()
nodejs_binary = "node.exe" if(system =="Windows") else "bin/node"
NODE_JS = ROOT_DIR + "/external/nodejs_{}_amd64/{}".format(system.lower(), nodejs_binary)
BINARYEN_ROOT = ROOT_DIR + "/external/emscripten"

View File

@@ -2,6 +2,4 @@
export ROOT_DIR=`(pwd -P)`
export EMSCRIPTEN=${ROOT_DIR}/external/emscripten/emscripten
export EM_CONFIG=${ROOT_DIR}/emscripten_toolchain/emscripten_config
export EM_CACHE=${ROOT_DIR}/emscripten_toolchain/cache