Jiahao XU
adc0a22a50
Rm unused variant MainExit::JoinErr
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 20:44:13 +10:00
Jiahao XU
d39bc0acab
Construct BinstallError
from JoinError
in main
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 20:43:47 +10:00
Jiahao XU
6e5ecc46cf
Construct BinstallError
from JoinError
in await_task
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 20:41:16 +10:00
Jiahao XU
46cf20a3f7
Add new variant BinstallError::TaskJoinError
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 20:40:31 +10:00
Jiahao XU
fb3e35624b
Fix err handling in Crates2Json::append_to_path
...
Only uses `Self::default()` if the file is not found.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:59:36 +10:00
Jiahao XU
1e725a9ffe
Refactor: Extract Crates2Json::append{_to_path}
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:58:23 +10:00
Jiahao XU
0157a594e6
Fix err handling in CratesToml::append_to_path
...
Make it more robust to `io::Error`: Only create a `Self::default()` if
fails to open the file.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:54:45 +10:00
Jiahao XU
31d9716d28
Refactor: Extract CratesToml::append{_to_path}
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:50:23 +10:00
Jiahao XU
4f0f01b75c
Fix typo in impl Version for crates_io_api::Version
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:20:21 +10:00
Jiahao XU
e308b275d5
Optimize and generalize find_version
...
- Rm the process of collecting into `BTreeMap` in `find_version`.
- Accept any type that implements trait `Version`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 19:19:50 +10:00
Jiahao XU
b2d09e2b13
Rm unused derive(Clone)
for DesiredTargets
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 15:07:09 +10:00
Jiahao XU
eda7b9445a
Rm unnecessary Arc
inside DesiredTargetsInner
...
Since `DesiredTargets` is now stored in `binstall::Options`, which
itself is wrapped in an `Arc`, `DesiredTargetsInner::Initialized` no
longer needs an `Arc` for O(1) `clone`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 15:06:00 +10:00
Jiahao XU
6a95bb07e0
Add field desired_targets
to binstall::Options
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 15:05:12 +10:00
Jiahao XU
aa88dce215
Add field cli_overrides
to binstall::Options
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 15:00:01 +10:00
Jiahao XU
f09004b5b7
Optimize: Share crates_io_api::AsyncClient
...
So that the connection pool and the rate limit will be shared.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 14:50:51 +10:00
Jiahao XU
21eac33e1f
Optimize: Create new fn helpers::cargo_home
...
that caches return value of `home::cargo_home`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 13:13:07 +10:00
Jiahao XU
305a4e4c30
Improve err msg in MultiFetcher::first_available
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 13:07:20 +10:00
Jiahao XU
dc8d8ccd88
Optimize MultiFetcher
: Start check
ing ASAP
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 13:06:34 +10:00
Jiahao XU
6180e9ec3e
Add comment in fn resolve
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 13:00:58 +10:00
Jiahao XU
c418c2dbbe
Optimize arg parsing: Avoid O(n) Vec::remove
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-21 12:44:54 +10:00
Jiahao XU
ef72f851f7
Merge pull request #220 from NobodyXu/fix
...
Forbid --manifest-path to used with batch installation
2022-07-20 19:39:38 +10:00
Jiahao XU
cfe7703af9
Forbid --manifest-path
to used with batch installation
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 19:11:02 +10:00
Jiahao XU
08190ac179
Add ManifestPathConflictedWithBatchInstallation
...
to error `BinstallError`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 19:09:59 +10:00
Jiahao XU
bcb97803c3
Merge pull request #219 from NobodyXu/dep
...
Enable feature "static" of dep xz2 & Disable all features of dep zstd
2022-07-20 18:57:35 +10:00
Jiahao XU
f7af4efa22
Disable feature flag "thin" of dep zstd
...
attempt to fix the CI
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 18:26:45 +10:00
Jiahao XU
f59d081733
Only enable feature "thin" of dep zstd
...
Disable "bindgen" that creates a bindgen at build time, which takes
quite some time and pulls in dep "bindgen" at bulid time.
Also disable feature "zstdmt" as we don't need multithreading here.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 18:18:39 +10:00
Jiahao XU
1e81babea8
Enable feature "static" of dep xz2
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 18:14:17 +10:00
Jiahao XU
15e0b22e50
Merge pull request #217 from NobodyXu/refactor
...
Refactor: Extract new mod `binstall`
2022-07-20 18:12:26 +10:00
Jiahao XU
9d6ed81d74
Merge pull request #218 from NobodyXu/optimize
...
Use `opt-level = "z"` for release
2022-07-20 18:11:02 +10:00
Jiahao XU
6324f9a7ca
Use opt-level = "z"
for release
...
On M1 MacOS Darwin 21.5, this produces binary that is 0.3M smaller while
taking 10s less to build.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 18:00:22 +10:00
Jiahao XU
3981400ebb
Create new type LazyJobserverClient
...
and use it to replace `jobserver::Client`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:54:17 +10:00
Jiahao XU
a1d7a7c117
Refactor: Extract new mod jobserver_client.rs
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:37:23 +10:00
Jiahao XU
2490cd5a84
Refactor: Extract new mod binstall/install.rs
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:30:34 +10:00
Jiahao XU
5e35604012
Refactor: Extract new mod binstall/resolve.rs
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:28:53 +10:00
Jiahao XU
921774b8f9
Refactor: Extract new mod binstall
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:26:24 +10:00
Jiahao XU
3a30e870b0
Merge pull request #216 from NobodyXu/feature/batch-installation
...
Feature: Implement batch installation
2022-07-20 17:18:35 +10:00
Jiahao XU
3b82e9e375
Rm unnecessary clone
in install_from_package
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 17:04:26 +10:00
Jiahao XU
1eedae1ee2
Rm unused param temp_dir
from install_from_package
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 16:59:23 +10:00
Jiahao XU
1ebd4bdb75
Refactor: Reduce params of install_from_package
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 16:58:12 +10:00
Jiahao XU
5bdffd9178
Refactor: Impl Source::cratesio_registry
...
Makes initializing `metafiles::CrateVersionSource` more readable and
improves performance since the parsing is now cached.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 16:48:34 +10:00
Jiahao XU
3961dbb84a
Add new dep once_cell
v1.13.0
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-20 16:43:02 +10:00
Jiahao XU
67ca36a0b5
Fix jobserver_client
: Create it as early as possible
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 12:15:00 +10:00
Jiahao XU
2bf7640729
Optimize: Avoid double spawn
if no_confirm
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 12:06:16 +10:00
Jiahao XU
de7ecad32c
Optimize: Avoid creation of Arc<str>
for target
...
in `entry`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 12:02:09 +10:00
Jiahao XU
758dab7d4f
Optimize DesiredTargets
: Avoid mem alloc on clone
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 11:59:10 +10:00
Jiahao XU
d58f340a45
Test batch installtion in run_tests_unix.sh
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 00:45:15 +10:00
Jiahao XU
b026462018
Refactor: Simplify struct Resolution
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 00:43:17 +10:00
Jiahao XU
c6281d8ea0
Fix opts.no_cleanup
behavior
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 00:39:27 +10:00
Jiahao XU
b223990bb1
Simplify helpers::await_task
API
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 00:35:48 +10:00
Jiahao XU
072253ebae
Improve comment in create_jobserver_client
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-19 00:32:56 +10:00