From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: [PROPOSAL] Builder, a build system integration for Emacs Date: Sun, 21 May 2023 12:58:47 -0700 Message-ID: References: <95980ffc-86e7-ad54-4a20-539d8c6ea5d0@mailo.com> <3f68f4bc-d426-0bcc-1329-674c12b29386@mailo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3531"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?UTF-8?Q?Augustin_Ch=c3=a9neau_=28BTuin=29?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 21 21:59:49 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q0pDY-0000l8-Rh for ged-emacs-devel@m.gmane-mx.org; Sun, 21 May 2023 21:59:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0pCf-0000Oj-Qj; Sun, 21 May 2023 15:58:53 -0400 Original-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 1q0pCe-0000OR-4v for emacs-devel@gnu.org; Sun, 21 May 2023 15:58:52 -0400 Original-Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0pCc-0003I5-Ia for emacs-devel@gnu.org; Sun, 21 May 2023 15:58:51 -0400 Original-Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d2b42a8f9so2483906b3a.3 for ; Sun, 21 May 2023 12:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684699129; x=1687291129; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=qromeCtIs/d2Z+bkexe8hCpz/CwnxKYRJ9W7hHXeiuI=; b=JTciNE+Pz+9hfY8IkNSnsMYfFdB1SIP3BWW3hQzqRo4EyX/nrW57X3gy31iDcZS/pZ rzAZhDHuEoSPH1TLW7pQ3p+G4sAGl470xkCmN/KZPLgyUC1qUtGVOdfkUmrByU3/KVyE w+Lk7IEVevaR9HJt4XvpADCe877uIgsgWYvft0f+wcCElgX83k4AhCz9wzaH97Dk6S85 CN7h3RJBrEgtv6Nc1qKQ4lLh2Y6/S4DjehdMxdk0I+8dxgwYyzxWHC5vHUtQSjvXwZK4 /bgcUT/wAp9VmISZgZFpiV9pPyAildkuTsmGbkhU4R6ilylWn/SGk1VRNveYz3XirA+z 1UjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684699129; x=1687291129; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qromeCtIs/d2Z+bkexe8hCpz/CwnxKYRJ9W7hHXeiuI=; b=DpwsHW9ENjZff6qmsz3sHOxHJGf3Cu5WbI1dgeyQiLszLT2+twM6BV14cB7uX1mDBo n4xMCu2YuZ436G6ZfACpCHziGsYZNFBRRL84KpQDZVslQSh/apGyn9eAqMdkkVVty+Pr lbuW6aJky70W3SXVPO6s5OEyLeOMrYh14GFEMByu2o3LPtGb1Np06P8EPtuw28LK8uC8 FIIY1fR2syltAPsBBgiKw8stQ7WPUfeCWKVeX3xyTkvBUk5TdQfSVXurz1vz45XepNQ0 jwpVfktkzKdAxx/uvF9LwZwZrDUBkuel32hOUYaHNxkelgPnmxNSaVDh//vp7zUUzDah gdwQ== X-Gm-Message-State: AC+VfDz7Yj0YolsnsEy1ETmFKWhLvylbOjA5KHotmLVqMpm3Bwff+2x5 ysLQiNcYhz7eR8GXku//VjE= X-Google-Smtp-Source: ACHHUZ6mIsilZ9byEez8ot5lArGVHEHh8tvcTP8C0D/chEYo4cgdOcko1WkUJLrA5KmvfZzmpRUpSQ== X-Received: by 2002:a05:6a00:893:b0:634:7ba3:d142 with SMTP id q19-20020a056a00089300b006347ba3d142mr11953022pfj.10.1684699129052; Sun, 21 May 2023 12:58:49 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id j1-20020aa783c1000000b0063d6666ee4csm642439pfn.34.2023.05.21.12.58.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 May 2023 12:58:48 -0700 (PDT) Content-Language: en-US In-Reply-To: <3f68f4bc-d426-0bcc-1329-674c12b29386@mailo.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306255 Archived-At: On 5/21/2023 12:33 PM, Augustin Chéneau (BTuin) wrote: > Interestingly I already thought about chaining build systems, but I > wasn't sure how to implement it. > Unfortunately the main drawback of your method is that you can't easily > switch between a debug or release mode (if I understood your code > correctly). Well, the main reason for that is that I just haven't implemented that yet, since I'd want to go well beyond just a debug/release toggle. For example, this feature could probably be useful for configuring *any* kind of build variant, including things like cross-compilation. I haven't figured out a sufficiently-generic way to handle that across many build systems though. Currently, the way I tend to use taco is just to let it give me an appropriate template for the compile command, which I hand-edit. For the configuration step, I often add some extra options, but I only need to do that when I'm setting up a build; for actually compiling a project, the default is usually what I want. > Also, what if an intermediate step is used in two different context, > both with different next step? I think that should be fine. For example, CMake can generate Makefile or Ninja files, depending on what flags you pass. Once it does that, it should be easy to see what the next step is retrospectively by looking at the files in your build dir. (This could get a bit trickier for something like meson, which seems to want you to use its own `meson compile` wrapper, even though it uses Ninja as the default build backend. But in that case, I think you'd just need to scan for an appropriate sentinel file for meson in the build dir, and then have the "meson compile step" be higher priority than the generic "Ninja compile step".) > I thought of something with a list of targets names, but I'll need to > think more deeply. > Currently you could achieve the same manually, but I agree it's not very > convenient. This is something I've thought a bit about too: right now, taco is only good for compiling a project, but it doesn't help for things like running unit tests, building HTML documentation, etc. That will take some careful thought though, since some build systems let you define arbitrary build targets for things like this, and others treat targets specially. For example, `make test` is just a normal Make target like any other, but `meson test` is (somewhat) special; I could call my Make "test" target anything I like (e.g. "check"), but I don't think meson is so flexible. Another lower-level option for targets is to take advantage of Emacs' built-in Pcomplete code. Pcomplete can handle completing command-line arguments for lots of commands, and if you added some Pcomplete handlers for "make" that let you tab-complete Make targets, then you could probably use that in Builder (or taco) as well. This has the additional benefit that you get nice tab-completion in M-x shell too.