diff options
-rw-r--r-- | BUILD.gn | 17 | ||||
-rw-r--r-- | build_extra/rust/BUILD.gn | 114 | ||||
m--------- | third_party | 0 |
3 files changed, 118 insertions, 13 deletions
@@ -60,10 +60,12 @@ main_extern = [ "$rust_build:futures", "$rust_build:idna", "$rust_build:iovec", + "$rust_build:kernel32", "$rust_build:lazy_static", "$rust_build:lazycell", "$rust_build:memoffset", "$rust_build:mio", + "$rust_build:miow", "$rust_build:net2", "$rust_build:nodrop", "$rust_build:num_cpus", @@ -85,11 +87,24 @@ main_extern = [ "$rust_build:unicode_bidi", "$rust_build:unicode_normalization", "$rust_build:winapi", + "$rust_build:ws2_32", +] + +# Old version of the 'winapi' crate, required by 'mio', 'miow', and 'iovec'. +# This exceptional! Generally we don't allow multiple versions of a crate. +# TODO: Remove this dependency. https://github.com/denoland/deno/issues/484 +main_extern_version = [ + { + label = "$rust_build:winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, ] rust_executable("deno") { source_root = "src/main.rs" extern = main_extern + extern_version = main_extern_version deps = [ ":libdeno", ] @@ -102,6 +117,7 @@ rust_executable("deno") { rust_executable("deno_ns") { source_root = "src/main.rs" extern = main_extern + extern_version = main_extern_version deps = [ ":libdeno_nosnapshot", ] @@ -110,6 +126,7 @@ rust_executable("deno_ns") { rust_test("test_rs") { source_root = "src/main.rs" extern = main_extern + extern_version = main_extern_version deps = [ ":libdeno", ] diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index 81613673b..b529f2f5a 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -83,17 +83,15 @@ rust_component("tempfile") { rust_component("rand") { source_root = "$registry_github/rand-0.5.4/src/lib.rs" - extern = [ - ":libc", - ":rand_core", - ] - if (is_win) { - extern += [ ":winapi" ] - } features = [ "std", "alloc", ] + extern = [ + ":libc", + ":rand_core", + ":winapi", + ] if (is_mac) { libs = [ "Security.framework" ] } @@ -105,10 +103,7 @@ rust_component("rand_core") { rust_component("remove_dir_all") { source_root = "$registry_github/remove_dir_all-0.5.1/src/lib.rs" - extern = [] - if (is_win) { - extern += [ ":winapi" ] - } + extern = [ ":winapi" ] } rust_component("winapi") { @@ -122,16 +117,21 @@ rust_component("winapi") { "fileapi", "guiddef", "handleapi", + "inaddr", + "in6addr", "ktmtypes", "libloaderapi", "lsalookup", "minwinbase", "minwindef", + "mstcpip", "ntdef", "ntsecapi", "ntstatus", "processthreadsapi", "profileapi", + "qos", + "rpcndr", "sspi", "std", "subauth", @@ -143,6 +143,45 @@ rust_component("winapi") { "winerror", "winnt", "winreg", + "winsock2", + "ws2def", + "ws2ipdef", + "ws2tcpip", + "wtypes", + "wtypesbase", + ] +} + +# Old version of the 'winapi' crate, required by 'mio', 'miow', and 'iovec'. +# This exceptional! Generally we don't allow multiple versions of a crate. +# TODO: Remove this dependency. https://github.com/denoland/deno/issues/484 +rust_component("winapi-0.2") { + crate_name = "winapi" + crate_version = "0.2" + source_root = "$registry_github/winapi-0.2.8/src/lib.rs" +} + +# TODO: Remove this crate together with crate 'winapi-0.2'. +rust_component("kernel32") { + source_root = "$registry_github/kernel32-sys-0.2.2/src/lib.rs" + extern_version = [ + { + label = ":winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, + ] +} + +# TODO: Remove this crate together with crate 'winapi-0.2'. +rust_component("ws2_32") { + source_root = "$registry_github/ws2_32-sys-0.2.1/src/lib.rs" + extern_version = [ + { + label = ":winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, ] } @@ -156,20 +195,64 @@ rust_component("futures") { rust_component("mio") { source_root = "$registry_github/mio-0.6.15/src/lib.rs" + features = [ + "default", + "with-deprecated", + ] extern = [ ":iovec", + ":kernel32", ":lazycell", + ":libc", ":log", + ":miow", ":net2", ":slab", - ":libc", ] - cfg = [ "feature=\"with-deprecated\"" ] + + # TODO: Upgrade to a current version of the 'winapi' crate. + # See https://github.com/denoland/deno/issues/484. + extern_version = [ + { + label = ":winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, + ] +} + +rust_component("miow") { + source_root = "$registry_github/miow-0.2.1/src/lib.rs" + extern = [ + ":kernel32", + ":net2", + ":ws2_32", + ] + + # TODO: Upgrade to a current version of the 'winapi' crate. + # See https://github.com/denoland/deno/issues/484. + extern_version = [ + { + label = ":winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, + ] } rust_component("iovec") { source_root = "$registry_github/iovec-0.1.2/src/lib.rs" extern = [ ":libc" ] + + # TODO: Upgrade to a current version of the 'winapi' crate. + # See https://github.com/denoland/deno/issues/484. + extern_version = [ + { + label = ":winapi-0.2" + crate_name = "winapi" + crate_version = "0.2" + }, + ] } rust_component("lazycell") { @@ -178,9 +261,14 @@ rust_component("lazycell") { rust_component("net2") { source_root = "$registry_github/net2-0.2.33/src/lib.rs" + features = [ + "default", + "duration", + ] extern = [ ":cfg_if", ":libc", + ":winapi", ] } diff --git a/third_party b/third_party -Subproject 5e912f7b808e3bb1cef7310d0412fdcb79b08fe +Subproject 785db4ec088750adde4f63211120ecb828fca14 |