aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-02-07 21:03:54 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-02-20 20:29:31 -0500
commita878c38476dbe886bf26bc7bafb07bd4f20f763e (patch)
treeafcbee8b273c17a3ad25a7aa0e69b198af7050b7 /docs
parent7884149bf55dfef1fc77f404b8dbb08cd12e0908 (diff)
downloadmeson-a878c38476dbe886bf26bc7bafb07bd4f20f763e.zip
meson-a878c38476dbe886bf26bc7bafb07bd4f20f763e.tar.gz
meson-a878c38476dbe886bf26bc7bafb07bd4f20f763e.tar.bz2
minstall: rework root elevation prompt for extensibility and behavior
There's a couple issues with the current approach: - pkexec is an unusual elevation method, the standard is sudo - it tries to elevate even in automated workflows - the user may not want to automatically rerun as root, that might be badly behaved Do some upfront checks instead, first to make sure it even makes sense to try becoming root, and then to ask the user "do you really want this". Also check for a couple common approaches to root elevation, including doas. Fixes #7345 Fixes #7809
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Installing.md14
-rw-r--r--docs/markdown/snippets/meson_install_elevate.md9
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/markdown/Installing.md b/docs/markdown/Installing.md
index a692afe..0bc9a47 100644
--- a/docs/markdown/Installing.md
+++ b/docs/markdown/Installing.md
@@ -102,6 +102,20 @@ Telling Meson to run this script at install time is a one-liner.
The argument is the name of the script file relative to the current
subdirectory.
+## Installing as the superuser
+
+When building as a non-root user, but installing to root-owned locations via
+e.g. `sudo ninja install`, ninja will attempt to rebuild any out of date
+targets as root. This results in various bad behaviors due to build outputs and
+ninja internal files being owned by root.
+
+Running `meson install` is preferred for several reasons. It can rebuild out of
+date targets and then re-invoke itself as root.
+
+*(since 1.1.0)* Re-invoking as root will try to guess the user's preferred method for
+re-running commands as root. The order of precedence is: sudo, doas, pkexec
+(polkit). An elevation tool can be forced by setting `$MESON_ROOT_CMD`.
+
## DESTDIR support
Sometimes you need to install to a different directory than the
diff --git a/docs/markdown/snippets/meson_install_elevate.md b/docs/markdown/snippets/meson_install_elevate.md
new file mode 100644
index 0000000..2ba92e6
--- /dev/null
+++ b/docs/markdown/snippets/meson_install_elevate.md
@@ -0,0 +1,9 @@
+## `meson install` now supports user-preferred root elevation tools
+
+Previously, when installing a project, if any files could not be installed due
+to insufficient permissions the install process was automatically re-run using
+polkit. Now it prompts to ask whether that is desirable, and checks for
+CLI-based tools such as sudo or opendoas or `$MESON_ROOT_CMD`, first.
+
+Meson will no longer attempt privilege elevation at all, when not running
+interactively.