|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") |
| 15 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 16 | +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") |
16 | 17 |
|
17 | 18 | def wasm_dependencies(): |
18 | | - _http_archive( |
| 19 | + maybe( |
| 20 | + http_archive, |
19 | 21 | name = "emscripten_toolchain", |
20 | 22 | build_file = "@proxy_wasm_cpp_sdk//:emscripten-toolchain.BUILD", |
21 | 23 | patch_cmds = [ |
22 | | - "./emsdk install 2.0.7", |
23 | | - "./emsdk activate --embedded 2.0.7", |
| 24 | + "./emsdk install 3.1.1", |
| 25 | + "./emsdk activate --embedded 3.1.1", |
24 | 26 | ], |
25 | | - strip_prefix = "emsdk-2.0.7", |
26 | | - url = "https://github.com/emscripten-core/emsdk/archive/2.0.7.tar.gz", |
27 | | - sha256 = "ce7a5c76e8b425aca874cea329fd9ac44b203b777053453b6a37b4496c5ce34f" |
| 27 | + strip_prefix = "emsdk-3.1.1", |
| 28 | + url = "https://github.com/emscripten-core/emsdk/archive/3.1.1.tar.gz", |
| 29 | + sha256 = "3a4893f0bb8203469e1197aa235fc49ed6f5dd2d490e9244a6899a8ad860f3e6", |
28 | 30 | ) |
29 | 31 |
|
30 | | - _http_archive( |
| 32 | + maybe( |
| 33 | + http_archive, |
31 | 34 | name = "com_google_protobuf", |
32 | 35 | sha256 = "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2", |
33 | 36 | strip_prefix = "protobuf-3.17.3", |
34 | 37 | url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz", |
35 | 38 | ) |
36 | | - |
37 | | -def _http_archive(name, **kwargs): |
38 | | - existing_rule_keys = native.existing_rules().keys() |
39 | | - if name in existing_rule_keys: |
40 | | - # This repository has already been defined. |
41 | | - return |
42 | | - |
43 | | - http_archive( |
44 | | - name = name, |
45 | | - **kwargs |
46 | | - ) |
0 commit comments