From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cJDyOaWAnGDAWAEAgWs5BA (envelope-from ) for ; Thu, 13 May 2021 03:28:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qEqlNaWAnGDUGgAA1q6Kng (envelope-from ) for ; Thu, 13 May 2021 01:28:05 +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 26F05240C1 for ; Thu, 13 May 2021 03:28:05 +0200 (CEST) Received: from localhost ([::1]:40258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lh08x-0000dD-SP for larch@yhetil.org; Wed, 12 May 2021 21:28:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lh08p-0000d4-0c for guix-devel@gnu.org; Wed, 12 May 2021 21:27:55 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:36958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lh08l-00014o-S6 for guix-devel@gnu.org; Wed, 12 May 2021 21:27:54 -0400 Date: Thu, 13 May 2021 01:27:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1620869267; bh=Ls4aMrBm1t7p3MKXQjvO1oxPDjOm18RPHt+LH5Yk/kk=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=nbE/dikBxE2eYGFVXMuL0q2FRr13hvZob6Cl23i3f2qgdtuK7g/6MgC3kKtCvrHDC MvfFE2He3Cenc7tm8/ZM3oOl2CoqlJnBL2UqyhVnglW9wkJa2PSz466XSGFQC2+FOK o8JhvpU9bXSysLO7E/p+FV0vDwk6KigoXcdgqYRY= To: Mathieu Othacehe From: raid5atemyhomework Cc: Pierre Neidhardt , "guix-devel@gnu.org" Subject: Re: Adding Substitute Mirrors page to installer Message-ID: <4HlazINP0mSEQboLeHTJJ45LmDc1HsA8GIDTy4SQDc-vs8IQYfLArkT_Yf8mRH_aiHYAb9C6Ji_JZXm76D6niESZJB1Bjdk7RspulUTN1yw=@protonmail.com> In-Reply-To: References: <87blbsah0x.fsf@ambrevar.xyz> <-WVvn-rIc2HXdunUeEp6YfVQ9WkU-JsP_sAdLNK4ebx5YUTZ0-lSxWF2MGWOTGpqCvfil-JSAW1n-_82UQlRSXM5Qmb2ajaTYsa_EFUJ6o4=@protonmail.com> <3YQTy8cg8z-IZkxgM7lJSk8ZeolHbf4t7_HPw9Q8GCkx1lP7CXrbdtPZ9Hvyo--NvKXyr9W2iv82d8lL2T0NQPpTPhDbBFo3_3jQ3eAdAEI=@protonmail.com> <87o8eys6ki.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.27; envelope-from=raid5atemyhomework@protonmail.com; helo=mail4.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620869285; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Ls4aMrBm1t7p3MKXQjvO1oxPDjOm18RPHt+LH5Yk/kk=; b=azRFjQ7TOViq5vzLwC2kClPs//0XLQgg3Up96mAyCWWYf+/9dp9cpRPoWk47/XEdNqE+Y/ q3n28ZzMTD1EwOj4/B8i5ABg7CiH1YGdSxU8WxddnVPZNsP4BhJ2TBQ1i/9lU1QDH2o97U NW8nigURLS7O0Wg5OEtPGFC7DThcLvxmYPUnatnEEP58k0d+L/FMU+gLS049s9TsKTQ1ZF ozLkI/8vgQyCe7NrPkc2Jc4UU/ns2N8uzjwxZay6hdl3N5mOBXTFjwXQ/hg+DJZltDqMLc 4e4R3t5b5cWrgXYz1+o/gZEbEJu3OONPEfcXhq144FYI3F04aWXyBwwHETfDtQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620869285; a=rsa-sha256; cv=none; b=QiqIuYn+QdoNWtGXft3bhRahifnRqzctgTjFQOL7Sj391jU6icaSJ4Q3qmIJLCOYEQWdiJ 8xQV2ZcvOYeK6wmpJGmEafF4dKUeNvFK6kogvBO7ij1bj1/rECWTPcmQeAwCxn/SJGEnFZ wESRv8p4F5IO33U3HqAtY/j9UvkbYW6GPwZk9/HAf0ApCTupJfhV6Iz228dZQNxkIhVuXg FNkfzgcPma+6p6Z2zXYGUQCcg4WOwKvPJ7PVhrcadWFOlS5IWGQ1Jnt9itwAn0oLQW6Gzj OrSnbrDmxAufTTOmsA9KlPBQMbwELyzn1nTkeLnz+15Yy2kSylkIj9ihtLghpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b="nbE/dikB"; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b="nbE/dikB"; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 26F05240C1 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: mou+FJo9MyEg bump > Hello Mathieu, > > > Hello, > > Thanks for this patch, it seems to work fine! > > > > > - ;; Extract the substitute URLs of the user configuratio= n. > > > > > > > > > - (os (read-operating-system (%installer-con= figuration-file))) > > > > > > > > > - (substitute-urls (and=3D> (find > > > > > > > > > - (lambda (service) > > > > > > > > > - (eq? guix-service-type > > > > > > > > > - (service-kind service)= )) > > > > > > > > > - (operating-system-services os= )) > > > > > > > > > - (compose guix-configuration-sub= stitute-urls > > > > > > > > > - service-value))) > > > > > > > > > > We could make the mirror selection a proper step, adding it to (gnu > > installer record). Then in (gnu installer), you could add: > > --8<---------------cut here---------------start------------->8--- > > (installer-step > > (id 'mirrors) > > (description (G_ "Mirror substitute server")) > > (compute (lambda _ > > ((installer-mirrors-page current-installer))))) > > --8<---------------cut here---------------end--------------->8--- > > This way, you should be able to select the step result in > > "run-final-page" this way: > > --8<---------------cut here---------------start------------->8--- > > (let* ((configuration (format-configuration prev-steps result)) > > (user-partitions (result-step result 'partition)) > > (locale (result-step result 'locale)) > > (users (result-step result 'user)) > > (mirrors (result-step result 'mirrors)) > > (install-ok? > > (with-mounted-partitions > > user-partitions > > (configuration->file configuration) > > > > (run-config-display-page #:locale locale) > > (run-install-shell locale #:users users #:mirrors mirrors)))) > > > > > > ...) > > --8<---------------cut here---------------end--------------->8--- > > That would avoid the need to parse the resulting configuration file. > > I don't think that will work. > > The intent is that mirror selection affects two things: > > - The actual installed system, i.e. `/etc/config.scm`. > - The installer's Guix Daemon. > > If my understanding of the above is correct, it will only affect the = installer's Guix Daemon (via `run-install-shell` which will call into `inst= all-system`, presumably with the added argument), but not affect the instal= led system, because the `configuration` cannot be modified by the `'mirrors= ` page in the above construction. > Currently what the installer assumes is that a page will at most incl= ude a unique entry into the `operating-system`, but it cannot handle a page= which modifies the entry created by a previous page. > > It would be a breakage of expectations to ask the user to select some= mirror, then the installed system, when `guix system reconfigure`d, uses t= he default `ci.guix.gnu.org`. > > My patch affects both, because that is logically what a user would ex= pect, after all, they selected a particular server to install from. > Thus, they expect, that both the installed system, and the installer,= will use the selected mirror. > Of course, it feels somewhat dirty, as there is a need to read the co= nfiguration file. > It would be cleaner if a page could affect the field created by a pre= vious page. > > For example, perhaps the result of a page is not an AST that is a fie= ld of an `operating-system` form, but instead a procedure that accepts a `(= operating-system ...)` form and returns it. > Most existing pages would just append their keyed sub-form. > However the `mirrors` page would modify an existing `services` field = in the input `operating-system` form instead. > > > > > +(define (run-substitute-mirror-page) > > > > > > - (let ((title (G_ "Substitute mirror"))) > > > > > > - (run-listbox-selection-page > > > > > > - #:title title > > > > > > > > > - #:info-text (G_ "Choose a server to get substitutes from. > > > > > > > > > - > > > > > > +Depending on your location, the official substitutes server can be s= low; \ > > > +in that case, using a mirror may be faster.") > > > > I wonder if it would make sense to select multiple mirrors, as fallback > > if the preferred mirror is not up to date. We could also add the > > possibility for the user to add a mirror manually. > > In that case, the mirror page could look like the "User creation" page, > > with an "Add" button opening a popup proposing to type a mirror URL or > > to select one from an existing list. > > WDYT? > > I think Less is More, and deploying an installer with a simple "select on= e mirror" pagenow will cover 90% of use-cases, and we can add the more comp= licated page later when there is more time. > > In particular, there is really only one public mirror of Guix that I know= of, the SJTU mirror, so all the flexibility here is not very useful, at le= ast not to me. > Since "multiple mirrors" aren't even available yet anyway, why add the co= mplication now? > > Maybe you can encourage more people to actually run mirrors if the instal= ler has a visible "select mirrors" page, so that you can actually get more = than just the SJTU mirror and "select multiple mirrors" is now a (good) pro= blem to have to solve. > > For now I think a simple "select one mirror, we'll add ci.guix.gnu.org as= a fallback" would be better. > You can add a "select multiple mirrors in an order I want to specify" lat= er, when there are multiple mirrors existing. > > Thanks > raid5atemyhomework