-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: Add --install-python=false
to install invocation.
#85
Conversation
The installer may attempt to install a Python package on MacOS, if the versions do not line up with the minimum version blessed by the script. To do this, it attempts to run sudo. This disables the installation with an install flag. The flag is present in all versions of gcloud since 352.0.0. Fixes jthegedus#82.
@jthegedus @fiadliel Thank you for your work here. I stumbled across this when trying to install @jthegedus Would it be possible to directly apply the suggested changes in #85 (comment) so we can unblock this PR? 🙏🏼 |
I can confirm @jthegedus suggestion work after patching the install file locally and running diff --git bin/install bin/install
index bd1489a..1e900af 100755
--- bin/install
+++ bin/install
@@ -32,7 +32,12 @@ install_gcloud() {
log_success "extracted!"
log_info "🚧 installing..."
- "${ASDF_INSTALL_PATH}/install.sh" --usage-reporting=false --path-update=false --quiet
+ if [[ "${ASDF_INSTALL_VERSION}" > "352.0.0" ]]; then
+ "${ASDF_INSTALL_PATH}/install.sh" --usage-reporting=false --path-update=false --install-python=false --quiet
+ else
+ "${ASDF_INSTALL_PATH}/install.sh" --usage-reporting=false --path-update=false --quiet
+ fi
+ # "${ASDF_INSTALL_PATH}/install.sh" --usage-reporting=false --path-update=false --quiet
# test executable
test -x "${ASDF_INSTALL_PATH}/bin/gcloud" || log_failure_and_exit "Expected ${ASDF_INSTALL_PATH}/bin/gcloud to be executable."
log_success "gcloud ${ASDF_INSTALL_VERSION} installed!" ❯ mise install
######################################################################## 100.0%
Your current Google Cloud CLI version is: 459.0.0
The latest available version is: 459.0.0
To install or remove components at your current SDK version [459.0.0], run:
$ gcloud components install COMPONENT_ID
$ gcloud components remove COMPONENT_ID
To update your SDK installation to the latest version [459.0.0], run:
$ gcloud components update
==> Source [/Users/tanle/.local/share/mise/installs/gcloud/459.0.0/path.fish.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH.
mise [email protected] ✓ installed |
Co-authored-by: Tan Le <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both! Sorry this took so long! 🙇
Description
The installer may attempt to install a Python package on MacOS, if the versions do not line up with the minimum version blessed by the script. To do this, it attempts to run sudo.
This disables the installation with an install flag.
Motivation and Context
Having a plugin modify global state (like installing a version of python globally) goes against the very reason for having an asdf plugin. Also, asdf installs should be non-interactive, and sudo requires user input.
This causes the minimum supported version to be 352.0.0 or greater (as the first version with this flag).
Alternatives to remove backwards compatibility issues with the change:
Fixes #82.
Types of changes
How Has This Been Tested?
--install-python=false
.Checklist: