Skip to content

Commit 2546ad2

Browse files
sstricklcommit-bot@chromium.org
authored andcommitted
Revert "[vm/wasm] Boilerplate for package:wasm"
This reverts commit 2bafc32. Reason for revert: Build failures on Flutter HHH CI bots and golem (Dart VM ARMv8, Flutter). Original change's description: > [vm/wasm] Boilerplate for package:wasm > > So far this just builds the wasmer library, copies it into the sdk > directory, loads the library, and allows you to compile WASM modules. > You can't actually do anything with the modules yet. > > Bug: #37882 > Change-Id: I7d7cfe5721bbe38a6afe76f326518e714d236ed4 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158367 > Commit-Queue: Liam Appelbe <[email protected]> > Reviewed-by: Ryan Macnak <[email protected]> [email protected],[email protected],[email protected] Change-Id: I2c5b390987bf45704a3de98e050f4bcf1cb235d8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: #37882 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159243 Reviewed-by: Tess Strickland <[email protected]> Commit-Queue: Tess Strickland <[email protected]>
1 parent 37c1da6 commit 2546ad2

19 files changed

+26
-279
lines changed

.dart_tool/package_config.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2020-08-18T11:26:08.472483",
14+
"generated": "2020-08-17T14:05:33.104579",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -515,7 +515,7 @@
515515
"name": "shelf",
516516
"rootUri": "../third_party/pkg/shelf",
517517
"packageUri": "lib/",
518-
"languageVersion": "2.1"
518+
"languageVersion": "2.0"
519519
},
520520
{
521521
"name": "shelf_packages_handler",
@@ -715,12 +715,6 @@
715715
"packageUri": "lib/",
716716
"languageVersion": "2.8"
717717
},
718-
{
719-
"name": "wasm",
720-
"rootUri": "../pkg/wasm",
721-
"packageUri": "lib/",
722-
"languageVersion": "2.6"
723-
},
724718
{
725719
"name": "watcher",
726720
"rootUri": "../third_party/pkg/watcher",

.packages

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ vector_math:third_party/pkg/vector_math/lib
116116
vm:pkg/vm/lib
117117
vm_service:pkg/vm_service/lib
118118
vm_snapshot_analysis:pkg/vm_snapshot_analysis/lib
119-
wasm:pkg/wasm/lib
120119
watcher:third_party/pkg/watcher/lib
121120
webdriver:third_party/pkg/webdriver/lib
122121
web_components:third_party/pkg/web_components/lib

DEPS

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ vars = {
133133
"quiver-dart_tag": "246e754fe45cecb6aa5f3f13b4ed61037ff0d784",
134134
"resource_rev": "f8e37558a1c4f54550aa463b88a6a831e3e33cd6",
135135
"root_certificates_rev": "16ef64be64c7dfdff2b9f4b910726e635ccc519e",
136-
"rust_revision": "cbe7c5ce705896d4e22bf6096590bc1f17993b78",
136+
"rust_revision": "60960a260f7b5c695fd0717311d72ce62dd4eb43",
137137
"shelf_static_rev": "v0.2.8",
138138
"shelf_packages_handler_tag": "2.0.0",
139139
"shelf_proxy_tag": "0.1.0+7",

build/rust/rust.gni

+12-73
Original file line numberDiff line numberDiff line change
@@ -8,95 +8,34 @@ template("rust_library") {
88
manifest = invoker.manifest
99
}
1010

11-
debug = defined(invoker.debug) && invoker.debug
12-
shared = defined(invoker.shared) && invoker.shared
13-
1411
cmd = [
15-
rebase_path("//buildtools/${host_os}-${host_cpu}/rust/bin/cargo"),
12+
rebase_path("//buildtools/${current_os}-${current_cpu}/rust/bin/cargo"),
1613
"build",
1714
"--target-dir",
1815
rebase_path(target_out_dir),
1916
"--manifest-path",
2017
manifest,
2118
]
19+
output = "$target_out_dir/lib${invoker.lib_name}.a"
20+
debug = defined(invoker.debug) && invoker.debug
2221

23-
# For cross compilation, figure out the target triple. You can get a full list
24-
# of the targets that rust supports like this: rustc --print target-list
25-
cargo_out_dir = target_out_dir
26-
if (is_linux) {
27-
rust_os = "unknown-linux-gnu"
28-
} else if (is_mac) {
29-
rust_os = "apple-darwin"
30-
} else if (is_win) {
31-
rust_os = "pc-windows-gnu"
32-
} else if (is_android) {
33-
rust_os = "linux-android"
34-
} else if (is_fuchsia) {
35-
rust_os = "fuchsia"
36-
}
37-
if (defined(rust_os)) {
38-
if (current_cpu == "x86") {
39-
rust_target = "i686-${rust_os}"
40-
} else if (current_cpu == "x64") {
41-
rust_target = "x86_64-${rust_os}"
42-
} else if (current_cpu == "arm") {
43-
rust_target = "arm-${rust_os}eabi"
44-
} else if (current_cpu == "arm64") {
45-
rust_target = "aarch64-${rust_os}"
46-
}
47-
}
48-
if (defined(rust_target)) {
49-
cmd += [
50-
"--target",
51-
rust_target,
52-
]
53-
cargo_out_dir += "/${rust_target}"
54-
}
55-
56-
if (debug) {
57-
cargo_out_dir += "/debug"
58-
} else {
59-
cargo_out_dir += "/release"
22+
if (!debug) {
6023
cmd += [ "--release" ]
6124
}
6225

63-
output_file = ""
64-
if (shared) {
65-
if (is_win) {
66-
output_file = "${invoker.lib_name}.dll"
67-
} else if (is_mac) {
68-
output_file = "lib${invoker.lib_name}.dylib"
69-
} else {
70-
output_file = "lib${invoker.lib_name}.so"
71-
}
72-
} else {
73-
if (is_win) {
74-
output_file = "${invoker.lib_name}.lib"
75-
}else {
76-
output_file = "lib${invoker.lib_name}.a"
77-
}
78-
}
79-
80-
action("${target_name}_cargo") {
26+
action(target_name) {
8127
script = "//build/rust/run.py"
8228
args = cmd
83-
outputs = [ "${cargo_out_dir}/${output_file}" ]
29+
outputs = [ output ]
8430
public_configs = [ ":${target_name}_config" ]
8531
}
8632

87-
config("${target_name}_cargo_config") {
88-
if (!shared) {
89-
libs = [ invoker.lib_name ]
90-
lib_dirs = [ out_dir ]
33+
config("${target_name}_config") {
34+
libs = [ "wasmer" ]
35+
if (debug) {
36+
lib_dirs = [ "$target_out_dir/debug" ]
37+
} else {
38+
lib_dirs = [ "$target_out_dir/release" ]
9139
}
9240
}
93-
94-
# Cargo leaves the library in cargo_out_dir, which varies based on the target.
95-
# So we need to copy it to target_out_dir to make it easier for dependees to
96-
# locate the library.
97-
copy(target_name) {
98-
deps = [ ":${target_name}_cargo" ]
99-
sources = [ "${cargo_out_dir}/${output_file}" ]
100-
outputs = [ "${target_out_dir}/${output_file}" ]
101-
}
10241
}

pkg/wasm/.gitignore

-3
This file was deleted.

pkg/wasm/AUTHORS

-6
This file was deleted.

pkg/wasm/LICENSE

-26
This file was deleted.

pkg/wasm/README.md

-4
This file was deleted.

pkg/wasm/analysis_options.yaml

-1
This file was deleted.

pkg/wasm/lib/module.dart

-15
This file was deleted.

pkg/wasm/lib/runtime.dart

-101
This file was deleted.

pkg/wasm/lib/wasm.dart

-5
This file was deleted.

pkg/wasm/pubspec.yaml

-12
This file was deleted.

runtime/BUILD.gn

+4
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ library_for_all_configs("libdart") {
221221
":generate_version_cc_file",
222222
"third_party/double-conversion/src:libdouble_conversion",
223223
]
224+
if (dart_enable_wasm) {
225+
extra_deps += [ "//third_party/wasmer" ]
226+
defines = [ "DART_ENABLE_WASM" ]
227+
}
224228
if (is_fuchsia) {
225229
if (using_fuchsia_gn_sdk) {
226230
extra_deps += [

runtime/runtime_args.gni

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ declare_args() {
9090

9191
# Whether libdart should export the symbols of the Dart API.
9292
dart_lib_export_symbols = true
93+
94+
# Whether dart:wasm should be enabled.
95+
dart_enable_wasm = false
9396
}
9497

9598
declare_args() {

runtime/vm/BUILD.gn

+3
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ library_for_all_configs("libdart_lib") {
156156
]
157157
}
158158
}
159+
if (dart_enable_wasm) {
160+
defines = [ "DART_ENABLE_WASM" ]
161+
}
159162
include_dirs = [ ".." ]
160163
allsources = async_runtime_cc_files + collection_runtime_cc_files +
161164
core_runtime_cc_files + developer_runtime_cc_files +

0 commit comments

Comments
 (0)