From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6FQrAcwj0V4sCQAA0tVLHw (envelope-from ) for ; Fri, 29 May 2020 15:01:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WJikOMsj0V6ZTQAAB5/wlQ (envelope-from ) for ; Fri, 29 May 2020 15:01:31 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B2E0B940538 for ; Fri, 29 May 2020 15:01:29 +0000 (UTC) Received: from localhost ([::1]:33682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jegVi-0005ZC-F0 for larch@yhetil.org; Fri, 29 May 2020 11:01:27 -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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: tdeCDHKG4ScW * 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 -- 2.26.2