Skip to content

Commit

Permalink
Add support for std::future and async/await (#71)
Browse files Browse the repository at this point in the history
* Add rustfmt.toml for 2018 edition fmt

* Part-way there

* Closer to upstream tokio

* No more MyFuture

* Port tests

* More stuff to async fn

* Use ? in tests over unwrap

* Workaround for rust-lang/rust#46415

* All tests pass

* async/await is only on nightly for now

* Only nightly on circle as well

* CI is hard

* Prep for async named pipes

* Don't fail tests if local infiles aren't supported

* No more workaround for taiki-e/pin-project#68

* Attempt at windows support

* PollEvented in tokio_net::util

* Avoid compilation error in Transaction::new

* Fix compilation error in tls::connect_async()

* Fix benches. Add SSL env var for tests.

* Test SSL during CI

* Bump dependencies
  • Loading branch information
jonhoo authored and blackbeam committed Sep 20, 2019
1 parent 18417fd commit 56d283b
Show file tree
Hide file tree
Showing 33 changed files with 1,851 additions and 2,448 deletions.
85 changes: 43 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ jobs:
type: string
flavor:
type: string
test-ssl:
type: boolean
default: false
test-unstable:
type: boolean
default: false
Expand All @@ -34,65 +31,69 @@ jobs:
- /usr/local/cargo/registry/index
- restore_cache:
key: deps-<< parameters.rust >>-{{ checksum "Cargo.lock" }}
- run: cargo test
- when:
condition: << parameters.test-ssl >>
steps:
- run: cargo test --features ssl
- run: rustup component add rustfmt
- run: cargo fmt -- --check
# - run: cargo test
# - when:
# condition: << parameters.test-ssl >>
# steps:
# - run: cargo test --features ssl
# - run: rustup component add rustfmt
# - run: cargo fmt -- --check
- save_cache:
key: deps-<< parameters.rust >>-{{ checksum "Cargo.lock" }}
paths:
- /usr/local/cargo/registry/cache
- when:
condition: << parameters.test-unstable >>
steps:
- run:
name: Beta
command: |
rustup toolchain install beta
cargo +beta test
# - run:
# name: Beta
# command: |
# rustup toolchain install beta
# cargo +beta test
- run:
name: Nightly
command: |
rustup toolchain install nightly
cargo +nightly test
- run:
name: Nightly SSL
command: cargo +nightly test
environment:
SSL: 1


workflows:
test:
jobs:
- linux:
name: stable-mysql-5.6
rust: latest
flavor: mysql
version: "5.6"
- linux:
name: stable-mysql-5.7
rust: latest
flavor: mysql
version: "5.7"
test-ssl: true
# - linux:
# name: stable-mysql-5.6
# rust: latest
# flavor: mysql
# version: "5.6"
# - linux:
# name: stable-mysql-5.7
# rust: latest
# flavor: mysql
# version: "5.7"
# test-ssl: true
- linux:
name: stable-mysql-8.0
rust: latest
flavor: mysql
version: "8.0"
test-ssl: true
test-unstable: true
- linux:
name: stable-mariadb-5.5
rust: latest
flavor: mariadb
version: "5.5"
- linux:
name: stable-mariadb-10.3
rust: latest
flavor: mariadb
version: "10.3"
- linux:
name: stable-mariadb-10.4
rust: latest
flavor: mariadb
version: "10.4"
# - linux:
# name: stable-mariadb-5.5
# rust: latest
# flavor: mariadb
# version: "5.5"
# - linux:
# name: stable-mariadb-10.3
# rust: latest
# flavor: mariadb
# version: "10.3"
# - linux:
# name: stable-mariadb-10.4
# rust: latest
# flavor: mariadb
# version: "10.4"
21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0"
name = "mysql_async"
readme = "README.md"
repository = "https://github.com/blackbeam/mysql_async"
version = "0.20.0"
version = "0.21.0-alpha.1"
exclude = ["test/*"]
edition = "2018"

Expand All @@ -19,19 +19,21 @@ crossbeam = "0.7"
failure = "0.1"
failure_derive = "0.1"
fnv = "1"
futures = "0.1.18"
futures-core-preview = "0.3.0-alpha.18"
futures-util-preview = "0.3.0-alpha.18"
futures-sink-preview = "0.3.0-alpha.18"
mio-named-pipes = "0.1.6"
mysql_common = "0.18"
native-tls = { version = "0.2", optional = true }
native-tls = "0.2"
percent-encoding = "2.1.0"
pin-project = { version = "0.4.0-alpha.11", features = ["project_attr"] }
regex = "1"
serde = "1"
serde_json = "1"
tokio = "0.1.9"
tokio-codec = "0.1"
tokio-io = "0.1"
tokio-named-pipes = "0.1"
tokio-uds = "0.2"
tokio-sync = "0.1"
# we only need rt-full for tokio::spawn
tokio = { version = "0.2.0-alpha.5", default-features = false, features = ["codec", "io", "net", "sync", "fs", "rt-full"] }
tokio-tls = "0.3.0-alpha.5"
tokio-net = "0.2.0-alpha.5"
twox-hash = "1"
url = "2.1"

Expand All @@ -40,7 +42,6 @@ lazy_static = "1"

[features]
nightly = []
ssl = ['native-tls']

[lib]
name = "mysql_async"
Expand Down
32 changes: 16 additions & 16 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ environment:
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
- TARGET: nightly-i686-pc-windows-gnu
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
- TARGET: beta-x86_64-pc-windows-msvc
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
- TARGET: beta-i686-pc-windows-msvc
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
- TARGET: beta-x86_64-pc-windows-gnu
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
- TARGET: beta-i686-pc-windows-gnu
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
- TARGET: 1.34.0-x86_64-pc-windows-msvc
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
- TARGET: 1.34.0-i686-pc-windows-msvc
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
- TARGET: 1.34.0-x86_64-pc-windows-gnu
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
- TARGET: 1.34.0-i686-pc-windows-gnu
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
# - TARGET: beta-x86_64-pc-windows-msvc
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
# - TARGET: beta-i686-pc-windows-msvc
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
# - TARGET: beta-x86_64-pc-windows-gnu
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
# - TARGET: beta-i686-pc-windows-gnu
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
# - TARGET: 1.34.0-x86_64-pc-windows-msvc
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
# - TARGET: 1.34.0-i686-pc-windows-msvc
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
# - TARGET: 1.34.0-x86_64-pc-windows-gnu
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
# - TARGET: 1.34.0-i686-pc-windows-gnu
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
services: mysql
install:
- cmd: >-
Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edition = "2018"
Loading

0 comments on commit 56d283b

Please sign in to comment.