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 YMgvB5Y+oGFMHAAAgWs5BA (envelope-from ) for ; Fri, 26 Nov 2021 02:55:34 +0100 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 QHu1ApY+oGFrVAAAbx9fmQ (envelope-from ) for ; Fri, 26 Nov 2021 01:55:34 +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 82232C2F3 for ; Fri, 26 Nov 2021 02:55:33 +0100 (CET) Received: from localhost ([::1]:43038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqQSZ-0000wB-EF for larch@yhetil.org; Thu, 25 Nov 2021 20:55:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqQS7-0000mX-4t for bug-guix@gnu.org; Thu, 25 Nov 2021 20:55:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqQS6-0004cF-St for bug-guix@gnu.org; Thu, 25 Nov 2021 20:55:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqQS6-0004Q8-Ny for bug-guix@gnu.org; Thu, 25 Nov 2021 20:55:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#28602: [core-updates] Unpack fails with no error message when using a .zip source Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 26 Nov 2021 01:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28602 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: nee Received: via spool by 28602-submit@debbugs.gnu.org id=B28602.163789167516913 (code B ref 28602); Fri, 26 Nov 2021 01:55:02 +0000 Received: (at 28602) by debbugs.gnu.org; 26 Nov 2021 01:54:35 +0000 Received: from localhost ([127.0.0.1]:58351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqQRQ-0004OO-BO for submit@debbugs.gnu.org; Thu, 25 Nov 2021 20:54:35 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:33737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqQRI-0004Nl-BL for 28602@debbugs.gnu.org; Thu, 25 Nov 2021 20:54:15 -0500 Received: by mail-wr1-f54.google.com with SMTP id d24so15330639wra.0 for <28602@debbugs.gnu.org>; Thu, 25 Nov 2021 17:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zo9XTUsRgZHTZVJ8hBH/ffzPntzvtEEdz90kZMUPZIo=; b=TaNneXNdt1IeglfUnhAfG20gabQd2kIYWHFqeiqXcWJqu8uxY08fyrjrKDRO4ykp/E CWD5bY8ip9rypm7UswCo7YvOmMG8E/Ice4wMfXHpkO4q5K7YeKxWuFXYd657A39rlUnb UvYfpO33EZq8XsnweJUup/rgx7uo9v87I4urLCXjyBX/4FSq44IjeyXQPE+268izvBvf J+7lSc3O/iQH38uAS4Xb2vWMtz4o0tAzh1+KeulsL3q8xjD5h1y6wkkHcLCyzORwSHob 0cYzs0oUZTxgFWUf/sZ1UaFFS1KNtchBquXQvgHS5gHPYBWP0TZwsB32fiwcEtmDJcVk q8XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zo9XTUsRgZHTZVJ8hBH/ffzPntzvtEEdz90kZMUPZIo=; b=xkCSMWx0aDVI0Ps4RnCj8CHIaxstFD9Skds5tGUpQvTKbVFWSaIGKA5GlNHPw374ZC 1fG7JAE2wxhj5TQvHr+jZM96NkZQmM1xkgfMTwbdNSviJC8bQbGH5TXzHFdXtJEiPAXK q5Tu7ifYSyFtCPpViG2CxPH75YljB6c+h1CJy6ChVw1mBjsu9X4XRwMVzDX/+OlFDN4i viWvO1vHcG9UcAV1ECJhWYzoRf59EILpE/JtPjlBjoSy3lKDajgDejB7lhwQGJfDyvVQ OP3B4Uk06xp3+m8GoW8p/noZdYzqtPf0zkNi4KemvhUm/fE1t97XPeaQJqsgk8j67tHm eCNQ== X-Gm-Message-State: AOAM5320iaVQdpSCxgOcUvpY/Fnmaw60wnfRTGjn41AU2rTj5AAZxd/V C+yOJu/cNERB8GhAi08Rb7Z4jOHaSOA= X-Google-Smtp-Source: ABdhPJwO/xC8xAcAHmdN3GEqSZ8+9RxXwX8ARz7nMbVceylozFmv3E2EhxuQR+sPzDBfuYPc6P4LzA== X-Received: by 2002:adf:8b1e:: with SMTP id n30mr11068242wra.75.1637891646414; Thu, 25 Nov 2021 17:54:06 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id a22sm4396105wme.19.2021.11.25.17.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 17:54:06 -0800 (PST) From: zimoun References: <2c2ccbd7-bb47-5292-74d9-e4c7fdc2c990@cock.li> <7075db45-09ad-f2d7-1bd4-27f2c9755a42@cock.li> <877di52dbh.fsf_-_@gmail.com> Date: Fri, 26 Nov 2021 02:49:04 +0100 In-Reply-To: <877di52dbh.fsf_-_@gmail.com> (zimoun's message of "Mon, 05 Jul 2021 13:46:26 +0200") Message-ID: <86fsrjr8j3.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 28602@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637891733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=zo9XTUsRgZHTZVJ8hBH/ffzPntzvtEEdz90kZMUPZIo=; b=NKKeUWPcXYwtRMgHXqzNapCGSYmAfVU7hsrHvIuyZlHOgfPKTC+B5DDIlOGiQFROMUv5CT ILgBo2QCCRHROkMrG8PC9N4dReChyaQolqRIZ7q0phE1XLinJ6VsA04Yrb2Gv+YEwhKxoU mnuWIw6TfjKchDJ5atejTz9tAUQlCSyLDbIs7abXQGZViYqjyZowZ2GJX60/BwkPr/01Sk uhojvblqwDhi+s3YaHa/ZjV/zJVGV5Ogfuvbsf1EGs2j67Z1FZwb5uEmTJ/rFURUXXF5e6 ISPz3RyyKgT1VM8bpv+XSXKULEgj3SIokqgaRhj0cQb9fdUW1eERu0jAi89JyQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637891733; a=rsa-sha256; cv=none; b=WaCuWyMHGcVcUlJSxRzurhyIiKBht25ubE1YPxy3Bg38JLUCvCYr/w5YN86o8R24jF5PIz lBspSUo6akr+ae1+8IrSICyVZAUxOVX54hmTCBQtrrgO81tZsJtGSGFKfZXdg0mEy2xTKz FQde+2Lxs/JDVTGYEcA8NKOqSIncqkv+5Bobb2tuv76Nf6h7VRWz5maoH4/NNm5r/MGLtA lqtTIc5BCTvGaK9g8szy0APr6xzJ0saRNrumNgCOAXummTAk6pIV6ZcaPYeDN2k1PGwcZ8 skCc2jSAy9445pMV5S8grCUGJ0grnjYiWvYnbQaF+qi3u5Hz9TuYvKVMB+JYOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TaNneXNd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -4.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TaNneXNd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 82232C2F3 X-Spam-Score: -4.10 X-Migadu-Scanner: scn1.migadu.com X-TUID: EoRYyVYufRrF Hi, This patch [1] had been submitted in 2017 and fallen in the cracks. The code below requires improvement and I am not convinced by the feature. Therefore closing? wrote: > On Mon, 09 Oct 2017 at 23:00, nee wrote: >> Hello here is a patch to fix this bug. It changes the gnu-build-system, >> so the hashes of almost all packages will also change. I guess >> core-updates is the right branch for this. >> >>>>>From 089b9741a734f0682a671df6c0c36dfefcbd407c Mon Sep 17 00:00:00 2001 >> From: nee >> Date: Mon, 9 Oct 2017 22:49:12 +0200 >> Subject: [PATCH] guix: gnu-build-system: warn about missing unzip input during >> unpack. >> >> --- >> guix/build/gnu-build-system.scm | 17 ++++++++++++++++- >> 1 file changed, 16 insertions(+), 1 deletion(-) >> >> diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm >> index e37b75140..c16d15964 100644 >> --- a/guix/build/gnu-build-system.scm >> +++ b/guix/build/gnu-build-system.scm >> @@ -67,6 +67,21 @@ See https://reproducible-builds.org/specs/source-date-epoch/." >> #f >> dir)) >> >> +(define (unzip filepath) >> + "Unzip archive file. >> +Warn the user when unzip fails and the executable is not present." >> + (define exit-code (system* "unzip" filepath)) >> + (define program-not-found-code 32512) >> + (cond ((zero? exit-code) #t) >> + ((eqv? exit-code program-not-found-code) >> + (format (current-error-port) >> + "warning: Archive with .zip suffix failed to unpack. >> +Please add unzip as native-input to the package, >> +e.g. (native-inputs `((\"unzip\" ,unzip)))") >> + (newline (current-error-port)) >> + #f) >> + (else #f))) > > Give a look at 'invoke' from (guix build utils). > >> (define* (set-paths #:key target inputs native-inputs >> (search-paths '()) (native-search-paths '()) >> #:allow-other-keys) >> @@ -154,7 +169,7 @@ working directory." >> #:keep-mtime? #t) >> #t) >> (and (if (string-suffix? ".zip" source) >> - (zero? (system* "unzip" source)) >> + (unzip source) >> (zero? (system* "tar" "xvf" source))) >> (chdir (first-subdirectory "."))))) > > After 9a87649c863e1ff8b073b356875eb05eecedbcf7, this part uses 'invoke'. > Instead of your 'unzip', the exception raised by 'invoke' should be > catched and then should trigger the hint message. WDYT? Cheers, simon