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 UM3CENgFEmBUTwAA0tVLHw (envelope-from ) for ; Thu, 28 Jan 2021 00:31:20 +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 gKZ3DNgFEmBWYAAAbx9fmQ (envelope-from ) for ; Thu, 28 Jan 2021 00:31:20 +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 B9F909401C0 for ; Thu, 28 Jan 2021 00:31:19 +0000 (UTC) Received: from localhost ([::1]:39766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4vDS-0007Kf-K3 for larch@yhetil.org; Wed, 27 Jan 2021 19:31:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4vDF-0007KR-Jm for guix-patches@gnu.org; Wed, 27 Jan 2021 19:31:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4vDC-0005Eq-B0 for guix-patches@gnu.org; Wed, 27 Jan 2021 19:31:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4vDC-000693-7l for guix-patches@gnu.org; Wed, 27 Jan 2021 19:31:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45972] [PATCH] Add julia-json with dependencies Resent-From: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Jan 2021 00:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45972 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 45972-submit@debbugs.gnu.org id=B45972.161179383423580 (code B ref 45972); Thu, 28 Jan 2021 00:31:02 +0000 Received: (at 45972) by debbugs.gnu.org; 28 Jan 2021 00:30:34 +0000 Received: from localhost ([127.0.0.1]:46534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4vCj-00068G-VS for submit@debbugs.gnu.org; Wed, 27 Jan 2021 19:30:34 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:39416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4vCi-000683-Fr for 45972@debbugs.gnu.org; Wed, 27 Jan 2021 19:30:32 -0500 Received: by mail-wr1-f47.google.com with SMTP id a1so3750455wrq.6 for <45972@debbugs.gnu.org>; Wed, 27 Jan 2021 16:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=Hi1Z9Th2lnO72uuzpTCiXlvJloNDxPMQ6FsUD5lcAG8=; b=Q9nCrYiwenNIuUCYEQTHdRw99dBI7D/uXmn7aKQjSTLMEzO7chqdoF9W/gG9/jCa6c FrfTIVPW35+TJKaTVAq6Gup4xronE4avG4f7s8vg1b0Wn5JsFJ+Go0Y2Zx9uESfqFYtT MTTIcne8D5v3eEVpKJKqH8lRmdvh+QtWfd7xnakbJRfMNJ97jOgDXff6+xLYiPIIAp5W KlhHkQYzEoHULmSM1VMIUswH2Xm52K6VixVpXJn4jxjc75cpCq6Mp7Iuthdm/p7XgyEl Rx9B1MkS1uZX622TCOPnOoH7FIXFR8EHhWmnfS0h9nZ8k41AjwdiFJ/CcB2CrSStnS2t DMRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=Hi1Z9Th2lnO72uuzpTCiXlvJloNDxPMQ6FsUD5lcAG8=; b=a7npkbiqPCVaQnloJAi0DppH86BjpiZkkA6okeGth524DN268f5aUNWPmbSqTeN/+P E5T8nG/gyL5vCyUJgowckfS0XBs6jqk/Mplg+9N3pOczf9OSgiQNzpZ6CPwFjDJmDkQm nWZUS4ThUn+jzYfeXyDSxdZPj7wmupk9WbOJFxD7g/4fMZYuxmI9bkIo6PsC12LltKvW zI3fg+FqvBXC09jUDD1Mrvf5+TQmKfZUY8XbQ9V3Gg/K514O9Xo28PEFVZv9/uQt+fOx WTKgll95yB5m/Chgnm2axDJ22DG6VjQ2vusGqBvhGMwHLKfX/AkGCTL7KPR5rxvC6j8H gXzA== X-Gm-Message-State: AOAM530Fh0X36mdsGFdDROKH7Gwei/TKwlmPpXRBYJ8hyQmdGDrscOMR 2RuyEv9kszjjSNPFr02B8qgSg8HhTbQ= X-Google-Smtp-Source: ABdhPJxVg7W1U6Ju7jvnIRfL3Io1nK9Eye4SBZgskOyt47ciQ/rlhd/A0i05gHoESZj4QG36s0nT7w== X-Received: by 2002:adf:dfc7:: with SMTP id q7mr13537957wrn.153.1611793826640; Wed, 27 Jan 2021 16:30:26 -0800 (PST) Received: from guixSD (host-87-4-165-57.retail.telecomitalia.it. [87.4.165.57]) by smtp.gmail.com with ESMTPSA id r124sm4176343wmr.16.2021.01.27.16.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 16:30:25 -0800 (PST) From: =?UTF-8?Q?Nicol=C3=B2?= Balzarotti In-Reply-To: <87mtwut34z.fsf@gnu.org> References: <87ft2xzu1g.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87wnvzwfgu.fsf@gnu.org> <87lfcfcmf3.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87mtwut34z.fsf@gnu.org> Date: Thu, 28 Jan 2021 01:30:24 +0100 Message-ID: <87czxpdhsv.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45972@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=Q9nCrYiw; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B9F909401C0 X-Spam-Score: -1.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: iLvSOpDAiaYw > My understanding is that the first patch expects the source file name to > match the Julia package name. That's correct, we use it in the build system. > IMO, that shouldn=E2=80=99t be the case. At first I wasn't sure it was ok, but it went on through the revision process when I submitted the first package (Compat) so I tought it was fine. > Can we either extract the Julia package name from metadata that=E2=80=99s= in > the package itself (?), or otherwise pass it to all the phases via > =E2=80=98julia-build-system=E2=80=99? Sure, I'd just read it from Package.toml (nowadays almost all the packages have this file, and for when it's missing we also have the julia-create-package-toml procedure that creates it). The file is toml, but I don't see a toml parser in guix. So, I'd use a function like the following: #+begin_src scheme (define (package.toml->name file) (call-with-input-file file (lambda (in) (let loop ((line (read-line in 'concat))) (if (eof-object? line) #f ;What to do? (let ((m (string-match "name\\s*=3D\\s*\"(.*)\"" line))) (if m (match:substring m 1) (loop (read-line in 'concat))))))))) #+end_src As you can see this is very minimal/naive (takes the first name =3D "" occurrence, does not even consider comments, for which I'd add a negative lookahead "^(?!#)" which I can't get to work with ice-9 regex), but tested on a few packages it working. I don't know what to do when the match is not found (since it's something that might happen only during development, the #f fallback should not be too bad, btw, as the build will fail). The other way I think this is easily solvable is by asking julia directly, by reading the output of: (invoke-julia "using Pkg; Pkg.TOML.parsefile("Project.toml")["name"] |> pri= ntln") doing something like cargo's manifest-target procedure does. But it'd go the other way if it's ok. Let me know! Once decided, I'll submit the updated patches > > Sorry for not noticing earlier! > np and thanks again!