Skip to content

Commit 90d2168

Browse files
authored
(bazel) Set @platforms//os:emscripten for platform_wasm (#1363)
* (bazel) Set @platforms//os:emscripten for platform_wasm * (bazel) Set @platforms//os:emscripten for platform_wasm * (bazel) Set @platforms//os:emscripten for platform_wasm
1 parent e10826f commit 90d2168

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

bazel/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ platform(
8282
name = "platform_wasm",
8383
constraint_values = [
8484
"@platforms//cpu:wasm32",
85+
"@platforms//os:emscripten",
8586
],
8687
)
8788

bazel/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bazel_dep(name = "platforms", version = "0.0.9")

bazel/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ The SHA1 hash in the above `strip_prefix` and `url` parameters correspond to the
2626
newer versions, you'll need to update those. To make use of older versions, change the
2727
parameter of `emsdk_emscripten_deps()`. Supported versions are listed in `revisions.bzl`
2828

29+
Bazel 7+ additionally requires `platforms` dependencies in the `MODULE.bazel` file.
30+
```starlark
31+
bazel_dep(name = "platforms", version = "0.0.9")
32+
```
33+
2934

3035
## Building
3136

bazel/deps.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
33

44
def deps():
5+
maybe(
6+
http_archive,
7+
name = "platforms",
8+
urls = [
9+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz",
10+
"https://github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz",
11+
],
12+
sha256 = "5eda539c841265031c2f82d8ae7a3a6490bd62176e0c038fc469eabf91f6149b",
13+
)
514
maybe(
615
http_archive,
716
name = "bazel_skylib",

bazel/test_external/MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bazel_dep(name = "platforms", version = "0.0.9")

0 commit comments

Comments
 (0)