Skip to content

Commit 56d283b

Browse files
jonhooblackbeam
authored andcommitted
Add support for std::future and async/await (#71)
* 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
1 parent 18417fd commit 56d283b

33 files changed

+1851
-2448
lines changed

.circleci/config.yml

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ jobs:
88
type: string
99
flavor:
1010
type: string
11-
test-ssl:
12-
type: boolean
13-
default: false
1411
test-unstable:
1512
type: boolean
1613
default: false
@@ -34,65 +31,69 @@ jobs:
3431
- /usr/local/cargo/registry/index
3532
- restore_cache:
3633
key: deps-<< parameters.rust >>-{{ checksum "Cargo.lock" }}
37-
- run: cargo test
38-
- when:
39-
condition: << parameters.test-ssl >>
40-
steps:
41-
- run: cargo test --features ssl
42-
- run: rustup component add rustfmt
43-
- run: cargo fmt -- --check
34+
# - run: cargo test
35+
# - when:
36+
# condition: << parameters.test-ssl >>
37+
# steps:
38+
# - run: cargo test --features ssl
39+
# - run: rustup component add rustfmt
40+
# - run: cargo fmt -- --check
4441
- save_cache:
4542
key: deps-<< parameters.rust >>-{{ checksum "Cargo.lock" }}
4643
paths:
4744
- /usr/local/cargo/registry/cache
4845
- when:
4946
condition: << parameters.test-unstable >>
5047
steps:
51-
- run:
52-
name: Beta
53-
command: |
54-
rustup toolchain install beta
55-
cargo +beta test
48+
# - run:
49+
# name: Beta
50+
# command: |
51+
# rustup toolchain install beta
52+
# cargo +beta test
5653
- run:
5754
name: Nightly
5855
command: |
5956
rustup toolchain install nightly
6057
cargo +nightly test
58+
- run:
59+
name: Nightly SSL
60+
command: cargo +nightly test
61+
environment:
62+
SSL: 1
6163

6264

6365
workflows:
6466
test:
6567
jobs:
66-
- linux:
67-
name: stable-mysql-5.6
68-
rust: latest
69-
flavor: mysql
70-
version: "5.6"
71-
- linux:
72-
name: stable-mysql-5.7
73-
rust: latest
74-
flavor: mysql
75-
version: "5.7"
76-
test-ssl: true
68+
# - linux:
69+
# name: stable-mysql-5.6
70+
# rust: latest
71+
# flavor: mysql
72+
# version: "5.6"
73+
# - linux:
74+
# name: stable-mysql-5.7
75+
# rust: latest
76+
# flavor: mysql
77+
# version: "5.7"
78+
# test-ssl: true
7779
- linux:
7880
name: stable-mysql-8.0
7981
rust: latest
8082
flavor: mysql
8183
version: "8.0"
82-
test-ssl: true
8384
test-unstable: true
84-
- linux:
85-
name: stable-mariadb-5.5
86-
rust: latest
87-
flavor: mariadb
88-
version: "5.5"
89-
- linux:
90-
name: stable-mariadb-10.3
91-
rust: latest
92-
flavor: mariadb
93-
version: "10.3"
94-
- linux:
95-
name: stable-mariadb-10.4
96-
rust: latest
97-
flavor: mariadb
98-
version: "10.4"
85+
# - linux:
86+
# name: stable-mariadb-5.5
87+
# rust: latest
88+
# flavor: mariadb
89+
# version: "5.5"
90+
# - linux:
91+
# name: stable-mariadb-10.3
92+
# rust: latest
93+
# flavor: mariadb
94+
# version: "10.3"
95+
# - linux:
96+
# name: stable-mariadb-10.4
97+
# rust: latest
98+
# flavor: mariadb
99+
# version: "10.4"

Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT/Apache-2.0"
77
name = "mysql_async"
88
readme = "README.md"
99
repository = "https://github.com/blackbeam/mysql_async"
10-
version = "0.20.0"
10+
version = "0.21.0-alpha.1"
1111
exclude = ["test/*"]
1212
edition = "2018"
1313

@@ -19,19 +19,21 @@ crossbeam = "0.7"
1919
failure = "0.1"
2020
failure_derive = "0.1"
2121
fnv = "1"
22-
futures = "0.1.18"
22+
futures-core-preview = "0.3.0-alpha.18"
23+
futures-util-preview = "0.3.0-alpha.18"
24+
futures-sink-preview = "0.3.0-alpha.18"
25+
mio-named-pipes = "0.1.6"
2326
mysql_common = "0.18"
24-
native-tls = { version = "0.2", optional = true }
27+
native-tls = "0.2"
2528
percent-encoding = "2.1.0"
29+
pin-project = { version = "0.4.0-alpha.11", features = ["project_attr"] }
2630
regex = "1"
2731
serde = "1"
2832
serde_json = "1"
29-
tokio = "0.1.9"
30-
tokio-codec = "0.1"
31-
tokio-io = "0.1"
32-
tokio-named-pipes = "0.1"
33-
tokio-uds = "0.2"
34-
tokio-sync = "0.1"
33+
# we only need rt-full for tokio::spawn
34+
tokio = { version = "0.2.0-alpha.5", default-features = false, features = ["codec", "io", "net", "sync", "fs", "rt-full"] }
35+
tokio-tls = "0.3.0-alpha.5"
36+
tokio-net = "0.2.0-alpha.5"
3537
twox-hash = "1"
3638
url = "2.1"
3739

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

4143
[features]
4244
nightly = []
43-
ssl = ['native-tls']
4445

4546
[lib]
4647
name = "mysql_async"

appveyor.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ environment:
1212
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
1313
- TARGET: nightly-i686-pc-windows-gnu
1414
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
15-
- TARGET: beta-x86_64-pc-windows-msvc
16-
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
17-
- TARGET: beta-i686-pc-windows-msvc
18-
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
19-
- TARGET: beta-x86_64-pc-windows-gnu
20-
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
21-
- TARGET: beta-i686-pc-windows-gnu
22-
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
23-
- TARGET: 1.34.0-x86_64-pc-windows-msvc
24-
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
25-
- TARGET: 1.34.0-i686-pc-windows-msvc
26-
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
27-
- TARGET: 1.34.0-x86_64-pc-windows-gnu
28-
PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
29-
- TARGET: 1.34.0-i686-pc-windows-gnu
30-
PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
15+
# - TARGET: beta-x86_64-pc-windows-msvc
16+
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
17+
# - TARGET: beta-i686-pc-windows-msvc
18+
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
19+
# - TARGET: beta-x86_64-pc-windows-gnu
20+
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
21+
# - TARGET: beta-i686-pc-windows-gnu
22+
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
23+
# - TARGET: 1.34.0-x86_64-pc-windows-msvc
24+
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
25+
# - TARGET: 1.34.0-i686-pc-windows-msvc
26+
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
27+
# - TARGET: 1.34.0-x86_64-pc-windows-gnu
28+
# PATH: C:\msys64\mingw64\bin\;c:\rust\bin;%PATH%
29+
# - TARGET: 1.34.0-i686-pc-windows-gnu
30+
# PATH: C:\msys64\mingw32\bin\;c:\rust\bin;%PATH%
3131
services: mysql
3232
install:
3333
- cmd: >-

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
edition = "2018"

0 commit comments

Comments
 (0)