Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emsdk@3.1.8 #2015

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions modules/emsdk/3.1.8/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module(
name = "emsdk",
version = "3.1.8",
compatibility_level = 1,
)

bazel_dep(
name = "platforms",
version = "0.0.9",
)
bazel_dep(
name = "rules_cc",
version = "0.0.9",
)
# -- bazel_dep definitions -- #

emscripten_deps_ext = use_extension("//:emscripten_deps.bzl", "emscripten_deps_ext")
use_repo(
emscripten_deps_ext,
"emscripten_bin_linux",
"emscripten_bin_mac",
"emscripten_bin_mac_arm64",
"emscripten_bin_win",
)
103 changes: 103 additions & 0 deletions modules/emsdk/3.1.8/patches/emsdk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
diff --git a/BUILD b/BUILD
index dfec803..da43b2e 100644
--- a/BUILD
+++ b/BUILD
@@ -45,13 +45,3 @@ alias(
}),
)

-alias(
- name = "node_modules",
- actual = select({
- ":linux": "@emscripten_npm_linux//:node_modules",
- ":macos": "@emscripten_npm_mac//:node_modules",
- ":macos_arm64": "@emscripten_npm_mac//:node_modules",
- ":windows": "@emscripten_npm_win//:node_modules",
- "//conditions:default": ":empty",
- }),
-)
diff --git a/emscripten_deps.bzl b/emscripten_deps.bzl
index 95801ba..f70749d 100644
--- a/emscripten_deps.bzl
+++ b/emscripten_deps.bzl
@@ -1,5 +1,4 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-load("@build_bazel_rules_nodejs//:index.bzl", "npm_install", "node_repositories")
load(":revisions.bzl", "EMSCRIPTEN_TAGS")

def _parse_version(v):
@@ -24,11 +23,6 @@ def emscripten_deps(emscripten_version = "latest"):
# This could potentially backfire for projects with multiple emscripten
# dependencies that use different emscripten versions
excludes = native.existing_rules().keys()
- if "nodejs_toolchains" not in excludes:
- # Node 16 is the first version that supports darwin_arm64
- node_repositories(
- node_version = "16.6.2",
- )

if "emscripten_bin_linux" not in excludes:
http_archive(
@@ -70,30 +64,6 @@ def emscripten_deps(emscripten_version = "latest"):
type = "zip",
)

- if "emscripten_npm_linux" not in excludes:
- npm_install(
- name = "emscripten_npm_linux",
- package_json = "@emscripten_bin_linux//:emscripten/package.json",
- package_lock_json = "@emscripten_bin_linux//:emscripten/package-lock.json",
- )
-
- if "emscripten_npm_mac" not in excludes:
- npm_install(
- name = "emscripten_npm_mac",
- package_json = "@emscripten_bin_mac//:emscripten/package.json",
- package_lock_json = "@emscripten_bin_mac//:emscripten/package-lock.json",
- )
-
- if "emscripten_npm_mac_arm64" not in excludes:
- npm_install(
- name = "emscripten_npm_mac",
- package_json = "@emscripten_bin_mac_arm64//:emscripten/package.json",
- package_lock_json = "@emscripten_bin_mac_arm64//:emscripten/package-lock.json",
- )
-
- if "emscripten_npm_win" not in excludes:
- npm_install(
- name = "emscripten_npm_win",
- package_json = "@emscripten_bin_win//:emscripten/package.json",
- package_lock_json = "@emscripten_bin_win//:emscripten/package-lock.json",
- )
+emscripten_deps_ext = module_extension(
+ implementation = lambda x: emscripten_deps(),
+)
diff --git a/emscripten_toolchain/BUILD.bazel b/emscripten_toolchain/BUILD.bazel
index eb36959..9c4ec77 100644
--- a/emscripten_toolchain/BUILD.bazel
+++ b/emscripten_toolchain/BUILD.bazel
@@ -13,8 +13,6 @@ filegroup(
"env.sh",
"env.bat",
"@emsdk//:binaries",
- "@emsdk//:node_modules",
- "@nodejs//:node_files",
],
)

@@ -31,7 +29,6 @@ filegroup(
"link_wrapper.py",
":common-script-includes",
"@emsdk//:binaries",
- "@nodejs//:node_files",
],
)

@@ -41,7 +38,6 @@ filegroup(
":compile-emscripten",
":link-emscripten",
"@emsdk//:binaries",
- "@nodejs//:node_files",
],
)

27 changes: 27 additions & 0 deletions modules/emsdk/3.1.8/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- a/MODULE.bazel
+++ a/MODULE.bazel
@@ -0,0 +1,24 @@
+module(
+ name = "emsdk",
+ version = "3.1.8",
+ compatibility_level = 1,
+)
+
+bazel_dep(
+ name = "platforms",
+ version = "0.0.9",
+)
+bazel_dep(
+ name = "rules_cc",
+ version = "0.0.9",
+)
+# -- bazel_dep definitions -- #
+
+emscripten_deps_ext = use_extension("//:emscripten_deps.bzl", "emscripten_deps_ext")
+use_repo(
+ emscripten_deps_ext,
+ "emscripten_bin_linux",
+ "emscripten_bin_mac",
+ "emscripten_bin_mac_arm64",
+ "emscripten_bin_win",
+)
17 changes: 17 additions & 0 deletions modules/emsdk/3.1.8/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@emsdk//...'
10 changes: 10 additions & 0 deletions modules/emsdk/3.1.8/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.8.tar.gz",
"integrity": "sha256-mOKlta79a+uCZZkc3eKZL06sGqy61S2kJfh3uCPelWA=",
"strip_prefix": "emsdk-3.1.8/bazel",
"patches": {
"emsdk.patch": "sha256-YQGNHmtdFmysTItA2sNZHWV/kjC2H6KMoxSV0+T6SZs=",
"module_dot_bazel.patch": "sha256-f0CuVFjCz2N3QV6K4/9GViprSUm0BFOHok4jZvzN19A="
},
"patch_strip": 1
}
16 changes: 16 additions & 0 deletions modules/emsdk/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"homepage": "http://emscripten.org",
"maintainers": [
{
"email": "bcr-maintainers@bazel.build",
"name": "No Maintainer Specified"
}
],
"repository": [
"github:emscripten-core/emsdk"
],
"versions": [
"3.1.8"
],
"yanked_versions": {}
}