Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Implement batch installation #216

Merged
merged 33 commits into from
Jul 20, 2022
Merged

Feature: Implement batch installation #216

merged 33 commits into from
Jul 20, 2022

Conversation

NobodyXu
Copy link
Member

Resolved #175

Signed-off-by: Jiahao XU [email protected]

NobodyXu added 24 commits July 18, 2022 16:05
prepare for the new feature batch installation.

Signed-off-by: Jiahao XU <[email protected]>
Rm arg `opts`

Signed-off-by: Jiahao XU <[email protected]>
where confirmation isn't required.

Signed-off-by: Jiahao XU <[email protected]>
This simplified `entry`.

Signed-off-by: Jiahao XU <[email protected]>
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 <[email protected]>
@NobodyXu NobodyXu added the PR: feature work PR that provides or works on a new feature label Jul 18, 2022
@NobodyXu NobodyXu marked this pull request as ready for review July 18, 2022 15:01
@NobodyXu NobodyXu requested a review from passcod July 18, 2022 15:01
src/main.rs Outdated Show resolved Hide resolved
@passcod
Copy link
Member

passcod commented Jul 18, 2022

This looks good apart from that the main.rs file is now very large and should be broken up into its component parts in the library. Ideally main.rs would be just args parsing + UI specifics + a few calls to the "backend".

@NobodyXu
Copy link
Member Author

This looks good apart from that the main.rs file is now very large and should be broken up into its component parts in the library. Ideally main.rs would be just args parsing + UI specifics + a few calls to the "backend".

Yes, I would post a PR to refactor this later.
The key is that resolve and install depends on information from Options, so we either move Options into the library as well, or we split it into multiple parts.

src/main.rs Show resolved Hide resolved
@NobodyXu
Copy link
Member Author

@passcod It will be interesting to see whether mimalloc would speedup given enough crates specified, like 5/10/15.

I don't have the environment setup to benchmark it on my local machine and my network connection is slow (using 4G LTE modem).

@NobodyXu NobodyXu requested a review from passcod July 19, 2022 03:07
NobodyXu added 5 commits July 20, 2022 16:43
Makes initializing `metafiles::CrateVersionSource` more readable and
improves performance since the parsing is now cached.

Signed-off-by: Jiahao XU <[email protected]>
@passcod
Copy link
Member

passcod commented Jul 20, 2022

The key is that resolve and install depends on information from Options,

true. I think putting these required data in another struct and then building that struct from clap options would work best.

Copy link
Member

@passcod passcod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this, without a further refactor to simplify main.rs which will have to be done later.

@NobodyXu NobodyXu merged commit 3a30e87 into cargo-bins:main Jul 20, 2022
@NobodyXu NobodyXu deleted the feature/batch-installation branch July 20, 2022 07:18
@passcod passcod mentioned this pull request Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature work PR that provides or works on a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Batch installation
2 participants