From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AJaqHq1Q4l64YwAA0tVLHw (envelope-from ) for ; Thu, 11 Jun 2020 15:41:33 +0000 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 COBwGq1Q4l6KYwAAbx9fmQ (envelope-from ) for ; Thu, 11 Jun 2020 15:41:33 +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 E4A8B9401CD for ; Thu, 11 Jun 2020 15:41:32 +0000 (UTC) Received: from localhost ([::1]:42218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjPKd-0005je-SE for larch@yhetil.org; Thu, 11 Jun 2020 11:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjPKR-0005jH-Ir for guix-devel@gnu.org; Thu, 11 Jun 2020 11:41:19 -0400 Received: from sender4-op-o10.zoho.com ([136.143.188.10]:17064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jjPKP-0001xz-FP for guix-devel@gnu.org; Thu, 11 Jun 2020 11:41:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1591890073; cv=none; d=zohomail.com; s=zohoarc; b=X47ufPSN2h++AStIIPzGBj8BxikuZ5acrxZ+nT2vI6g2sDa7+Zsz4jXhdCaPOqr9uAu0R27tn5GO1ihQh3Js+XOs5sGEMW+u1QpQ3Tn9xcE2cfinKhNNOIeKxHwWmMwCwhXr/lsCZqE+B3GrlpZbDmIeFYVZft+ikbwRlo4AHtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591890073; h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=anemHdRcpz9kue1mImlz8KYPAlB04IX7bGiQH+41ic0=; b=fxDWEpxzkPkKN0vKCqdrtepZpgXWqU8GkPmnmx1APSvNZ+snyxf6AlwzBqR3YRKDoUlnSqyAgowg7b/Tn3ve0ABcW+T7ATUp5ESxtgTLw5PCC81QbTH60KE56RkDc01L4dVimjK4Unb8qVmS5Pmpc8pETxDqDi6v+2pOL2p853w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=beaver-labs.com; spf=pass smtp.mailfrom=edk@beaver-labs.com; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1591890073; s=zoho; d=beaver-labs.com; i=edk@beaver-labs.com; h=References:From:To:Subject:In-reply-to:Message-ID:Date:MIME-Version:Content-Type; bh=anemHdRcpz9kue1mImlz8KYPAlB04IX7bGiQH+41ic0=; b=FSiXTIvuNXQm1YgXLVwqibYEzoz+AL81m9mAPbzYP9xjK84VoP3j/MuRYgRJdLQQ XVZBRH80WJAnCZHoKCWfYLsC844Lx0sgO8z2//5FvMhOqkJcKiBK1MC0YbOPdYtUVJ7 QO6CkXCcUw0wkqyuu3iYwmqS6LoGbFfcPZqVB5V0= Received: from alice.lan (lfbn-idf1-1-1299-119.w90-79.abo.wanadoo.fr [90.79.23.119]) by mx.zohomail.com with SMTPS id 1591890070046150.0956305283537; Thu, 11 Jun 2020 08:41:10 -0700 (PDT) References: <87sgf1r5nk.fsf@alice.lan> User-agent: mu4e 1.4.6; emacs 26.3 From: Edouard Klein To: guix-devel@gnu.org Subject: Re: A script to check an edit does not break anything In-reply-to: <87sgf1r5nk.fsf@alice.lan> Message-ID: <87mu59r4od.fsf@alice.lan> Date: Thu, 11 Jun 2020 17:41:06 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Zoho-Virus-Status: 1 X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.10; envelope-from=edk@beaver-labs.com; helo=sender4-op-o10.zoho.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 11:41:15 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=beaver-labs.com header.s=zoho header.b=FSiXTIvu; dmarc=none; 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-Spam-Score: -0.61 X-TUID: 0paj+7G7dVNt --=-=-= Content-Type: text/plain An now with the attachment. --=-=-= Content-Type: text/x-shellscript Content-Disposition: attachment; filename=gpwc.t #!/bin/bash # Put this script in a subfolder (e.g. gpwc) # of the guix source # And install sharness in it # https://github.com/chriscool/sharness # Install prove as well # https://linux.die.net/man/1/prove # To run the tests, invoke # prove gpwc.t # Fill in the names of the packages you've been meddling with # In my case it was python-prompt-toolkit PACKAGES=(python-prompt-toolkit python-ipywidgets) test_description="Checking my meddling with ${PACKAGES[*]} did not break anything" . ./sharness.sh # Check that the new packages themselves are OK for package in "${PACKAGES[@]}" do test_expect_success "Build $package" " guix environment guix --pure -- ${SHARNESS_BUILD_DIRECTORY}/pre-inst-env guix build $package " test_expect_success "Lint $package" " guix environment guix --pure -- ${SHARNESS_BUILD_DIRECTORY}/pre-inst-env guix lint $package " test_expect_success "See if $package is reproducible" " guix environment guix --pure -- ${SHARNESS_BUILD_DIRECTORY}/pre-inst-env guix build --rounds=2 python-websockets " test_expect_success "Install $package" " guix environment guix --pure -- ${SHARNESS_BUILD_DIRECTORY}/pre-inst-env \ guix install --profile=./${package}-tmp-profile ${package} " done # Check the consequences of having meddled with the new packages dependents(){ guix environment guix --pure -- "${SHARNESS_BUILD_DIRECTORY}"/pre-inst-env \ guix graph --type=reverse-bag "$1" | \ grep @ | sed 's/.*\"\(.*\)@.*/\1/' } # Union of all the dependents for package in "${PACKAGES[@]}" do dependents "$package" done | sort -u > dependents.txt for package in $(cat dependents.txt) do test_expect_success "Build dependent $package" " guix environment guix --pure -- \"${SHARNESS_BUILD_DIRECTORY}\"/pre-inst-env guix build $package " profile="$SHARNESS_TRASH_DIRECTORY/$(echo $package | sed 's/\(.*\)@/\1'/)-tmp-profile" test_expect_success "Install dependent $package" " guix environment guix --pure -- ${SHARNESS_BUILD_DIRECTORY}/pre-inst-env \ guix install --profile=\"${profile}\" ${package} " done test_done --=-=-= Content-Type: text/plain Edouard Klein writes: > Dear Guixers, > > I recently broke jupyter while updating python-prompt-toolkit (a mistake > I'm still trying to fix...) despite doing my best to follow the > instructions of the manual: > https://guix.gnu.org/manual/en/html_node/Packaging-Guidelines.html > https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html#Submitting-Patches > > Because of the subtle consequences of editing a package are hard to keep > track of, I wrote the attached script (you need sharness to run it, but > with slight modification it can become a standalone script). > > This script goes beyond the instructions of the manual on two fronts: > - First, it not only tries to build the packages, but also to install > them, > - Secondly, it does not limit itself to the dependents (as listed by > guix refresh --list-dependents) of the packages one is meddling with, > but to the whole reverse bags (as listed by guix graph > --type=reverse-bag). > > Both these extensions are necessary to discover that my update broke the > jupyter package: > - jupyter builds, so if you don't try to install it you won't discover > it's broken > - the leafs of the dependency graph that depend on jupyter fail to build > for reasons unrelated to python-prompt-toolkit, so by just building the > leafs (which are what is being returned by guix refresh > --list-dependents) you can't discover jupyter's broken status. > > I think an update of the manual is in order (I've added it to my own > TODO queue, but I have no idea when I'll be able to get to it) but I > first wanted to share my script in case it may be useful to someone > else, and gather some feedback as to whether other developers have > encountered these kind of errors, and the way seasoned developers make > sure they don't push breaking changes. > > Cheers, > > Edouard. --=-=-=--