From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KKPSETr562A2vwAAgWs5BA (envelope-from ) for ; Mon, 12 Jul 2021 10:11:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6IiBDTr562BacAAA1q6Kng (envelope-from ) for ; Mon, 12 Jul 2021 08:11:38 +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 C17B0B644 for ; Mon, 12 Jul 2021 10:11:37 +0200 (CEST) Received: from localhost ([::1]:32842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2r2O-00077T-Ni for larch@yhetil.org; Mon, 12 Jul 2021 04:11:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ZQi-0007nu-0R for guix-devel@gnu.org; Sun, 11 Jul 2021 09:23:32 -0400 Received: from mail4.protonmail.ch ([185.70.40.27]:45673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2ZQf-0007QB-PA for guix-devel@gnu.org; Sun, 11 Jul 2021 09:23:31 -0400 Date: Sun, 11 Jul 2021 13:23:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1626009798; bh=E3qu7FPxbR5Z4eufYzs7fe05uz5df9K6hcqH27vMpI4=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=mIDVkOiwJgjbleBmsWFXcV30Tldygj733GhhlauWaiguN5ZX6MdobxHez5nHH8bjo MhPiUSbLXamQlOO1iCfHR+DiUApt7XO1fxrHbr+YbDams+n10N0qkzUH6fSDhiUQi0 LTE7zEMEnS4QNKNponnuN4VuMSnYP2id32SL0Sxw= To: zimoun From: Kaelyn Cc: Leo Famulari , =?utf-8?Q?Ludovic_Court=C3=A8s?= , guix-devel@gnu.org Subject: Re: guix weather exit status? Message-ID: In-Reply-To: <86mtqti6q2.fsf@gmail.com> References: <87r1g6b593.fsf@gnu.org> <86mtqti6q2.fsf@gmail.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=kaelyn.alexi@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-Mailman-Approved-At: Mon, 12 Jul 2021 04:11:19 -0400 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: Kaelyn 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=1626077497; 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=E3qu7FPxbR5Z4eufYzs7fe05uz5df9K6hcqH27vMpI4=; b=Nxw/1NvBk9NBcFImvHmWVnSuOcdH9OW4SFe5hSx+Yq/gGa+kMsQyJDV/gr6I8sw0d9lLA5 6yA/iJ8DakX2FjyrzYLBumFFqzzA872+7nlsy/nsPSIolLphG9W60nmMET5W/d36UZYrV/ ndSjNuXkt2j+IDVPmRD7eRzgDoz0IH5zV8TABSrvwwpIThd67ZksFweYJCFn8NXmn56KZ7 LN8+V9rymwRKjYWWs0T1bZFUq+78MHK4DeOJ8gQMuJDN8B1KlTxUCDy9aGZEXa2J65ZMnP S1AdeGH9YV9sma/1Hj+Ds2nGpHVl+oKWhVgmo4NT+gXCbKwo429GbKGM5gXTqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626077497; a=rsa-sha256; cv=none; b=Da/0lhPvo/nX1XbryYSNWU1cZGoKkJYMeo5NcE/eNAWf6ajGqZgjL7Ea86MCpqCLZz9/db XZu/vyjiFHVeZao4KmUQLy+Wqx6K+txNQMN3DfWgRep5A99vqYpRANrk6jMNwVpGViX6iA DjPFzlL83N+doYr79geKo+eoIgS1A8CKmZ967FxCy5uWadypumZxiiF8UVyQjLnmuz1k3d YKOCX/0ggmCFLgsS3TI1/zXyByM1Xxo70iApHH+rXsprqunwdGjmHOMBxPBeFgMgOlKZyH r9UPn4f4QFfoSF/97I+IIdEVBv5a+lPF2ZETVfTFJa1kQq4uRcmqkeFwZkdDoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=mIDVkOiw; 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: -0.60 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=mIDVkOiw; 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: C17B0B644 X-Spam-Score: -0.60 X-Migadu-Scanner: scn1.migadu.com X-TUID: ChgsVcuadzMR Hi, I'm fairly new to Guix and haven't made much use of guix weather, but had a= thought about the exit status. On Sunday, July 11th, 2021 at 4:40 AM, zimoun wr= ote: > Hi, > > On Sat, 10 Jul 2021 at 18:06, Leo Famulari leo@famulari.name wrote: > > > On Sat, Jul 10, 2021 at 04:41:44PM +0200, Ludovic Court=C3=A8s wrote: > > > > > I agree we could change (or rather refine) semantics to exit with > > > > > > non-zero when overall coverage is below 100%. In the example above, i= t > > > > > > should return 0. > > > > Maybe we could distinguish between various cases like this: > > > > 0 means 100% coverage > > > > 1 means a substitute is available, but not from all servers > > > > 2 means a substitute is not available > > > > This would preserve the current meaning of 0, while still allowing `gui= x weather` to be used in scripts to "wait for a substitute". > > What about two or more packages? =E2=80=9Cguix weather foo bar=E2=80= =9D when the > > package =E2=80=99foo=E2=80=99 is available on one server and =E2=80=99bar= =E2=80=99 is not at all. Or if > > =E2=80=99foo=E2=80=99 is available on one server and =E2=80=99bar= =E2=80=99 on the other. Etc. > > We could have: > > 0 100% all servers > > 1 100% from one server > > 2 100% from a server mix > > 3 one or more substitute is missing It looks to me like there are two overlapping use cases for guix weather an= d it's exit status (and sorry if they aren't the clearest): checking substi= tute availability for download, and substitute progress/coverage among serv= ers. There is already a "--coverage" flag to guix weather that the help describe= s as "show substitute coverage for packages with at least COUNT dependents"= . What if a new flag was added, say "-a" / "--available", which specifies t= he number of servers a single substitute must be available from to be consi= dered available, possibly with a default of "1". That way guix weather can = exit 0 when needed for both of the use cases. For example, with the original output that showed 100% substitute availabil= ity from ci.guix.gnu.org and 0% availability from bordeaux.guix.gnu.org for= a single package and exited 1 as a result: * "guix weather -a 1" would exit 0 * "guix weather -a 2" would exit 1 because it was available from less than = 2 servers. That way, even when multiple packages are specified at once, guix weather w= ould exit 0 as long as all of the packages met the requested minimum availa= bility. Cheers, Kaelyn P.S. If folks like the idea, I'm volunteering to implement it. ;)