From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D28D8138350 for ; Mon, 27 Jan 2020 10:26:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC702E087E; Mon, 27 Jan 2020 10:26:05 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8ECFDE087E for ; Mon, 27 Jan 2020 10:26:05 +0000 (UTC) Received: from muon (vm4.gentoo.osuosl.org [140.211.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: heroxbd) by smtp.gentoo.org (Postfix) with ESMTPSA id F14C134E3A2 for ; Mon, 27 Jan 2020 10:26:04 +0000 (UTC) Received: from [2001:470:4c22:ae86:babe:10:0:1] (port=45374 helo=proton) by muon with esmtp (Exim 4.92) (envelope-from ) id 1iw1aj-00052n-EX for gentoo-alt@lists.gentoo.org; Mon, 27 Jan 2020 10:26:01 +0000 From: Benda Xu To: gentoo-alt@lists.gentoo.org Subject: Re: [gentoo-alt] Allow non-interactive bootstrap to be stopped at arbitrary stages References: <874kwwduzd.fsf@robot.e.airelinux.org> <87blqrlmf2.fsf@gentoo.org> Date: Mon, 27 Jan 2020 18:26:00 +0800 In-Reply-To: (Sam Pfeiffer's message of "Mon, 27 Jan 2020 20:43:57 +1100") Message-ID: <87zhe9gpqf.fsf@proton.d.airelinux.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-alt@lists.gentoo.org Reply-to: gentoo-alt@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain X-Archives-Salt: 5b1ee54b-69f8-468a-a753-a4021847d789 X-Archives-Hash: 2d3da18561df684ab4c53f581ae64463 Hi Sam, Sam Pfeiffer writes: > It took me a while to figure out how to do it with minimal > changes... but this is the new version I came up with: > > https://gist.github.com/awesomebytes/c930100ca97dd4195123104c5396b645 > > The changes to the current bootstrap_prefix.sh are these (in .patch > format): > https://gist.github.com/awesomebytes/ab1f237feea2f51ae65a5ecca203842e > > That patch in words: I've wrapped the setup stuff in a function called >bootstrap_get_defaults (as that's what it is doing). Then the complete >bootstrap process is named bootstrap_all_stages. I also separated the >last step calling it bootstrap_emerge_emptytree_system. > > This keeps the usage of the script the same for the interactive case, > the non interactive case, but...There is a 'maybe' breaking change, as > now giving the name of the function to execute first calls > bootstrap_get_defaults, then calls the function... and does a couple > of necessary workarounds. > > I say 'maybe' breaking, as it doesn't 'exactly' do the same it did > before when executing ./bootstrap-prefix.sh EPREFIX stage2 (but I > think it was either broken or I don't know how it was used, which is > the most likely option). > If you don't like this new behaviour, my alternative implementation > was to create extra functions like: bootstrap_stage1_noninteractive, > bootstrap_stage2_noninteractive, bootstrap_stage3_noninteractive, > bootstrap_emerge_emptytree_system_noninteractive Which would do the > bootstrap_get_defaults and the workarounds. > > Let me know what you think. I can prepare a patch with that too. If > that's the case, I'd love an explanation on how to use the current > behaviour of the script. I read your patches. But I don't understand the motivation for completely reproduce the interactive use of bootstrap-prefix.sh by bootstrap_get_defaults() and bootstrap_emerge_emptytree_system(). The most important part of the CI is to test stages 1~3, because both the hosts and the gentoo repository are moving targets. In the past 10 years, there were few problems happening in bootstrap_get_defaults() and bootstrap_emerge_emptytree_system(), or equivalents. I would like to propose the 3rd way: 1. set the PATH, CHOST, etc. with your CI script, 2. bootstrap-prefix.sh stage1 3. bootstrap-prefix.sh stage2 4. bootstrap-prefix.sh stage3 5. call emerge -e @system with your CI script. What do you think? Yours, Benda