From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6J3HIL2vtGCHSwAAgWs5BA (envelope-from ) for ; Mon, 31 May 2021 11:43:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OEAqHL2vtGA8SAAAbx9fmQ (envelope-from ) for ; Mon, 31 May 2021 09:43:25 +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 984131069D for ; Mon, 31 May 2021 11:43:24 +0200 (CEST) Received: from localhost ([::1]:35228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lneSB-0004Z6-Mk for larch@yhetil.org; Mon, 31 May 2021 05:43:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lneRx-0004Xa-N3 for guix-devel@gnu.org; Mon, 31 May 2021 05:43:11 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:37297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lneRu-0001ee-KY; Mon, 31 May 2021 05:43:09 -0400 Date: Mon, 31 May 2021 09:42:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1622454180; bh=k50JNbUQeXwx86OBgpYlQQKl1IG7IslikGth0em+BZQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=yYJcvBfSLCW11ckYeZNH6MeggkCjxb4yf9L+L6JpBgsh+l12jrWfwEwfO45h9Sgne gFmielgnh1Ba8SIdXqOghF08Pwh7gtwHckW/CY/FQEZUG2Ppc7B2M8Ow9m9ofUA3uc YOdOWI6Xn1sp/IaYtTiBurN0Bx/uzeUHUZDri7jU= 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: <4HlazINP0mSEQboLeHTJJ45LmDc1HsA8GIDTy4SQDc-vs8IQYfLArkT_Yf8mRH_aiHYAb9C6Ji_JZXm76D6niESZJB1Bjdk7RspulUTN1yw=@protonmail.com> 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> <4HlazINP0mSEQboLeHTJJ45LmDc1HsA8GIDTy4SQDc-vs8IQYfLArkT_Yf8mRH_aiHYAb9C6Ji_JZXm76D6niESZJB1Bjdk7RspulUTN1yw=@protonmail.com> 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H2=-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=1622454205; 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=k50JNbUQeXwx86OBgpYlQQKl1IG7IslikGth0em+BZQ=; b=LnARuU+ZT5mi+x1Y3tGAkbyowbth+3gy7msfeuY8wbEz/ExxftYOn2bL8Qr+CBQIM6PQw+ 4h5CwZsGGKbBiCUZ02HVJswXc8xR8BOB54XgcX5jVw4GK+ZGzqc5ZG+vLwu1/b7sEUwOCp TuC2UB8FIfStC6keJwN53EKBWfATo3NPpDQH/kLth8UQN0iIVP5Wyv1+usFniGOj/jqHdb 0cOX9kQdm3973lkKblZnXsXSFYTTAo/GWOq4lFQZy+4frklCw3vZMeNO3qdzYxrflpNIqY hJqmGZtesEdF8U1YBvafuBKq5nhn4yumh/nNuNL/aIlCFgRgnoRumDo+ggU39w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622454205; a=rsa-sha256; cv=none; b=df9e/BO0TROeulIVvLL9PAkXV4BH/xjLXs2oLCpYZoJQ5FJIeoD+O9YDRBlrdZk5hAgzyV 6g2rc/mSUrTBitjqHnK6bq59XEWMNlxxj+Hoa4BBE2h8A2ICPAFfsgqzysPYog6iHPLfGG BJQ7TfNKuGJhjCVWMwvTl/iZCM4SyMltFBwQUV8TSLU+dog9SlYuU1g0Jqu3rF7J+s7JZ3 WeNJg29/uMpSvjI8Y7m53ruUkldIdakcIa9UAWzdnNNUCBrjYSj0MuSgSljMR7DZQA4n4m sWajKRqfs6dzuEkmhGogyHaj8BkGVTvNH3TKh99f29xPwRwRbXa2gie2ax2tVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=yYJcvBfS; 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: -1.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=yYJcvBfS; 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: 984131069D X-Spam-Score: -1.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5KveIjsyQqTw bump > bump > > > Hello Mathieu, > > > > > Hello, > > > Thanks for this patch, it seems to work fine! > > > > > > > - ;; Extract the substitute URLs of the user configur= ation. > > > > > > > > > > > > - (os (read-operating-system (%installer= -configuration-file))) > > > > > > > > > > > > - (substitute-urls (and=3D> (find > > > > > > > > > > > > - (lambda (service) > > > > > > > > > > > > - (eq? guix-service-type > > > > > > > > > > > > - (service-kind serv= ice))) > > > > > > > > > > > > - (operating-system-service= s os)) > > > > > > > > > > > > - (compose guix-configuration= -substitute-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 th= e installer's Guix Daemon (via `run-install-shell` which will call into `in= stall-system`, presumably with the added argument), but not affect the inst= alled system, because the `configuration` cannot be modified by the `'mirro= rs` page in the above construction. > > Currently what the installer assumes is that a page will at most in= clude a unique entry into the `operating-system`, but it cannot handle a pa= ge which modifies the entry created by a previous page. > > It would be a breakage of expectations to ask the user to select so= me mirror, then the installed system, when `guix system reconfigure`d, uses= the default `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 installe= r, will use the selected mirror. > > Of course, it feels somewhat dirty, as there is a need to read the = configuration file. > > It would be cleaner if a page could affect the field created by a p= revious page. > > For example, perhaps the result of a page is not an AST that is a f= ield 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` fiel= d 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 fr= om. > > > > > > > > > > > > - > > > > > > > > +Depending on your location, the official substitutes server can be= slow; \ > > > > +in that case, using a mirror may be faster.") > > > > > > I wonder if it would make sense to select multiple mirrors, as fallba= ck > > > 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" pag= e, > > > with an "Add" button opening a popup proposing to type a mirror URL o= r > > > to select one from an existing list. > > > WDYT? > > > > I think Less is More, and deploying an installer with a simple "select = one mirror" pagenow will cover 90% of use-cases, and we can add the more co= mplicated page later when there is more time. > > In particular, there is really only one public mirror of Guix that I kn= ow of, the SJTU mirror, so all the flexibility here is not very useful, at = least not to me. > > Since "multiple mirrors" aren't even available yet anyway, why add the = complication now? > > Maybe you can encourage more people to actually run mirrors if the inst= aller has a visible "select mirrors" page, so that you can actually get mor= e than just the SJTU mirror and "select multiple mirrors" is now a (good) p= roblem 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" l= ater, when there are multiple mirrors existing. > > Thanks > > raid5atemyhomework