From cdde2e7a273cbab2085b822efcf54c6bec822681 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 19 Mar 2019 14:58:59 -0700 Subject: [PATCH] chore: repo maintenance + no path dependencies (#991) - Move `tokio` into its own directory. - Remove `path` dependencies. - Run tests with once with crates.io dep and once with patched dep. --- Cargo.toml | 110 +----------------- azure-pipelines.yml | 2 +- ci/azure-cargo-check.yml | 11 +- ci/azure-test-stable.yml | 34 +++--- ci/azure-tsan.yml | 6 + ci/patch.toml | 22 ++++ tokio-async-await/Cargo.toml | 4 +- tokio-codec/Cargo.toml | 2 +- tokio-current-thread/Cargo.toml | 2 +- tokio-fs/Cargo.toml | 10 +- tokio-io/Cargo.toml | 2 +- tokio-reactor/Cargo.toml | 8 +- tokio-signal/Cargo.toml | 8 +- tokio-sync/Cargo.toml | 2 +- tokio-tcp/Cargo.toml | 6 +- tokio-threadpool/Cargo.toml | 2 +- tokio-timer/Cargo.toml | 4 +- tokio-timer/tests/throttle.rs | 7 +- tokio-tls/Cargo.toml | 4 +- tokio-udp/Cargo.toml | 6 +- tokio-uds/Cargo.toml | 8 +- tokio/Cargo.toml | 103 ++++++++++++++++ {src => tokio/src}/async_await.rs | 0 {src => tokio/src}/clock.rs | 0 {src => tokio/src}/codec/length_delimited.rs | 0 {src => tokio/src}/codec/mod.rs | 0 .../src}/executor/current_thread/mod.rs | 0 {src => tokio/src}/executor/mod.rs | 0 {src => tokio/src}/fs.rs | 0 {src => tokio/src}/io.rs | 0 {src => tokio/src}/lib.rs | 0 {src => tokio/src}/net.rs | 0 {src => tokio/src}/prelude.rs | 0 {src => tokio/src}/reactor/mod.rs | 0 {src => tokio/src}/reactor/poll_evented.rs | 0 .../src}/runtime/current_thread/builder.rs | 0 .../src}/runtime/current_thread/mod.rs | 0 .../src}/runtime/current_thread/runtime.rs | 0 {src => tokio/src}/runtime/mod.rs | 0 .../src}/runtime/threadpool/builder.rs | 0 {src => tokio/src}/runtime/threadpool/mod.rs | 0 .../src}/runtime/threadpool/shutdown.rs | 0 .../src}/runtime/threadpool/task_executor.rs | 0 {src => tokio/src}/sync.rs | 0 {src => tokio/src}/timer.rs | 0 {src => tokio/src}/util/enumerate.rs | 0 {src => tokio/src}/util/future.rs | 0 {src => tokio/src}/util/mod.rs | 0 {src => tokio/src}/util/stream.rs | 0 {tests => tokio/tests}/buffered.rs | 0 {tests => tokio/tests}/clock.rs | 0 {tests => tokio/tests}/drop-core.rs | 0 {tests => tokio/tests}/enumerate.rs | 0 {tests => tokio/tests}/global.rs | 0 {tests => tokio/tests}/length_delimited.rs | 0 {tests => tokio/tests}/line-frames.rs | 0 {tests => tokio/tests}/pipe-hup.rs | 0 {tests => tokio/tests}/reactor.rs | 0 {tests => tokio/tests}/runtime.rs | 0 {tests => tokio/tests}/timer.rs | 0 60 files changed, 194 insertions(+), 169 deletions(-) create mode 100644 ci/patch.toml create mode 100644 tokio/Cargo.toml rename {src => tokio/src}/async_await.rs (100%) rename {src => tokio/src}/clock.rs (100%) rename {src => tokio/src}/codec/length_delimited.rs (100%) rename {src => tokio/src}/codec/mod.rs (100%) rename {src => tokio/src}/executor/current_thread/mod.rs (100%) rename {src => tokio/src}/executor/mod.rs (100%) rename {src => tokio/src}/fs.rs (100%) rename {src => tokio/src}/io.rs (100%) rename {src => tokio/src}/lib.rs (100%) rename {src => tokio/src}/net.rs (100%) rename {src => tokio/src}/prelude.rs (100%) rename {src => tokio/src}/reactor/mod.rs (100%) rename {src => tokio/src}/reactor/poll_evented.rs (100%) rename {src => tokio/src}/runtime/current_thread/builder.rs (100%) rename {src => tokio/src}/runtime/current_thread/mod.rs (100%) rename {src => tokio/src}/runtime/current_thread/runtime.rs (100%) rename {src => tokio/src}/runtime/mod.rs (100%) rename {src => tokio/src}/runtime/threadpool/builder.rs (100%) rename {src => tokio/src}/runtime/threadpool/mod.rs (100%) rename {src => tokio/src}/runtime/threadpool/shutdown.rs (100%) rename {src => tokio/src}/runtime/threadpool/task_executor.rs (100%) rename {src => tokio/src}/sync.rs (100%) rename {src => tokio/src}/timer.rs (100%) rename {src => tokio/src}/util/enumerate.rs (100%) rename {src => tokio/src}/util/future.rs (100%) rename {src => tokio/src}/util/mod.rs (100%) rename {src => tokio/src}/util/stream.rs (100%) rename {tests => tokio/tests}/buffered.rs (100%) rename {tests => tokio/tests}/clock.rs (100%) rename {tests => tokio/tests}/drop-core.rs (100%) rename {tests => tokio/tests}/enumerate.rs (100%) rename {tests => tokio/tests}/global.rs (100%) rename {tests => tokio/tests}/length_delimited.rs (100%) rename {tests => tokio/tests}/line-frames.rs (100%) rename {tests => tokio/tests}/pipe-hup.rs (100%) rename {tests => tokio/tests}/reactor.rs (100%) rename {tests => tokio/tests}/runtime.rs (100%) rename {tests => tokio/tests}/timer.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 87132b2e4..1c403e438 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,30 +1,7 @@ -[package] -name = "tokio" -# When releasing to crates.io: -# - Update html_root_url. -# - Update doc url -# - Cargo.toml -# - README.md -# - Update CHANGELOG.md. -# - Create "v0.1.x" git tag. -version = "0.1.17" -authors = ["Carl Lerche "] -license = "MIT" -readme = "README.md" -documentation = "https://docs.rs/tokio/0.1.17/tokio/" -repository = "https://github.com/tokio-rs/tokio" -homepage = "https://tokio.rs" -description = """ -An event-driven, non-blocking I/O platform for writing asynchronous I/O -backed applications. -""" -categories = ["asynchronous", "network-programming"] -keywords = ["io", "async", "non-blocking", "futures"] - [workspace] members = [ - "./", + "tokio", "tokio-async-await", "tokio-buf", "tokio-codec", @@ -44,88 +21,3 @@ members = [ "tokio-udp", "tokio-uds", ] - -[features] -default = [ - "codec", - "fs", - "io", - "reactor", - "rt-full", - "sync", - "tcp", - "timer", - "udp", - "uds", -] - -codec = ["io", "tokio-codec"] -fs = ["tokio-fs"] -io = ["bytes", "tokio-io"] -reactor = ["io", "mio", "tokio-reactor"] -rt-full = [ - "num_cpus", - "reactor", - "timer", - "tokio-current-thread", - "tokio-executor", - "tokio-threadpool", - "tokio-trace-core", -] -sync = ["tokio-sync"] -tcp = ["tokio-tcp"] -timer = ["tokio-timer"] -udp = ["tokio-udp"] -uds = ["tokio-uds"] - -# This feature comes with no promise of stability. Things will -# break with each patch release. Use at your own risk. -async-await-preview = [ - "tokio-async-await/async-await-preview", -] - -[badges] -travis-ci = { repository = "tokio-rs/tokio" } -appveyor = { repository = "carllerche/tokio", id = "s83yxhy9qeb58va7" } - -[dependencies] -# Only non-optional dependency... -futures = "0.1.20" - -# Everything else is optional... -bytes = { version = "0.4", optional = true } -num_cpus = { version = "1.8.0", optional = true } -tokio-codec = { version = "0.1.0", path = "tokio-codec", optional = true } -tokio-current-thread = { version = "0.1.3", path = "tokio-current-thread", optional = true } -tokio-fs = { version = "0.1.6", path = "tokio-fs", optional = true } -tokio-io = { version = "0.1.6", path = "tokio-io", optional = true } -tokio-executor = { version = "0.1.5", path = "tokio-executor", optional = true } -tokio-reactor = { version = "0.1.1", path = "tokio-reactor", optional = true } -tokio-sync = { version = "0.1.3", path = "tokio-sync", optional = true } -tokio-threadpool = { version = "0.1.8", path = "tokio-threadpool", optional = true } -tokio-tcp = { version = "0.1.0", path = "tokio-tcp", optional = true } -tokio-udp = { version = "0.1.0", path = "tokio-udp", optional = true } -tokio-timer = { version = "0.2.8", path = "tokio-timer", optional = true } -tokio-trace-core = { version = "0.1", path = "tokio-trace/tokio-trace-core", optional = true } - -# Needed until `reactor` is removed from `tokio`. -mio = { version = "0.6.14", optional = true } - -# Needed for async/await preview support -tokio-async-await = { version = "0.1.0", path = "tokio-async-await", optional = true } - -[target.'cfg(unix)'.dependencies] -tokio-uds = { version = "0.2.1", path = "tokio-uds", optional = true } - -[dev-dependencies] -env_logger = { version = "0.5", default-features = false } -flate2 = { version = "1", features = ["tokio"] } -futures-cpupool = "0.1" -http = "0.1" -httparse = "1.0" -libc = "0.2" -num_cpus = "1.0" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -time = "0.1" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 677c72926..57f47e687 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,7 @@ jobs: - template: ci/azure-test-stable.yml parameters: name: test_linux - displayName: Test sub crates - Any + displayName: Test sub crates - crates: - tokio-buf - tokio-codec diff --git a/ci/azure-cargo-check.yml b/ci/azure-cargo-check.yml index 5a29376ea..d386bd6c3 100644 --- a/ci/azure-cargo-check.yml +++ b/ci/azure-cargo-check.yml @@ -13,14 +13,9 @@ jobs: - ${{ each crate in parameters.crates }}: - ${{ each feature in crate.value }}: - - ${{ if eq(crate.key, 'tokio') }}: - - script: cargo check ${{ parameters.noDefaultFeatures }} --features ${{ feature }} - displayName: Check features = ${{ feature }} - - - ${{ if not(eq(crate.key, 'tokio')) }}: - - script: cargo check ${{ parameters.noDefaultFeatures }} --features ${{ feature }} - displayName: Check `${{ crate.key }}`, features = ${{ feature }} - workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }} + - script: cargo check ${{ parameters.noDefaultFeatures }} --features ${{ feature }} + displayName: Check `${{ crate.key }}`, features = ${{ feature }} + workingDirectory: $(Build.SourcesDirectory)/${{ crate.key }} - ${{ if parameters.benches }}: - script: cargo check --benches --all diff --git a/ci/azure-test-stable.yml b/ci/azure-test-stable.yml index 718d618bc..af378d5e3 100644 --- a/ci/azure-test-stable.yml +++ b/ci/azure-test-stable.yml @@ -20,17 +20,25 @@ jobs: rust_version: stable - ${{ each crate in parameters.crates }}: - - ${{ if eq(crate, 'tokio') }}: - - script: cargo test - env: - LOOM_MAX_DURATION: 10 - CI: 'True' - displayName: cargo test + - script: cargo test + env: + LOOM_MAX_DURATION: 10 + CI: 'True' + displayName: cargo test -p ${{ crate }} + workingDirectory: $(Build.SourcesDirectory)/${{ crate }} - - ${{ if not(eq(crate, 'tokio')) }}: - - script: cargo test - env: - LOOM_MAX_DURATION: 10 - CI: 'True' - displayName: cargo test -p ${{ crate }} - workingDirectory: $(Build.SourcesDirectory)/${{ crate }} + - script: | + set -e + cat ci/patch.toml >> Cargo.toml + echo "~~~~ Cargo.toml ~~~~" + cat Cargo.toml + echo "~~~~~~~~~~~~~~~~~~~~" + displayName: Patch Cargo.toml + + - ${{ each crate in parameters.crates }}: + - script: cargo test + env: + LOOM_MAX_DURATION: 10 + CI: 'True' + displayName: cargo test -p ${{ crate }} (PATCHED) + workingDirectory: $(Build.SourcesDirectory)/${{ crate }} diff --git a/ci/azure-tsan.yml b/ci/azure-tsan.yml index f785ab2d2..9395f6685 100644 --- a/ci/azure-tsan.yml +++ b/ci/azure-tsan.yml @@ -16,6 +16,12 @@ jobs: - script: | set -e + + cat ci/patch.toml >> Cargo.toml + echo "~~~~ Cargo.toml ~~~~" + cat Cargo.toml + echo "~~~~~~~~~~~~~~~~~~~~" + # Make sure the benchmarks compile export ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0" export TSAN_OPTIONS="suppressions=`pwd`/ci/tsan" diff --git a/ci/patch.toml b/ci/patch.toml new file mode 100644 index 000000000..97e86ae9a --- /dev/null +++ b/ci/patch.toml @@ -0,0 +1,22 @@ +# Patch dependencies to run all tests against versions of the crate in the +# repository. +[patch.crates-io] +tokio = { path = "tokio" } +tokio-async-await = { path = "tokio-async-await" } +tokio-buf = { path = "tokio-buf" } +tokio-codec = { path = "tokio-codec" } +tokio-current-thread = { path = "tokio-current-thread" } +tokio-executor = { path = "tokio-executor" } +tokio-fs = { path = "tokio-fs" } +tokio-io = { path = "tokio-io" } +tokio-reactor = { path = "tokio-reactor" } +tokio-signal = { path = "tokio-signal" } +tokio-sync = { path = "tokio-sync" } +tokio-threadpool = { path = "tokio-threadpool" } +tokio-timer = { path = "tokio-timer" } +tokio-tcp = { path = "tokio-tcp" } +tokio-tls = { path = "tokio-tls" } +tokio-trace = { path = "tokio-trace" } +tokio-trace-core = { path = "tokio-trace/tokio-trace-core" } +tokio-udp = { path = "tokio-udp" } +tokio-uds = { path = "tokio-uds" } diff --git a/tokio-async-await/Cargo.toml b/tokio-async-await/Cargo.toml index 50eee67d2..f65568456 100644 --- a/tokio-async-await/Cargo.toml +++ b/tokio-async-await/Cargo.toml @@ -21,9 +21,9 @@ async-await-preview = ["futures/nightly"] [dependencies] futures = "0.1.23" -tokio-io = { version = "0.1.7", path = "../tokio-io" } +tokio-io = "0.1.7" [dev-dependencies] bytes = "0.4.9" -tokio = { version = "0.1.8", path = ".." } +tokio = "0.1.8" hyper = "0.12.8" diff --git a/tokio-codec/Cargo.toml b/tokio-codec/Cargo.toml index 756e8ff1b..7ff44b59c 100644 --- a/tokio-codec/Cargo.toml +++ b/tokio-codec/Cargo.toml @@ -18,6 +18,6 @@ Utilities for encoding and decoding frames. categories = ["asynchronous"] [dependencies] -tokio-io = { version = "0.1.7", path = "../tokio-io" } +tokio-io = "0.1.7" bytes = "0.4.7" futures = "0.1.18" diff --git a/tokio-current-thread/Cargo.toml b/tokio-current-thread/Cargo.toml index 32ed491ee..f144c74b1 100644 --- a/tokio-current-thread/Cargo.toml +++ b/tokio-current-thread/Cargo.toml @@ -21,5 +21,5 @@ keywords = ["futures", "tokio"] categories = ["concurrency", "asynchronous"] [dependencies] -tokio-executor = { version = "0.1.5", path = "../tokio-executor" } +tokio-executor = "0.1.5" futures = "0.1.19" diff --git a/tokio-fs/Cargo.toml b/tokio-fs/Cargo.toml index 844568cff..1aca47666 100644 --- a/tokio-fs/Cargo.toml +++ b/tokio-fs/Cargo.toml @@ -23,13 +23,13 @@ categories = ["asynchronous", "network-programming", "filesystem"] [dependencies] futures = "0.1.21" -tokio-threadpool = { version = "0.1.3", path = "../tokio-threadpool" } -tokio-io = { version = "0.1.6", path = "../tokio-io" } +tokio-threadpool = "0.1.3" +tokio-io = "0.1.6" [dev-dependencies] rand = "0.6" tempfile = "3" tempdir = "0.3" -tokio-io = { version = "0.1.6", path = "../tokio-io" } -tokio-codec = { version = "0.1.0", path = "../tokio-codec" } -tokio = { version = "0.1.7", path = ".." } +tokio-io = "0.1.6" +tokio-codec = "0.1.0" +tokio = "0.1.7" diff --git a/tokio-io/Cargo.toml b/tokio-io/Cargo.toml index 3ab84fb39..f3c4f0db3 100644 --- a/tokio-io/Cargo.toml +++ b/tokio-io/Cargo.toml @@ -25,4 +25,4 @@ futures = "0.1.18" log = "0.4" [dev-dependencies] -tokio-current-thread = { version = "0.1.1", path = "../tokio-current-thread" } +tokio-current-thread = "0.1.1" diff --git a/tokio-reactor/Cargo.toml b/tokio-reactor/Cargo.toml index f51a4c207..ab614b748 100644 --- a/tokio-reactor/Cargo.toml +++ b/tokio-reactor/Cargo.toml @@ -29,11 +29,11 @@ mio = "0.6.14" num_cpus = "1.8.0" parking_lot = "0.7.0" slab = "0.4.0" -tokio-executor = { version = "0.1.1", path = "../tokio-executor" } -tokio-io = { version = "0.1.6", path = "../tokio-io" } -tokio-sync = { version = "0.1.1", path = "../tokio-sync" } +tokio-executor = "0.1.1" +tokio-io = "0.1.6" +tokio-sync = "0.1.1" [dev-dependencies] num_cpus = "1.8.0" -tokio = { version = "0.1.7", path = ".." } +tokio = "0.1.7" tokio-io-pool = "0.1.4" diff --git a/tokio-signal/Cargo.toml b/tokio-signal/Cargo.toml index 4646f1086..9caa92a79 100644 --- a/tokio-signal/Cargo.toml +++ b/tokio-signal/Cargo.toml @@ -24,9 +24,9 @@ appveyor = { repository = "carllerche/tokio", id = "s83yxhy9qeb58va7" } [dependencies] futures = "0.1.11" mio = "0.6.14" -tokio-reactor = { version = "0.1.0", path = "../tokio-reactor" } -tokio-executor = { version = "0.1.0", path = "../tokio-executor" } -tokio-io = { version = "0.1", path = "../tokio-io" } +tokio-reactor = "0.1.0" +tokio-executor = "0.1.0" +tokio-io = "0.1" [target.'cfg(unix)'.dependencies] libc = "0.2" @@ -34,7 +34,7 @@ mio-uds = "0.6" signal-hook = "0.1" [dev-dependencies] -tokio = { version = "0.1.8", path = ".." } +tokio = "0.1.8" [target.'cfg(windows)'.dependencies.winapi] version = "0.3" diff --git a/tokio-sync/Cargo.toml b/tokio-sync/Cargo.toml index b3798c8b6..850b7e120 100644 --- a/tokio-sync/Cargo.toml +++ b/tokio-sync/Cargo.toml @@ -24,6 +24,6 @@ futures = "0.1.19" [dev-dependencies] env_logger = { version = "0.5", default-features = false } -tokio = { version = "0.1.15", path = ".." } +tokio = "0.1.15" tokio-mock-task = "0.1.1" loom = { version = "0.1.1", features = ["futures"] } diff --git a/tokio-tcp/Cargo.toml b/tokio-tcp/Cargo.toml index a357343ab..c88909328 100644 --- a/tokio-tcp/Cargo.toml +++ b/tokio-tcp/Cargo.toml @@ -20,8 +20,8 @@ TCP bindings for tokio. categories = ["asynchronous"] [dependencies] -tokio-io = { version = "0.1.6", path = "../tokio-io" } -tokio-reactor = { version = "0.1.1", path = "../tokio-reactor" } +tokio-io = "0.1.6" +tokio-reactor = "0.1.1" bytes = "0.4" mio = "0.6.14" iovec = "0.1" @@ -29,4 +29,4 @@ futures = "0.1.19" [dev-dependencies] env_logger = { version = "0.5", default-features = false } -tokio = { version = "0.1.13", path = ".." } +tokio = "0.1.13" diff --git a/tokio-threadpool/Cargo.toml b/tokio-threadpool/Cargo.toml index 014e8427d..43a2c6f38 100644 --- a/tokio-threadpool/Cargo.toml +++ b/tokio-threadpool/Cargo.toml @@ -20,7 +20,7 @@ keywords = ["futures", "tokio"] categories = ["concurrency", "asynchronous"] [dependencies] -tokio-executor = { version = "0.1.2", path = "../tokio-executor" } +tokio-executor = "0.1.2" futures = "0.1.19" crossbeam-deque = "0.7.0" crossbeam-queue = "0.1.0" diff --git a/tokio-timer/Cargo.toml b/tokio-timer/Cargo.toml index b347c9156..958b10d14 100644 --- a/tokio-timer/Cargo.toml +++ b/tokio-timer/Cargo.toml @@ -20,7 +20,7 @@ Timer facilities for Tokio [dependencies] futures = "0.1.19" -tokio-executor = { version = "0.1.1", path = "../tokio-executor" } +tokio-executor = "0.1.1" crossbeam-utils = "0.6.0" # Backs `DelayQueue` @@ -29,4 +29,4 @@ slab = "0.4.1" [dev-dependencies] rand = "0.6" tokio-mock-task = "0.1.0" -tokio = { version = "0.1.7", path = "../" } +tokio = "0.1.7" diff --git a/tokio-timer/tests/throttle.rs b/tokio-timer/tests/throttle.rs index 4ef157ea6..253309c98 100644 --- a/tokio-timer/tests/throttle.rs +++ b/tokio-timer/tests/throttle.rs @@ -1,5 +1,4 @@ extern crate futures; -extern crate tokio; extern crate tokio_executor; extern crate tokio_timer; @@ -8,13 +7,13 @@ mod support; use support::*; use futures::{prelude::*, sync::mpsc}; -use tokio::util::StreamExt; +use tokio_timer::throttle::Throttle; #[test] fn throttle() { mocked(|timer, _| { let (tx, rx) = mpsc::unbounded(); - let mut stream = rx.throttle(ms(1)).map_err(|e| panic!("{:?}", e)); + let mut stream = Throttle::new(rx, ms(1)); assert_not_ready!(stream); @@ -36,7 +35,7 @@ fn throttle() { fn throttle_dur_0() { mocked(|_, _| { let (tx, rx) = mpsc::unbounded(); - let mut stream = rx.throttle(ms(0)).map_err(|e| panic!("{:?}", e)); + let mut stream = Throttle::new(rx, ms(0)); assert_not_ready!(stream); diff --git a/tokio-tls/Cargo.toml b/tokio-tls/Cargo.toml index 89d4c1ed3..5b3c99e94 100644 --- a/tokio-tls/Cargo.toml +++ b/tokio-tls/Cargo.toml @@ -22,10 +22,10 @@ travis-ci = { repository = "tokio-rs/tokio-tls" } [dependencies] futures = "0.1.23" native-tls = "0.2" -tokio-io = { version = "0.1.7", path = "../tokio-io" } +tokio-io = "0.1.7" [dev-dependencies] -tokio = { version = "0.1", path = "../" } +tokio = "0.1" cfg-if = "0.1" env_logger = { version = "0.5", default-features = false } diff --git a/tokio-udp/Cargo.toml b/tokio-udp/Cargo.toml index 25bd56651..6aa56a1c8 100644 --- a/tokio-udp/Cargo.toml +++ b/tokio-udp/Cargo.toml @@ -18,9 +18,9 @@ UDP bindings for tokio. categories = ["asynchronous"] [dependencies] -tokio-codec = { version = "0.1.0", path = "../tokio-codec" } -tokio-io = { version = "0.1.7", path = "../tokio-io" } -tokio-reactor = { version = "0.1.1", path = "../tokio-reactor" } +tokio-codec = "0.1.0" +tokio-io = "0.1.7" +tokio-reactor = "0.1.1" bytes = "0.4" mio = "0.6.14" log = "0.4" diff --git a/tokio-uds/Cargo.toml b/tokio-uds/Cargo.toml index 741f97b35..2996dbf18 100644 --- a/tokio-uds/Cargo.toml +++ b/tokio-uds/Cargo.toml @@ -26,10 +26,10 @@ libc = "0.2.42" log = "0.4.2" mio = "0.6.14" mio-uds = "0.6.5" -tokio-codec = { version = "0.1.0", path = "../tokio-codec" } -tokio-reactor = { version = "0.1.1", path = "../tokio-reactor" } -tokio-io = { version = "0.1.6", path = "../tokio-io" } +tokio-codec = "0.1.0" +tokio-reactor = "0.1.1" +tokio-io = "0.1.6" [dev-dependencies] -tokio = { version = "0.1.6", path = "../" } +tokio = "0.1.6" tempfile = "3" diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml new file mode 100644 index 000000000..45a7dc684 --- /dev/null +++ b/tokio/Cargo.toml @@ -0,0 +1,103 @@ +[package] +name = "tokio" +# When releasing to crates.io: +# - Update html_root_url. +# - Update doc url +# - Cargo.toml +# - README.md +# - Update CHANGELOG.md. +# - Create "v0.1.x" git tag. +version = "0.1.17" +authors = ["Carl Lerche "] +license = "MIT" +readme = "README.md" +documentation = "https://docs.rs/tokio/0.1.17/tokio/" +repository = "https://github.com/tokio-rs/tokio" +homepage = "https://tokio.rs" +description = """ +An event-driven, non-blocking I/O platform for writing asynchronous I/O +backed applications. +""" +categories = ["asynchronous", "network-programming"] +keywords = ["io", "async", "non-blocking", "futures"] + +[features] +default = [ + "codec", + "fs", + "io", + "reactor", + "rt-full", + "sync", + "tcp", + "timer", + "udp", + "uds", +] + +codec = ["io", "tokio-codec"] +fs = ["tokio-fs"] +io = ["bytes", "tokio-io"] +reactor = ["io", "mio", "tokio-reactor"] +rt-full = [ + "num_cpus", + "reactor", + "timer", + "tokio-current-thread", + "tokio-executor", + "tokio-threadpool", + "tokio-trace-core", +] +sync = ["tokio-sync"] +tcp = ["tokio-tcp"] +timer = ["tokio-timer"] +udp = ["tokio-udp"] +uds = ["tokio-uds"] + +# This feature comes with no promise of stability. Things will +# break with each patch release. Use at your own risk. +async-await-preview = [ + "tokio-async-await/async-await-preview", +] + +[dependencies] +# Only non-optional dependency... +futures = "0.1.20" + +# Everything else is optional... +bytes = { version = "0.4", optional = true } +num_cpus = { version = "1.8.0", optional = true } +tokio-codec = { version = "0.1.0", optional = true } +tokio-current-thread = { version = "0.1.3", optional = true } +tokio-fs = { version = "0.1.6", optional = true } +tokio-io = { version = "0.1.6", optional = true } +tokio-executor = { version = "0.1.5", optional = true } +tokio-reactor = { version = "0.1.1", optional = true } +tokio-sync = { version = "0.1.3", optional = true } +tokio-threadpool = { version = "0.1.8", optional = true } +tokio-tcp = { version = "0.1.0", optional = true } +tokio-udp = { version = "0.1.0", optional = true } +tokio-timer = { version = "0.2.8", optional = true } +tokio-trace-core = { version = "0.1", optional = true } + +# Needed until `reactor` is removed from `tokio`. +mio = { version = "0.6.14", optional = true } + +# Needed for async/await preview support +tokio-async-await = { version = "0.1.0", optional = true } + +[target.'cfg(unix)'.dependencies] +tokio-uds = { version = "0.2.1", optional = true } + +[dev-dependencies] +env_logger = { version = "0.5", default-features = false } +flate2 = { version = "1", features = ["tokio"] } +futures-cpupool = "0.1" +http = "0.1" +httparse = "1.0" +libc = "0.2" +num_cpus = "1.0" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +time = "0.1" diff --git a/src/async_await.rs b/tokio/src/async_await.rs similarity index 100% rename from src/async_await.rs rename to tokio/src/async_await.rs diff --git a/src/clock.rs b/tokio/src/clock.rs similarity index 100% rename from src/clock.rs rename to tokio/src/clock.rs diff --git a/src/codec/length_delimited.rs b/tokio/src/codec/length_delimited.rs similarity index 100% rename from src/codec/length_delimited.rs rename to tokio/src/codec/length_delimited.rs diff --git a/src/codec/mod.rs b/tokio/src/codec/mod.rs similarity index 100% rename from src/codec/mod.rs rename to tokio/src/codec/mod.rs diff --git a/src/executor/current_thread/mod.rs b/tokio/src/executor/current_thread/mod.rs similarity index 100% rename from src/executor/current_thread/mod.rs rename to tokio/src/executor/current_thread/mod.rs diff --git a/src/executor/mod.rs b/tokio/src/executor/mod.rs similarity index 100% rename from src/executor/mod.rs rename to tokio/src/executor/mod.rs diff --git a/src/fs.rs b/tokio/src/fs.rs similarity index 100% rename from src/fs.rs rename to tokio/src/fs.rs diff --git a/src/io.rs b/tokio/src/io.rs similarity index 100% rename from src/io.rs rename to tokio/src/io.rs diff --git a/src/lib.rs b/tokio/src/lib.rs similarity index 100% rename from src/lib.rs rename to tokio/src/lib.rs diff --git a/src/net.rs b/tokio/src/net.rs similarity index 100% rename from src/net.rs rename to tokio/src/net.rs diff --git a/src/prelude.rs b/tokio/src/prelude.rs similarity index 100% rename from src/prelude.rs rename to tokio/src/prelude.rs diff --git a/src/reactor/mod.rs b/tokio/src/reactor/mod.rs similarity index 100% rename from src/reactor/mod.rs rename to tokio/src/reactor/mod.rs diff --git a/src/reactor/poll_evented.rs b/tokio/src/reactor/poll_evented.rs similarity index 100% rename from src/reactor/poll_evented.rs rename to tokio/src/reactor/poll_evented.rs diff --git a/src/runtime/current_thread/builder.rs b/tokio/src/runtime/current_thread/builder.rs similarity index 100% rename from src/runtime/current_thread/builder.rs rename to tokio/src/runtime/current_thread/builder.rs diff --git a/src/runtime/current_thread/mod.rs b/tokio/src/runtime/current_thread/mod.rs similarity index 100% rename from src/runtime/current_thread/mod.rs rename to tokio/src/runtime/current_thread/mod.rs diff --git a/src/runtime/current_thread/runtime.rs b/tokio/src/runtime/current_thread/runtime.rs similarity index 100% rename from src/runtime/current_thread/runtime.rs rename to tokio/src/runtime/current_thread/runtime.rs diff --git a/src/runtime/mod.rs b/tokio/src/runtime/mod.rs similarity index 100% rename from src/runtime/mod.rs rename to tokio/src/runtime/mod.rs diff --git a/src/runtime/threadpool/builder.rs b/tokio/src/runtime/threadpool/builder.rs similarity index 100% rename from src/runtime/threadpool/builder.rs rename to tokio/src/runtime/threadpool/builder.rs diff --git a/src/runtime/threadpool/mod.rs b/tokio/src/runtime/threadpool/mod.rs similarity index 100% rename from src/runtime/threadpool/mod.rs rename to tokio/src/runtime/threadpool/mod.rs diff --git a/src/runtime/threadpool/shutdown.rs b/tokio/src/runtime/threadpool/shutdown.rs similarity index 100% rename from src/runtime/threadpool/shutdown.rs rename to tokio/src/runtime/threadpool/shutdown.rs diff --git a/src/runtime/threadpool/task_executor.rs b/tokio/src/runtime/threadpool/task_executor.rs similarity index 100% rename from src/runtime/threadpool/task_executor.rs rename to tokio/src/runtime/threadpool/task_executor.rs diff --git a/src/sync.rs b/tokio/src/sync.rs similarity index 100% rename from src/sync.rs rename to tokio/src/sync.rs diff --git a/src/timer.rs b/tokio/src/timer.rs similarity index 100% rename from src/timer.rs rename to tokio/src/timer.rs diff --git a/src/util/enumerate.rs b/tokio/src/util/enumerate.rs similarity index 100% rename from src/util/enumerate.rs rename to tokio/src/util/enumerate.rs diff --git a/src/util/future.rs b/tokio/src/util/future.rs similarity index 100% rename from src/util/future.rs rename to tokio/src/util/future.rs diff --git a/src/util/mod.rs b/tokio/src/util/mod.rs similarity index 100% rename from src/util/mod.rs rename to tokio/src/util/mod.rs diff --git a/src/util/stream.rs b/tokio/src/util/stream.rs similarity index 100% rename from src/util/stream.rs rename to tokio/src/util/stream.rs diff --git a/tests/buffered.rs b/tokio/tests/buffered.rs similarity index 100% rename from tests/buffered.rs rename to tokio/tests/buffered.rs diff --git a/tests/clock.rs b/tokio/tests/clock.rs similarity index 100% rename from tests/clock.rs rename to tokio/tests/clock.rs diff --git a/tests/drop-core.rs b/tokio/tests/drop-core.rs similarity index 100% rename from tests/drop-core.rs rename to tokio/tests/drop-core.rs diff --git a/tests/enumerate.rs b/tokio/tests/enumerate.rs similarity index 100% rename from tests/enumerate.rs rename to tokio/tests/enumerate.rs diff --git a/tests/global.rs b/tokio/tests/global.rs similarity index 100% rename from tests/global.rs rename to tokio/tests/global.rs diff --git a/tests/length_delimited.rs b/tokio/tests/length_delimited.rs similarity index 100% rename from tests/length_delimited.rs rename to tokio/tests/length_delimited.rs diff --git a/tests/line-frames.rs b/tokio/tests/line-frames.rs similarity index 100% rename from tests/line-frames.rs rename to tokio/tests/line-frames.rs diff --git a/tests/pipe-hup.rs b/tokio/tests/pipe-hup.rs similarity index 100% rename from tests/pipe-hup.rs rename to tokio/tests/pipe-hup.rs diff --git a/tests/reactor.rs b/tokio/tests/reactor.rs similarity index 100% rename from tests/reactor.rs rename to tokio/tests/reactor.rs diff --git a/tests/runtime.rs b/tokio/tests/runtime.rs similarity index 100% rename from tests/runtime.rs rename to tokio/tests/runtime.rs diff --git a/tests/timer.rs b/tokio/tests/timer.rs similarity index 100% rename from tests/timer.rs rename to tokio/tests/timer.rs