From a284b087f3be3b08138365df743b25414f96dca4 Mon Sep 17 00:00:00 2001 From: Daan de Graaf Date: Sun, 18 Oct 2020 23:49:33 +0100 Subject: [PATCH] Add (broken) platform_specific test. This is currently trying to build for wasm, we should switch to Windows and Mac OS instead. Maybe use https://crates.io/crates/os_info? --- src/lib.rs | 1 + tests/platform_specific/Cargo.toml | 3 + .../platform_specific/cargo_dependencies.bzl | 775 ++++++++++++++++-- tests/run.sh | 5 + 4 files changed, 738 insertions(+), 46 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 34cbfb1..1dcdee6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,6 +38,7 @@ const SUPPORTED_TARGETS: &[&str] = &[ "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", + "wasm32-unknown-unknown", ]; fn default_crate_opts() -> Vec<(String, CrateOpts)> { diff --git a/tests/platform_specific/Cargo.toml b/tests/platform_specific/Cargo.toml index ac1b486..b46919b 100644 --- a/tests/platform_specific/Cargo.toml +++ b/tests/platform_specific/Cargo.toml @@ -35,3 +35,6 @@ rustc_flags = [ "--cfg=__standback_before_1_45", "--cfg=__standback_before_1_46", ] + +[package.metadata.blackjack.stdweb-internal-runtime] +build_script = true diff --git a/tests/platform_specific/cargo_dependencies.bzl b/tests/platform_specific/cargo_dependencies.bzl index a1962f5..be30c75 100644 --- a/tests/platform_specific/cargo_dependencies.bzl +++ b/tests/platform_specific/cargo_dependencies.bzl @@ -8,6 +8,81 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def cargo_dependencies(): + http_archive( + name = "crates_io_base_x_0.2.6", + url = "https://crates.io/api/v1/crates/base-x/0.2.6/download", + sha256 = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1", + strip_prefix = "base-x-0.2.6", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "base_x", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_bumpalo_3.4.0", + url = "https://crates.io/api/v1/crates/bumpalo/3.4.0/download", + sha256 = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820", + strip_prefix = "bumpalo-3.4.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "bumpalo", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = ["default"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_cfg_if_0.1.10", + url = "https://crates.io/api/v1/crates/cfg-if/0.1.10/download", + sha256 = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822", + strip_prefix = "cfg-if-0.1.10", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "cfg_if", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + http_archive( name = "crates_io_const_fn_0.4.2", url = "https://crates.io/api/v1/crates/const_fn/0.4.2/download", @@ -18,14 +93,364 @@ def cargo_dependencies(): load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "const_fn", + name = "const_fn", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "proc-macro", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_discard_1.0.4", + url = "https://crates.io/api/v1/crates/discard/1.0.4/download", + sha256 = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0", + strip_prefix = "discard-1.0.4", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "discard", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_itoa_0.4.6", + url = "https://crates.io/api/v1/crates/itoa/0.4.6/download", + sha256 = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6", + strip_prefix = "itoa-0.4.6", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "itoa", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_lazy_static_1.4.0", + url = "https://crates.io/api/v1/crates/lazy_static/1.4.0/download", + sha256 = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646", + strip_prefix = "lazy_static-1.4.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "lazy_static", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_libc_0.2.76", + url = "https://crates.io/api/v1/crates/libc/0.2.76/download", + sha256 = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3", + strip_prefix = "libc-0.2.76", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "libc", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = ["default", "std"], + rustc_flags = ["--cap-lints=allow"] + ["--cfg=libc_priv_mod_use", "--cfg=libc_union", "--cfg=libc_const_size_of", "--cfg=libc_align", "--cfg=libc_core_cvoid", "--cfg=libc_packedN", "--cfg=libc_cfg_target_vendor"], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_log_0.4.11", + url = "https://crates.io/api/v1/crates/log/0.4.11/download", + sha256 = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b", + strip_prefix = "log-0.4.11", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "log", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_cfg_if_0.1.10//:cfg_if"], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_proc_macro_hack_0.5.18", + url = "https://crates.io/api/v1/crates/proc-macro-hack/0.5.18/download", + sha256 = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598", + strip_prefix = "proc-macro-hack-0.5.18", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "proc_macro_hack", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "proc-macro", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_proc_macro2_1.0.20", + url = "https://crates.io/api/v1/crates/proc-macro2/1.0.20/download", + sha256 = "175c513d55719db99da20232b06cda8bab6b83ec2d04e3283edf0213c37c1a29", + strip_prefix = "proc-macro2-1.0.20", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "proc_macro2", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_unicode_xid_0.2.1//:unicode_xid"], + proc_macro_deps = [], + edition = "2018", + crate_features = ["default", "proc-macro"], + rustc_flags = ["--cap-lints=allow"] + ["--cfg=use_proc_macro"], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_quote_1.0.7", + url = "https://crates.io/api/v1/crates/quote/1.0.7/download", + sha256 = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37", + strip_prefix = "quote-1.0.7", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "quote", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_proc_macro2_1.0.20//:proc_macro2"], + proc_macro_deps = [], + edition = "2018", + crate_features = ["default", "proc-macro"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_rustc_version_0.2.3", + url = "https://crates.io/api/v1/crates/rustc_version/0.2.3/download", + sha256 = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a", + strip_prefix = "rustc_version-0.2.3", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "rustc_version", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_semver_0.9.0//:semver"], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_ryu_1.0.5", + url = "https://crates.io/api/v1/crates/ryu/1.0.5/download", + sha256 = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e", + strip_prefix = "ryu-1.0.5", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "ryu", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_semver_0.9.0", + url = "https://crates.io/api/v1/crates/semver/0.9.0/download", + sha256 = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403", + strip_prefix = "semver-0.9.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "semver", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_semver_parser_0.7.0//:semver_parser"], + proc_macro_deps = [], + edition = "2015", + crate_features = ["default"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_semver_parser_0.7.0", + url = "https://crates.io/api/v1/crates/semver-parser/0.7.0/download", + sha256 = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3", + strip_prefix = "semver-parser-0.7.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "semver_parser", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_serde_1.0.115", + url = "https://crates.io/api/v1/crates/serde/1.0.115/download", + sha256 = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5", + strip_prefix = "serde-1.0.115", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "serde", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = ["default", "std"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_serde_derive_1.0.115", + url = "https://crates.io/api/v1/crates/serde_derive/1.0.115/download", + sha256 = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48", + strip_prefix = "serde_derive-1.0.115", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "serde_derive", aliases = {}, srcs = glob(["**/*.rs"]), crate_type = "proc-macro", - deps = [], + deps = ["@crates_io_proc_macro2_1.0.20//:proc_macro2", "@crates_io_quote_1.0.7//:quote", "@crates_io_syn_1.0.39//:syn"], proc_macro_deps = [], - edition = "2018", - crate_features = [], + edition = "2015", + crate_features = ["default"], rustc_flags = ["--cap-lints=allow"] + [], visibility = ["//visibility:public"], ) @@ -34,24 +459,24 @@ rust_library( http_archive( - name = "crates_io_libc_0.2.76", - url = "https://crates.io/api/v1/crates/libc/0.2.76/download", - sha256 = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3", - strip_prefix = "libc-0.2.76", + name = "crates_io_serde_json_1.0.57", + url = "https://crates.io/api/v1/crates/serde_json/1.0.57/download", + sha256 = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c", + strip_prefix = "serde_json-1.0.57", type = "tar.gz", build_file_content = """ load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "libc", + name = "serde_json", aliases = {}, srcs = glob(["**/*.rs"]), crate_type = "lib", - deps = [], + deps = ["@crates_io_itoa_0.4.6//:itoa", "@crates_io_ryu_1.0.5//:ryu", "@crates_io_serde_1.0.115//:serde"], proc_macro_deps = [], - edition = "2015", + edition = "2018", crate_features = ["default", "std"], - rustc_flags = ["--cap-lints=allow"] + ["--cfg=libc_priv_mod_use", "--cfg=libc_union", "--cfg=libc_const_size_of", "--cfg=libc_align", "--cfg=libc_core_cvoid", "--cfg=libc_packedN", "--cfg=libc_cfg_target_vendor"], + rustc_flags = ["--cap-lints=allow"] + [], visibility = ["//visibility:public"], ) """, @@ -59,22 +484,22 @@ rust_library( http_archive( - name = "crates_io_proc_macro_hack_0.5.18", - url = "https://crates.io/api/v1/crates/proc-macro-hack/0.5.18/download", - sha256 = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598", - strip_prefix = "proc-macro-hack-0.5.18", + name = "crates_io_sha1_0.6.0", + url = "https://crates.io/api/v1/crates/sha1/0.6.0/download", + sha256 = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d", + strip_prefix = "sha1-0.6.0", type = "tar.gz", build_file_content = """ load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "proc_macro_hack", + name = "sha1", aliases = {}, srcs = glob(["**/*.rs"]), - crate_type = "proc-macro", + crate_type = "lib", deps = [], proc_macro_deps = [], - edition = "2018", + edition = "2015", crate_features = [], rustc_flags = ["--cap-lints=allow"] + [], visibility = ["//visibility:public"], @@ -84,24 +509,24 @@ rust_library( http_archive( - name = "crates_io_proc_macro2_1.0.20", - url = "https://crates.io/api/v1/crates/proc-macro2/1.0.20/download", - sha256 = "175c513d55719db99da20232b06cda8bab6b83ec2d04e3283edf0213c37c1a29", - strip_prefix = "proc-macro2-1.0.20", + name = "crates_io_standback_0.2.10", + url = "https://crates.io/api/v1/crates/standback/0.2.10/download", + sha256 = "33a71ea1ea5f8747d1af1979bfb7e65c3a025a70609f04ceb78425bc5adad8e6", + strip_prefix = "standback-0.2.10", type = "tar.gz", build_file_content = """ load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "proc_macro2", + name = "standback", aliases = {}, srcs = glob(["**/*.rs"]), crate_type = "lib", - deps = ["@crates_io_unicode_xid_0.2.1//:unicode_xid"], + deps = [], proc_macro_deps = [], edition = "2018", - crate_features = ["default", "proc-macro"], - rustc_flags = ["--cap-lints=allow"] + ["--cfg=use_proc_macro"], + crate_features = ["std"], + rustc_flags = ["--cap-lints=allow"] + ["--cfg=__standback_since_1_31", "--cfg=__standback_since_1_32", "--cfg=__standback_since_1_33", "--cfg=__standback_since_1_34", "--cfg=__standback_since_1_35", "--cfg=__standback_since_1_36", "--cfg=__standback_since_1_37", "--cfg=__standback_since_1_38", "--cfg=__standback_since_1_39", "--cfg=__standback_since_1_40", "--cfg=__standback_since_1_41", "--cfg=__standback_since_1_42", "--cfg=__standback_since_1_43", "--cfg=__standback_since_1_44", "--cfg=__standback_before_1_45", "--cfg=__standback_before_1_46"], visibility = ["//visibility:public"], ) """, @@ -109,23 +534,23 @@ rust_library( http_archive( - name = "crates_io_quote_1.0.7", - url = "https://crates.io/api/v1/crates/quote/1.0.7/download", - sha256 = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37", - strip_prefix = "quote-1.0.7", + name = "crates_io_stdweb_0.4.20", + url = "https://crates.io/api/v1/crates/stdweb/0.4.20/download", + sha256 = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5", + strip_prefix = "stdweb-0.4.20", type = "tar.gz", build_file_content = """ load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "quote", + name = "stdweb", aliases = {}, srcs = glob(["**/*.rs"]), crate_type = "lib", - deps = ["@crates_io_proc_macro2_1.0.20//:proc_macro2"], - proc_macro_deps = [], - edition = "2018", - crate_features = ["default", "proc-macro"], + deps = ["@crates_io_discard_1.0.4//:discard", "@crates_io_stdweb_internal_runtime_0.1.5//:stdweb_internal_runtime"] + select({"//conditions:default": [], "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown": ["@crates_io_wasm_bindgen_0.2.67//:wasm_bindgen"]}), + proc_macro_deps = ["@crates_io_stdweb_derive_0.5.3//:stdweb_derive", "@crates_io_stdweb_internal_macros_0.2.9//:stdweb_internal_macros"], + edition = "2015", + crate_features = [], rustc_flags = ["--cap-lints=allow"] + [], visibility = ["//visibility:public"], ) @@ -134,24 +559,82 @@ rust_library( http_archive( - name = "crates_io_standback_0.2.10", - url = "https://crates.io/api/v1/crates/standback/0.2.10/download", - sha256 = "33a71ea1ea5f8747d1af1979bfb7e65c3a025a70609f04ceb78425bc5adad8e6", - strip_prefix = "standback-0.2.10", + name = "crates_io_stdweb_derive_0.5.3", + url = "https://crates.io/api/v1/crates/stdweb-derive/0.5.3/download", + sha256 = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef", + strip_prefix = "stdweb-derive-0.5.3", type = "tar.gz", build_file_content = """ load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") rust_library( - name = "standback", + name = "stdweb_derive", aliases = {}, srcs = glob(["**/*.rs"]), - crate_type = "lib", + crate_type = "proc-macro", + deps = ["@crates_io_proc_macro2_1.0.20//:proc_macro2", "@crates_io_quote_1.0.7//:quote", "@crates_io_serde_1.0.115//:serde", "@crates_io_syn_1.0.39//:syn"], + proc_macro_deps = ["@crates_io_serde_derive_1.0.115//:serde_derive"], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_stdweb_internal_macros_0.2.9", + url = "https://crates.io/api/v1/crates/stdweb-internal-macros/0.2.9/download", + sha256 = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11", + strip_prefix = "stdweb-internal-macros-0.2.9", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "stdweb_internal_macros", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "proc-macro", + deps = ["@crates_io_base_x_0.2.6//:base_x", "@crates_io_proc_macro2_1.0.20//:proc_macro2", "@crates_io_quote_1.0.7//:quote", "@crates_io_serde_1.0.115//:serde", "@crates_io_serde_json_1.0.57//:serde_json", "@crates_io_sha1_0.6.0//:sha1", "@crates_io_syn_1.0.39//:syn"], + proc_macro_deps = ["@crates_io_serde_derive_1.0.115//:serde_derive"], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_stdweb_internal_runtime_0.1.5", + url = "https://crates.io/api/v1/crates/stdweb-internal-runtime/0.1.5/download", + sha256 = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0", + strip_prefix = "stdweb-internal-runtime-0.1.5", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +load("@io_bazel_rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script") + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], deps = [], +) + +rust_library( + name = "stdweb_internal_runtime", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [":build_script"], proc_macro_deps = [], - edition = "2018", - crate_features = ["std"], - rustc_flags = ["--cap-lints=allow"] + ["--cfg=__standback_since_1_31", "--cfg=__standback_since_1_32", "--cfg=__standback_since_1_33", "--cfg=__standback_since_1_34", "--cfg=__standback_since_1_35", "--cfg=__standback_since_1_36", "--cfg=__standback_since_1_37", "--cfg=__standback_since_1_38", "--cfg=__standback_since_1_39", "--cfg=__standback_since_1_40", "--cfg=__standback_since_1_41", "--cfg=__standback_since_1_42", "--cfg=__standback_since_1_43", "--cfg=__standback_since_1_44", "--cfg=__standback_before_1_45", "--cfg=__standback_before_1_46"], + edition = "2015", + crate_features = ["default"], + rustc_flags = ["--cap-lints=allow"] + [], visibility = ["//visibility:public"], ) """, @@ -197,7 +680,7 @@ rust_library( aliases = {}, srcs = glob(["**/*.rs"]), crate_type = "lib", - deps = ["@crates_io_libc_0.2.76//:libc", "@crates_io_standback_0.2.10//:standback", "@crates_io_time_macros_0.1.0//:time_macros"], + deps = ["@crates_io_standback_0.2.10//:standback", "@crates_io_time_macros_0.1.0//:time_macros"] + select({"@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu": ["@crates_io_libc_0.2.76//:libc"], "@io_bazel_rules_rust//rust/platform:i686-apple-darwin": ["@crates_io_libc_0.2.76//:libc"], "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc": ["@crates_io_winapi_0.3.9//:winapi"], "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown": ["@crates_io_stdweb_0.4.20//:stdweb"], "//conditions:default": [], "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu": ["@crates_io_libc_0.2.76//:libc"], "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc": ["@crates_io_winapi_0.3.9//:winapi"], "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin": ["@crates_io_libc_0.2.76//:libc"]}), proc_macro_deps = ["@crates_io_const_fn_0.4.2//:const_fn"], edition = "2018", crate_features = ["default", "deprecated", "libc", "std", "stdweb", "winapi"], @@ -307,3 +790,203 @@ rust_library( """, ) + + http_archive( + name = "crates_io_wasm_bindgen_0.2.67", + url = "https://crates.io/api/v1/crates/wasm-bindgen/0.2.67/download", + sha256 = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c", + strip_prefix = "wasm-bindgen-0.2.67", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "wasm_bindgen", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_cfg_if_0.1.10//:cfg_if"], + proc_macro_deps = ["@crates_io_wasm_bindgen_macro_0.2.67//:wasm_bindgen_macro"], + edition = "2018", + crate_features = ["default", "spans", "std"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_wasm_bindgen_backend_0.2.67", + url = "https://crates.io/api/v1/crates/wasm-bindgen-backend/0.2.67/download", + sha256 = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0", + strip_prefix = "wasm-bindgen-backend-0.2.67", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "wasm_bindgen_backend", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_bumpalo_3.4.0//:bumpalo", "@crates_io_lazy_static_1.4.0//:lazy_static", "@crates_io_log_0.4.11//:log", "@crates_io_proc_macro2_1.0.20//:proc_macro2", "@crates_io_quote_1.0.7//:quote", "@crates_io_syn_1.0.39//:syn", "@crates_io_wasm_bindgen_shared_0.2.67//:wasm_bindgen_shared"], + proc_macro_deps = [], + edition = "2018", + crate_features = ["spans"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_wasm_bindgen_macro_0.2.67", + url = "https://crates.io/api/v1/crates/wasm-bindgen-macro/0.2.67/download", + sha256 = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2", + strip_prefix = "wasm-bindgen-macro-0.2.67", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "wasm_bindgen_macro", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "proc-macro", + deps = ["@crates_io_quote_1.0.7//:quote", "@crates_io_wasm_bindgen_macro_support_0.2.67//:wasm_bindgen_macro_support"], + proc_macro_deps = [], + edition = "2018", + crate_features = ["spans"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_wasm_bindgen_macro_support_0.2.67", + url = "https://crates.io/api/v1/crates/wasm-bindgen-macro-support/0.2.67/download", + sha256 = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556", + strip_prefix = "wasm-bindgen-macro-support-0.2.67", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "wasm_bindgen_macro_support", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = ["@crates_io_proc_macro2_1.0.20//:proc_macro2", "@crates_io_quote_1.0.7//:quote", "@crates_io_syn_1.0.39//:syn", "@crates_io_wasm_bindgen_backend_0.2.67//:wasm_bindgen_backend", "@crates_io_wasm_bindgen_shared_0.2.67//:wasm_bindgen_shared"], + proc_macro_deps = [], + edition = "2018", + crate_features = ["spans"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_wasm_bindgen_shared_0.2.67", + url = "https://crates.io/api/v1/crates/wasm-bindgen-shared/0.2.67/download", + sha256 = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092", + strip_prefix = "wasm-bindgen-shared-0.2.67", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "wasm_bindgen_shared", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2018", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_winapi_0.3.9", + url = "https://crates.io/api/v1/crates/winapi/0.3.9/download", + sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419", + strip_prefix = "winapi-0.3.9", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "winapi", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [] + select({"@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-gnu": ["@crates_io_winapi_x86_64_pc_windows_gnu_0.4.0//:winapi_x86_64_pc_windows_gnu"], "@io_bazel_rules_rust//rust/platform:i686-pc-windows-gnu": ["@crates_io_winapi_i686_pc_windows_gnu_0.4.0//:winapi_i686_pc_windows_gnu"], "//conditions:default": []}), + proc_macro_deps = [], + edition = "2015", + crate_features = ["minwinbase", "minwindef", "timezoneapi"], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_winapi_i686_pc_windows_gnu_0.4.0", + url = "https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download", + sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6", + strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "winapi_i686_pc_windows_gnu", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + + + http_archive( + name = "crates_io_winapi_x86_64_pc_windows_gnu_0.4.0", + url = "https://crates.io/api/v1/crates/winapi-x86_64-pc-windows-gnu/0.4.0/download", + sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f", + strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0", + type = "tar.gz", + build_file_content = """ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "winapi_x86_64_pc_windows_gnu", + aliases = {}, + srcs = glob(["**/*.rs"]), + crate_type = "lib", + deps = [], + proc_macro_deps = [], + edition = "2015", + crate_features = [], + rustc_flags = ["--cap-lints=allow"] + [], + visibility = ["//visibility:public"], +) + """, + ) + diff --git a/tests/run.sh b/tests/run.sh index 492c4be..e3f7935 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -19,3 +19,8 @@ echo | bazel run //:blackjack bazel run //crate1 bazel run //crate2 popd + +pushd tests/platform_specific +echo | bazel run //:blackjack +bazel build --platforms=@io_bazel_rules_rust//rust/platform:wasm //:crates +popd