all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Augustin Chéneau (BTuin)" <btuin@mailo.com>
To: emacs-devel@gnu.org
Subject: Re: [PROPOSAL] Builder, a build system integration for Emacs
Date: Mon, 22 May 2023 18:35:04 +0200	[thread overview]
Message-ID: <76e12f7c-335f-476b-ffb3-fd8e8e4ab5d0@mailo.com> (raw)
In-Reply-To: <ae8100bc-3fdb-32fd-d312-db93c309f1d7@gmail.com>

Le 21/05/2023 à 21:58, Jim Porter a écrit :
> 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.
> 
Oh I didn't mean a simple toggle, I meant an arbitrary command variant. 
For instance with Builder you can define a "debug2", "compile_arm" or 
any other command.

Maybe you could do something like this with Taco:
(cmake
  (build-step . configure)
  (project-file . "CMakeLists.txt")
  (working-directory srcdir)
  (commands
   (release . "cmake" "-G" "Unix Makefiles" builddir)
   (option . "cmake" "-G" "Unix Makefiles" "-DMY_OPTION=yes" buildir))
  (next-step build (make . parallel)))
(make
  (build-step . build)
  (project-file . "Makefile")
  (working-directory builddir)
  (commands
   (default . "make")
   (parallel . "make" "-j4")))

> 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".)
> 
That's why I went with the idea that each build system uses its own 
command to compile, but that's still not ideal as you can't change 
globally the "make" command...


>> 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.
> 
Yes, this is getting complex very quickly.
I think that separating targets is simpler, so you have a known list of 
targets (configure, compile, package, install, test, and run), and you 
can treat each case and build system separately.  The price to pay is a 
lower interoperability between build systems, but I'm not sure if the 
additional complexity worth it anyway.
But I would be interested if you manage to solve it properly!

> 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.
> 
Nice, thank you!  I wasn't aware of its existence, I'll try it.










  parent reply	other threads:[~2023-05-22 16:35 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 10:21 [PROPOSAL] Builder, a build system integration for Emacs BTuin
2023-05-21 12:11 ` Philip Kaludercic
2023-05-21 14:56   ` Augustin Chéneau (BTuin)
2023-05-21 17:24 ` Jim Porter
2023-05-21 19:33   ` Augustin Chéneau (BTuin)
2023-05-21 19:58     ` Jim Porter
2023-05-21 21:36       ` John Yates
2023-05-22 16:35       ` Augustin Chéneau (BTuin) [this message]
2023-05-23  0:44         ` Po Lu
2023-05-23 21:10           ` Augustin Chéneau (BTuin)
2023-05-23 21:17             ` Óscar Fuentes
2023-05-24  6:09             ` Dirk-Jan C. Binnema
2023-05-24 21:35               ` Richard Stallman
2023-05-24 23:32                 ` Jim Porter
2023-05-25  0:11                 ` Gregory Heytings
2023-05-25  4:00                   ` tomas
2023-05-25  6:53                     ` Gregory Heytings
2023-05-25  7:48                       ` Eli Zaretskii
2023-05-25  9:33                         ` Gregory Heytings
2023-05-25 11:28                           ` Eli Zaretskii
2023-05-25 11:53                             ` Gregory Heytings
2023-05-25 13:09                               ` Eli Zaretskii
2023-05-25 14:36                                 ` Gregory Heytings
2023-05-25 16:20                                   ` Eli Zaretskii
2023-05-25 16:40                                     ` tomas
2023-05-25 19:23                                     ` Gregory Heytings
2023-05-26  0:57                                       ` Po Lu
2023-05-27  0:24                                         ` Gregory Heytings
2023-05-26  5:57                                       ` Eli Zaretskii
2023-05-26 21:16                                       ` Richard Stallman
2023-05-27  0:25                                         ` Gregory Heytings
2023-05-28 10:20                                           ` Madhu
2023-05-28 12:38                                             ` Po Lu
2023-05-29 22:03                                               ` Gregory Heytings
2023-05-29 22:42                                                 ` Po Lu
2023-05-30  7:26                                                   ` Gregory Heytings
2023-05-30 12:54                                                     ` Po Lu
2023-05-30 15:08                                                       ` Gregory Heytings
2023-05-30 16:50                                                         ` chad
2023-05-31  1:14                                                         ` Po Lu
2023-06-05  1:09                                                           ` Gregory Heytings
2023-06-05  5:29                                                             ` Po Lu
2023-06-05  8:17                                                               ` Gregory Heytings
2023-06-05  9:06                                                                 ` Po Lu
2023-06-17  3:34                                                                   ` Yilkal Argaw
2023-05-27 14:55                                         ` Brian Cully via Emacs development discussions.
2023-05-26  0:54                                   ` Po Lu
2023-05-26 21:16                                   ` Richard Stallman
2023-05-27  0:26                                     ` Gregory Heytings
2023-05-27  2:37                                       ` Ruijie Yu via Emacs development discussions.
2023-05-28 21:48                                       ` Richard Stallman
2023-05-29 22:05                                         ` Gregory Heytings
2023-05-30 13:01                                           ` Po Lu
2023-05-30 15:08                                             ` Gregory Heytings
2023-05-31  1:16                                               ` Po Lu
2023-06-02 21:38                                                 ` Richard Stallman
2023-06-05  1:10                                                 ` Gregory Heytings
2023-06-05  5:19                                                   ` Po Lu
2023-06-05  8:17                                                     ` Gregory Heytings
2023-06-05  9:00                                                       ` Po Lu
2023-05-31 22:28                                               ` Richard Stallman
2023-05-30 21:52                                           ` Richard Stallman
2023-05-28 21:48                                       ` Richard Stallman
2023-05-25 13:16                         ` chad
2023-05-25 19:38                           ` Augustin Chéneau (BTuin)
2023-05-26 21:32                           ` Richard Stallman
2023-05-27  9:45                             ` Yuri Khan
2023-05-28 21:48                               ` Richard Stallman
2023-05-29  8:03                                 ` Yuri Khan
2023-05-30 21:47                                   ` Richard Stallman
2023-05-25  7:55                       ` tomas
2023-05-25  8:44                         ` Gregory Heytings
2023-05-25 10:38                       ` Po Lu
2023-05-25 11:44                         ` Gregory Heytings
2023-05-25 12:02                           ` Po Lu
2023-05-25 12:08                             ` Gregory Heytings
2023-05-26  0:52                               ` Po Lu
2023-05-26 21:16                           ` Richard Stallman
2023-05-27  0:26                             ` Gregory Heytings
2023-05-28 21:47                               ` Richard Stallman
2023-05-29 22:05                                 ` Gregory Heytings
2023-05-30 13:03                                   ` Po Lu
2023-05-31 22:29                                     ` Richard Stallman
2023-05-26 22:59                       ` Lynn Winebarger
2023-05-28 21:22                         ` Björn Bidar
2023-05-29 22:38                           ` Richard Stallman
2023-05-29 22:38                           ` Richard Stallman
2023-05-30  4:28                             ` tomas
2023-05-25 10:42             ` Po Lu
2023-05-25 19:36               ` Augustin Chéneau (BTuin)
2023-05-22 22:00 ` Richard Stallman
2023-05-23  8:36   ` Philip Kaludercic
2023-05-23 11:18     ` Eli Zaretskii
2023-05-23 12:13       ` Po Lu
2023-05-23 18:46       ` Augustin Chéneau (BTuin)
2023-05-24  6:32         ` Juri Linkov
2023-05-24 20:09           ` Augustin Chéneau (BTuin)
2023-05-24  3:34     ` David Masterson
2023-05-24 10:26       ` Philip Kaludercic
2023-05-28 21:17     ` Björn Bidar
  -- strict thread matches above, loose matches on Subject: below --
2023-05-27  7:12 [PROPOSAL] " Payas Relekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76e12f7c-335f-476b-ffb3-fd8e8e4ab5d0@mailo.com \
    --to=btuin@mailo.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.