From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id EFnCAchFC2XuIQEAG6o9tA:P1 (envelope-from ) for ; Wed, 20 Sep 2023 21:19:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EFnCAchFC2XuIQEAG6o9tA (envelope-from ) for ; Wed, 20 Sep 2023 21:19:36 +0200 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 AD00B68D53 for ; Wed, 20 Sep 2023 21:19:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EqiWTrcI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695237575; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=diwvqMss1ufIWjri3ZIbvtNCdsiarWfC5J5rF7MclGc=; b=Tpf1k8oVV0QgBX11QR9/ZSu+smEYuaaLxf6iJDb+bUCzG6xaH28ClR4fKweqVLcGIxDDLO iI+HcfEtywFBIHgbGvcXSYyqJNAqSYLdV6fdpNBuFqTb9wj0044tqWmLVtVU8hHvSigIT7 Ar3FNRUnFJ9PvJcTX9RSbv4s3ZH/LIz309seU8wBjfDc5WYAy4YnXQMeQHD3YYKoAf4cmy TZ05f2Id65qsuwIrpMBNdzLlU79SIRwYVaOqXzIqK4FXt+S6CURCVJc8Z0aaH35k1VNGaT y9sYHBmQVDrn8qZeJJ5Bprx02MW6YyTXD4nkmwqcr7LEkt71Y0B59mhx3hxo/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695237575; a=rsa-sha256; cv=none; b=uvU6mRjd77ByQAqyXywVR3RiUx2vNHJ47QzH8HPn3ROJPzcRqB5rg74EPjUW5J5uwBXnr4 3sQqWfHNs+g/Kc2rSC1fjYFXOmXfkkAk2qMEOBkFnEPUc2oguDOYNTt35gqJbIwy4ZDIs/ B3B32xJSdg/w5i3NoYWv5ZzHSkZP+aUFhtkEfYAg2+9zL1Fo85hMv3Ago9vP9Cd0an4oUA EQ1YP6jb6dXQ5gDeG1bh8Wsxv9Wck1ReIE31btVmcjkJPnPCV/VAOzc9wGcz81EH89vO0e Z56xw85a5BAxnbil3DvogXHDofpkneeYurvd6EFoN6Q4Nr0qBr73BG5HO5igqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EqiWTrcI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qj2jI-0007QI-9h; Wed, 20 Sep 2023 15:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qj2jG-0007Pi-HL for help-guix@gnu.org; Wed, 20 Sep 2023 15:19:18 -0400 Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qj2jD-0002Oo-Eg for help-guix@gnu.org; Wed, 20 Sep 2023 15:19:18 -0400 Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-45269fe9d6bso96738137.2 for ; Wed, 20 Sep 2023 12:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695237553; x=1695842353; darn=gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=diwvqMss1ufIWjri3ZIbvtNCdsiarWfC5J5rF7MclGc=; b=EqiWTrcIJoADYBXKc1RCglm1DNr37svZ19P2rojXuG2S8yeTqUFBOZIQLotwUtVHVx kR1ds+PwIQHvQAv0BhfWTiQsKFkXryUfsp2dExaukyTSADJhSp8L6M3m38mlLEtMqnii 7dkSTw6uwtGplPOB1L/9bBnMvCCVtk2gHFuvPtkVxyHTRVD+kKa2nITa/ufjMyEfZtXI 7AFcIyJqP8uf5AGoE6NkwdzFPxjg7L7MJrksdnvBM7g0MSj2w1o3qmOiPN0gU1Bf7Wq4 Wp8ZVFItn3xLLku/iIybKpBQIxuIUv5rnMdPb5DAKALIMENrTuYXIIhmmHExFB/7cQYA pWqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695237553; x=1695842353; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=diwvqMss1ufIWjri3ZIbvtNCdsiarWfC5J5rF7MclGc=; b=vKEUiFQT+gWr11pt88mToPUfWfxVR23rwsH5Ucbv4wYvNRBF82+JnVsXfIknPbPk4V VCqvooFy2zaN7WYh2Q821JVdzsgq+leBqq2xAVsODQtPvXnIBgPE7Z0kFNFwFEwz1BHQ yisQtPB6mpDY86cx+fZutIBzE4ouCm0KUlxNpg/f05BvpfW0p+dHHCCdJDDE0SWFf1bV NsY90CmhMyrq8d68Jp+gTPa81aNy8NNtEKQDQQcRXjAmUrmAG13QweHjuiyITtsMii10 Y+K23kQxCcKZHLxKjyHgXBMak8MS5YqY0+Hq2NwBHCxnBVZWHaK0YstxiPBewaYDCuAj Wunw== X-Gm-Message-State: AOJu0YzUSokbrHhsfSnSZNafeV3p0Ffxyx2DZ+o89Eetx97/p1gHPcde 0tDpXSNWK/t/ndtmj0PIkprFBaWnvN+PyVL68Yaj544HN5h+xeEr X-Google-Smtp-Source: AGHT+IGiWbZp1Quys2JBkhXshEOO7ZCSTAQdiMWiRKLG56PwzxlmcKd2WOmvt0dGSVJ3hOJtw5QhCLVeDPrbLofMybA= X-Received: by 2002:a67:f3d7:0:b0:44e:8ef9:3371 with SMTP id j23-20020a67f3d7000000b0044e8ef93371mr3791139vsn.8.1695237553527; Wed, 20 Sep 2023 12:19:13 -0700 (PDT) MIME-Version: 1.0 From: Rodrigo Morales Date: Wed, 20 Sep 2023 19:18:57 +0000 Message-ID: Subject: [TIL] guix doesn't check hash when uri starts with file:/// To: help-guix@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::e36; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-vs1-xe36.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_BTC_ID=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.58 X-Spam-Score: -9.58 X-Migadu-Queue-Id: AD00B68D53 X-Migadu-Scanner: mx0.migadu.com X-TUID: ksiWKQRRbc6p I've opened this thread to share something which I've learned with other Guix users. I'm currently making some modifications to the source code of zathura , which is a PDF viewer. The original Guix package is called =3Dzathura=3D. In that direction, I've defined the following package definition. #+BEGIN_SRC scheme (define-module (my packages experiments-zathura-custom) #:use-module (guix packages) #:use-module (guix download) #:use-module (gnu packages pdf) #:use-module (gnu packages gnome)) (define-public zathura-custom (package (inherit zathura) (name "zathura-custom") (version "4.0") (source (origin (method url-fetch) (uri "file:///home/rdrg/my/git-repos/zathura") (sha256 (base32 "0000000000000000000000000000000000000000000000000000")))) (native-inputs (modify-inputs (package-native-inputs zathura) (prepend json-glib))))) #+END_SRC The actual hash of the directory =3Dfile:///home/rdrg/my/git-repos/zathura= =3D is =3D0jc8iivcahq7izbcxr1kf3gjxlzkmf8ccrq54pv6v13h5wjk56jk2=3D, but I wrote =3D0000000000000000000000000000000000000000000000000000=3D and I can still the package by executing the following command (see proof below). #+BEGIN_SRC sh guix package --no-substitutes -L ~/my/git-repos/guix-packages/ -i zathura-c= ustom #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE The following package will be upgraded: zathura-custom 3.0 =E2=86=92 my-version-1 The following derivation will be built: /gnu/store/nbqq72vkrjjw4vpdsbckyvk5cxk4add6-zathura-custom-my-version-1.d= rv building /gnu/store/nbqq72vkrjjw4vpdsbckyvk5cxk4add6-zathura-custom-my-vers= ion-1.drv... The following derivation will be built: /gnu/store/9sasyz1dp9qj2gaz9i2qrjzvnhyrl7pj-profile.drv applying 19 grafts for zathura-custom-my-version-1 ... building CA certificate bundle... listing Emacs sub-directories... building fonts directory... generating GdkPixbuf loaders cache... generating GLib schema cache... creating GTK+ icon theme cache... building cache files for GTK+ input methods... building directory of Info manuals... building XDG desktop file cache... building XDG MIME database... building profile with 6 packages... hint: Consider setting the necessary environment variables by running: GUIX_PROFILE=3D"/home/rdrg/.guix-profile" . "$GUIX_PROFILE/etc/profile" Alternately, see `guix package --search-paths -p "/home/rdrg/.guix-profile"= '. #+END_EXAMPLE #+BEGIN_SRC sh echo $? #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE 0 #+END_EXAMPLE Now when I change the =3Duri=3D so that it starts with =3Dhttps=3D (please = see below) and I try to install the package, I get the error shown below. #+BEGIN_SRC scheme (define-module (my packages experiments-zathura-custom) #:use-module (guix packages) #:use-module (guix download) #:use-module (gnu packages pdf) #:use-module (gnu packages gnome)) (define-public zathura-custom (package (inherit zathura) (name "zathura-custom") (version "my-version-3") (source (origin (method url-fetch) (uri "https://pwmt.org/projects/zathura/download/zathura-0.5.2.tar.xz"= ) (sha256 (base32 "0000000000000000000000000000000000000000000000000000")))) (native-inputs (modify-inputs (package-native-inputs zathura) (prepend json-glib))))) #+END_SRC #+BEGIN_SRC sh guix package --no-substitutes -L ~/my/git-repos/guix-packages/ -i zathura-c= ustom #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE The following package will be upgraded: zathura-custom my-version-2 =E2=86=92 my-version-3 The following derivations will be built: /gnu/store/32prmnm2f65wv3vg645c321884qz6991-zathura-custom-my-version-3.d= rv /gnu/store/1lk541cdiv7q1zfwzjql4ail5dhvrzc6-zathura-0.5.2.tar.xz.drv building /gnu/store/1lk541cdiv7q1zfwzjql4ail5dhvrzc6-zathura-0.5.2.tar.xz.d= rv... \sha256 hash mismatch for /gnu/store/3y83i49y4inc7iclg8x3pv1nnchvsjlx-zathura-0.5.2.tar.xz: expected hash: 0000000000000000000000000000000000000000000000000000 actual hash: 15314m9chmh5jkrd9vk2h2gwcwkcffv2kjcxkd4v3wmckz5sfjy6 hash mismatch for store item '/gnu/store/3y83i49y4inc7iclg8x3pv1nnchvsjlx-zathura-0.5.2.tar.xz' build of /gnu/store/1lk541cdiv7q1zfwzjql4ail5dhvrzc6-zathura-0.5.2.tar.xz.d= rv failed View build log at '/var/log/guix/drvs/1l/k541cdiv7q1zfwzjql4ail5dhvrzc6-zathura-0.5.2.tar.xz.= drv.gz'. cannot build derivation `/gnu/store/32prmnm2f65wv3vg645c321884qz6991-zathura-custom-my-version-3.dr= v': 1 dependencies couldn't be built guix package: error: build of `/gnu/store/32prmnm2f65wv3vg645c321884qz6991-zathura-custom-my-version-3.dr= v' failed #+END_EXAMPLE #+BEGIN_SRC sh $ echo $? #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE 1 #+END_EXAMPLE >From the information shown above, I conclude that =3Dguix=3D doesn't check hash correctness when a URI starts with =3Dfile:///=3D but it does when it starts with =3Dhttps://=3D. (Please, correct me if I'm wrong.) I personally like this behavior because I'm currently editing the source code of Zathura and I wouldn't like to edit the package definition to insert the correct hash whenever I make a change in any of the files of the project directory. This is not mentioned in the Info manual, but I think it should be mentioned. The Info node that documents =3Durl-fetch=3D is "(guix) origin Reference".