emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PROPOSAL] Builder, a build system integration for Emacs


From: Jim Porter
Subject: Re: [PROPOSAL] Builder, a build system integration for Emacs
Date: Sun, 21 May 2023 12:58:47 -0700

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]