From: Ergus <spacibba@aol.com>
To: "Dirk-Jan C. Binnema" <djcb.bulk@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Project out of sources compilation
Date: Mon, 1 Apr 2024 19:18:12 +0200 [thread overview]
Message-ID: <dzia62ivxcr7eilg3ljbgco536olpbmdnstrmtdv23k6mkog5p@wiytokobaxso> (raw)
In-Reply-To: <871q7pyv9f.fsf@djcbsoftware.nl>
On Mon, Apr 01, 2024 at 06:09:48PM +0300, Dirk-Jan C. Binnema wrote:
>On Monday Apr 01 2024, Ergus wrote:
>
>> On Mon, Apr 01, 2024 at 10:49:25AM +0300, Dirk-Jan C. Binnema wrote:
>
>>>> I added one method and with that I already support autotools and cmake.
>>>
>>>(would be nice to add "meson" too!)
>>>
>> No problem once the feature will be more advanced I can add it to the
>> project-multi backend in my github...
>
>Great!
>
>For meson support, I found I needed somewhat of a variation on
>`locate-dominating-file' to find the remotest parent directory that has
>a meson.build. Guess it's similar to what's needed for cmake.�
>
Yes in project-multi I only need to add a simple entry like this:
(:type cmake // will be meson in your case
:program "cmake" // name of program to build
:root-hint "CMakeLists.txt" // the filename to search in the root dir (gets the top most if nested)
:build-hint "CMakeCache.txt" // The file to search in the build dir (searches in root and all root's subdirs)
:project-regex "project[[:blank:]]*([[:blank:]]*\\([[:alnum:]]+\\).+)" // Regex to search the project name in :root-hint
:compile-command ":program --build ." // A command pattern to build from build-dir; `:program' will be substituted
)
:project-regex can also be a function.
sadly I don't really have time now to implement another version of the
code needed in project.el... Because there is a part in Dmitry's
comments I don't really know how to manage to support the workflow I
have now...
>>>No immediate opinions on how to implement this, but things I commonly
>>>want in projects:
>>>
>>>- build
>>>- run
>>>- test
>>>- install
>>>- flash
>>>- debug
>>>- clean
>>>
>> Lets start with the one common to all: `build'
>>
>> Some others are difficult to support i.e I have no idea what is
>> `flash'. And makefile based projects may not have a clean target defined.
>
>Yes, these are only useful for _some_ projects; currently I have some
>custom solution to determine the flash command for the current
>project (if any). But I think it'd be nice to somehow attach the
>functionality to the current project.
>
>Note - it'd indeed be hard to automatically guess/determine this for
>some project; in many cases, it would probably require the user to
>configure some project-specific variable to set the commands.
>
>> The install may be also controversial as it may refer to install in the
>> system or create an install directory.
>>
>> And run is complicated because most projects create multiple outputs, so
>> we need to find some kind of standard method to list them in order to at
>> least ask the user in the first call.
>
>As above, some of this might require some project-specific user
>variables.
>
>For comparison e.g. VSCode allows for doing such actions for many
>projects; Emacs can do that as well, but currently it requires quite a
>bit of custom tweaking; I'm just saying it'd be nice to integrate that
>with project.el.
>
>Some .project-locals.el could be useful for this.
>
>> As Dmitry said, the multiple targets may be also difficult to handle
>> with this abstraction either to `build only one' (may require
>> completion in the command manually) or to debug (in order to know
>> which target/executable to debug). I am not saying it is impossible,
>> just that I don't have enough knowledge about all the tools and their
>> support for such commands.
>>
>> Also remember that this only applies to specific backends because vc
>> backends know nothing about this, so the commands need to be defined
>> somehow conditionally in M-x according to the backend... That's very far
>> from my elisp capabilities...
>>
>>>It's possible of course to "multiplex" with the compile-command and put
>>>in a "transient" or something like that; but it'd be nice to handle this
>>>directly across projects; also for adding menu / toolbar commands.
>>>
>>>Guess this is a bit of an open-ended list, so having `project-*-command`
>>>may not to be the best.
>>>
>> Agree here, but I am not a good lisper... so probably Dmitry can bring
>> some advanced elisp feature I am not be aware of that could solve this
>> issue.
>
>Sorry for hi-jacking your useful proposal to propose some more :-)
>
Not need to sorry... is actually good that someone else also cares about
this... ;)
>Kind regards,
>Dirk.
>
>--
>Dirk-Jan C. Binnema Helsinki, Finland
>e:djcb@djcbsoftware.nl w:www.djcbsoftware.nl
>gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036
>
next prev parent reply other threads:[~2024-04-01 17:18 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4wwljrdnra3bsloehioa46y24ozxajajmvf2elvskxxq3mhtg2.ref@pyv2z5snot6h>
2024-03-16 13:12 ` Project out of sources compilation Ergus
2024-03-16 16:50 ` Konstantin Kharlamov
2024-03-16 19:00 ` Ergus
2024-03-16 20:56 ` Konstantin Kharlamov
2024-03-17 2:53 ` Dmitry Gutov
2024-03-17 7:22 ` Ergus
2024-03-17 8:45 ` Eli Zaretskii
2024-03-17 17:33 ` Ergus
2024-03-17 17:38 ` Eli Zaretskii
2024-03-17 17:58 ` Ergus
2024-03-17 11:36 ` Augusto Stoffel
2024-03-17 17:47 ` Ergus
2024-03-19 18:36 ` Ergus
2024-03-27 16:38 ` [PATCH] " Ergus
2024-03-31 2:41 ` Dmitry Gutov
2024-03-31 21:07 ` Ergus
2024-04-01 7:49 ` Dirk-Jan C. Binnema
2024-04-01 13:52 ` Ergus
2024-04-01 15:09 ` Dirk-Jan C. Binnema
2024-04-01 17:18 ` Ergus [this message]
2024-04-02 23:23 ` Dmitry Gutov
2024-04-03 19:47 ` Ergus
2024-04-06 2:05 ` Ergus
2024-04-14 1:44 ` Dmitry Gutov
2024-04-16 14:56 ` Ergus
2024-04-22 17:05 ` Ergus
2024-04-22 18:48 ` Ergus
2024-04-22 21:20 ` Mohsin Kaleem
2024-04-23 15:17 ` Ergus
2024-04-23 19:26 ` Mohsin Kaleem
2024-04-26 0:47 ` Dmitry Gutov
2024-04-02 21:39 ` Richard Stallman
2024-04-02 22:43 ` Dr. Arne Babenhauserheide
2024-04-05 21:40 ` Richard Stallman
2024-04-03 10:40 ` Konstantin Kharlamov
2024-04-03 11:45 ` Eli Zaretskii
2024-04-03 13:31 ` Konstantin Kharlamov
2024-04-03 14:11 ` Eli Zaretskii
2024-04-03 15:00 ` Konstantin Kharlamov
2024-04-03 15:47 ` Eli Zaretskii
2024-04-03 17:27 ` Konstantin Kharlamov
2024-04-03 18:22 ` Eli Zaretskii
2024-04-03 19:08 ` Konstantin Kharlamov
2024-04-03 20:12 ` Ergus
2024-04-04 5:26 ` Eli Zaretskii
2024-04-04 9:59 ` Ergus
2024-04-04 11:59 ` Eli Zaretskii
2024-04-04 12:34 ` Ergus
2024-04-04 13:02 ` Eli Zaretskii
2024-04-04 14:27 ` Ergus
2024-04-04 14:41 ` Eli Zaretskii
2024-04-04 18:15 ` Ergus
2024-04-04 18:56 ` Eli Zaretskii
2024-04-04 20:16 ` Konstantin Kharlamov
2024-04-05 5:11 ` Eli Zaretskii
2024-04-04 5:07 ` Eli Zaretskii
[not found] ` <87jzlefgi9.fsf@dick>
2024-04-03 18:44 ` Konstantin Kharlamov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dzia62ivxcr7eilg3ljbgco536olpbmdnstrmtdv23k6mkog5p@wiytokobaxso \
--to=spacibba@aol.com \
--cc=djcb.bulk@gmail.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).