Skip to content

async std unstable feature compiles wasm crates on non-wasm arch #823

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

Closed
jbr opened this issue Jun 24, 2020 · 4 comments
Closed

async std unstable feature compiles wasm crates on non-wasm arch #823

jbr opened this issue Jun 24, 2020 · 4 comments

Comments

@jbr
Copy link
Contributor

jbr commented Jun 24, 2020

Versions:

My platform:x86_64-apple-darwin
Async-std version: 1.6.2
rust version: both rustc 1.44.1 (c7087fe00 2020-06-17) and rustc 1.46.0-nightly (a8cf39911 2020-06-21)

Issue:

This line

futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }
activates if the unstable feature is enabled regardless of the target_arch. This means that crates that use the unstable feature such as http-rs/http-types and http-rs/tide have to compile web-sys and js-sys.

These are the changes to cargo tree --features unstable when commenting out that line, which shouldn't be activated on x86_64-apple-darwin. I don't assume that the fix is actually to comment this line out. Is this a cargo bug?

--- master
+++ without line 81
@@ -8,47 +8,9 @@
 ├── futures-core v0.3.5
 ├── futures-io v0.3.5
 ├── futures-timer v3.0.2
-│   ├── gloo-timers v0.2.1
-│   │   ├── futures-channel v0.3.5
-│   │   │   ├── futures-core v0.3.5
-│   │   │   └── futures-sink v0.3.5
-│   │   ├── futures-core v0.3.5
-│   │   ├── js-sys v0.3.40
-│   │   │   └── wasm-bindgen v0.2.63
-│   │   │       ├── cfg-if v0.1.10
-│   │   │       ├── serde v1.0.114
-│   │   │       ├── serde_json v1.0.55
-│   │   │       │   ├── itoa v0.4.6
-│   │   │       │   ├── ryu v1.0.5
-│   │   │       │   └── serde v1.0.114
-│   │   │       └── wasm-bindgen-macro v0.2.63
-│   │   │           ├── quote v1.0.7
-│   │   │           │   └── proc-macro2 v1.0.18
-│   │   │           │       └── unicode-xid v0.2.0
-│   │   │           └── wasm-bindgen-macro-support v0.2.63
-│   │   │               ├── proc-macro2 v1.0.18 (*)
-│   │   │               ├── quote v1.0.7 (*)
-│   │   │               ├── syn v1.0.33
-│   │   │               │   ├── proc-macro2 v1.0.18 (*)
-│   │   │               │   ├── quote v1.0.7 (*)
-│   │   │               │   └── unicode-xid v0.2.0
-│   │   │               ├── wasm-bindgen-backend v0.2.63
-│   │   │               │   ├── bumpalo v3.4.0
-│   │   │               │   ├── lazy_static v1.4.0
-│   │   │               │   ├── log v0.4.8
-│   │   │               │   │   └── cfg-if v0.1.10
-│   │   │               │   ├── proc-macro2 v1.0.18 (*)
-│   │   │               │   ├── quote v1.0.7 (*)
-│   │   │               │   ├── syn v1.0.33 (*)
-│   │   │               │   └── wasm-bindgen-shared v0.2.63
-│   │   │               └── wasm-bindgen-shared v0.2.63
-│   │   ├── wasm-bindgen v0.2.63 (*)
-│   │   └── web-sys v0.3.40
-│   │       ├── js-sys v0.3.40 (*)
-│   │       └── wasm-bindgen v0.2.63 (*)
-│   └── send_wrapper v0.4.0
 ├── kv-log-macro v1.0.6
-│   └── log v0.4.8 (*)
+│   └── log v0.4.8
+│       └── cfg-if v0.1.10
 ├── log v0.4.8 (*)
 ├── memchr v2.3.3
 ├── num_cpus v1.13.0
@@ -60,16 +22,23 @@
 └── smol v0.1.18
     ├── async-task v3.0.0
     ├── blocking v0.4.6
-    │   ├── futures-channel v0.3.5 (*)
+    │   ├── futures-channel v0.3.5
+    │   │   ├── futures-core v0.3.5
+    │   │   └── futures-sink v0.3.5
     │   ├── futures-util v0.3.5
     │   │   ├── futures-channel v0.3.5 (*)
     │   │   ├── futures-core v0.3.5
     │   │   ├── futures-io v0.3.5
     │   │   ├── futures-macro v0.3.5
     │   │   │   ├── proc-macro-hack v0.5.16
-    │   │   │   ├── proc-macro2 v1.0.18 (*)
-    │   │   │   ├── quote v1.0.7 (*)
-    │   │   │   └── syn v1.0.33 (*)
+    │   │   │   ├── proc-macro2 v1.0.18
+    │   │   │   │   └── unicode-xid v0.2.0
+    │   │   │   ├── quote v1.0.7
+    │   │   │   │   └── proc-macro2 v1.0.18 (*)
+    │   │   │   └── syn v1.0.33
+    │   │   │       ├── proc-macro2 v1.0.18 (*)
+    │   │   │       ├── quote v1.0.7 (*)
+    │   │   │       └── unicode-xid v0.2.0
     │   │   ├── futures-sink v0.3.5
     │   │   ├── futures-task v0.3.5
     │   │   │   └── once_cell v1.4.0
@@ -154,7 +123,10 @@
 │   │   ├── proc-macro2 v1.0.18 (*)
 │   │   ├── quote v1.0.7 (*)
 │   │   └── syn v1.0.33 (*)
-│   └── serde_json v1.0.55 (*)
+│   └── serde_json v1.0.55
+│       ├── itoa v0.4.6
+│       ├── ryu v1.0.5
+│       └── serde v1.0.114
 ├── futures v0.3.5
 │   ├── futures-channel v0.3.5 (*)
 │   ├── futures-core v0.3.5
@Fishrock123
Copy link
Member

Fishrock123 commented Jul 15, 2020

Since smol/async-io has its own timers implementation, do we really need futures-timer? Or can we only pull it in for wasm timers?

@dignifiedquire
Copy link
Member

we pull it in if we don’t have smol as runtime activated. unfortunately the flags are not perfect so it currently doesn‘t quite work out. we might be able to improve on this with the latest smol refactors

@nickpelone
Copy link

Gentle +1, it would be great to not have to chew through all those crates if we are not targeting wasm. (especially on my platform(OpenBSD) where rustc is still weirdly really, really, slow, like, even more so than in other places)

@dignifiedquire
Copy link
Member

should be fixed on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants