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

gcloud 449.0.0 attempts to install python as root on MacOS #82

Closed
fiadliel opened this issue Oct 6, 2023 · 0 comments · Fixed by #85
Closed

gcloud 449.0.0 attempts to install python as root on MacOS #82

fiadliel opened this issue Oct 6, 2023 · 0 comments · Fixed by #85
Labels
bug Something isn't working

Comments

@fiadliel
Copy link
Contributor

fiadliel commented Oct 6, 2023

Describe the bug

When attempting to install gcloud 449.0.0, the installer attempts to install a python package, including asking for the root password. On rtx, the install appears to hang, because sudo is waiting for input.

The command attempted is:

sudo installer -target / -pkg ./python-3.10.11-macos11.pkg

The command comes from bin/bootstrapping/install.py

It looks like this can be avoided by running

  --install-python INSTALL_PYTHON
                        (true/false) Attempt to install Python. MacOS only.

It can also be avoided, by using an archive for installation instead of the install script.

This "feature" appears to have been added in either version 330 or 352 of the CLI (see https://cloud.google.com/sdk/docs/release-notes#33000_2021-03-02), and is now triggered by the script looking for a different python version.

Steps to reproduce

  1. rtx --version
    2023.10.1 macos-arm64 (2023-10-05)

  2. rtx use [email protected]

  3. (installation doesn't complete, due to sudo prompt)

Looking for sudo in currently running programs, will show the command referenced in the bug report.

asdf version

rtx 2023.10.1 macos-arm64 (2023-10-05)

asdf-gcloud version

1.2.3

gcloud version

449.0.0

Additional Information

It looks like since version 448(?) the CLI started looking for python3 to be version 3.10 or higher: https://cloud.google.com/sdk/docs/release-notes#44800_2023-09-26

@fiadliel fiadliel added the bug Something isn't working label Oct 6, 2023
fiadliel added a commit to fiadliel/asdf-gcloud that referenced this issue Oct 12, 2023
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 gcloud versions available from the
bucket that asdf-gcloud downloads from (the oldest version is
371.0.0), so the behavior doesn't need any special-casing.

Fixes jthegedus#82.
fiadliel added a commit to fiadliel/asdf-gcloud that referenced this issue Oct 12, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant