-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: faster self-install without rate limit issue (#1963)
* Add new hidden option `--self-install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix typo Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Optimize: Only call `LazyJobserverClient::new` when necessary Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * `--self-install` should include a path to a binary On windows, we cannot just copy an executable with process running from it, so better to copy it to a temporary location. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl manifest update and basic API of `self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add dep atomic-file-install to cargo-binstall Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl `self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Make `--self-install` a boolean flag Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Accept no duration in `MainExit::new` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl self-install mode in main_impl.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use `--self-install` mode in install-from-binstall-release.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use `--self-install` in install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix import in mod entry Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix call of `self_install` in `main_impl` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix `--self-install` clap doc Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix `entry::self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix parsing semver number in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix compilation in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in bin_util.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use --self-install if supported in unix install script Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use --self-install if available in powershell install script Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fi install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Create self-install.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add e2e-test-self-install to justfile Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args::parse() for self-install mode Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args parsing: Do no require positional arg if --self-install is present Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
89 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
unset CARGO_INSTALL_ROOT | ||
|
||
CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') | ||
export CARGO_HOME | ||
export PATH="$CARGO_HOME/bin:$PATH" | ||
|
||
"./$1" --self-install | ||
|
||
cargo binstall --help | ||
cargo install --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters