From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oPwLAlm0/GOlrAAAbAwnHQ (envelope-from ) for ; Mon, 27 Feb 2023 14:47:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KIwhAlm0/GPsgAEA9RJhRA (envelope-from ) for ; Mon, 27 Feb 2023 14:47:05 +0100 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 B771819759 for ; Mon, 27 Feb 2023 14:47:04 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H4ydi+iO; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677505624; a=rsa-sha256; cv=none; b=YyudUIV2FYzqYMwJfLtQZTHf1ADfAcXejaVRHTqXaL6DmsylH5yVE9qqFyer52WbjNabHG GsRvQfTyRSxTgIxBDQNYDIYj53deLkfRUTBgMNQtTbx/d9zWLkOEnz4hPogRFgU1dnGEtv RooMiE+lQUI9wWnL84CJiJN6fVW4/Mc0BZoSRAhPhDZSFMHKYsmocrhqXmJEeM7p1dQhcu n6lPUMpTQeJNbCz0ruYaBErOmbpBWzeDNMrd6X83aDzl0x40+Wwxq2MrYj1VpgI2IAaaEj WgP1eu451Am5v3CjfCa8jJT5+YywkZGZWxejAUpH0U0sVavJt5kJ6LV7Su6Zjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H4ydi+iO; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677505624; 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: 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=RybTKbKq0qKyNwgpstBa6RIy7bpNaaR3sYldP2GZqZE=; b=h3otOK3mIvuJNb6/DzKFd98jBkKHxcXbMxP4nDxycPPJud7PjVOBe31ieKt9ngj8r0BVmh tl+cktu5jTVpJ6JbtwJOCNQuathag9/XIH9wVNGnerAyHAF9UlKyDD8wenONgcj7nCtNk0 oTrj/WFLfrmYihWxE1Xo/pP0do1g7grRdg9/6LXL0O5tObDFUN7G8jeW+leq5qh6ZFINNA 9BQ1OU6Fznj+jgGcqd7JIrM2qeNb+Tof+ZHJutQ/1yCQpWg1bEvI60ZeTiellPteULPMzP Z0C1UaSyFuHVOCYlUWjJT9GURSbKEqlUc5185IHUCMa5ibRHO+usp4s6QIyqCg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWdpo-0001CN-Oa; Mon, 27 Feb 2023 08:46:32 -0500 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 1pWdpe-0001Ae-6r for guix-devel@gnu.org; Mon, 27 Feb 2023 08:46:22 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWdpc-0003j4-5e; Mon, 27 Feb 2023 08:46:21 -0500 Received: by mail-wr1-x42f.google.com with SMTP id bt28so6273578wrb.8; Mon, 27 Feb 2023 05:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677505578; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=RybTKbKq0qKyNwgpstBa6RIy7bpNaaR3sYldP2GZqZE=; b=H4ydi+iO5DvUIzKJA1tOKBJeJEuJlhYTxilZLIkRfqoIVU+aootMTXI1+aqVPpSQWE cadwZ4fQbluThj91hULwSW9v7CnOvYdB6KKBNJJv+wJVpQs3pcvFeeorkaK3nHThMlqY 7XM9wVPQcIBysYLdKXJO2XpdABy/8vTIU80bM/EvEP126ybQNEGORWsA56DDj3xhP0pG WmH4LLi/20/D0PUBZgNPaGi8gDbJdmS+3qjq/HSfxgNvTmvANchAA1AmIXXEEFLyNocz zxBdG5Drd4p9hlhnWJd9n1/fUK0OfCJRuhqYmJ1IQTRPQQtzDwubv9SuvTHO/C6VOjGc FRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677505578; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RybTKbKq0qKyNwgpstBa6RIy7bpNaaR3sYldP2GZqZE=; b=RQboApE5+ZpQ/46CusmV7YQWKS2VafHCS+q81d6VUyXj8S+oLcu/lzhGvpygWpORE3 8Zc27oBqrCq8n0hO1X6mrlR9AIhU9w+cOtTYu/hsHU5mE6WK7Gwb4jDiKEnGFCHPEIHd GB8YJ/QlW7H0XxZN/moCAjzIOmKfYoMoOXNM8aUtxSjyS+igXAfJjPDlvhlWNPaCblOf 7JSDTnzG6XclnS1zw10W7ibTjyVE23nszNFm0s7DZ2pfoaMlbJ6f+JtrLsdGuoyHlq3C x9E+H2zmFDPtnM7HZ2TjMz4AyheRtlAvJFVsji2jsS1EHrgAFC9l4AIkIjt0i7JlTfuD 7zmQ== X-Gm-Message-State: AO0yUKXauDGky5dqUaxJYJ6ctbpicRoMjTlUhN5rDKHV5SInz0o9rzXw juFr3ZQznGp7+bMSrkf8itI= X-Google-Smtp-Source: AK7set/+el76W5AUD1aYaBFTBquOlczlKiwTKDFfSihigPiOhMewPiHp71C9RyBUxXFOt3uuv4WsCg== X-Received: by 2002:adf:f2cf:0:b0:2c7:a3c:5b92 with SMTP id d15-20020adff2cf000000b002c70a3c5b92mr13912440wrp.6.1677505577702; Mon, 27 Feb 2023 05:46:17 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3-20020a05600012c300b002c5694aef92sm7112559wrx.21.2023.02.27.05.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 05:46:17 -0800 (PST) From: Simon Tournier To: Nicolas Graves , Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org, Jean-Baptiste Volatier , =?utf-8?Q?Nicol=C3=B2?= Balzarotti Subject: Re: Follow-up on julia import script In-Reply-To: <87v8jn49vm.fsf@ngraves.fr> References: <87a61358ej.fsf@ngraves.fr> <87o7pilyb4.fsf@gmail.com> <874jra5a2x.fsf@ngraves.fr> <865ybqc4zo.fsf@gmail.com> <874jr9wqml.fsf@gnu.org> <86k003za7z.fsf@gmail.com> <87v8jn49vm.fsf@ngraves.fr> Date: Mon, 27 Feb 2023 14:46:14 +0100 Message-ID: <87k003kyqh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42f.google.com 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_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: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: B771819759 X-Spam-Score: -6.41 X-Migadu-Spam-Score: -6.41 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: NxmLToEpzb8u Hi Nicolas, On lun., 27 f=C3=A9vr. 2023 at 12:37, Nicolas Graves via "Development of GN= U Guix and the GNU System distribution." wrote: > What we get from juliahub is really not bad, since it's really close to > what we have in other importers. Oh cool! Thanks. > - we don't have a `hash` field in the json, tough we might be able to > get it by parsing Versions.toml additionally to the json. This I can > do with a very simple parser. Do you mean Versions.toml from General registry? Well, I do not think it is straightforward to go from Git SHA1 hash to NAR SHA256 hash, to put it mildly. :-) Because two points: 1. Git uses one way for serializing and NAR is another. 2. SHA1 is one hash function and SHA256 is another. 1. Git uses one way for serializing and NAR is another. From Versions.toml [0], it reads, --8<---------------cut here---------------start------------->8--- ["0.6.41"] git-tree-sha1 =3D "3cfdb31b517eec4173584fba2b1aa65daad46e09" --8<---------------cut here---------------end--------------->8--- 0: --8<---------------cut here---------------start------------->8--- $ git -C Zygote.jl log -1 --oneline 4777767 (HEAD, tag: v0.6.41) un-bump version $ guix hash -S git -H sha1 -f hex -x Zygote.jl 3cfdb31b517eec4173584fba2b1aa65daad46e09 --8<---------------cut here---------------end--------------->8--- Let only replace the serializer from Git to NAR: --8<---------------cut here---------------start------------->8--- $ guix hash -S nar -H sha1 -f hex -x Zygote.jl 85fc67799543110880acaa8c584d44edb3565b7d --8<---------------cut here---------------end--------------->8--- 2. SHA1 is one hash function and SHA256 is another. Obviously, it is impossible to go from one to the other. --8<---------------cut here---------------start------------->8--- $ guix hash -S nar -H sha256 -f hex -x Zygote.jl f3d1776c4f3f539987141ad4a57198fd62038e6ef5e9a2eea8ba0819aa916f09 --8<---------------cut here---------------end--------------->8--- However, here the format is =E2=80=99hex=E2=80=99 and it is possible to con= vert this checksum from the format =E2=80=99hex=E2=80=99 to the format =E2=80=99nix-b= ase32=E2=80=99. From this f3d1776c4f3f539987141ad4a57198fd62038e6ef5e9a2eea8ba0819aa916f09, it is straightforward to get 02bgj6m1j25sm3pa5sgmds706qpxk1qsbm0s2j3rjlrz9xn7glgk as specified by the recipe, --8<---------------cut here---------------start------------->8--- (version "0.6.41") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/FluxML/Zygote.jl") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "02bgj6m1j25sm3pa5sgmds706qpxk1qsbm0s2j3rjlrz9xn7glgk")))) --8<---------------cut here---------------end--------------->8--- For my point of view, you need to clone the repository to be able to compute the =E2=80=99hash=E2=80=99 field. Cheers, simon