From patchwork Fri May 29 15:00:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 22440 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 35C4127BBE8; Fri, 29 May 2020 16:01:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0279F27BBE6 for ; Fri, 29 May 2020 16:01:36 +0100 (BST) Received: from localhost ([::1]:33682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jegVr-0005ZC-GA for patchwork@mira.cbaines.net; Fri, 29 May 2020 11:01:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jegVL-0005Jr-6h for guix-patches@gnu.org; Fri, 29 May 2020 11:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jegVK-0005pc-7A for guix-patches@gnu.org; Fri, 29 May 2020 11:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jegVK-0003jn-5x for guix-patches@gnu.org; Fri, 29 May 2020 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41601] [PATCH] doc: Make 'sudo -E ./pre-inst-env guix-daemon' example less prominent. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 29 May 2020 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41601@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159076441014291 (code B ref -1); Fri, 29 May 2020 15:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 May 2020 15:00:10 +0000 Received: from localhost ([127.0.0.1]:55782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jegUT-0003iQ-HG for submit@debbugs.gnu.org; Fri, 29 May 2020 11:00:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:34254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jegUR-0003iH-3Q for submit@debbugs.gnu.org; Fri, 29 May 2020 11:00:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jegUQ-0004XZ-Nm for guix-patches@gnu.org; Fri, 29 May 2020 11:00:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40629) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jegUQ-0004tY-BN for guix-patches@gnu.org; Fri, 29 May 2020 11:00:06 -0400 Received: from ti0006q161-2604.bb.online.no ([84.202.68.75]:59020 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jegUP-000609-LN for guix-patches@gnu.org; Fri, 29 May 2020 11:00:06 -0400 From: Marius Bakke Date: Fri, 29 May 2020 17:00:03 +0200 Message-Id: <20200529150003.4560-1-marius@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * doc/contributing.texi (Running Guix Before It Is Installed): Move './pre-inst-env guix-daemon' example after the mention of GUILE_LOAD_PATH & co, because running the daemon from the checkout frequently trips new users. Additionally clarify that sudo must be setuid. --- doc/contributing.texi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/contributing.texi b/doc/contributing.texi index 88128e5498..d9e54dd23b 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -161,13 +161,8 @@ with all the dependencies available (@pxref{Building from Git}), and then simply prefix each command with @command{./pre-inst-env} (the @file{pre-inst-env} script lives in the top build tree of Guix; it is generated by @command{./configure}). -An example@footnote{The @option{-E} flag to -@command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set -such that @command{guix-daemon} and the tools it uses can find the Guile -modules they need.}: @example -$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild $ ./pre-inst-env guix build hello @end example @@ -205,6 +200,16 @@ $1 = 361 The @command{pre-inst-env} script sets up all the environment variables necessary to support this, including @env{PATH} and @env{GUILE_LOAD_PATH}. +When root privileges are required, use the @option{-E} argument to +@command{sudo} to preserve the environment@footnote{Additionally, make sure +to use the installed @command{sudo} such as @file{/run/setuid-programs/sudo} +instead of the @code{sudo} package, otherwise sudo won't be able to elevate +privileges}. E.g. if you are testing changes to @command{guix-daemon}: + +@example +$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild +@end example + Note that @command{./pre-inst-env guix pull} does @emph{not} upgrade the local source tree; it simply updates the @file{~/.config/guix/current} symlink (@pxref{Invoking guix pull}). Run @command{git pull} instead if