withoutboats / romio

asynchronous networking primitives

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Current master does not build

zaharidichev opened this issue · comments

Whenever I do cargo test, I do get the following output:

   Compiling futures-util-preview v0.3.0-alpha.10
error[E0599]: no function or associated item named `get_unchecked_mut` found for type `std::pin::Pin<_>` in the current scope
  --> /Users/zaharidichev/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-preview-0.3.0-alpha.10/src/future/map.rs:19:5
   |
19 |     unsafe_unpinned!(f: Option<F>);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `std::pin::Pin<_>`
   |
   = help: did you mean `map_unchecked_mut`?
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Env:
rustc 1.33.0-nightly (adbfec229 2018-12-17)
cargo 1.33.0-nightly (2cf1f5dda 2018-12-11)

Is something broken at the moment or the problem is with my environment ?

commented

I got errors but for crate futures-core-preview:

error[E0599]: no function or associated item named `get_mut_unchecked` found for type `std::pin::Pin<_>` in the current scope
   --> /home/humbug/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-core-preview-0.3.0-alpha.10/src/stream/stream_obj.rs:218:44
    |
218 |             let mut_ref: &mut F = unsafe { Pin::get_mut_unchecked(Pin::as_mut(&mut self)) };
    |                                            ^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `std::pin::Pin<_>`

error: aborting due to 8 previous errors

Some errors occurred: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `futures-core-preview`

Yes, the Pin api changed a bit when this was merged rust-lang/rust@20d694a However I am running the same rustc version as the one running on the last build of this master branch here, and yet my build is failing while master did not fail. So I wonder whats the problem... Furthermore, what is the converntion here.. Should romio be tracking the last rust nightly ? Sorry for the noob questions, I am just exploring the async/await universe while trying to pick up rust (scala guy here... )

commented

Unfortunately while you are on nightly using nightly features and -preview-...-alpha crates this is extremely unstable.

You should use romio if you want to experiment with writing networking code using the new async/await syntax. However, romio is not directly compatible with other libraries built on top of tokio - like hyper, actix, and tower - so if you want to use those, romio might not be a good fit for you.

So far it would be great to fix this error.

I am not yet aware of the full story but it seems and update was atempted on futures-rs and then reverted... rust-lang/futures-rs@642c941 I guess its a matter of time. A bit of explanation on why this happened will be extremely educational for me :)

commented

So I downloaded master branch of futures-rs and changed it in romio/Cargo.toml:

diff --git a/Cargo.toml b/Cargo.toml
index 8312f7d..d5ac149 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,7 +31,8 @@ slab = "0.4.0"
 libc = "0.2.43"
 
 [dependencies.futures]
-version = "0.3.0-alpha.10"
+path = "../futures-rs/futures"
+#version = "0.3.0-alpha.10"
 package = "futures-preview"
 
 [dev-dependencies]

And it works. It can be a temp fix for you until futures-rs release a new version

commented

@zaharidichev A new version of futures-rs has been released.

$ cargo update
    Updating crates.io index
      Adding futures-channel-preview v0.3.0-alpha.11
      Adding futures-core-preview v0.3.0-alpha.11
      Adding futures-executor-preview v0.3.0-alpha.11
      Adding futures-io-preview v0.3.0-alpha.11
      Adding futures-preview v0.3.0-alpha.11
      Adding futures-select-macro-preview v0.3.0-alpha.11
      Adding futures-sink-preview v0.3.0-alpha.11
      Adding futures-util-preview v0.3.0-alpha.11
$ cargo build
...
   Compiling romio v0.3.0-alpha.1 (/home/kpp/romio)
warning: the feature `pin` has been stable since 1.33.0 and no longer requires an attribute to enable
  --> src/lib.rs:59:25
   |
59 | #![feature(futures_api, pin, arbitrary_self_types)]
   |                         ^^^
   |
   = note: #[warn(stable_features)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 7.56s

The issue is resolved.

The issue is resolved.

Do we need to update our declared dependency on futures or are the -alpha.Xversions treated as semver compatible?

commented

I believe you need to pin the version at the moment:

 [dependencies.futures]
version = "=0.3.0-alpha.11"

@kpp that fixes it. Thanks a lot guys !

-alpha.X are treated as semver compatible so the update should be picked up by cargo update, but it would be good to update here as well to force it since the actual futures-preview releases aren't semver compatible.

commented

#55 and #56 should allow master to build successfully again.

commented

Master should now be fixed! 🎉 -- just needs a release by @withoutboats when they're back from vacation next week.