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

google-cloud-sdk: Can't build as root or with sudo. #59

Closed
will-ca opened this issue Mar 4, 2022 · 3 comments
Closed

google-cloud-sdk: Can't build as root or with sudo. #59

will-ca opened this issue Mar 4, 2022 · 3 comments
Labels
area/package/google-cloud-sdk Issue or PR that relates to //google-cloud-sdk kind/support Categorizes issue or PR as a support question

Comments

@will-ca
Copy link

will-ca commented Mar 4, 2022

$ sudo pamac install google-cloud-sdk

[…]

  File "/var/cache/private/pamac/google-cloud-sdk/pkg/google-cloud-sdk/opt/google-cloud-sdk/lib/googlecloudsdk/core/configurations/named_configs.py", line 549, in _ActiveConfigNameFromFile
    raise NamedConfigFileAccessError(
googlecloudsdk.core.configurations.named_configs.NamedConfigFileAccessError: Active configuration name could not be read from: [/root/.config/gcloud/active_config]. Ensure you have sufficient read permissions on required active configuration in [/root/.config/gcloud/configurations].
  Unable to read file [/root/.config/gcloud/active_config]: [Errno 13] Permission denied: '/root/.config/gcloud/active_config'
==> ERROR: A failure occurred in package().
    Aborting...
Finished with result: exit-code
Main processes terminated with: code=exited/status=4

I tried various combinations of sudo, bash -c, su, and environment variables. The result was the same failure in each case.

Running makepkg as a regular user and using sudo for the install afterwards works.

But it is a bit more trouble. It means GUI package managers with update reminders or CLI tools with blanket update commands and such don't work, and also in turn means losing some automatic caching of build files.

@sudoforge sudoforge added state: declined kind/bug Categorizes issue or PR as related to a bug labels Mar 4, 2022
@sudoforge
Copy link
Owner

As a rule, I do not support third-party AUR helpers (and encourage other package maintainers to take the same stance), as I do not have the bandwidth to look through Pamac and determine where its error is. This is not an issue with the package, but with pamac attempting to install the package as root, as it shouldn't even allow this behavior in the first place

Running makepkg as root is not allowed:

https://github.com/archlinux/devtools/blob/fa5afbc30b68912eb7f16d434a27faf787c3da9c/makechrootpkg.in#L355-L358

(commit fa5afbc30b68912eb7f16d434a27faf787c3da9c is the latest on that file as of the writing of this comment)

@sudoforge sudoforge removed state: unable to repro kind/bug Categorizes issue or PR as related to a bug labels Mar 4, 2022
@sudoforge
Copy link
Owner

sudoforge commented Mar 4, 2022

Some additional thoughts...

It means GUI package managers with update reminders or CLI tools with blanket update commands and such don't work

If these tools you mention also execute the PKGBUILD instructions as the root user, then yes, they will fail with the same error.

... also in turn means losing some automatic caching of build files

Can you provide specific examples that show how the package build instructions are not caching files in the way you expect?

@will-ca
Copy link
Author

will-ca commented Mar 4, 2022

Right. Maybe I should look into whether Pamac's doing something wrong, then.

Can you provide specific examples that show how the package build instructions are not caching files in the way you expect?

I just mean how running pamac install repeatedly will only download the PKGBUILD and source repos once. It looks like they just go in various places in /tmp/ and /var/tmp. Naturally redoing the build in my home directory means downloading everything again. Just a Pamac behaviour, and at most a minor UX inconvenience. Really it's more the bulk updating that I'm missing.

@sudoforge sudoforge added kind/support Categorizes issue or PR as a support question area/package/google-cloud-sdk Issue or PR that relates to //google-cloud-sdk and removed state: declined labels Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/package/google-cloud-sdk Issue or PR that relates to //google-cloud-sdk kind/support Categorizes issue or PR as a support question
Projects
None yet
Development

No branches or pull requests

2 participants