Skip to content

Commit 795b8df

Browse files
committed
Upgrade to official rust image
1 parent 456bbbe commit 795b8df

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

circle.yml

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
1+
restore_registry: &RESTORE_REGISTRY
2+
restore_cache:
3+
key: registry
4+
5+
save_registry: &SAVE_REGISTRY
6+
save_cache:
7+
key: registry-{{ .BuildNum }}
8+
paths:
9+
- /usr/local/cargo/registry/index
10+
11+
deps_key: &DEPS_KEY
12+
key: deps-1.19.0-{{ checksum "Cargo.lock" }}
13+
14+
restore_deps: &RESTORE_DEPS
15+
restore_cache:
16+
<<: *DEPS_KEY
17+
18+
save_deps: &SAVE_DEPS
19+
save_cache:
20+
<<: *DEPS_KEY
21+
paths:
22+
- target
23+
- /usr/local/cargo/registry/cache
24+
125
version: 2
226
jobs:
327
build:
428
working_directory: ~/build
529
docker:
6-
- image: jimmycuadra/rust:1.18.0
30+
- image: rust:1.19.0
731
- image: sfackler/rust-postgres-test:2
832
steps:
933
- checkout
1034
- run: apt-get update
1135
- run: DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends jq
12-
- restore_cache:
13-
key: registry
36+
- <<: *RESTORE_REGISTRY
1437
- run: cargo generate-lockfile
15-
- save_cache:
16-
key: registry-{{ epoch }}
17-
paths:
18-
- ~/.cargo/registry/index
19-
- restore_cache:
20-
key: dependencies-1.18-{{ checksum "Cargo.lock" }}
38+
- <<: *SAVE_REGISTRY
39+
- <<: *RESTORE_DEPS
2140
- run: cargo test --all
2241
- run: cargo test --manifest-path=postgres/Cargo.toml --features "$(cargo read-manifest --manifest-path=postgres/Cargo.toml | jq -r '.features|keys|map(select(. != "with-security-framework" and . != "with-schannel"))|join(" ")')"
2342
- run: cargo test --manifest-path=tokio-postgres/Cargo.toml --all-features
24-
- save_cache:
25-
key: dependencies-1.18-{{ checksum "Cargo.lock" }}
26-
paths:
27-
- target
28-
- ~/.cargo/registry/cache
43+
- <<: *SAVE_DEPS

postgres/src/priv_io.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ impl MessageStream {
118118
}
119119

120120
fn set_read_timeout(&self, timeout: Option<Duration>) -> io::Result<()> {
121-
self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
121+
// self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
122+
let s = unsafe {
123+
::std::net::TcpStream::from_raw_fd(self.stream.get_ref().get_ref().0.as_raw_fd())
124+
};
125+
let r = s.set_read_timeout(timeout);
126+
::std::mem::forget(s);
127+
r
122128
}
123129

124130
fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {

0 commit comments

Comments
 (0)