Jiahao XU
aecc474f29
Rm unused BinstallError::VersionWarning
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 18:34:20 +10:00
Jiahao XU
c87941211c
Treat 1.2.3
as =1.2.3
to match cargo-install
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 18:33:31 +10:00
Jiahao XU
e2207f7b59
Add diagnostic(help)
to DuplicateVersionReq
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 17:12:01 +10:00
Jiahao XU
ff0bd4d948
Support specifing ver via crate_name@version
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 17:08:54 +10:00
Jiahao XU
41961ce218
Add new variant BinstallError::DuplicateVersionReq
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 17:03:12 +10:00
Jiahao XU
38c8bc8cf2
Impl new type helpes::CrateName
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-12 16:47:44 +10:00
Jiahao XU
4a9e04967c
Refactor: Mv confirmation from install_from_source
to entry
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-11 22:21:11 +10:00
Jiahao XU
8bbc6d0171
Rm unused lint allow(clippy::too_many_arguments)
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-11 22:19:21 +10:00
Jiahao XU
2d0c4a8c4e
Refactor: Extract fn collect_bin_files
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-11 22:18:45 +10:00
Jiahao XU
7a85cae859
Refactor: Mv confirm into entry
and remove unncessary confirm
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-11 21:49:28 +10:00
Jiahao XU
fa63dbe5cf
Refactor: Rm global var helpers::CLIENT
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-10 18:07:07 +10:00
Félix Saparelli
63afa5b791
Just hide mimalloc behind a feature, available for all platforms
2022-07-06 23:33:51 +12:00
Félix Saparelli
e66dc60867
Also use mimalloc on musl
2022-07-06 23:31:24 +12:00
Félix Saparelli
fe724585ae
Use mimalloc on windows
2022-07-05 23:10:57 +12:00
Jiahao XU
5ad572fa42
Rename new_reqwest_client
> get_reqwest_client
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-05 19:57:56 +10:00
Jiahao XU
6582eefd25
Refactor: Replace REQWESTCONFIG
with initialize_reqwest_client
...
so that we don't need two `OnceCell`s.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-05 19:57:54 +10:00
Jiahao XU
50b436100e
Reuse Client
everywhere instead of recreate one
...
which pools the connection to the same site (github.com).
This commit also sets `USER_AGENT` so that quickinstall
can reuse it.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-05 19:57:14 +10:00
Félix Saparelli
7518993212
Merge pull request #195 from NobodyXu/feature/atomic-install
2022-07-05 21:52:06 +12:00
Félix Saparelli
f056978858
Merge pull request #199 from NobodyXu/fix-and-improve-windows-target-detection
2022-07-05 21:49:35 +12:00
Félix Saparelli
68ba9b06f5
Create meta files if not present
2022-07-05 21:46:58 +12:00
Félix Saparelli
17cf6f5dc5
Write to .crates2.json
2022-07-05 21:17:59 +12:00
Félix Saparelli
1c2d005fd4
Write to .crates.toml
2022-07-04 23:53:47 +12:00
Jiahao XU
1ec1f972b7
Fix copy-paste error in detect_targets_windows
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-01 19:46:30 +10:00
Jiahao XU
8e58398f57
Fix windows target detection for abi gnullvm
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-01 19:34:52 +10:00
Jiahao XU
ec6f81935c
Refactor: Extract detect_alternative_targets
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-01 19:30:31 +10:00
Félix Saparelli
66a14d0c7c
Polish up new secure options
2022-06-28 03:19:04 +12:00
Félix Saparelli
4bc16863e0
Format -> formats
2022-06-28 03:19:04 +12:00
Félix Saparelli
401fa8772c
Merge pull request #194 from NobodyXu/fix/blocking
2022-06-28 03:14:27 +12:00
Félix Saparelli
9d70e33337
Merge pull request #193 from NobodyXu/fix/macos-target-detection
...
Fix macos detection: Use built-time `TARGET` as fallback
2022-06-28 03:10:18 +12:00
Jiahao XU
14c606d72b
Simplify BinFile::link_dest
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 23:27:16 +10:00
Jiahao XU
43238e39a3
Use atomic_symlink_file
in install_link
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 23:26:46 +10:00
Jiahao XU
77ce57815c
Impl new fn helpers::symlink_file
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 23:26:30 +10:00
Jiahao XU
e9c86dfad4
Rm set_permissions
in BinFile::install_bin
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 22:51:50 +10:00
Jiahao XU
d4105585db
Fix atomic_install
: Copy permissions of src
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 22:50:30 +10:00
Jiahao XU
97bfeb7bd8
Use atomic_install
in install_bin
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 21:27:44 +10:00
Jiahao XU
7616546a61
Impl new fn atomic_install
for atommically installing a file
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 21:27:15 +10:00
Jiahao XU
e18ac6e117
Run Manifest
parsing in block_in_place
mode
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 19:55:09 +10:00
Jiahao XU
60caa9ee17
Run load_manifest_path
in block_in_place
mode
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 19:50:25 +10:00
Jiahao XU
a35db557ea
Run "Install binaries" step in block_in_place
mode
...
Since they execute a lot of blocking fs operations.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 19:48:03 +10:00
Félix Saparelli
cc8144e06d
Merge pull request #192 from NobodyXu/optimize/parallelize-target-detection
...
Optimize/parallelize target detection
2022-06-23 21:41:15 +12:00
Jiahao XU
536f3b2c6f
Fix macos detection: Use super::TARGET
as fallback
...
When `guess_host_triple` failed to detect the target.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 19:39:36 +10:00
Félix Saparelli
ee4cbaa3d5
Merge pull request #191 from NobodyXu/feature/target-detection-windows
...
feature: Detect `*-pc-windows-gnu` targets in `targets.rs`
2022-06-23 21:34:37 +12:00
Jiahao XU
68d111f946
Use get_desired_targets
in entry
...
instead of `detect_targets`, so that if `opts.targets` is
`None`, the future returned by `detect_targets` can be run
in parallel by using `tokio::spawn` with other async code
in `entry`, such as `fetch_crate_cratesio`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 14:47:59 +10:00
Jiahao XU
be4b3ead97
Add new fn get_desired_targets
& newtype DesiredTargets
...
so that if `opts.targets` is `None`, the future returned by
`detect_targets` can be run in parallel by using `tokio::spawn` with
other async code in `entry`, such as `fetch_crate_cratesio`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 14:46:53 +10:00
Jiahao XU
8bc0f11569
Detect *-pc-windows-gnu
targets in targets
...
And add fallback `*-pc-windows-msvc` to the returned targets.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:59:53 +10:00
Jiahao XU
691bc18dd0
Set min TLS ver to 1.2 for https only mode
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:03:50 +10:00
Jiahao XU
9b62ebdae1
Fix https only mode: It should not be http2 only
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:01:22 +10:00
Jiahao XU
087d544331
Initialize REQWESTGLOBALCONFIG
in main::entry
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:01:22 +10:00
Jiahao XU
a3ab3ec502
Add new static var REQWESTGLOBALCONFIG
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:01:22 +10:00
Jiahao XU
64f468acd6
Add new opt https_only_mode
& min_tls_version
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-23 13:00:52 +10:00