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
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
Jiahao XU
fb0a6a5514
Use jobserver to limit parallism of cargo-install
...
Since we execute multiple `cargo-install` concurrently, we must use
jobserver to limit the parallism so that they won't spawn too much
processes/threads to overload the system.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 21:12:58 +10:00
Jiahao XU
c67c59b3ca
Impl new fn helpers::create_jobserver_client
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 21:04:36 +10:00
Jiahao XU
8cc085b1b6
Add new dep jobserver v0.1.24
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 20:46:44 +10:00
Jiahao XU
9552e0e8ed
Add comment to entry
to improve readbility
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:31:29 +10:00
Jiahao XU
79ec122647
Refactor entry
: Avoid Arc::clone
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:26:16 +10:00
Jiahao XU
119192f8ee
Refactor main.rs
: Print resolution in resolve
...
This simplified `entry`.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:21:35 +10:00
Jiahao XU
bcb46cd736
Optimize main.rs
: Avoid frequent Box::clone
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:17:56 +10:00
Jiahao XU
c66d8154eb
Print out resolution
in optimized path
...
where confirmation isn't required.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:13:06 +10:00
Jiahao XU
f0fb7da99b
Refactor main.rs
: Extract fn Resolution::print
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:11:27 +10:00
Jiahao XU
90059c11cf
Optimize: Launch install
immediately if confirmation is not required
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:09:29 +10:00
Jiahao XU
8ca85382af
Refactor: Avoid repeated heap alloc of temp_dir
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 17:00:18 +10:00
Jiahao XU
d514219ee4
Refactor main.rs
: Extract new fn install
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:58:04 +10:00
Jiahao XU
40a872dbe3
Avoid Box::clone
for targets
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:54:45 +10:00
Jiahao XU
7f11b74f5e
Support new feature batch installation!
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:46:51 +10:00
Jiahao XU
5e7aab7373
Impl helpers::await_task
: Handle JoinError
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:46:21 +10:00
Jiahao XU
730f7d6c15
Refactor main.rs
: Simplify install_from_source
...
Rm arg `opts`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:21:03 +10:00
Jiahao XU
d6db552db1
Refactor main.rs
: Extract new fn resolve
...
prepare for the new feature batch installation.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:16:50 +10:00
Jiahao XU
409f31f0bf
derive(Clone)
for CrateName
...
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-07-18 16:07:47 +10:00