Commit graph

358 commits

Author SHA1 Message Date
Félix Saparelli
d58ce3892a
Use clap3 2022-06-07 23:56:24 +12:00
Félix Saparelli
6877a0c3a9
Merge pull request #161 from NobodyXu/feature/bin-multi-targets 2022-06-07 23:55:05 +12:00
Félix Saparelli
d7792de0c6
Merge pull request #165 from NobodyXu/fix/arg-parsing 2022-06-07 23:54:42 +12:00
Jiahao XU
2ea341381d
Fix parsing in entry: Use std::env::args_os
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 17:07:17 +10:00
Jiahao XU
6f7c8fa8ab
Merge branch 'main' into feature/bin-multi-targets 2022-06-07 16:38:14 +10:00
Jiahao XU
ad3e707aa3
Fix install_from_package: Rm use of opts.target
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 16:37:04 +10:00
Jiahao XU
3f2e03893a
Add Fetcher::target to trait Fetcher
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 16:35:47 +10:00
Félix Saparelli
764a960c90
Merge pull request #164 from NobodyXu/optimize-tokio-usage 2022-06-07 18:35:43 +12:00
Jiahao XU
456e896483
Use code 17 for MainExit::JoinErr
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 16:22:01 +10:00
Jiahao XU
903c9f5591
Refactor: Use Result::map_or_else in main
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 16:19:07 +10:00
Jiahao XU
b6245bcf4b
Spawn entry() in main to improve parallelism
Using `rt.block_on`, the future returned by `entry` can only be run on
the main thread.

Buf if we use `tokio::spawn`, then it can be run on any thread.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 16:13:38 +10:00
Félix Saparelli
7fa053cbd1
Merge pull request #163 from NobodyXu/optimization 2022-06-07 17:58:58 +12:00
Félix Saparelli
20ec8d6359
Merge pull request #162 from NobodyXu/feature/parallelize-MultiFetcher 2022-06-07 17:54:12 +12:00
Jiahao XU
b2a533dbdb
Optimize GhCrateMeta::check: Avoid converting url to str
Only to convert it back to `Url` in `helpers::remote_exists`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:40:55 +10:00
Jiahao XU
3d6679fd7d
Refactor MultiFetcher.first_available
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:35:21 +10:00
Jiahao XU
c393270899
Run fetchers in parallel in MultiFetcher.first_available
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:29:09 +10:00
Jiahao XU
d373ad5145
Require Send and Sync for trait Fetcher
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:28:48 +10:00
Jiahao XU
31b7439a69
Mod trait Fetcher::new to return Arc<Self>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:16:10 +10:00
Jiahao XU
603955b848
Support for checking multi-targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 15:11:04 +10:00
Félix Saparelli
0c83d010b1
Merge pull request #160 from NobodyXu/feature/target-detection 2022-06-07 14:41:03 +12:00
Félix Saparelli
ee03e971f0
Merge pull request #158 from ryankurte/dependabot/cargo/tokio-1.19.1 2022-06-07 14:25:27 +12:00
Félix Saparelli
bc1491d6c6
Merge pull request #159 from ryankurte/dependabot/cargo/async-trait-0.1.56 2022-06-07 14:24:45 +12:00
Jiahao XU
0819b65308
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:21:50 +10:00
Jiahao XU
9c818e0e95
Remove dep arrayvec
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:21:03 +10:00
Jiahao XU
ecf6fdbab5
Revert back to using Vec<Box<str>> for targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:20:46 +10:00
Jiahao XU
9ee2609b25
Refactor get_target_from_rustc impl
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:14:27 +10:00
Jiahao XU
96336e4dd9
Update doc of get_target_from_rustc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:11:49 +10:00
Jiahao XU
95b7c4f771
Rename get_targets_from_rustc to get_target_from_rustc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:11:04 +10:00
Jiahao XU
1d71f92ee6
Impl IntoIterator for &Targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 12:10:05 +10:00
Jiahao XU
bd224f7186
Use star re-export for mod targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 11:49:02 +10:00
Jiahao XU
7a244176b4
Reorder dep in Cargo.toml
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 11:48:19 +10:00
Jiahao XU
efc8119c45
Add opaque newtype Targets over ArrayVec<Box<str>, 2>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 11:45:53 +10:00
Jiahao XU
11fe943a11
Fix parse_abi for gnu_ilp32 and gnuspe
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 11:30:00 +10:00
Jiahao XU
1df135f4c0
Fix target::linux::parse_abi: Remove const
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-07 00:20:52 +10:00
Jiahao XU
44b1bdbfe5
Fix use of ends_with
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 23:20:09 +10:00
Jiahao XU
3f7f293b78
Fix bugs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 23:17:07 +10:00
Jiahao XU
c9c3cffb25
Fix detect_targets for win and other targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 23:08:00 +10:00
Jiahao XU
6b764b0b3f
Add fallbacks for get_targets_from_rustc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 23:07:25 +10:00
Jiahao XU
cce378e2c5
Add get_targets_from_rustc to detect_targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 23:00:33 +10:00
Jiahao XU
8bf4d187ee
Rename parse_libc_version to parse_libc_version_from_ldd_output
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:53:12 +10:00
Jiahao XU
7232f32428
Use ArrayVec to avoid heap alloc in detect_targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:52:11 +10:00
Jiahao XU
c50e949170
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:45:21 +10:00
Jiahao XU
1ebc759b17
Add dep arrayvec v0.7.2
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:45:06 +10:00
Jiahao XU
b74139f457
Support for other platforms in detect_targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:42:43 +10:00
Jiahao XU
9a8b28afcf
Fix invocation of linux::detect_targets_linux
in `detect_targets`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:41:36 +10:00
Jiahao XU
4157f20b99
Support for macos in detect_targets
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:40:52 +10:00
Jiahao XU
ca5c9b7c23
Add dep guess_host_triple for target_os macos
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:35:51 +10:00
Jiahao XU
8bd4b9b6a1
Impl detect_targets for linux
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:32:15 +10:00
Jiahao XU
69f2a56595
Move TARGET in lib.rs into new mod target.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-06 22:00:01 +10:00
dependabot[bot]
fe551438a0
Bump async-trait from 0.1.53 to 0.1.56
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.53 to 0.1.56.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.53...0.1.56)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-06 01:25:44 +00:00