From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WL6wLveE5GNUKQAAbAwnHQ (envelope-from ) for ; Thu, 09 Feb 2023 06:30:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QN7bLfeE5GP4ZAEAG6o9tA (envelope-from ) for ; Thu, 09 Feb 2023 06:30:31 +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 46E871535D for ; Thu, 9 Feb 2023 06:30:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPzVU-0004vj-T5; Thu, 09 Feb 2023 00:30:04 -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 1pPzVT-0004vV-5g for guix-patches@gnu.org; Thu, 09 Feb 2023 00:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPzVS-0007HZ-PI for guix-patches@gnu.org; Thu, 09 Feb 2023 00:30:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pPzVS-00035O-7i for guix-patches@gnu.org; Thu, 09 Feb 2023 00:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60429] [PATCH v2 4/5] gnu: yosys: Propagate external dependencies. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Feb 2023 05:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60429 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon South , Christopher Baines Cc: 60429@debbugs.gnu.org Received: via spool by 60429-submit@debbugs.gnu.org id=B60429.167592058011807 (code B ref 60429); Thu, 09 Feb 2023 05:30:02 +0000 Received: (at 60429) by debbugs.gnu.org; 9 Feb 2023 05:29:40 +0000 Received: from localhost ([127.0.0.1]:57203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPzV5-00034N-Ma for submit@debbugs.gnu.org; Thu, 09 Feb 2023 00:29:39 -0500 Received: from mail-ej1-f67.google.com ([209.85.218.67]:38782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPzV0-000344-Nv for 60429@debbugs.gnu.org; Thu, 09 Feb 2023 00:29:37 -0500 Received: by mail-ej1-f67.google.com with SMTP id gr7so3151540ejb.5 for <60429@debbugs.gnu.org>; Wed, 08 Feb 2023 21:29:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=3HeJ5kIdQRHkUOdLsQBix+mBO/m0Kt9D+rm/qrKa4uk=; b=VEFxCMflEXstM6RyU18vXcGDES6YlNxZBOjjqM6Bpg6dQqnX1aLQWV5yowIs0VOhqU Qa5BW5xX7WV/QB4YwVj4UHL9o6br6HBu1JsTUH/NIh+YDa4Th7EKbcov2h2lz3ajqS1T KAvY/xG9r3ZK0aOMZMZn+QbiKXdei/eK6MdvPlATvk+Wup3CN4jp691708Ci6bnG8ifS 8s2tvmwDeTFCKR5TIWUIymhT6t4JqIl+9pkmcKSwhu6NkR7Wc0TlkNnVBsfawl8jKoBa K3HmiVwoqjh/N9vaDUJSVwYPYAg00bQ7LTUWc3NSnzRJjE8xaY8c7fzmvH+5IVNgS0Y3 yajA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3HeJ5kIdQRHkUOdLsQBix+mBO/m0Kt9D+rm/qrKa4uk=; b=VxsPNpyDNQm2NLTL4PSGs0JtRD9bM2dKMX6YUz6b20Sr7jjF2GysLDdLVadFUe5/iM fh/lFfralomfFanLRiokWIan/cPf/MGqRuUh9XveYKkoZcuCyrM17bFV9XsyMW1k1ayJ H5sWt1VcoKVDCFVCHbyD1EckVW27+uihRiFEWOAHI3cd9hLwNi5w1DKYLtiyyeYBUAFC oi5jqpICZwduPGBKF9m77G5kw2xtoqSGF4IKXbA3N0xglNbBkL7fKboVFNzL4/rWEqOD +iwfoVPxAAReNpyi3CVpOxIYf3z1Jp2Vl07A5ubI++j9LX2BrQTJ0SmCocVjQd79gd8B alNA== X-Gm-Message-State: AO0yUKWHAzTGCW+d2vYubtYUfqv3DolNKAnzXt36WWq5B+AhsCgvXatU x2C/3X+fmL9OPF0aeVx6fqM= X-Google-Smtp-Source: AK7set++4hDY+n9t3nFOGU9OcqH4yCYF1dWgm3FLhNN2DAfgOsJbwoEj3GBT1KCh0dn9zm12V8s0Mw== X-Received: by 2002:a17:906:5246:b0:8af:4120:63a8 with SMTP id y6-20020a170906524600b008af412063a8mr235196ejm.68.1675920568514; Wed, 08 Feb 2023 21:29:28 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id a12-20020a17090640cc00b008a47ee398a9sm392102ejk.47.2023.02.08.21.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 21:29:27 -0800 (PST) Message-ID: From: Liliana Marie Prikler Date: Thu, 09 Feb 2023 06:29:26 +0100 In-Reply-To: <87v8kb7k19.fsf@simonsouth.net> References: <62b19db61f34b63e37ba204fd9691b97d5c245bb.1673202235.git.simon@simonsouth.net> <87357g6pfz.fsf@cbaines.net> <87v8kb7k19.fsf@simonsouth.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675920631; a=rsa-sha256; cv=none; b=ulpC2k5t/zG8TwZMgVIlLA7L2lqXsr2+A5laThRFOPp34ja6SD6smSpCM95M3FCUtMjVaD Vo1KctsqeLrgCafgfH0xWk7K2cF8W7s+KoNtGMCSlmrH02t65pLudWqYyaA7K7rpAoHXxD CQw1jc/fvtmEjMAbZvddEP/J/HiyLrc7JqWwvBsxEMTGGP7NfZu5ZDVWaM7X6EwTYyt8or NSHOOQCjJlX9U9b+A0zcFApa/6+Dv0U/Ase2D3ZuEtTpcYb4eXMunCevIjTN8LSuzW8kCk EJp3YntSwlufPXcvG0fJc7RbHBBK36cgBXjF8ny7L+MOjr2Yhew13pL+ettkNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VEFxCMfl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675920631; 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: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=3HeJ5kIdQRHkUOdLsQBix+mBO/m0Kt9D+rm/qrKa4uk=; b=UE5HLuqLL2PJGSDTfvOU3zwaIgACbeVV8wPMjp2keSBR5Ni4WnF4HtEiqSR3fk/OtPhxFk GqpvUjlW715AsXsGynl17UXNa4Id8zS+0jTWlGwA5eCag0P8E9mi0fAlzdMROfGxIzoe1R GbiLshwO4gx/37o4E9lESAaKm7fgmo7iY/bP8aq/M1PMu5xc0vkXShazSrKcwVUzgV4tbf JFXJFxUGEiDIBBZeXko7eGnBiCJUODMwzb3eJTF2pbhR5Wb+cTS141odAS8B7I23agJq+1 AP45mHtKgNEdwecfPdDkc0EUhyaTrb9cPJze17WeOEk3WBMHt6ywKL9noN0zUA== X-Spam-Score: -2.80 X-Migadu-Queue-Id: 46E871535D X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VEFxCMfl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.80 X-TUID: Q9UsZWx+p/lM Am Mittwoch, dem 08.02.2023 um 19:35 -0500 schrieb Simon South: > Yosys' "show" command produces its output by building and executing a > shell command that invokes "dot" or "xdot" on the user's data.=C2=A0 The > implementation is in passes/cmds/show.cc[0]; the code for invoking > dot for instance looks like >=20 > =C2=A0=C2=A0=C2=A0 #define DOT_CMD "dot -T%s '%s' > '%s.new' && mv '%s.ne= w' '%s'" > =C2=A0=C2=A0=C2=A0 (...) > =C2=A0=C2=A0=C2=A0 std::string cmd =3D stringf(DOT_CMD, format.c_str(), > dot_file.c_str(), out_file.c_str(), out_file.c_str(), > out_file.c_str()); > =C2=A0=C2=A0=C2=A0 log("Exec: %s\n", cmd.c_str()); > =C2=A0=C2=A0=C2=A0 if (run_command(cmd) !=3D 0) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 log_cmd_error("Shell command f= ailed!\n"); >=20 > Obviously this works only if "dot" is in the user's PATH (as Yosys > blindly assumes), so the graphviz package must be installed as well > or the "show" command will be broken.=C2=A0 Similarly for the "fuser" and > "xdot" executables, which by default are invoked to provide graphical > output (though their use can be overridden by a setting at runtime). >=20 > I find this business of generating shell commands a bit ugly but at > least it creates only a loose coupling between the executables: The > shell is free to select a suitable "dot" to run, so the user can > substitute their own as easily as changing their PATH. When propagating inputs, it creates the same tight coupling as hardcoding would, but with worse UX (think propagating conflicts). You should instead try: std::optional dot_bin =3D which("dot") if (!dot_bin) dot_bin =3D "@dot@"; std::string cmd =3D string(DOT_CMD, *dot_bin, ...) Cheers