rust-pcap / pcap

Rust language pcap library
Apache License 2.0
620 stars 144 forks source link

Upgrade to use Tokio 1.0 #170

Closed DanielRussell closed 3 years ago

DanielRussell commented 3 years ago
DanielRussell commented 3 years ago

I think CI is failing because Tokio minimum supported version is 1.45 and CI uses 1.40.

Wojtek242 commented 3 years ago

Thanks for PR @DanielRussell! Apologies for keeping you waiting, but I didn't have much motivation for side projects in April. I'm back now though : )

So I'm not very keen on updating the minimum rustc version across the board to 1.45 since not that many distros support it (e.g. Debian Buster is on 1.41). At the same time I don't see much reason to support tokio 0.2 now that there is a 1.0 version.

Therefore, I'd rather require rustc 1.45 only for the optional capture-stream feature. This is actually quite straightforward to achieve using the GitHub workflows. Here's a commit you can cherry-pick: https://github.com/ebfull/pcap/pull/172/commits/ccfcde4b11d941b443c2de9ab8983b03157aa6fd (it's not merged into master).

Could you please incorporate that commit with the version split into your PR then? I've looked at the rest of the code and it looks fine to me.

DanielRussell commented 3 years ago

Welcome back!

Great idea and solution @Wojtek242, thank you for laying out your thought process.

I think your patch mismatched the toolchain and features, so I updated. I also removed tokio as a dev-dependency so the crate will build on 1.40.

Wojtek242 commented 3 years ago

They're not actually mismatched. Those are excluded workflows. What I wanted to do is to exclude --features full if the version is 1.40.0 (and vice versa for 1.45.0). I've enabled the workflow to run and as you can see they fail.

Perhaps adding a comment to clarify this would help the next person working with these files.

DanielRussell commented 3 years ago

Whoops! Now that I look, the exclude: and include: are clear -- I should have read the file more closely. I made a small change to the comment that may make things more obvious for anyone who isn't reading the steps carefully.

Wojtek242 commented 3 years ago

Great, thanks for the PR!

Stargateur commented 3 years ago

@DanielRussell https://github.com/ebfull/pcap/issues/187 ?