Commit graph

394 commits

Author SHA1 Message Date
Jiahao XU
f955abd2d5
Optimize fn log using Arguments::as_str
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 23:53:01 +10:00
Jiahao XU
d79f30e897
Treat failure to read input as UserAbort
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 18:41:48 +10:00
Jiahao XU
5b0a97f380
Fix UIThread stopping runtime from shutdown
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 02:07:43 +10:00
Jiahao XU
d4eb56d017
Do not lock stderr in UIThreadInner
which will prevent other thread from `eprintln!`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:46:13 +10:00
Jiahao XU
f5514c834b
Fix UIThreadLogger: Add newline for each logging
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:40:06 +10:00
Jiahao XU
b283908bd5
Enable feature std of dep log
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:39:10 +10:00
Jiahao XU
9bea1619b3
Rm dep simplelog
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:37:33 +10:00
Jiahao XU
9e232a4051
Update main::entry to use UIThread's logger
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:37:07 +10:00
Jiahao XU
72cf83bcbc
Init UIThreadLogger in UIThread::new
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:36:50 +10:00
Jiahao XU
584b61144e
Fix clippy suggestion in UIThreadInner::new
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:31:58 +10:00
Jiahao XU
d0129b3bef
Print Error & Warn msg to stderr in UIThreadLogger
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:30:57 +10:00
Jiahao XU
dfea96821f
Update UIThreadLogger to use std::sync::mpsc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:28:16 +10:00
Jiahao XU
af6a307a13
Use std::sync::mpsc for request_tx in UIThreadInner
since it can be used to `send` data in sync functions that are run in
async context.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:27:33 +10:00
Jiahao XU
670bfcc1bc
Impl new type UIThreadLogger
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:20:46 +10:00
Jiahao XU
b541cdecff
Add derive(Debug) for UIRequest
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 01:00:24 +10:00
Jiahao XU
417a10ca5d
Always create UIThreadInner in UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 00:46:46 +10:00
Jiahao XU
ac492e6d8b
Add stdout/stderr printing support to UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-19 00:45:31 +10:00
Félix Saparelli
c33f195d5f
Merge pull request #178 from NobodyXu/ci 2022-06-11 21:57:38 +12:00
Jiahao XU
5302240829
Refactor workflow rust: Extract test into script
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 18:21:57 +10:00
Félix Saparelli
bd4cc85386
Merge pull request #179 from NobodyXu/feature/improve-readable-rx 2022-06-11 20:11:33 +12:00
Félix Saparelli
50183a38c5
Merge pull request #171 from NobodyXu/fix/confirm 2022-06-11 20:11:20 +12:00
Jiahao XU
9bf1ce3000
Fix typo in step "Test (Unix)"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 17:11:52 +10:00
Jiahao XU
dd24661091
Test installed bin in step "Test (Windows)"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 17:02:53 +10:00
Jiahao XU
19656b6f45
Fix typo in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 17:02:31 +10:00
Jiahao XU
4b78d4eb4d
Fix step Test: Run cargo binstall --help instead
of `cargo binstall --version` since `--version` does not print the
version of `cargo-binstall`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 16:52:51 +10:00
Jiahao XU
58f0d5f12d
Run bins after installation in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 16:43:11 +10:00
Jiahao XU
868f6c2759
Add more debug! to untar
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 16:13:33 +10:00
Jiahao XU
4a882dc2cb
Use BufRead inextract_compressed_from_readable
Use `BufRead` instead of `Read` to avoid copying of data and improve
efficiency.

`GzDecoder` and `XzDecoder` both have their `BufRead` counterpart
in mod `bufread` and their `read` counterpart merely wraps the input in
a `std::io::BufReader`.

`ZstdDecoder::new` also wraps it in a `BufReader` and pass it to
`ZstdDecoder::with_buffer`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 15:44:16 +10:00
Jiahao XU
e753c9ec30
Impl BufRead for ReadableRx
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 15:41:15 +10:00
Jiahao XU
ac22db5e79
Set log level to debug in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 14:37:14 +10:00
Jiahao XU
4c210fd2c3
Rm unused imports in mod helpers
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:41 +10:00
Jiahao XU
88c3f15b3f
Rename Confirmer to UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:27 +10:00
Jiahao XU
9349fbabdc
Unwrap in Confirmer task if failed to read
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:27 +10:00
Jiahao XU
b2bf065a2b
Rm unused fn helpers::confirm::confirm
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:26 +10:00
Jiahao XU
47ed7ce27b
Use Confirmer instead of confirm in main.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:26 +10:00
Jiahao XU
dd2fa2de33
Impl helpers::confirm::Confirmer
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:26 +10:00
Jiahao XU
c1809d41fa
Refactor: Extract confirm into a new mod
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:22 +10:00
Félix Saparelli
f53680c497
Merge pull request #174 from NobodyXu/fix/find_crate_cratesio 2022-06-11 14:54:50 +12:00
Jiahao XU
4297b13ed9
Fix testing on Windows
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 18:20:59 +10:00
Jiahao XU
fbcfe369da
Rm cbindgen from bins in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 18:16:28 +10:00
Jiahao XU
cfa6090e6e
Rm non-existent crate in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:32:38 +10:00
Jiahao XU
ea71cede42
Fix if cond for step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:28:23 +10:00
Jiahao XU
e312a22ba2
set -euxo pipefail in step "Test"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:19:21 +10:00
Jiahao XU
dc5978e737
Fix step "Test": Fix invoking cargo-binstall directly
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:13:01 +10:00
Jiahao XU
68942f56e4
Merge two testing step into one in workflow rust
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:08:54 +10:00
Jiahao XU
57d2b4c3b4
Run job "Test binstall" only natively
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:08:26 +10:00
Jiahao XU
d038e77978
Fix typo in step "Test installing bins"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 17:02:18 +10:00
Jiahao XU
53c9d667ce
Enable caching on macos as issue has been fixed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:55:21 +10:00
Jiahao XU
665564420a
Add more bins to test in job "Test installing bins"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:54:55 +10:00
Jiahao XU
4ff64dee34
Fix caching: Only cache .cargo/{git, registry}
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:53:34 +10:00