From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id m3lEKooIgWDsWAEAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 07:24:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yKK2JIoIgWCwSwAAbx9fmQ (envelope-from ) for ; Thu, 22 Apr 2021 05:24:26 +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 51BC727095 for ; Thu, 22 Apr 2021 07:24:26 +0200 (CEST) Received: from localhost ([::1]:55522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZRpB-0007mE-GL for larch@yhetil.org; Thu, 22 Apr 2021 01:24:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZRoE-00073R-CI for guix-devel@gnu.org; Thu, 22 Apr 2021 01:23:26 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:61545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZRo9-00013e-S0 for guix-devel@gnu.org; Thu, 22 Apr 2021 01:23:25 -0400 Date: Thu, 22 Apr 2021 05:23:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1619068990; bh=wXYh5NPiUgkNrs6b7q99a4awjy4BpB9faQ1wI9luRDI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=k7GoOnEGduPstLD54C9ha26TRijRa1Ew94zpJZzSJ0gAA+iY3F41JbVvG1nnkzjA/ KAFc9rqBBUzutH9qw5qeFibNjBgFnfqATX7pNvtLeysmOlY8KINckGbTXTuegybBTc m+SN5vrT0WrXolHD5hnRatifat+UQdp68URz4fM8= To: Mathieu Othacehe From: raid5atemyhomework Cc: Pierre Neidhardt , "guix-devel@gnu.org" Subject: Re: Adding Substitute Mirrors page to installer Message-ID: In-Reply-To: <87o8eys6ki.fsf@gnu.org> 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=ham 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=1619069066; 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=wXYh5NPiUgkNrs6b7q99a4awjy4BpB9faQ1wI9luRDI=; b=s1k0pmwSu6JCGv3bXCH8NA7zf7WbiDRksmkVLmiMGfOEq6gRjUM0l8XXR2C07ZR7ib1fFd NwuH8bdFJXuT5jhp2infJxdN9TViyyGTA8zTIit9N8xg/Ocl5wW9YQG18U7NRi03OpePIQ vM1/IyrIhnvAKrFvLGRkf/nHzzRiUbtDPUjcQKON/6rmigAlLFVLKWF+YMygf6tSTRgLVc 3C09GwQXD5ENzJVra2Apa/rQtFGCYY7DC20e4nFA0kBhVFuDjR+zAMxrxYju6bBU43gNgs 7Y9Y/ddNuyCMAXoy8uSZAszyTlOsDs4Yu7GLGnFZFgSTyyNNztYiZzbgIFjiQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619069066; a=rsa-sha256; cv=none; b=B2HqgrVM+HwBHU7GZuWe6isavRcLcNNdSGJhS+qs0sXurotCo9kQs1MS6l8HLhp51dSfkI NNbqn8pILs1BNzBnpAPP6ruTklyELo/5XuIHKYi4iTkxYze5PhK3P00r/ARnWbdMdJZwEp zDWuNarwHdWcgSM4XqgubCIluP1qJnNfrxRG1Wx6E/ldw42KRM/tbCApTVsWOXfY3HXU9M zImJyun9HgwWVilDNYPWde6BpZt8zw3HrLSdTsZFp+2a3anrdLqPFQv3m63vf10DnGxOia O8g3iiU1hoaGFz1vna/q/wagzIZlnaOqeSh3OSwRF0oyEaGgn0wi1O424ft2ow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=k7GoOnEG; 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.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=k7GoOnEG; 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: 51BC727095 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: jiyU7RnQqph/ Hello Mathieu, > Hello, > > Thanks for this patch, it seems to work fine! > > > - ;; Extract the substitute URLs of the user configuration. > > > > > > - (os (read-operating-system (%installer-configu= ration-file))) > > > > > > - (substitute-urls (and=3D> (find > > > > > > - (lambda (service) > > > > > > - (eq? guix-service-type > > > > > > - (service-kind service))) > > > > > > - (operating-system-services os)) > > > > > > - (compose guix-configuration-substit= ute-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 instal= ler's Guix Daemon (via `run-install-shell` which will call into `install-sy= stem`, presumably with the added argument), but not affect the ***installed= *** 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 include 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 mirro= r, then the installed system, when `guix system reconfigure`d, uses the def= ault `ci.guix.gnu.org`. My patch affects both, because that is logically what a user would expect, = 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 configur= ation file. It would be cleaner if a page could affect the field created by a previous = page. For example, perhaps the result of a page is not an AST that is a field of = an `operating-system` form, but instead a procedure that accepts a `(operat= ing-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 slo= w; \ > > +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 one = mirror" page *now* will cover 90% of use-cases, and we can add the more com= plicated page later when there is more time. In particular, there is really only one public mirror of Guix that I know o= f, the SJTU mirror, so all the flexibility here is not very useful, at leas= t not to me. Since "multiple mirrors" aren't even available yet anyway, why add the comp= lication now? Maybe you can encourage more people to actually run mirrors if the installe= r has a visible "select mirrors" page, so that you can actually get more th= an just the SJTU mirror and "select multiple mirrors" is now a (good) probl= em 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" later= , when there *are* multiple mirrors existing. Thanks raid5atemyhomework