Skip to content

Commit

Permalink
(bazel) Set @platforms//os:emscripten for platform_wasm (#1363)
Browse files Browse the repository at this point in the history
* (bazel) Set @platforms//os:emscripten for platform_wasm

* (bazel) Set @platforms//os:emscripten for platform_wasm

* (bazel) Set @platforms//os:emscripten for platform_wasm
  • Loading branch information
trzeciak authored Apr 4, 2024
1 parent e10826f commit 90d2168
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ platform(
name = "platform_wasm",
constraint_values = [
"@platforms//cpu:wasm32",
"@platforms//os:emscripten",
],
)

Expand Down
1 change: 1 addition & 0 deletions bazel/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel_dep(name = "platforms", version = "0.0.9")
5 changes: 5 additions & 0 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ The SHA1 hash in the above `strip_prefix` and `url` parameters correspond to the
newer versions, you'll need to update those. To make use of older versions, change the
parameter of `emsdk_emscripten_deps()`. Supported versions are listed in `revisions.bzl`

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


## Building

Expand Down
9 changes: 9 additions & 0 deletions bazel/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def deps():
maybe(
http_archive,
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz",
],
sha256 = "5eda539c841265031c2f82d8ae7a3a6490bd62176e0c038fc469eabf91f6149b",
)
maybe(
http_archive,
name = "bazel_skylib",
Expand Down
1 change: 1 addition & 0 deletions bazel/test_external/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel_dep(name = "platforms", version = "0.0.9")

0 comments on commit 90d2168

Please sign in to comment.