Skip to content
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

version 1.0.0 fails to build #6

Open
commandline-be opened this issue Sep 29, 2021 · 9 comments · May be fixed by #7
Open

version 1.0.0 fails to build #6

commandline-be opened this issue Sep 29, 2021 · 9 comments · May be fixed by #7

Comments

@commandline-be
Copy link

commandline-be commented Sep 29, 2021

Platform: Ubuntu 20.04
Requirements check:

sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1.1).


error[E0599]: no function or associated item named new_immediate found for trait object dyn Watcher in the current scope
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/linemux-0.1.3/src/events.rs:61:64
|
61 | let inner: notify::RecommendedWatcher = NotifyWatcher::new_immediate(move |res| {
| ^^^^^^^^^^^^^ function or associated item not found in dyn Watcher

error[E0308]: mismatched types
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/linemux-0.1.3/src/events.rs:90:20
|
88 | fn watch(watcher: &mut notify::RecommendedWatcher, path: impl AsRef) -> io::Result<()> {
| ---------------- this type parameter
89 | watcher
90 | .watch(path, notify::RecursiveMode::NonRecursive)
| ^^^^ expected &Path, found type parameter impl AsRef<Path>
|
= note: expected reference &Path
found type parameter impl AsRef<Path>

error[E0308]: mismatched types
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/linemux-0.1.3/src/events.rs:95:25
|
94 | fn unwatch(watcher: &mut notify::RecommendedWatcher, path: impl AsRef) -> io::Result<()> {
| ---------------- this type parameter
95 | watcher.unwatch(path).map_err(notify_to_io_error)
| ^^^^ expected &Path, found type parameter impl AsRef<Path>
|
= note: expected reference &Path
found type parameter impl AsRef<Path>

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try rustc --explain E0308.
error: could not compile linemux

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile logtail v1.0.0, intermediate artifacts can be found at /tmp/cargo-installCv5XNS

Caused by:
build failed

@happybeing
Copy link
Owner

Thanks for the report. This looks like a problem with the linemux dependency. I don't have much time to look at code atm so if anyone wants to try giving this let us know in a reply.

Otherwise I'll get to it eventually!

@commandline-be
Copy link
Author

is there a dependency history ?
should i consider simply using a different tag ?

@commandline-be
Copy link
Author

commandline-be commented Sep 29, 2021

changed linemux version = "0.1.3" to "0.2.3" for Cargo.toml and Cargo.toml.orig and now it builds, error now on termion-rs, my guess is the dependency issue now ripples onwards beyond linemux


error[E0432]: unresolved import tokio::stream
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/logtail-1.0.0/src/bin/logtail-termion.rs:18:12
|
18 | use tokio::stream::StreamExt;
| ^^^^^^ could not find stream in tokio

error[E0432]: unresolved import tokio::stream
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/logtail-1.0.0/src/bin/logtail-crossterm.rs:14:12
|
14 | use tokio::stream::StreamExt;
| ^^^^^^ could not find stream in tokio

error[E0599]: no method named next found for struct MuxedLines in the current scope
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/logtail-1.0.0/src/bin/logtail-termion.rs:92:38
|
92 | let logfiles_future = app.logfiles.next().fuse();
| ^^^^ method not found in MuxedLines
|
::: /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.17/src/stream/stream/mod.rs:250:8
|
250 | fn next(&mut self) -> Next<'_, Self>
| ---- the method is available for Box<MuxedLines> here
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a use for it:
|
14 | use futures::StreamExt;
|

error[E0599]: no method named next found for struct MuxedLines in the current scope
--> /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/logtail-1.0.0/src/bin/logtail-crossterm.rs:81:38
|
81 | let logfiles_future = app.logfiles.next().fuse();
| ^^^^ method not found in MuxedLines
|
::: /home/joris/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.17/src/stream/stream/mod.rs:250:8
|
250 | fn next(&mut self) -> Next<'_, Self>
| ---- the method is available for Box<MuxedLines> here
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a use for it:
|
14 | use futures::StreamExt;
|

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try rustc --explain E0432.
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try rustc --explain E0432.
error: could not compile logtail

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile logtail v1.0.0, intermediate artifacts can be found at /tmp/cargo-installVnlD8z

Caused by:
build failed

@happybeing
Copy link
Owner

I'd look at recent linemux releases and step back through them. IIRC we had a similar issue not long ago, but I'm not certain if it was fixed in linemux. I may have opened an issue there for it.

Sorry to be vague.

@commandline-be
Copy link
Author

2 more corrections, sorry, i don't have experience modifying code using rust or git

rewrite in both src/bin/logtail-crossterm.rs and src/bin/logtail-termion.rs

use tokio::stream::StreamExt;
as
use tokio_stream::StreamExt;

@commandline-be
Copy link
Author

logtail compiles and installs again after changing dependendy for linemux and adding dependencies for tokio-stream-ext and correcting the use of tokio::stream to tokio_stream

Cargo.toml now looks like
. . .
[dependencies.linemux]
version = "0.2.3"
. . .
[dependencies.tokio-stream]
version = "0.1.7"

[dependencies.tokio-stream-ext]
version = "0.1.5"

rewrite in both src/bin/logtail-crossterm.rs and src/bin/logtail-termion.rs

use tokio::stream::StreamExt;
as
use tokio_stream::StreamExt;

@commandline-be
Copy link
Author

Damn. I've not tested. This i fail to understand / resolve. I don't have time to dig into the code here at this point. Neither do i think i can make meaningful observations due to a lack of experience and understanding.

logtail file1 file2

Loading 2 files...
file: .bash_logout
thread 'main' panicked at 'requires the rt Tokio feature flag', /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.12.0/src/blocking.rs:18:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@happybeing
Copy link
Owner

Looks like useful progress thanks. You can enable features like the rt asked for there in Cargo.toml (I forget the syntax but there might be an example there). No worries if you want to leave it at that, I may find time to look at it over the next days. Thanks for having a go.

@commandline-be
Copy link
Author

commandline-be commented Sep 29, 2021

Tried a bit more, no progress. The code for blocking.rs has two main fuctions/macros(?)

one is cfg_rt! and the other is cfg_not_rt!

the latter is where the message 'requires the rt Tokio feature flag' originates from.

I don't see where blocking.rs is called from in the first place to arrive at this condition.

My assumption is i may have skipped a few releases in the Cargo.toml modifications and this breaks stuff.

@jmagnuson jmagnuson linked a pull request Oct 9, 2021 that will close this issue
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.

2 participants