Show More
This diff has been collapsed as it changes many lines, (595 lines changed) Show them Hide them | |||
@@ -1,701 +1,482 | |||
|
1 | 1 | # This file is automatically @generated by Cargo. |
|
2 | 2 | # It is not intended for manual editing. |
|
3 | 3 | [[package]] |
|
4 | 4 | name = "arc-swap" |
|
5 | 5 | version = "0.4.5" |
|
6 | 6 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
7 | 7 | |
|
8 | 8 | [[package]] |
|
9 |
name = "a |
|
|
10 |
version = " |
|
|
9 | name = "async-trait" | |
|
10 | version = "0.1.30" | |
|
11 | 11 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
12 | dependencies = [ | |
|
13 | "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
14 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
15 | "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
16 | ] | |
|
12 | 17 | |
|
13 | 18 | [[package]] |
|
14 | 19 | name = "bitflags" |
|
15 | 20 | version = "1.2.1" |
|
16 | 21 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
17 | 22 | |
|
18 | 23 | [[package]] |
|
19 |
name = "byte |
|
|
20 |
version = " |
|
|
24 | name = "bytes" | |
|
25 | version = "0.5.4" | |
|
21 | 26 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
22 | 27 | |
|
23 | 28 | [[package]] |
|
24 | name = "bytes" | |
|
25 | version = "0.4.12" | |
|
26 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
27 | dependencies = [ | |
|
28 | "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
29 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
30 | ] | |
|
31 | ||
|
32 | [[package]] | |
|
33 | 29 | name = "cc" |
|
34 | 30 | version = "1.0.50" |
|
35 | 31 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
36 | 32 | |
|
37 | 33 | [[package]] |
|
38 | 34 | name = "cfg-if" |
|
39 | 35 | version = "0.1.10" |
|
40 | 36 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
41 | 37 | |
|
42 | 38 | [[package]] |
|
43 | 39 | name = "chg" |
|
44 | 40 | version = "0.1.0" |
|
45 | 41 | dependencies = [ |
|
46 |
" |
|
|
42 | "async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
43 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
47 | 44 | "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", |
|
48 |
"futures 0. |
|
|
49 |
"libc 0.2.6 |
|
|
45 | "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
46 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
50 | 47 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
51 |
"tokio 0. |
|
|
52 |
"tokio-hglib 0. |
|
|
53 | "tokio-process 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
54 | "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
55 | ] | |
|
56 | ||
|
57 | [[package]] | |
|
58 | name = "cloudabi" | |
|
59 | version = "0.0.3" | |
|
60 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
61 | dependencies = [ | |
|
62 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
63 | ] | |
|
64 | ||
|
65 | [[package]] | |
|
66 | name = "crossbeam-deque" | |
|
67 | version = "0.7.3" | |
|
68 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
69 | dependencies = [ | |
|
70 | "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
71 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
72 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
73 | ] | |
|
74 | ||
|
75 | [[package]] | |
|
76 | name = "crossbeam-epoch" | |
|
77 | version = "0.8.2" | |
|
78 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
79 | dependencies = [ | |
|
80 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
81 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
82 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
83 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
84 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
85 | "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
86 | "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
48 | "tokio 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
49 | "tokio-hglib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
87 | 50 | ] |
|
88 | 51 | |
|
89 | 52 | [[package]] |
|
90 | name = "crossbeam-queue" | |
|
91 | version = "0.1.2" | |
|
92 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
93 | dependencies = [ | |
|
94 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
95 | ] | |
|
96 | ||
|
97 | [[package]] | |
|
98 | name = "crossbeam-queue" | |
|
99 | version = "0.2.1" | |
|
100 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
101 | dependencies = [ | |
|
102 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
103 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
104 | ] | |
|
105 | ||
|
106 | [[package]] | |
|
107 | name = "crossbeam-utils" | |
|
108 | version = "0.6.6" | |
|
109 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
110 | dependencies = [ | |
|
111 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
112 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
113 | ] | |
|
114 | ||
|
115 | [[package]] | |
|
116 | name = "crossbeam-utils" | |
|
117 | version = "0.7.2" | |
|
118 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
119 | dependencies = [ | |
|
120 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
121 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
122 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
123 | ] | |
|
124 | ||
|
125 | [[package]] | |
|
126 | name = "fnv" | |
|
127 | version = "1.0.6" | |
|
128 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
129 | ||
|
130 | [[package]] | |
|
131 | 53 | name = "fuchsia-zircon" |
|
132 | 54 | version = "0.3.3" |
|
133 | 55 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
134 | 56 | dependencies = [ |
|
135 | 57 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
|
136 | 58 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
|
137 | 59 | ] |
|
138 | 60 | |
|
139 | 61 | [[package]] |
|
140 | 62 | name = "fuchsia-zircon-sys" |
|
141 | 63 | version = "0.3.3" |
|
142 | 64 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
143 | 65 | |
|
144 | 66 | [[package]] |
|
145 | 67 | name = "futures" |
|
146 |
version = "0. |
|
|
68 | version = "0.3.4" | |
|
69 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
70 | dependencies = [ | |
|
71 | "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
72 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
73 | "futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
74 | "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
75 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
76 | "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
77 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
78 | ] | |
|
79 | ||
|
80 | [[package]] | |
|
81 | name = "futures-channel" | |
|
82 | version = "0.3.4" | |
|
83 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
84 | dependencies = [ | |
|
85 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
86 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
87 | ] | |
|
88 | ||
|
89 | [[package]] | |
|
90 | name = "futures-core" | |
|
91 | version = "0.3.4" | |
|
147 | 92 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
148 | 93 | |
|
149 | 94 | [[package]] |
|
150 | name = "hermit-abi" | |
|
151 |
version = "0. |
|
|
95 | name = "futures-executor" | |
|
96 | version = "0.3.4" | |
|
97 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
98 | dependencies = [ | |
|
99 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
100 | "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
101 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
102 | ] | |
|
103 | ||
|
104 | [[package]] | |
|
105 | name = "futures-io" | |
|
106 | version = "0.3.4" | |
|
107 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
108 | ||
|
109 | [[package]] | |
|
110 | name = "futures-macro" | |
|
111 | version = "0.3.4" | |
|
152 | 112 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
153 | 113 | dependencies = [ |
|
154 |
" |
|
|
114 | "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
115 | "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
116 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
117 | "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
118 | ] | |
|
119 | ||
|
120 | [[package]] | |
|
121 | name = "futures-sink" | |
|
122 | version = "0.3.4" | |
|
123 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
124 | ||
|
125 | [[package]] | |
|
126 | name = "futures-task" | |
|
127 | version = "0.3.4" | |
|
128 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
129 | ||
|
130 | [[package]] | |
|
131 | name = "futures-util" | |
|
132 | version = "0.3.4" | |
|
133 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
134 | dependencies = [ | |
|
135 | "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
136 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
137 | "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
138 | "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
139 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
140 | "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
141 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
142 | "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
143 | "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
144 | "proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
145 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
155 | 146 | ] |
|
156 | 147 | |
|
157 | 148 | [[package]] |
|
158 | 149 | name = "iovec" |
|
159 | 150 | version = "0.1.4" |
|
160 | 151 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
161 | 152 | dependencies = [ |
|
162 |
"libc 0.2.6 |
|
|
153 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
163 | 154 | ] |
|
164 | 155 | |
|
165 | 156 | [[package]] |
|
166 | 157 | name = "kernel32-sys" |
|
167 | 158 | version = "0.2.2" |
|
168 | 159 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
169 | 160 | dependencies = [ |
|
170 | 161 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
171 | 162 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", |
|
172 | 163 | ] |
|
173 | 164 | |
|
174 | 165 | [[package]] |
|
175 | 166 | name = "lazy_static" |
|
176 | 167 | version = "1.4.0" |
|
177 | 168 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
178 | 169 | |
|
179 | 170 | [[package]] |
|
180 | 171 | name = "libc" |
|
181 |
version = "0.2.6 |
|
|
172 | version = "0.2.69" | |
|
182 | 173 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
183 | 174 | |
|
184 | 175 | [[package]] |
|
185 | name = "lock_api" | |
|
186 | version = "0.3.3" | |
|
187 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
188 | dependencies = [ | |
|
189 | "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
190 | ] | |
|
191 | ||
|
192 | [[package]] | |
|
193 | 176 | name = "log" |
|
194 | 177 | version = "0.4.8" |
|
195 | 178 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
196 | 179 | dependencies = [ |
|
197 | 180 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", |
|
198 | 181 | ] |
|
199 | 182 | |
|
200 | 183 | [[package]] |
|
201 |
name = "m |
|
|
202 |
version = "2. |
|
|
184 | name = "memchr" | |
|
185 | version = "2.3.3" | |
|
203 | 186 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
204 | 187 | |
|
205 | 188 | [[package]] |
|
206 | name = "memoffset" | |
|
207 | version = "0.5.4" | |
|
208 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
209 | dependencies = [ | |
|
210 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
211 | ] | |
|
212 | ||
|
213 | [[package]] | |
|
214 | 189 | name = "mio" |
|
215 | 190 | version = "0.6.21" |
|
216 | 191 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
217 | 192 | dependencies = [ |
|
218 | 193 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", |
|
219 | 194 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
|
220 | 195 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
|
221 | 196 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", |
|
222 | 197 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", |
|
223 |
"libc 0.2.6 |
|
|
198 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
224 | 199 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
225 | 200 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
|
226 | 201 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", |
|
227 | 202 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", |
|
228 | 203 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
229 | 204 | ] |
|
230 | 205 | |
|
231 | 206 | [[package]] |
|
232 | 207 | name = "mio-named-pipes" |
|
233 | 208 | version = "0.1.6" |
|
234 | 209 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
235 | 210 | dependencies = [ |
|
236 | 211 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
237 | 212 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", |
|
238 | 213 | "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
|
239 | 214 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
240 | 215 | ] |
|
241 | 216 | |
|
242 | 217 | [[package]] |
|
243 | 218 | name = "mio-uds" |
|
244 | 219 | version = "0.6.7" |
|
245 | 220 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
246 | 221 | dependencies = [ |
|
247 | 222 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", |
|
248 |
"libc 0.2.6 |
|
|
223 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
249 | 224 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", |
|
250 | 225 | ] |
|
251 | 226 | |
|
252 | 227 | [[package]] |
|
253 | 228 | name = "miow" |
|
254 | 229 | version = "0.2.1" |
|
255 | 230 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
256 | 231 | dependencies = [ |
|
257 | 232 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", |
|
258 | 233 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", |
|
259 | 234 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
260 | 235 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
|
261 | 236 | ] |
|
262 | 237 | |
|
263 | 238 | [[package]] |
|
264 | 239 | name = "miow" |
|
265 | 240 | version = "0.3.3" |
|
266 | 241 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
267 | 242 | dependencies = [ |
|
268 |
"socket2 0.3.1 |
|
|
243 | "socket2 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
269 | 244 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
270 | 245 | ] |
|
271 | 246 | |
|
272 | 247 | [[package]] |
|
273 | 248 | name = "net2" |
|
274 | 249 | version = "0.2.33" |
|
275 | 250 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
276 | 251 | dependencies = [ |
|
277 | 252 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", |
|
278 |
"libc 0.2.6 |
|
|
253 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
279 | 254 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
280 | 255 | ] |
|
281 | 256 | |
|
282 | 257 | [[package]] |
|
283 | name = "num_cpus" | |
|
284 |
version = " |
|
|
258 | name = "pin-project-lite" | |
|
259 | version = "0.1.4" | |
|
260 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
261 | ||
|
262 | [[package]] | |
|
263 | name = "pin-utils" | |
|
264 | version = "0.1.0-alpha.4" | |
|
265 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
266 | ||
|
267 | [[package]] | |
|
268 | name = "proc-macro-hack" | |
|
269 | version = "0.5.15" | |
|
270 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
271 | ||
|
272 | [[package]] | |
|
273 | name = "proc-macro-nested" | |
|
274 | version = "0.1.4" | |
|
275 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
276 | ||
|
277 | [[package]] | |
|
278 | name = "proc-macro2" | |
|
279 | version = "1.0.10" | |
|
285 | 280 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
286 | 281 | dependencies = [ |
|
287 |
" |
|
|
288 | "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
282 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
289 | 283 | ] |
|
290 | 284 | |
|
291 | 285 | [[package]] |
|
292 |
name = " |
|
|
293 |
version = " |
|
|
286 | name = "quote" | |
|
287 | version = "1.0.3" | |
|
294 | 288 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
295 | 289 | dependencies = [ |
|
296 |
" |
|
|
297 | "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
298 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
299 | ] | |
|
300 | ||
|
301 | [[package]] | |
|
302 | name = "parking_lot_core" | |
|
303 | version = "0.6.2" | |
|
304 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
305 | dependencies = [ | |
|
306 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
307 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
308 | "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
309 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
310 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
311 | "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
312 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
290 | "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
313 | 291 | ] |
|
314 | 292 | |
|
315 | 293 | [[package]] |
|
316 | 294 | name = "redox_syscall" |
|
317 | 295 | version = "0.1.56" |
|
318 | 296 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
319 | 297 | |
|
320 | 298 | [[package]] |
|
321 | name = "rustc_version" | |
|
322 | version = "0.2.3" | |
|
323 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
324 | dependencies = [ | |
|
325 | "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
326 | ] | |
|
327 | ||
|
328 | [[package]] | |
|
329 | name = "scopeguard" | |
|
330 | version = "1.1.0" | |
|
331 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
332 | ||
|
333 | [[package]] | |
|
334 | name = "semver" | |
|
335 | version = "0.9.0" | |
|
336 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
337 | dependencies = [ | |
|
338 | "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
339 | ] | |
|
340 | ||
|
341 | [[package]] | |
|
342 | name = "semver-parser" | |
|
343 | version = "0.7.0" | |
|
344 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
345 | ||
|
346 | [[package]] | |
|
347 | 299 | name = "signal-hook-registry" |
|
348 | 300 | version = "1.2.0" |
|
349 | 301 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
350 | 302 | dependencies = [ |
|
351 | 303 | "arc-swap 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", |
|
352 |
"libc 0.2.6 |
|
|
304 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
353 | 305 | ] |
|
354 | 306 | |
|
355 | 307 | [[package]] |
|
356 | 308 | name = "slab" |
|
357 | 309 | version = "0.4.2" |
|
358 | 310 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
359 | 311 | |
|
360 | 312 | [[package]] |
|
361 | name = "smallvec" | |
|
362 | version = "0.6.13" | |
|
363 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
364 | dependencies = [ | |
|
365 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
366 | ] | |
|
367 | ||
|
368 | [[package]] | |
|
369 | 313 | name = "socket2" |
|
370 |
version = "0.3.1 |
|
|
314 | version = "0.3.12" | |
|
371 | 315 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
372 | 316 | dependencies = [ |
|
373 | 317 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", |
|
374 |
"libc 0.2.6 |
|
|
318 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
375 | 319 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", |
|
376 | 320 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
377 | 321 | ] |
|
378 | 322 | |
|
379 | 323 | [[package]] |
|
380 |
name = " |
|
|
381 |
version = " |
|
|
324 | name = "syn" | |
|
325 | version = "1.0.17" | |
|
382 | 326 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
383 | 327 | dependencies = [ |
|
384 |
" |
|
|
385 |
" |
|
|
386 |
" |
|
|
387 | "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
388 | "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
389 | "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
390 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
391 | "tokio-fs 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
392 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
393 | "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
394 | "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
395 | "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
396 | "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
397 | "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
398 | "tokio-udp 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
399 | "tokio-uds 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
400 | ] | |
|
401 | ||
|
402 | [[package]] | |
|
403 | name = "tokio-codec" | |
|
404 | version = "0.1.2" | |
|
405 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
406 | dependencies = [ | |
|
407 | "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
408 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
409 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
410 | ] | |
|
411 | ||
|
412 | [[package]] | |
|
413 | name = "tokio-current-thread" | |
|
414 | version = "0.1.7" | |
|
415 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
416 | dependencies = [ | |
|
417 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
418 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
328 | "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
329 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
330 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
419 | 331 | ] |
|
420 | 332 | |
|
421 | 333 | [[package]] |
|
422 |
name = "tokio |
|
|
423 |
version = "0. |
|
|
424 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
425 | dependencies = [ | |
|
426 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
427 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
428 | ] | |
|
429 | ||
|
430 | [[package]] | |
|
431 | name = "tokio-fs" | |
|
432 | version = "0.1.7" | |
|
433 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
434 | dependencies = [ | |
|
435 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
436 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
437 | "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
438 | ] | |
|
439 | ||
|
440 | [[package]] | |
|
441 | name = "tokio-hglib" | |
|
442 | version = "0.2.0" | |
|
334 | name = "tokio" | |
|
335 | version = "0.2.18" | |
|
443 | 336 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
444 | 337 | dependencies = [ |
|
445 |
"bytes 0.4 |
|
|
446 |
"futures |
|
|
447 | "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
448 | "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
449 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
450 | "tokio-process 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
451 | "tokio-uds 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
452 | ] | |
|
453 | ||
|
454 | [[package]] | |
|
455 | name = "tokio-io" | |
|
456 | version = "0.1.13" | |
|
457 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
458 | dependencies = [ | |
|
459 | "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
460 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
461 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
462 | ] | |
|
463 | ||
|
464 | [[package]] | |
|
465 | name = "tokio-process" | |
|
466 | version = "0.2.5" | |
|
467 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
468 | dependencies = [ | |
|
469 | "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
470 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
338 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
339 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
471 | 340 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
|
472 |
"libc 0.2.6 |
|
|
473 |
" |
|
|
341 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
342 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
474 | 343 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", |
|
475 | 344 | "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", |
|
476 |
" |
|
|
477 |
" |
|
|
478 |
" |
|
|
345 | "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
346 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
347 | "signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
348 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
349 | "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
479 | 350 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
480 | 351 | ] |
|
481 | 352 | |
|
482 | 353 | [[package]] |
|
483 |
name = "tokio- |
|
|
484 |
version = "0. |
|
|
485 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
486 | dependencies = [ | |
|
487 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
488 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
489 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
490 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
491 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
492 | "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
493 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
494 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
495 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
496 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
497 | "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
498 | ] | |
|
499 | ||
|
500 | [[package]] | |
|
501 | name = "tokio-signal" | |
|
502 | version = "0.2.9" | |
|
354 | name = "tokio-hglib" | |
|
355 | version = "0.3.0" | |
|
503 | 356 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
504 | 357 | dependencies = [ |
|
505 |
" |
|
|
506 |
" |
|
|
507 |
" |
|
|
508 |
" |
|
|
509 |
" |
|
|
510 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
511 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
512 | "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
513 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
514 | ] | |
|
515 | ||
|
516 | [[package]] | |
|
517 | name = "tokio-sync" | |
|
518 | version = "0.1.8" | |
|
519 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
520 | dependencies = [ | |
|
521 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
522 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
523 | ] | |
|
524 | ||
|
525 | [[package]] | |
|
526 | name = "tokio-tcp" | |
|
527 | version = "0.1.4" | |
|
528 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
529 | dependencies = [ | |
|
530 | "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
531 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
532 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
533 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
534 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
535 | "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
358 | "async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
359 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
360 | "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
361 | "tokio 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
362 | "tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
536 | 363 | ] |
|
537 | 364 | |
|
538 | 365 | [[package]] |
|
539 |
name = "tokio- |
|
|
540 |
version = "0. |
|
|
366 | name = "tokio-macros" | |
|
367 | version = "0.2.5" | |
|
541 | 368 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
542 | 369 | dependencies = [ |
|
543 |
" |
|
|
544 |
" |
|
|
545 |
" |
|
|
546 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
547 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
548 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
549 | "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
550 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
551 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
552 | ] | |
|
553 | ||
|
554 | [[package]] | |
|
555 | name = "tokio-timer" | |
|
556 | version = "0.2.13" | |
|
557 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
558 | dependencies = [ | |
|
559 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
560 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
561 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
562 | "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
370 | "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
371 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
372 | "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
563 | 373 | ] |
|
564 | 374 | |
|
565 | 375 | [[package]] |
|
566 |
name = "tokio-u |
|
|
567 |
version = "0. |
|
|
376 | name = "tokio-util" | |
|
377 | version = "0.3.1" | |
|
568 | 378 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
569 | 379 | dependencies = [ |
|
570 |
"bytes 0.4 |
|
|
571 |
"futures |
|
|
380 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
381 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
382 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
572 | 383 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
573 |
" |
|
|
574 |
"tokio |
|
|
575 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
576 | "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
384 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
385 | "tokio 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
577 | 386 | ] |
|
578 | 387 | |
|
579 | 388 | [[package]] |
|
580 |
name = " |
|
|
581 |
version = "0.2. |
|
|
389 | name = "unicode-xid" | |
|
390 | version = "0.2.0" | |
|
582 | 391 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
583 | dependencies = [ | |
|
584 | "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
585 | "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
586 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
587 | "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
588 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
589 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
590 | "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
591 | "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
592 | "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
593 | "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | |
|
594 | ] | |
|
595 | 392 | |
|
596 | 393 | [[package]] |
|
597 | 394 | name = "winapi" |
|
598 | 395 | version = "0.2.8" |
|
599 | 396 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
600 | 397 | |
|
601 | 398 | [[package]] |
|
602 | 399 | name = "winapi" |
|
603 | 400 | version = "0.3.8" |
|
604 | 401 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
605 | 402 | dependencies = [ |
|
606 | 403 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
|
607 | 404 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
|
608 | 405 | ] |
|
609 | 406 | |
|
610 | 407 | [[package]] |
|
611 | 408 | name = "winapi-build" |
|
612 | 409 | version = "0.1.1" |
|
613 | 410 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
614 | 411 | |
|
615 | 412 | [[package]] |
|
616 | 413 | name = "winapi-i686-pc-windows-gnu" |
|
617 | 414 | version = "0.4.0" |
|
618 | 415 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
619 | 416 | |
|
620 | 417 | [[package]] |
|
621 | 418 | name = "winapi-x86_64-pc-windows-gnu" |
|
622 | 419 | version = "0.4.0" |
|
623 | 420 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
624 | 421 | |
|
625 | 422 | [[package]] |
|
626 | 423 | name = "ws2_32-sys" |
|
627 | 424 | version = "0.2.1" |
|
628 | 425 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
629 | 426 | dependencies = [ |
|
630 | 427 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
|
631 | 428 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", |
|
632 | 429 | ] |
|
633 | 430 | |
|
634 | 431 | [metadata] |
|
635 | 432 | "checksum arc-swap 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d663a8e9a99154b5fb793032533f6328da35e23aac63d5c152279aa8ba356825" |
|
636 |
"checksum a |
|
|
433 | "checksum async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "da71fef07bc806586090247e971229289f64c210a278ee5ae419314eb386b31d" | |
|
637 | 434 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" |
|
638 |
"checksum byte |
|
|
639 | "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" | |
|
435 | "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" | |
|
640 | 436 | "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" |
|
641 | 437 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" |
|
642 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" | |
|
643 | "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" | |
|
644 | "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" | |
|
645 | "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" | |
|
646 | "checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" | |
|
647 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" | |
|
648 | "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" | |
|
649 | "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" | |
|
650 | 438 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" |
|
651 | 439 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" |
|
652 |
"checksum futures 0. |
|
|
653 | "checksum hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e" | |
|
440 | "checksum futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" | |
|
441 | "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" | |
|
442 | "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" | |
|
443 | "checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" | |
|
444 | "checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" | |
|
445 | "checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" | |
|
446 | "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" | |
|
447 | "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" | |
|
448 | "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" | |
|
654 | 449 | "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" |
|
655 | 450 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" |
|
656 | 451 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" |
|
657 |
"checksum libc 0.2.6 |
|
|
658 | "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" | |
|
452 | "checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" | |
|
659 | 453 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
|
660 | "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" | |
|
661 | "checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" | |
|
454 | "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" | |
|
662 | 455 | "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" |
|
663 | 456 | "checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" |
|
664 | 457 | "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" |
|
665 | 458 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" |
|
666 | 459 | "checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" |
|
667 | 460 | "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" |
|
668 |
"checksum |
|
|
669 |
"checksum p |
|
|
670 |
"checksum p |
|
|
461 | "checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" | |
|
462 | "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" | |
|
463 | "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" | |
|
464 | "checksum proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" | |
|
465 | "checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" | |
|
466 | "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" | |
|
671 | 467 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" |
|
672 | "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" | |
|
673 | "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" | |
|
674 | "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" | |
|
675 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" | |
|
676 | 468 | "checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" |
|
677 | 469 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" |
|
678 |
"checksum s |
|
|
679 |
"checksum s |
|
|
680 |
"checksum tokio 0. |
|
|
681 |
"checksum tokio- |
|
|
682 | "checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" | |
|
683 |
"checksum tokio- |
|
|
684 | "checksum tokio-fs 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" | |
|
685 | "checksum tokio-hglib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a138c3cb866c8a95ceddae44634bb159eefeebcdba45aec2158f8ad6c201e6d" | |
|
686 | "checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" | |
|
687 | "checksum tokio-process 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "382d90f43fa31caebe5d3bc6cfd854963394fff3b8cb59d5146607aaae7e7e43" | |
|
688 | "checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" | |
|
689 | "checksum tokio-signal 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c34c6e548f101053321cba3da7cbb87a610b85555884c41b07da2eb91aff12" | |
|
690 | "checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" | |
|
691 | "checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" | |
|
692 | "checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" | |
|
693 | "checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" | |
|
694 | "checksum tokio-udp 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" | |
|
695 | "checksum tokio-uds 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" | |
|
470 | "checksum socket2 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" | |
|
471 | "checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" | |
|
472 | "checksum tokio 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "34ef16d072d2b6dc8b4a56c70f5c5ced1a37752116f8e7c1e80c659aa7cb6713" | |
|
473 | "checksum tokio-hglib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8d7e2b5d44911ebf67a1044423604f5f69206c5cbbd7e911b4966e6831514bca" | |
|
474 | "checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" | |
|
475 | "checksum tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" | |
|
476 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" | |
|
696 | 477 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" |
|
697 | 478 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" |
|
698 | 479 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" |
|
699 | 480 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" |
|
700 | 481 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" |
|
701 | 482 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" |
@@ -1,23 +1,25 | |||
|
1 | 1 | [package] |
|
2 | 2 | name = "chg" |
|
3 | 3 | version = "0.1.0" |
|
4 | 4 | authors = ["Yuya Nishihara <yuya@tcha.org>"] |
|
5 | 5 | description = "Client for Mercurial command server with cHg extension" |
|
6 | 6 | license = "GPL-2.0+" |
|
7 | 7 | edition = "2018" |
|
8 | 8 | |
|
9 | 9 | # TODO: enable auto discovery |
|
10 | 10 | autobins = false |
|
11 | 11 | |
|
12 | 12 | [dependencies] |
|
13 | bytes = "0.4" | |
|
14 |
|
|
|
13 | async-trait = "0.1" | |
|
14 | bytes = "0.5" | |
|
15 | futures = "0.3" | |
|
15 | 16 | libc = "0.2" |
|
16 | 17 | log = { version = "0.4", features = ["std"] } |
|
17 |
tokio = "0. |
|
|
18 | tokio-hglib = "0.2" | |
|
19 | tokio-process = "0.2.3" | |
|
20 | tokio-timer = "0.2" | |
|
18 | tokio-hglib = "0.3" | |
|
19 | ||
|
20 | [dependencies.tokio] | |
|
21 | version = "0.2" | |
|
22 | features = ["rt-core", "io-util", "time", "process", "macros"] | |
|
21 | 23 | |
|
22 | 24 | [build-dependencies] |
|
23 | 25 | cc = "1.0" |
@@ -1,128 +1,128 | |||
|
1 | 1 | // Copyright 2018 Yuya Nishihara <yuya@tcha.org> |
|
2 | 2 | // |
|
3 | 3 | // This software may be used and distributed according to the terms of the |
|
4 | 4 | // GNU General Public License version 2 or any later version. |
|
5 | 5 | |
|
6 | 6 | //! cHg extensions to command server client. |
|
7 | 7 | |
|
8 | 8 | use bytes::{BufMut, Bytes, BytesMut}; |
|
9 | 9 | use std::ffi::OsStr; |
|
10 | 10 | use std::io; |
|
11 | 11 | use std::mem; |
|
12 | 12 | use std::os::unix::ffi::OsStrExt; |
|
13 | 13 | use std::os::unix::io::AsRawFd; |
|
14 | 14 | use std::path::Path; |
|
15 | 15 | use tokio_hglib::protocol::{OneShotQuery, OneShotRequest}; |
|
16 | 16 | use tokio_hglib::{Client, Connection}; |
|
17 | 17 | |
|
18 | 18 | use crate::attachio::AttachIo; |
|
19 | 19 | use crate::message::{self, Instruction}; |
|
20 | 20 | use crate::runcommand::ChgRunCommand; |
|
21 | 21 | use crate::uihandler::SystemHandler; |
|
22 | 22 | |
|
23 | 23 | pub trait ChgClientExt<C> |
|
24 | 24 | where |
|
25 | 25 | C: Connection + AsRawFd, |
|
26 | 26 | { |
|
27 | 27 | /// Attaches the client file descriptors to the server. |
|
28 | 28 | fn attach_io<I, O, E>(self, stdin: I, stdout: O, stderr: E) -> AttachIo<C, I, O, E> |
|
29 | 29 | where |
|
30 | 30 | I: AsRawFd, |
|
31 | 31 | O: AsRawFd, |
|
32 | 32 | E: AsRawFd; |
|
33 | 33 | |
|
34 | 34 | /// Changes the working directory of the server. |
|
35 | 35 | fn set_current_dir(self, dir: impl AsRef<Path>) -> OneShotRequest<C>; |
|
36 | 36 | |
|
37 | 37 | /// Updates the environment variables of the server. |
|
38 | 38 | fn set_env_vars_os( |
|
39 | 39 | self, |
|
40 | 40 | vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>, |
|
41 | 41 | ) -> OneShotRequest<C>; |
|
42 | 42 | |
|
43 | 43 | /// Changes the process title of the server. |
|
44 | 44 | fn set_process_name(self, name: impl AsRef<OsStr>) -> OneShotRequest<C>; |
|
45 | 45 | |
|
46 | 46 | /// Changes the umask of the server process. |
|
47 | 47 | fn set_umask(self, mask: u32) -> OneShotRequest<C>; |
|
48 | 48 | |
|
49 | 49 | /// Runs the specified Mercurial command with cHg extension. |
|
50 | 50 | fn run_command_chg<H>( |
|
51 | 51 | self, |
|
52 | 52 | handler: H, |
|
53 | 53 | args: impl IntoIterator<Item = impl AsRef<OsStr>>, |
|
54 | 54 | ) -> ChgRunCommand<C, H> |
|
55 | 55 | where |
|
56 | 56 | H: SystemHandler; |
|
57 | 57 | |
|
58 | 58 | /// Validates if the server can run Mercurial commands with the expected |
|
59 | 59 | /// configuration. |
|
60 | 60 | /// |
|
61 | 61 | /// The `args` should contain early command arguments such as `--config` |
|
62 | 62 | /// and `-R`. |
|
63 | 63 | /// |
|
64 | 64 | /// Client-side environment must be sent prior to this request, by |
|
65 | 65 | /// `set_current_dir()` and `set_env_vars_os()`. |
|
66 | 66 | fn validate( |
|
67 | 67 | self, |
|
68 | 68 | args: impl IntoIterator<Item = impl AsRef<OsStr>>, |
|
69 | 69 | ) -> OneShotQuery<C, fn(Bytes) -> io::Result<Vec<Instruction>>>; |
|
70 | 70 | } |
|
71 | 71 | |
|
72 | 72 | impl<C> ChgClientExt<C> for Client<C> |
|
73 | 73 | where |
|
74 | 74 | C: Connection + AsRawFd, |
|
75 | 75 | { |
|
76 | 76 | fn attach_io<I, O, E>(self, stdin: I, stdout: O, stderr: E) -> AttachIo<C, I, O, E> |
|
77 | 77 | where |
|
78 | 78 | I: AsRawFd, |
|
79 | 79 | O: AsRawFd, |
|
80 | 80 | E: AsRawFd, |
|
81 | 81 | { |
|
82 | 82 | AttachIo::with_client(self, stdin, stdout, Some(stderr)) |
|
83 | 83 | } |
|
84 | 84 | |
|
85 | 85 | fn set_current_dir(self, dir: impl AsRef<Path>) -> OneShotRequest<C> { |
|
86 | 86 | OneShotRequest::start_with_args(self, b"chdir", dir.as_ref().as_os_str().as_bytes()) |
|
87 | 87 | } |
|
88 | 88 | |
|
89 | 89 | fn set_env_vars_os( |
|
90 | 90 | self, |
|
91 | 91 | vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>, |
|
92 | 92 | ) -> OneShotRequest<C> { |
|
93 | 93 | OneShotRequest::start_with_args(self, b"setenv", message::pack_env_vars_os(vars)) |
|
94 | 94 | } |
|
95 | 95 | |
|
96 | 96 | fn set_process_name(self, name: impl AsRef<OsStr>) -> OneShotRequest<C> { |
|
97 | 97 | OneShotRequest::start_with_args(self, b"setprocname", name.as_ref().as_bytes()) |
|
98 | 98 | } |
|
99 | 99 | |
|
100 | 100 | fn set_umask(self, mask: u32) -> OneShotRequest<C> { |
|
101 | 101 | let mut args = BytesMut::with_capacity(mem::size_of_val(&mask)); |
|
102 |
args.put_u32 |
|
|
102 | args.put_u32(mask); | |
|
103 | 103 | OneShotRequest::start_with_args(self, b"setumask2", args) |
|
104 | 104 | } |
|
105 | 105 | |
|
106 | 106 | fn run_command_chg<H>( |
|
107 | 107 | self, |
|
108 | 108 | handler: H, |
|
109 | 109 | args: impl IntoIterator<Item = impl AsRef<OsStr>>, |
|
110 | 110 | ) -> ChgRunCommand<C, H> |
|
111 | 111 | where |
|
112 | 112 | H: SystemHandler, |
|
113 | 113 | { |
|
114 | 114 | ChgRunCommand::with_client(self, handler, message::pack_args_os(args)) |
|
115 | 115 | } |
|
116 | 116 | |
|
117 | 117 | fn validate( |
|
118 | 118 | self, |
|
119 | 119 | args: impl IntoIterator<Item = impl AsRef<OsStr>>, |
|
120 | 120 | ) -> OneShotQuery<C, fn(Bytes) -> io::Result<Vec<Instruction>>> { |
|
121 | 121 | OneShotQuery::start_with_args( |
|
122 | 122 | self, |
|
123 | 123 | b"validate", |
|
124 | 124 | message::pack_args_os(args), |
|
125 | 125 | message::parse_instructions, |
|
126 | 126 | ) |
|
127 | 127 | } |
|
128 | 128 | } |
@@ -1,490 +1,490 | |||
|
1 | 1 | // Copyright 2011, 2018 Yuya Nishihara <yuya@tcha.org> |
|
2 | 2 | // |
|
3 | 3 | // This software may be used and distributed according to the terms of the |
|
4 | 4 | // GNU General Public License version 2 or any later version. |
|
5 | 5 | |
|
6 | 6 | //! Utility for locating command-server process. |
|
7 | 7 | |
|
8 | 8 | use futures::future::{self, Either, Loop}; |
|
9 | 9 | use log::debug; |
|
10 | 10 | use std::env; |
|
11 | 11 | use std::ffi::{OsStr, OsString}; |
|
12 | 12 | use std::fs::{self, DirBuilder}; |
|
13 | 13 | use std::io; |
|
14 | 14 | use std::os::unix::ffi::{OsStrExt, OsStringExt}; |
|
15 | 15 | use std::os::unix::fs::{DirBuilderExt, MetadataExt}; |
|
16 | 16 | use std::path::{Path, PathBuf}; |
|
17 |
use std::process |
|
|
17 | use std::process; | |
|
18 | 18 | use std::time::Duration; |
|
19 | 19 | use tokio::prelude::*; |
|
20 | use tokio::process::{Child, Command}; | |
|
21 | use tokio::time; | |
|
20 | 22 | use tokio_hglib::UnixClient; |
|
21 | use tokio_process::{Child, CommandExt}; | |
|
22 | use tokio_timer; | |
|
23 | 23 | |
|
24 | 24 | use crate::clientext::ChgClientExt; |
|
25 | 25 | use crate::message::{Instruction, ServerSpec}; |
|
26 | 26 | use crate::procutil; |
|
27 | 27 | |
|
28 | 28 | const REQUIRED_SERVER_CAPABILITIES: &[&str] = &[ |
|
29 | 29 | "attachio", |
|
30 | 30 | "chdir", |
|
31 | 31 | "runcommand", |
|
32 | 32 | "setenv", |
|
33 | 33 | "setumask2", |
|
34 | 34 | "validate", |
|
35 | 35 | ]; |
|
36 | 36 | |
|
37 | 37 | /// Helper to connect to and spawn a server process. |
|
38 | 38 | #[derive(Clone, Debug)] |
|
39 | 39 | pub struct Locator { |
|
40 | 40 | hg_command: OsString, |
|
41 | 41 | hg_early_args: Vec<OsString>, |
|
42 | 42 | current_dir: PathBuf, |
|
43 | 43 | env_vars: Vec<(OsString, OsString)>, |
|
44 | 44 | process_id: u32, |
|
45 | 45 | base_sock_path: PathBuf, |
|
46 | 46 | redirect_sock_path: Option<PathBuf>, |
|
47 | 47 | timeout: Duration, |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | impl Locator { |
|
51 | 51 | /// Creates locator capturing the current process environment. |
|
52 | 52 | /// |
|
53 | 53 | /// If no `$CHGSOCKNAME` is specified, the socket directory will be |
|
54 | 54 | /// created as necessary. |
|
55 | 55 | pub fn prepare_from_env() -> io::Result<Locator> { |
|
56 | 56 | Ok(Locator { |
|
57 | 57 | hg_command: default_hg_command(), |
|
58 | 58 | hg_early_args: Vec::new(), |
|
59 | 59 | current_dir: env::current_dir()?, |
|
60 | 60 | env_vars: env::vars_os().collect(), |
|
61 | 61 | process_id: process::id(), |
|
62 | 62 | base_sock_path: prepare_server_socket_path()?, |
|
63 | 63 | redirect_sock_path: None, |
|
64 | 64 | timeout: default_timeout(), |
|
65 | 65 | }) |
|
66 | 66 | } |
|
67 | 67 | |
|
68 | 68 | /// Temporary socket path for this client process. |
|
69 | 69 | fn temp_sock_path(&self) -> PathBuf { |
|
70 | 70 | let src = self.base_sock_path.as_os_str().as_bytes(); |
|
71 | 71 | let mut buf = Vec::with_capacity(src.len() + 6); // "{src}.{pid}".len() |
|
72 | 72 | buf.extend_from_slice(src); |
|
73 | 73 | buf.extend_from_slice(format!(".{}", self.process_id).as_bytes()); |
|
74 | 74 | OsString::from_vec(buf).into() |
|
75 | 75 | } |
|
76 | 76 | |
|
77 | 77 | /// Specifies the arguments to be passed to the server at start. |
|
78 | 78 | pub fn set_early_args(&mut self, args: impl IntoIterator<Item = impl AsRef<OsStr>>) { |
|
79 | 79 | self.hg_early_args = args.into_iter().map(|a| a.as_ref().to_owned()).collect(); |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | 82 | /// Connects to the server. |
|
83 | 83 | /// |
|
84 | 84 | /// The server process will be spawned if not running. |
|
85 | 85 | pub fn connect(self) -> impl Future<Item = (Self, UnixClient), Error = io::Error> { |
|
86 | 86 | future::loop_fn((self, 0), |(loc, cnt)| { |
|
87 | 87 | if cnt < 10 { |
|
88 | 88 | let fut = loc |
|
89 | 89 | .try_connect() |
|
90 | 90 | .and_then(|(loc, client)| { |
|
91 | 91 | client |
|
92 | 92 | .validate(&loc.hg_early_args) |
|
93 | 93 | .map(|(client, instructions)| (loc, client, instructions)) |
|
94 | 94 | }) |
|
95 | 95 | .and_then(move |(loc, client, instructions)| { |
|
96 | 96 | loc.run_instructions(client, instructions, cnt) |
|
97 | 97 | }); |
|
98 | 98 | Either::A(fut) |
|
99 | 99 | } else { |
|
100 | 100 | let msg = format!( |
|
101 | 101 | concat!( |
|
102 | 102 | "too many redirections.\n", |
|
103 | 103 | "Please make sure {:?} is not a wrapper which ", |
|
104 | 104 | "changes sensitive environment variables ", |
|
105 | 105 | "before executing hg. If you have to use a ", |
|
106 | 106 | "wrapper, wrap chg instead of hg.", |
|
107 | 107 | ), |
|
108 | 108 | loc.hg_command |
|
109 | 109 | ); |
|
110 | 110 | Either::B(future::err(io::Error::new(io::ErrorKind::Other, msg))) |
|
111 | 111 | } |
|
112 | 112 | }) |
|
113 | 113 | } |
|
114 | 114 | |
|
115 | 115 | /// Runs instructions received from the server. |
|
116 | 116 | fn run_instructions( |
|
117 | 117 | mut self, |
|
118 | 118 | client: UnixClient, |
|
119 | 119 | instructions: Vec<Instruction>, |
|
120 | 120 | cnt: usize, |
|
121 | 121 | ) -> io::Result<Loop<(Self, UnixClient), (Self, usize)>> { |
|
122 | 122 | let mut reconnect = false; |
|
123 | 123 | for inst in instructions { |
|
124 | 124 | debug!("instruction: {:?}", inst); |
|
125 | 125 | match inst { |
|
126 | 126 | Instruction::Exit(_) => { |
|
127 | 127 | // Just returns the current connection to run the |
|
128 | 128 | // unparsable command and report the error |
|
129 | 129 | return Ok(Loop::Break((self, client))); |
|
130 | 130 | } |
|
131 | 131 | Instruction::Reconnect => { |
|
132 | 132 | reconnect = true; |
|
133 | 133 | } |
|
134 | 134 | Instruction::Redirect(path) => { |
|
135 | 135 | if path.parent() != self.base_sock_path.parent() { |
|
136 | 136 | let msg = format!( |
|
137 | 137 | "insecure redirect instruction from server: {}", |
|
138 | 138 | path.display() |
|
139 | 139 | ); |
|
140 | 140 | return Err(io::Error::new(io::ErrorKind::InvalidData, msg)); |
|
141 | 141 | } |
|
142 | 142 | self.redirect_sock_path = Some(path); |
|
143 | 143 | reconnect = true; |
|
144 | 144 | } |
|
145 | 145 | Instruction::Unlink(path) => { |
|
146 | 146 | if path.parent() != self.base_sock_path.parent() { |
|
147 | 147 | let msg = format!( |
|
148 | 148 | "insecure unlink instruction from server: {}", |
|
149 | 149 | path.display() |
|
150 | 150 | ); |
|
151 | 151 | return Err(io::Error::new(io::ErrorKind::InvalidData, msg)); |
|
152 | 152 | } |
|
153 | 153 | fs::remove_file(path).unwrap_or(()); // may race |
|
154 | 154 | } |
|
155 | 155 | } |
|
156 | 156 | } |
|
157 | 157 | |
|
158 | 158 | if reconnect { |
|
159 | 159 | Ok(Loop::Continue((self, cnt + 1))) |
|
160 | 160 | } else { |
|
161 | 161 | Ok(Loop::Break((self, client))) |
|
162 | 162 | } |
|
163 | 163 | } |
|
164 | 164 | |
|
165 | 165 | /// Tries to connect to the existing server, or spawns new if not running. |
|
166 | 166 | fn try_connect(self) -> impl Future<Item = (Self, UnixClient), Error = io::Error> { |
|
167 | 167 | let sock_path = self |
|
168 | 168 | .redirect_sock_path |
|
169 | 169 | .as_ref() |
|
170 | 170 | .unwrap_or(&self.base_sock_path) |
|
171 | 171 | .clone(); |
|
172 | 172 | debug!("try connect to {}", sock_path.display()); |
|
173 | 173 | UnixClient::connect(sock_path) |
|
174 | 174 | .then(|res| { |
|
175 | 175 | match res { |
|
176 | 176 | Ok(client) => Either::A(future::ok((self, client))), |
|
177 | 177 | Err(_) => { |
|
178 | 178 | // Prevent us from being re-connected to the outdated |
|
179 | 179 | // master server: We were told by the server to redirect |
|
180 | 180 | // to redirect_sock_path, which didn't work. We do not |
|
181 | 181 | // want to connect to the same master server again |
|
182 | 182 | // because it would probably tell us the same thing. |
|
183 | 183 | if self.redirect_sock_path.is_some() { |
|
184 | 184 | fs::remove_file(&self.base_sock_path).unwrap_or(()); |
|
185 | 185 | // may race |
|
186 | 186 | } |
|
187 | 187 | Either::B(self.spawn_connect()) |
|
188 | 188 | } |
|
189 | 189 | } |
|
190 | 190 | }) |
|
191 | 191 | .and_then(|(loc, client)| { |
|
192 | 192 | check_server_capabilities(client.server_spec())?; |
|
193 | 193 | Ok((loc, client)) |
|
194 | 194 | }) |
|
195 | 195 | .and_then(|(loc, client)| { |
|
196 | 196 | // It's purely optional, and the server might not support this command. |
|
197 | 197 | if client.server_spec().capabilities.contains("setprocname") { |
|
198 | 198 | let fut = client |
|
199 | 199 | .set_process_name(format!("chg[worker/{}]", loc.process_id)) |
|
200 | 200 | .map(|client| (loc, client)); |
|
201 | 201 | Either::A(fut) |
|
202 | 202 | } else { |
|
203 | 203 | Either::B(future::ok((loc, client))) |
|
204 | 204 | } |
|
205 | 205 | }) |
|
206 | 206 | .and_then(|(loc, client)| { |
|
207 | 207 | client |
|
208 | 208 | .set_current_dir(&loc.current_dir) |
|
209 | 209 | .map(|client| (loc, client)) |
|
210 | 210 | }) |
|
211 | 211 | .and_then(|(loc, client)| { |
|
212 | 212 | client |
|
213 | 213 | .set_env_vars_os(loc.env_vars.iter().cloned()) |
|
214 | 214 | .map(|client| (loc, client)) |
|
215 | 215 | }) |
|
216 | 216 | } |
|
217 | 217 | |
|
218 | 218 | /// Spawns new server process and connects to it. |
|
219 | 219 | /// |
|
220 | 220 | /// The server will be spawned at the current working directory, then |
|
221 | 221 | /// chdir to "/", so that the server will load configs from the target |
|
222 | 222 | /// repository. |
|
223 | 223 | fn spawn_connect(self) -> impl Future<Item = (Self, UnixClient), Error = io::Error> { |
|
224 | 224 | let sock_path = self.temp_sock_path(); |
|
225 | 225 | debug!("start cmdserver at {}", sock_path.display()); |
|
226 | 226 | Command::new(&self.hg_command) |
|
227 | 227 | .arg("serve") |
|
228 | 228 | .arg("--cmdserver") |
|
229 | 229 | .arg("chgunix") |
|
230 | 230 | .arg("--address") |
|
231 | 231 | .arg(&sock_path) |
|
232 | 232 | .arg("--daemon-postexec") |
|
233 | 233 | .arg("chdir:/") |
|
234 | 234 | .args(&self.hg_early_args) |
|
235 | 235 | .current_dir(&self.current_dir) |
|
236 | 236 | .env_clear() |
|
237 | 237 | .envs(self.env_vars.iter().cloned()) |
|
238 | 238 | .env("CHGINTERNALMARK", "") |
|
239 |
.spawn |
|
|
239 | .spawn() | |
|
240 | 240 | .into_future() |
|
241 | 241 | .and_then(|server| self.connect_spawned(server, sock_path)) |
|
242 | 242 | .and_then(|(loc, client, sock_path)| { |
|
243 | 243 | debug!( |
|
244 | 244 | "rename {} to {}", |
|
245 | 245 | sock_path.display(), |
|
246 | 246 | loc.base_sock_path.display() |
|
247 | 247 | ); |
|
248 | 248 | fs::rename(&sock_path, &loc.base_sock_path)?; |
|
249 | 249 | Ok((loc, client)) |
|
250 | 250 | }) |
|
251 | 251 | } |
|
252 | 252 | |
|
253 | 253 | /// Tries to connect to the just spawned server repeatedly until timeout |
|
254 | 254 | /// exceeded. |
|
255 | 255 | fn connect_spawned( |
|
256 | 256 | self, |
|
257 | 257 | server: Child, |
|
258 | 258 | sock_path: PathBuf, |
|
259 | 259 | ) -> impl Future<Item = (Self, UnixClient, PathBuf), Error = io::Error> { |
|
260 | 260 | debug!("try connect to {} repeatedly", sock_path.display()); |
|
261 | 261 | let connect = future::loop_fn(sock_path, |sock_path| { |
|
262 | 262 | UnixClient::connect(sock_path.clone()).then(|res| { |
|
263 | 263 | match res { |
|
264 | 264 | Ok(client) => Either::A(future::ok(Loop::Break((client, sock_path)))), |
|
265 | 265 | Err(_) => { |
|
266 | 266 | // try again with slight delay |
|
267 |
let fut = |
|
|
267 | let fut = time::delay_for(Duration::from_millis(10)) | |
|
268 | 268 | .map(|()| Loop::Continue(sock_path)) |
|
269 | 269 | .map_err(|err| io::Error::new(io::ErrorKind::Other, err)); |
|
270 | 270 | Either::B(fut) |
|
271 | 271 | } |
|
272 | 272 | } |
|
273 | 273 | }) |
|
274 | 274 | }); |
|
275 | 275 | |
|
276 | 276 | // waits for either connection established or server failed to start |
|
277 | 277 | connect |
|
278 | 278 | .select2(server) |
|
279 | 279 | .map_err(|res| res.split().0) |
|
280 | 280 | .timeout(self.timeout) |
|
281 | 281 | .map_err(|err| { |
|
282 | 282 | err.into_inner().unwrap_or_else(|| { |
|
283 | 283 | io::Error::new( |
|
284 | 284 | io::ErrorKind::TimedOut, |
|
285 | 285 | "timed out while connecting to server", |
|
286 | 286 | ) |
|
287 | 287 | }) |
|
288 | 288 | }) |
|
289 | 289 | .and_then(|res| { |
|
290 | 290 | match res { |
|
291 | 291 | Either::A(((client, sock_path), server)) => { |
|
292 | 292 | server.forget(); // continue to run in background |
|
293 | 293 | Ok((self, client, sock_path)) |
|
294 | 294 | } |
|
295 | 295 | Either::B((st, _)) => Err(io::Error::new( |
|
296 | 296 | io::ErrorKind::Other, |
|
297 | 297 | format!("server exited too early: {}", st), |
|
298 | 298 | )), |
|
299 | 299 | } |
|
300 | 300 | }) |
|
301 | 301 | } |
|
302 | 302 | } |
|
303 | 303 | |
|
304 | 304 | /// Determines the server socket to connect to. |
|
305 | 305 | /// |
|
306 | 306 | /// If no `$CHGSOCKNAME` is specified, the socket directory will be created |
|
307 | 307 | /// as necessary. |
|
308 | 308 | fn prepare_server_socket_path() -> io::Result<PathBuf> { |
|
309 | 309 | if let Some(s) = env::var_os("CHGSOCKNAME") { |
|
310 | 310 | Ok(PathBuf::from(s)) |
|
311 | 311 | } else { |
|
312 | 312 | let mut path = default_server_socket_dir(); |
|
313 | 313 | create_secure_dir(&path)?; |
|
314 | 314 | path.push("server"); |
|
315 | 315 | Ok(path) |
|
316 | 316 | } |
|
317 | 317 | } |
|
318 | 318 | |
|
319 | 319 | /// Determines the default server socket path as follows. |
|
320 | 320 | /// |
|
321 | 321 | /// 1. `$XDG_RUNTIME_DIR/chg` |
|
322 | 322 | /// 2. `$TMPDIR/chg$UID` |
|
323 | 323 | /// 3. `/tmp/chg$UID` |
|
324 | 324 | pub fn default_server_socket_dir() -> PathBuf { |
|
325 | 325 | // XDG_RUNTIME_DIR should be ignored if it has an insufficient permission. |
|
326 | 326 | // https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html |
|
327 | 327 | if let Some(Ok(s)) = env::var_os("XDG_RUNTIME_DIR").map(check_secure_dir) { |
|
328 | 328 | let mut path = PathBuf::from(s); |
|
329 | 329 | path.push("chg"); |
|
330 | 330 | path |
|
331 | 331 | } else { |
|
332 | 332 | let mut path = env::temp_dir(); |
|
333 | 333 | path.push(format!("chg{}", procutil::get_effective_uid())); |
|
334 | 334 | path |
|
335 | 335 | } |
|
336 | 336 | } |
|
337 | 337 | |
|
338 | 338 | /// Determines the default hg command. |
|
339 | 339 | pub fn default_hg_command() -> OsString { |
|
340 | 340 | // TODO: maybe allow embedding the path at compile time (or load from hgrc) |
|
341 | 341 | env::var_os("CHGHG") |
|
342 | 342 | .or(env::var_os("HG")) |
|
343 | 343 | .unwrap_or(OsStr::new("hg").to_owned()) |
|
344 | 344 | } |
|
345 | 345 | |
|
346 | 346 | fn default_timeout() -> Duration { |
|
347 | 347 | let secs = env::var("CHGTIMEOUT") |
|
348 | 348 | .ok() |
|
349 | 349 | .and_then(|s| s.parse().ok()) |
|
350 | 350 | .unwrap_or(60); |
|
351 | 351 | Duration::from_secs(secs) |
|
352 | 352 | } |
|
353 | 353 | |
|
354 | 354 | /// Creates a directory which the other users cannot access to. |
|
355 | 355 | /// |
|
356 | 356 | /// If the directory already exists, tests its permission. |
|
357 | 357 | fn create_secure_dir(path: impl AsRef<Path>) -> io::Result<()> { |
|
358 | 358 | DirBuilder::new() |
|
359 | 359 | .mode(0o700) |
|
360 | 360 | .create(path.as_ref()) |
|
361 | 361 | .or_else(|err| { |
|
362 | 362 | if err.kind() == io::ErrorKind::AlreadyExists { |
|
363 | 363 | check_secure_dir(path).map(|_| ()) |
|
364 | 364 | } else { |
|
365 | 365 | Err(err) |
|
366 | 366 | } |
|
367 | 367 | }) |
|
368 | 368 | } |
|
369 | 369 | |
|
370 | 370 | fn check_secure_dir<P>(path: P) -> io::Result<P> |
|
371 | 371 | where |
|
372 | 372 | P: AsRef<Path>, |
|
373 | 373 | { |
|
374 | 374 | let a = fs::symlink_metadata(path.as_ref())?; |
|
375 | 375 | if a.is_dir() && a.uid() == procutil::get_effective_uid() && (a.mode() & 0o777) == 0o700 { |
|
376 | 376 | Ok(path) |
|
377 | 377 | } else { |
|
378 | 378 | Err(io::Error::new(io::ErrorKind::Other, "insecure directory")) |
|
379 | 379 | } |
|
380 | 380 | } |
|
381 | 381 | |
|
382 | 382 | fn check_server_capabilities(spec: &ServerSpec) -> io::Result<()> { |
|
383 | 383 | let unsupported: Vec<_> = REQUIRED_SERVER_CAPABILITIES |
|
384 | 384 | .iter() |
|
385 | 385 | .cloned() |
|
386 | 386 | .filter(|&s| !spec.capabilities.contains(s)) |
|
387 | 387 | .collect(); |
|
388 | 388 | if unsupported.is_empty() { |
|
389 | 389 | Ok(()) |
|
390 | 390 | } else { |
|
391 | 391 | let msg = format!( |
|
392 | 392 | "insufficient server capabilities: {}", |
|
393 | 393 | unsupported.join(", ") |
|
394 | 394 | ); |
|
395 | 395 | Err(io::Error::new(io::ErrorKind::Other, msg)) |
|
396 | 396 | } |
|
397 | 397 | } |
|
398 | 398 | |
|
399 | 399 | /// Collects arguments which need to be passed to the server at start. |
|
400 | 400 | pub fn collect_early_args(args: impl IntoIterator<Item = impl AsRef<OsStr>>) -> Vec<OsString> { |
|
401 | 401 | let mut args_iter = args.into_iter(); |
|
402 | 402 | let mut early_args = Vec::new(); |
|
403 | 403 | while let Some(arg) = args_iter.next() { |
|
404 | 404 | let argb = arg.as_ref().as_bytes(); |
|
405 | 405 | if argb == b"--" { |
|
406 | 406 | break; |
|
407 | 407 | } else if argb.starts_with(b"--") { |
|
408 | 408 | let mut split = argb[2..].splitn(2, |&c| c == b'='); |
|
409 | 409 | match split.next().unwrap() { |
|
410 | 410 | b"traceback" => { |
|
411 | 411 | if split.next().is_none() { |
|
412 | 412 | early_args.push(arg.as_ref().to_owned()); |
|
413 | 413 | } |
|
414 | 414 | } |
|
415 | 415 | b"config" | b"cwd" | b"repo" | b"repository" => { |
|
416 | 416 | if split.next().is_some() { |
|
417 | 417 | // --<flag>=<val> |
|
418 | 418 | early_args.push(arg.as_ref().to_owned()); |
|
419 | 419 | } else { |
|
420 | 420 | // --<flag> <val> |
|
421 | 421 | args_iter.next().map(|val| { |
|
422 | 422 | early_args.push(arg.as_ref().to_owned()); |
|
423 | 423 | early_args.push(val.as_ref().to_owned()); |
|
424 | 424 | }); |
|
425 | 425 | } |
|
426 | 426 | } |
|
427 | 427 | _ => {} |
|
428 | 428 | } |
|
429 | 429 | } else if argb.starts_with(b"-R") { |
|
430 | 430 | if argb.len() > 2 { |
|
431 | 431 | // -R<val> |
|
432 | 432 | early_args.push(arg.as_ref().to_owned()); |
|
433 | 433 | } else { |
|
434 | 434 | // -R <val> |
|
435 | 435 | args_iter.next().map(|val| { |
|
436 | 436 | early_args.push(arg.as_ref().to_owned()); |
|
437 | 437 | early_args.push(val.as_ref().to_owned()); |
|
438 | 438 | }); |
|
439 | 439 | } |
|
440 | 440 | } |
|
441 | 441 | } |
|
442 | 442 | |
|
443 | 443 | early_args |
|
444 | 444 | } |
|
445 | 445 | |
|
446 | 446 | #[cfg(test)] |
|
447 | 447 | mod tests { |
|
448 | 448 | use super::*; |
|
449 | 449 | |
|
450 | 450 | #[test] |
|
451 | 451 | fn collect_early_args_some() { |
|
452 | 452 | assert!(collect_early_args(&[] as &[&OsStr]).is_empty()); |
|
453 | 453 | assert!(collect_early_args(&["log"]).is_empty()); |
|
454 | 454 | assert_eq!( |
|
455 | 455 | collect_early_args(&["log", "-Ra", "foo"]), |
|
456 | 456 | os_string_vec_from(&[b"-Ra"]) |
|
457 | 457 | ); |
|
458 | 458 | assert_eq!( |
|
459 | 459 | collect_early_args(&["log", "-R", "repo", "", "--traceback", "a"]), |
|
460 | 460 | os_string_vec_from(&[b"-R", b"repo", b"--traceback"]) |
|
461 | 461 | ); |
|
462 | 462 | assert_eq!( |
|
463 | 463 | collect_early_args(&["log", "--config", "diff.git=1", "-q"]), |
|
464 | 464 | os_string_vec_from(&[b"--config", b"diff.git=1"]) |
|
465 | 465 | ); |
|
466 | 466 | assert_eq!( |
|
467 | 467 | collect_early_args(&["--cwd=..", "--repository", "r", "log"]), |
|
468 | 468 | os_string_vec_from(&[b"--cwd=..", b"--repository", b"r"]) |
|
469 | 469 | ); |
|
470 | 470 | assert_eq!( |
|
471 | 471 | collect_early_args(&["log", "--repo=r", "--repos", "a"]), |
|
472 | 472 | os_string_vec_from(&[b"--repo=r"]) |
|
473 | 473 | ); |
|
474 | 474 | } |
|
475 | 475 | |
|
476 | 476 | #[test] |
|
477 | 477 | fn collect_early_args_orphaned() { |
|
478 | 478 | assert!(collect_early_args(&["log", "-R"]).is_empty()); |
|
479 | 479 | assert!(collect_early_args(&["log", "--config"]).is_empty()); |
|
480 | 480 | } |
|
481 | 481 | |
|
482 | 482 | #[test] |
|
483 | 483 | fn collect_early_args_unwanted_value() { |
|
484 | 484 | assert!(collect_early_args(&["log", "--traceback="]).is_empty()); |
|
485 | 485 | } |
|
486 | 486 | |
|
487 | 487 | fn os_string_vec_from(v: &[&[u8]]) -> Vec<OsString> { |
|
488 | 488 | v.iter().map(|s| OsStr::from_bytes(s).to_owned()).collect() |
|
489 | 489 | } |
|
490 | 490 | } |
@@ -1,88 +1,86 | |||
|
1 | 1 | // Copyright 2018 Yuya Nishihara <yuya@tcha.org> |
|
2 | 2 | // |
|
3 | 3 | // This software may be used and distributed according to the terms of the |
|
4 | 4 | // GNU General Public License version 2 or any later version. |
|
5 | 5 | |
|
6 | 6 | use futures::future::IntoFuture; |
|
7 | 7 | use futures::Future; |
|
8 | 8 | use std::io; |
|
9 | 9 | use std::os::unix::io::AsRawFd; |
|
10 | 10 | use std::os::unix::process::ExitStatusExt; |
|
11 |
use std::process:: |
|
|
11 | use std::process::Stdio; | |
|
12 | 12 | use tokio; |
|
13 |
use tokio |
|
|
13 | use tokio::process::{ChildStdin, Command}; | |
|
14 | 14 | |
|
15 | 15 | use crate::message::CommandSpec; |
|
16 | 16 | use crate::procutil; |
|
17 | 17 | |
|
18 | 18 | /// Callback to process shell command requests received from server. |
|
19 | 19 | pub trait SystemHandler: Sized { |
|
20 | 20 | type PagerStdin: AsRawFd; |
|
21 | 21 | type SpawnPagerResult: IntoFuture<Item = (Self, Self::PagerStdin), Error = io::Error>; |
|
22 | 22 | type RunSystemResult: IntoFuture<Item = (Self, i32), Error = io::Error>; |
|
23 | 23 | |
|
24 | 24 | /// Handles pager command request. |
|
25 | 25 | /// |
|
26 | 26 | /// Returns the pipe to be attached to the server if the pager is spawned. |
|
27 | 27 | fn spawn_pager(self, spec: CommandSpec) -> Self::SpawnPagerResult; |
|
28 | 28 | |
|
29 | 29 | /// Handles system command request. |
|
30 | 30 | /// |
|
31 | 31 | /// Returns command exit code (positive) or signal number (negative). |
|
32 | 32 | fn run_system(self, spec: CommandSpec) -> Self::RunSystemResult; |
|
33 | 33 | } |
|
34 | 34 | |
|
35 | 35 | /// Default cHg implementation to process requests received from server. |
|
36 | 36 | pub struct ChgUiHandler {} |
|
37 | 37 | |
|
38 | 38 | impl ChgUiHandler { |
|
39 | 39 | pub fn new() -> ChgUiHandler { |
|
40 | 40 | ChgUiHandler {} |
|
41 | 41 | } |
|
42 | 42 | } |
|
43 | 43 | |
|
44 | 44 | impl SystemHandler for ChgUiHandler { |
|
45 | 45 | type PagerStdin = ChildStdin; |
|
46 | 46 | type SpawnPagerResult = io::Result<(Self, Self::PagerStdin)>; |
|
47 | 47 | type RunSystemResult = Box<dyn Future<Item = (Self, i32), Error = io::Error> + Send>; |
|
48 | 48 | |
|
49 | 49 | fn spawn_pager(self, spec: CommandSpec) -> Self::SpawnPagerResult { |
|
50 | let mut pager = new_shell_command(&spec) | |
|
51 | .stdin(Stdio::piped()) | |
|
52 | .spawn_async()?; | |
|
53 | let pin = pager.stdin().take().unwrap(); | |
|
50 | let mut pager = new_shell_command(&spec).stdin(Stdio::piped()).spawn()?; | |
|
51 | let pin = pager.stdin.take().unwrap(); | |
|
54 | 52 | procutil::set_blocking_fd(pin.as_raw_fd())?; |
|
55 | 53 | // TODO: if pager exits, notify the server with SIGPIPE immediately. |
|
56 | 54 | // otherwise the server won't get SIGPIPE if it does not write |
|
57 | 55 | // anything. (issue5278) |
|
58 | 56 | // kill(peerpid, SIGPIPE); |
|
59 | 57 | tokio::spawn(pager.map(|_| ()).map_err(|_| ())); // just ignore errors |
|
60 | 58 | Ok((self, pin)) |
|
61 | 59 | } |
|
62 | 60 | |
|
63 | 61 | fn run_system(self, spec: CommandSpec) -> Self::RunSystemResult { |
|
64 | 62 | let fut = new_shell_command(&spec) |
|
65 |
.spawn |
|
|
63 | .spawn() | |
|
66 | 64 | .into_future() |
|
67 | 65 | .flatten() |
|
68 | 66 | .map(|status| { |
|
69 | 67 | let code = status |
|
70 | 68 | .code() |
|
71 | 69 | .or_else(|| status.signal().map(|n| -n)) |
|
72 | 70 | .expect("either exit code or signal should be set"); |
|
73 | 71 | (self, code) |
|
74 | 72 | }); |
|
75 | 73 | Box::new(fut) |
|
76 | 74 | } |
|
77 | 75 | } |
|
78 | 76 | |
|
79 | 77 | fn new_shell_command(spec: &CommandSpec) -> Command { |
|
80 | 78 | let mut builder = Command::new("/bin/sh"); |
|
81 | 79 | builder |
|
82 | 80 | .arg("-c") |
|
83 | 81 | .arg(&spec.command) |
|
84 | 82 | .current_dir(&spec.current_dir) |
|
85 | 83 | .env_clear() |
|
86 | 84 | .envs(spec.envs.iter().cloned()); |
|
87 | 85 | builder |
|
88 | 86 | } |
General Comments 0
You need to be logged in to leave comments.
Login now