Is there a way that I can execute a command that I...
# general
a
Is there a way that I can execute a command that I run with
./pants run
as
sudo
without pants switching to the root user cache?
s
first of all: sounds like a bad idea to do this.
i would probably create a group/role with the specific rights necessary
i guess it highly depends on what you're trying to do
h
You can re-set the paths to the caches back to those under the non-su's homedir with these options (via cmd-line flag or env var, or supplemental config file): ā€¢ https://www.pantsbuild.org/docs/reference-global#section-local-store-dir ā€¢ https://www.pantsbuild.org/docs/reference-global#section-named-caches-dir
šŸ™‚ 1
I think the
./pants
script also uses the homedir for something, you might have to tweak that as well
But keep in mind that Pants will write files as the root user, and this may mess with any future runs as the non-root user
This overall seems like it will be trouble
šŸ’Æ 1
s
not only for build artifacts and executables. You got pants (service) running as a root then.
a
Thanks guys for the suggestions and infos. You're absolutely right about not doing that. I'll look into how I can restructure the process there to not require sudo at that place.
šŸ‘ 1
s
I don't think this is something, you would want to do, ever. I'm even splitting building and installing software with Make. It does mess with git repositories from time to time as well
Regardless of which build system you are using