From a66017f04985f5e7b7cb981e370e78a7291a5537 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Wed, 23 Dec 2020 09:26:14 -0800 Subject: [PATCH] chore: prepare Tokio 1.0 release (#3319) --- README.md | 1 - ROADMAP.md | 67 --------------------------------------- tokio-macros/CHANGELOG.md | 4 +++ tokio-macros/Cargo.toml | 3 +- tokio-macros/LICENSE | 2 +- tokio-macros/src/lib.rs | 50 ++++++++++++++--------------- tokio-stream/CHANGELOG.md | 3 ++ tokio-stream/Cargo.toml | 1 - tokio-stream/LICENSE | 25 +++++++++++++++ tokio-test/CHANGELOG.md | 4 +++ tokio-test/Cargo.toml | 1 - tokio-test/LICENSE | 2 +- tokio-util/CHANGELOG.md | 8 +++++ tokio-util/Cargo.toml | 3 +- tokio-util/LICENSE | 2 +- tokio/CHANGELOG.md | 50 +++++++++++++++++++++++++++++ tokio/Cargo.toml | 1 - tokio/LICENSE | 2 +- tokio/src/io/mod.rs | 8 ++--- tokio/src/lib.rs | 6 ++-- 20 files changed, 131 insertions(+), 112 deletions(-) delete mode 100644 ROADMAP.md create mode 100644 tokio-stream/CHANGELOG.md create mode 100644 tokio-stream/LICENSE diff --git a/README.md b/README.md index ecc87018ced..9250e9afcc8 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,6 @@ the Rust programming language. It is: [Website](https://tokio.rs) | [Guides](https://tokio.rs/tokio/tutorial) | [API Docs](https://docs.rs/tokio/latest/tokio) | -[Roadmap](https://github.com/tokio-rs/tokio/blob/master/ROADMAP.md) | [Chat](https://discord.gg/tokio) ## Overview diff --git a/ROADMAP.md b/ROADMAP.md deleted file mode 100644 index 0c0069d7a24..00000000000 --- a/ROADMAP.md +++ /dev/null @@ -1,67 +0,0 @@ -# Tokio Roadmap - -## A Roadmap to 1.0 - -The question of "why not 1.0?" has come up a few times. After all, Tokio 0.1 has -been stable for three years. The short answer: because it isn't time. There is -nobody who would rather ship a Tokio 1.0 than us. It also isn't something to rush. - -After all, `async / await` only landed in the stable Rust channel weeks ago. -There has been no significant production validation yet, except maybe fuchsia -and that seems like a fairly specialized use case. This release of Tokio -includes significant new code and new strategies with feature flags. Also, there -are still big open questions, such as the [proposed changes][pr-1744] to -`AsyncRead` and `AsyncWrite`. - -Tokio 1.0 will be released as soon as the APIs are proven to handle real-world -production cases. - -### Tokio 1.0 in Q3 2020 with LTS support - -The Tokio 1.0 release will be **no later** than Q3 2020. It will also come with -"long-term support" guarantees: - -* A minimum of 5 years of maintenance. -* A minimum of 3 years before a hypothetical 2.0 release. - -When Tokio 1.0 is released in Q3 2020, on-going support, security fixes, and -critical bug fixes are guaranteed until **at least** Q3 2025. Tokio 2.0 will not -be released until **at least** Q3 2023 (though, ideally there will never be a -Tokio 2.0 release). - -### How to get there - -While Tokio 0.1 probably should have been a 1.0, Tokio 0.2 will be a **true** -0.2 release. There will be breaking change releases every 2 ~ 3 months until 1.0. -These changes will be **much** smaller than going from 0.1 -> 0.2. It is -expected that the 1.0 release will look a lot like 0.2. - -### What is expected to change - -The biggest change will be the `AsyncRead` and `AsyncWrite` traits. Based on -experience gained over the past 3 years, there are a couple of issues to -address: - -* Be able to **safely** use uninitialized memory as a read buffer. -* Practical read vectored and write vectored APIs. - -There are a few strategies to solve these problems. These strategies need to be -investigated and the solution validated. You can see [this comment][pr-1744-comment] for a -detailed statement of the problem. - -The other major change, which has been in the works for a while, is updating -Mio. Mio 0.6 was first released almost 4 years ago and has not had a breaking -change since. Mio 0.7 has been in the works for a while. It includes a full -rewrite of the windows support as well as a refined API. More will be written -about this shortly. - -Finally, now that the API is starting to stabilize, effort will be put into -documentation. Tokio 0.2 is being released before updating the website and many -of the old content will no longer be relevant. In the coming weeks, expect to -see updates there. - -So, we have our work cut out for us. We hope you enjoy this 0.2 release and are -looking forward to your feedback and help. - -[pr-1744]: https://github.com/tokio-rs/tokio/pull/1744 -[pr-1744-comment]: https://github.com/tokio-rs/tokio/pull/1744#issuecomment-553575438 diff --git a/tokio-macros/CHANGELOG.md b/tokio-macros/CHANGELOG.md index 50dfc39ab96..26ee5eaa93d 100644 --- a/tokio-macros/CHANGELOG.md +++ b/tokio-macros/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.0.0 (December 23, 2020) + +- track `tokio` 1.0 release. + # 0.3.1 (October 25, 2020) ### Fixed diff --git a/tokio-macros/Cargo.toml b/tokio-macros/Cargo.toml index f7ed01eb3cb..fa2568c535d 100644 --- a/tokio-macros/Cargo.toml +++ b/tokio-macros/Cargo.toml @@ -13,12 +13,11 @@ authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-macros/0.3.1/tokio_macros" +documentation = "https://docs.rs/tokio-macros/1.0.0/tokio_macros" description = """ Tokio's proc macros. """ categories = ["asynchronous"] -publish = false [lib] proc-macro = true diff --git a/tokio-macros/LICENSE b/tokio-macros/LICENSE index 0fbb7399f5a..6c6df9c4d69 100644 --- a/tokio-macros/LICENSE +++ b/tokio-macros/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019 Tokio Contributors +Copyright (c) 2020 Tokio Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index 120d35ad4a7..b48bd004967 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -24,8 +24,8 @@ mod select; use proc_macro::TokenStream; -/// Marks async function to be executed by the selected runtime. This macro helps -/// set up a `Runtime` without requiring the user to use +/// Marks async function to be executed by the selected runtime. This macro +/// helps set up a `Runtime` without requiring the user to use /// [Runtime](../tokio/runtime/struct.Runtime.html) or /// [Builder](../tokio/runtime/struct.Builder.html) directly. /// @@ -36,10 +36,10 @@ use proc_macro::TokenStream; /// powerful interface. /// /// Note: This macro can be used on any function and not just the `main` -/// function. Using it on a non-main function makes the function behave -/// as if it was synchronous by starting a new runtime each time it is called. -/// If the function is called often, it is preferable to create the runtime using -/// the runtime builder so the runtime can be reused across calls. +/// function. Using it on a non-main function makes the function behave as if it +/// was synchronous by starting a new runtime each time it is called. If the +/// function is called often, it is preferable to create the runtime using the +/// runtime builder so the runtime can be reused across calls. /// /// # Multi-threaded runtime /// @@ -53,7 +53,8 @@ use proc_macro::TokenStream; /// The `worker_threads` option configures the number of worker threads, and /// defaults to the number of cpus on the system. This is the default flavor. /// -/// Note: The multi-threaded runtime requires the `rt-multi-thread` feature flag. +/// Note: The multi-threaded runtime requires the `rt-multi-thread` feature +/// flag. /// /// # Current thread runtime /// @@ -145,10 +146,10 @@ use proc_macro::TokenStream; /// /// ### NOTE: /// -/// If you rename the tokio crate in your dependencies this macro will not work. -/// If you must rename the 0.3 version of tokio because you're also using the -/// 0.1 version of tokio, you _must_ make the tokio 0.3 crate available as -/// `tokio` in the module where this macro is expanded. +/// If you rename the Tokio crate in your dependencies this macro will not work. +/// If you must rename the current version of Tokio because you're also using an +/// older version of Tokio, you _must_ make the current version of Tokio +/// available as `tokio` in the module where this macro is expanded. #[proc_macro_attribute] #[cfg(not(test))] // Work around for rust-lang/rust#62127 pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { @@ -190,11 +191,10 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ### NOTE: /// -/// If you rename the tokio crate in your dependencies this macro -/// will not work. If you must rename the 0.3 version of tokio because -/// you're also using the 0.1 version of tokio, you _must_ make the -/// tokio 0.3 crate available as `tokio` in the module where this -/// macro is expanded. +/// If you rename the Tokio crate in your dependencies this macro will not work. +/// If you must rename the current version of Tokio because you're also using an +/// older version of Tokio, you _must_ make the current version of Tokio +/// available as `tokio` in the module where this macro is expanded. #[proc_macro_attribute] #[cfg(not(test))] // Work around for rust-lang/rust#62127 pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { @@ -227,11 +227,10 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ### NOTE: /// -/// If you rename the tokio crate in your dependencies this macro -/// will not work. If you must rename the 0.3 version of tokio because -/// you're also using the 0.1 version of tokio, you _must_ make the -/// tokio 0.3 crate available as `tokio` in the module where this -/// macro is expanded. +/// If you rename the Tokio crate in your dependencies this macro will not work. +/// If you must rename the current version of Tokio because you're also using an +/// older version of Tokio, you _must_ make the current version of Tokio +/// available as `tokio` in the module where this macro is expanded. #[proc_macro_attribute] pub fn test(args: TokenStream, item: TokenStream) -> TokenStream { entry::test(args, item, true) @@ -250,11 +249,10 @@ pub fn test(args: TokenStream, item: TokenStream) -> TokenStream { /// /// ### NOTE: /// -/// If you rename the tokio crate in your dependencies this macro -/// will not work. If you must rename the 0.3 version of tokio because -/// you're also using the 0.1 version of tokio, you _must_ make the -/// tokio 0.3 crate available as `tokio` in the module where this -/// macro is expanded. +/// If you rename the Tokio crate in your dependencies this macro will not work. +/// If you must rename the current version of Tokio because you're also using an +/// older version of Tokio, you _must_ make the current version of Tokio +/// available as `tokio` in the module where this macro is expanded. #[proc_macro_attribute] pub fn test_rt(args: TokenStream, item: TokenStream) -> TokenStream { entry::test(args, item, false) diff --git a/tokio-stream/CHANGELOG.md b/tokio-stream/CHANGELOG.md new file mode 100644 index 00000000000..8671dc0ca9f --- /dev/null +++ b/tokio-stream/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.1.0 (December 23, 2020) + +- Initial release \ No newline at end of file diff --git a/tokio-stream/Cargo.toml b/tokio-stream/Cargo.toml index b93d4d56820..6d28588233e 100644 --- a/tokio-stream/Cargo.toml +++ b/tokio-stream/Cargo.toml @@ -18,7 +18,6 @@ description = """ Utilities to work with `Stream` and `tokio`. """ categories = ["asynchronous"] -publish = false [features] default = ["time"] diff --git a/tokio-stream/LICENSE b/tokio-stream/LICENSE new file mode 100644 index 00000000000..243fcd6c728 --- /dev/null +++ b/tokio-stream/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2020 Tokio Contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/tokio-test/CHANGELOG.md b/tokio-test/CHANGELOG.md index 406d223e2dd..0094de608b4 100644 --- a/tokio-test/CHANGELOG.md +++ b/tokio-test/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.0 (December 23, 2020) + +- Track `tokio` 1.0 release. + # 0.3.0 (October 15, 2020) - Track `tokio` 0.3 release. diff --git a/tokio-test/Cargo.toml b/tokio-test/Cargo.toml index f6beac3497e..52e48e1fad6 100644 --- a/tokio-test/Cargo.toml +++ b/tokio-test/Cargo.toml @@ -18,7 +18,6 @@ description = """ Testing utilities for Tokio- and futures-based code """ categories = ["asynchronous", "testing"] -publish = false [dependencies] tokio = { version = "1.0.0", path = "../tokio", features = ["rt", "sync", "time", "test-util"] } diff --git a/tokio-test/LICENSE b/tokio-test/LICENSE index cdb28b4b56a..243fcd6c728 100644 --- a/tokio-test/LICENSE +++ b/tokio-test/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019 Tokio Contributors +Copyright (c) 2020 Tokio Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/tokio-util/CHANGELOG.md b/tokio-util/CHANGELOG.md index 70de1a9ba5c..460e6bcc3db 100644 --- a/tokio-util/CHANGELOG.md +++ b/tokio-util/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.6.0 (December 23, 2020) + +### Changed +- depend on `tokio` 1.0. + +### Added +- rt: add constructors to `TokioContext` (#3221). + # 0.5.1 (December 3, 2020) ### Added diff --git a/tokio-util/Cargo.toml b/tokio-util/Cargo.toml index 93b7d05dacb..72717d2106b 100644 --- a/tokio-util/Cargo.toml +++ b/tokio-util/Cargo.toml @@ -13,12 +13,11 @@ authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-util/0.5.1/tokio_util" +documentation = "https://docs.rs/tokio-util/0.6.0/tokio_util" description = """ Additional utilities for working with Tokio. """ categories = ["asynchronous"] -publish = false [features] # No features on by default diff --git a/tokio-util/LICENSE b/tokio-util/LICENSE index cdb28b4b56a..243fcd6c728 100644 --- a/tokio-util/LICENSE +++ b/tokio-util/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019 Tokio Contributors +Copyright (c) 2020 Tokio Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index b9bbd04ad65..36003701cf4 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,53 @@ +# 1.0.0 (December 23, 2020) + +Commit to the API and long-term support. + +### Fixed +- sync: spurious wakeup in `watch` (#3234). + +### Changed +- io: rename `AsyncFd::with_io()` to `try_io()` (#3306) +- fs: avoid OS specific `*Ext` traits in favor of conditionally defining the fn (#3264). +- fs: `Sleep` is `!Unpin` (#3278). +- net: pass `SocketAddr` by value (#3125). +- net: `TcpStream::poll_peek` takes `ReadBuf` (#3259). +- rt: rename `runtime::Builder::max_threads()` to `max_blocking_threads()` (#3287). +- time: require `current_thread` runtime when calling `time::pause()` (#3289). + +### Removed +- remove `tokio::prelude` (#3299). +- io: remove `AsyncFd::with_poll()` (#3306). +- net: remove `{Tcp,Unix}Stream::shutdown()` in favor of `AsyncWrite::shutdown()` (#3298). +- stream: move all stream utilities to `tokio-stream` until `Stream` is added to + `std` (#3277). +- sync: mpsc `try_recv()` due to unexpected behavior (#3263). +- tracing: make unstable as `tracing-core` is not 1.0 yet (#3266). + +### Added +- fs: `poll_*` fns to `DirEntry` (#3308). +- io: `poll_*` fns to `io::Lines`, `io::Split` (#3308). +- io: `_mut` method variants to `AsyncFd` (#3304). +- net: `poll_*` fns to `UnixDatagram` (#3223). +- net: `UnixStream` readiness and non-blocking ops (#3246). +- sync: `UnboundedReceiver::blocking_recv()` (#3262). +- sync: `watch::Sender::borrow()` (#3269). +- sync: `Semaphore::close()` (#3065). +- sync: `poll_recv` fns to `mpsc::Receiver`, `mpsc::UnboundedReceiver` (#3308). +- time: `poll_tick` fn to `time::Interval` (#3316). + +# 0.3.6 (December 14, 2020) + +### Fixed +- rt: fix deadlock in shutdown (#3228) +- rt: fix panic in task abort when off rt (#3159) +- sync: make `add_permits` panic with usize::MAX >> 3 permits (#3188) +- time: Fix race condition in timer drop (#3229) +- watch: fix spurious wakeup (#3244) + +### Added +- example: add back udp-codec example (#3205) +- net: add `TcpStream::into_std` (#3189) + # 0.3.5 (November 30, 2020) ### Fixed diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index e76323bf179..dc7534304bb 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -22,7 +22,6 @@ backed applications. """ categories = ["asynchronous", "network-programming"] keywords = ["io", "async", "non-blocking", "futures"] -publish = false [features] # Include nothing by default diff --git a/tokio/LICENSE b/tokio/LICENSE index cdb28b4b56a..243fcd6c728 100644 --- a/tokio/LICENSE +++ b/tokio/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019 Tokio Contributors +Copyright (c) 2020 Tokio Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/tokio/src/io/mod.rs b/tokio/src/io/mod.rs index 6942a71051e..3e7c9438ad9 100644 --- a/tokio/src/io/mod.rs +++ b/tokio/src/io/mod.rs @@ -144,7 +144,7 @@ //! that implements [`AsyncRead`] and [`AsyncWrite`] into a `Sink`/`Stream` of //! your structured data. //! -//! [tokio-util]: https://docs.rs/tokio-util/0.3/tokio_util/codec/index.html +//! [tokio-util]: https://docs.rs/tokio-util/0.6/tokio_util/codec/index.html //! //! # Standard input and output //! @@ -169,9 +169,9 @@ //! [`AsyncWrite`]: trait@AsyncWrite //! [`AsyncReadExt`]: trait@AsyncReadExt //! [`AsyncWriteExt`]: trait@AsyncWriteExt -//! ["codec"]: https://docs.rs/tokio-util/0.3/tokio_util/codec/index.html -//! [`Encoder`]: https://docs.rs/tokio-util/0.3/tokio_util/codec/trait.Encoder.html -//! [`Decoder`]: https://docs.rs/tokio-util/0.3/tokio_util/codec/trait.Decoder.html +//! ["codec"]: https://docs.rs/tokio-util/0.6/tokio_util/codec/index.html +//! [`Encoder`]: https://docs.rs/tokio-util/0.6/tokio_util/codec/trait.Encoder.html +//! [`Decoder`]: https://docs.rs/tokio-util/0.6/tokio_util/codec/trait.Decoder.html //! [`Error`]: struct@Error //! [`ErrorKind`]: enum@ErrorKind //! [`Result`]: type@Result diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 946006bb5d1..a41b565ae21 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -57,7 +57,7 @@ //! enabling the `full` feature flag: //! //! ```toml -//! tokio = { version = "0.3", features = ["full"] } +//! tokio = { version = "1", features = ["full"] } //! ``` //! //! ### Authoring applications @@ -72,7 +72,7 @@ //! This example shows the quickest way to get started with Tokio. //! //! ```toml -//! tokio = { version = "0.3", features = ["full"] } +//! tokio = { version = "1", features = ["full"] } //! ``` //! //! ### Authoring libraries @@ -88,7 +88,7 @@ //! needs to `tokio::spawn` and use a `TcpStream`. //! //! ```toml -//! tokio = { version = "0.3", features = ["rt", "net"] } +//! tokio = { version = "1", features = ["rt", "net"] } //! ``` //! //! ## Working With Tasks