From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Project out of sources compilation Date: Mon, 1 Apr 2024 19:18:12 +0200 Message-ID: References: <4wwljrdnra3bsloehioa46y24ozxajajmvf2elvskxxq3mhtg2@pyv2z5snot6h> <87ttl5w0mr.fsf@gmail.com> <1fd527fc-9643-49d2-8fae-d7e7fd043fe1@gutov.dev> <87le5x34l6.fsf@gmail.com> <27rton4k4r6sacysluk7iikj57ai2tyiak4ldd5nzpts7thmhg@nriej75catir> <871q7pyv9f.fsf@djcbsoftware.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5276"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Dirk-Jan C. Binnema" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 01 19:19:09 2024 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 1rrLJM-00017f-Fy for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Apr 2024 19:19:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrLIj-0001Mv-Ew; Mon, 01 Apr 2024 13:18:29 -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 1rrLIh-0001La-Sv for emacs-devel@gnu.org; Mon, 01 Apr 2024 13:18:27 -0400 Original-Received: from sonic304-9.consmr.mail.bf2.yahoo.com ([74.6.128.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrLIe-0006pm-9O for emacs-devel@gnu.org; Mon, 01 Apr 2024 13:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1711991901; bh=9JLs5nrL+5onQeg1axc/htBSwhsCUKLpzP8CDPDv6GI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=GnVrYVAtiaoi1FBw9VyVw8yavhJI86zvQDyACIzKIsk8A+wbgrjmBq/Jto9LyUwRITwf11rh0x0o+JEZ6Iz0UKGsdj978tET6IBiJiVGy3WBwBz0HZT+9GmlX+FjV2PzjV1DgPtdpsnf5bCwaHy4Y51VkEGXnbSrYStrGjMV7/DnReqWfRgcU3PK/rw0uAHNrbJDLEIU9ueBqvtICb041glff5/zwA1+eO//8IDYFHwZv0h+JfotwHuxyAklp13xTx7a/bizyYjUFHqIMnjKxk9W2UJ0YdgWf734lZJMmYzMaECxWnoFe1V7vi+ttTH2v5bZMEi+3k4Zdev60mpfWQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1711991901; bh=gNUBpjPQ6fAf/+AtirulnHaYj8DIk1Iq/OJ69nAbRnT=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=uIZO3bbT0EY1/Az0AKW1roJavJ8lHfBKST6wF/uVvDQshsGgDY1+wfEzN7rcLw7DnUPwIA2hZcrK/OW2yRdOn+G0u8gafqGM3iZMfuMIq3K+KBiromedtDWLGE9gzAIUtnEXwfYd4wKFnFWUwUK8KN8v9E6DKsfm5omLElR0BPFeQrXEt9wpiaWwYweZrKRCOl1bKrQTP/hN9mJyjaTRF1Q5FDztfzHPwW1uSSfAfOn+9G45bwsiYo2RBVOi9HZ3f8IGNQXqGQW7p2yTtbXMTpl772IR9xBX6l9FrrXfzGgjd2pNsbuUirQ8X7YugoJbNUPFYLA3VQCQCmIrXkwVpg== X-YMail-OSG: fb61M9oVM1nsXZPF6YNtIZHhyGZ9vmh3WcKwqx7U58mKYE1N6ISxrIINxlk9U8L pAAn8WzHKQAJoqK5MLm1fMwu.HPYUy0XyQhcrfEZnsZcoJnX.vKe8T22QwrL6gfG97zPTaiAv3G5 .nC7rpI.Sa1hhRIKWzHVPC1DBahyLp6gqIuLFom3wZrf5Zh0g0a6aAW6Nu6JwsXT1arLPcs5448A D4Wk1gQ0EQvfC8jKNUNsIv6G0W6_gt4OLFYf1Xfd28TPUHbJVijgtfwR_VCXsv75uPP21rsen_IX PJd_k2iQUGLXmNDPnf3nK5KHvaU4bxjUh3LyhrA.30cKccGX7gB5I0diNYEzCHiVsWkJ84WJ.vrX v6B8g3XPf_kGz3l1O4pY4hQ2bVzuu2QI5v5hQ1AUgPHTGabuV.Idm_hVgyFIFNA1J2FQFDkWL0Bn biaWEWA0_eN8jInypKwr7IS9GoMMTLaWZQZbBiSR0Bcj_5sYUUPmhdent..4SQazWXAkZod9Ak75 j5jH_g8kN7.iFymvUltApSVGL9BPYAbHfBZ88GCRlAh6ax8PqVeRGeYwoeyhk7uob7Fa6P243Azl iHSxE2UZazYoTGQXuQdJfyMGl4IAAsRwQTJukMbesAS3yUTTWbBxM9ORDRr6S9hHGIl0AiplIQwa w4N9yqDFfA2SOyDTM45fB_.pYz2xYQMC1ZmG0p8I8kxL0Ochrc5hoKzrXwwl3pTJO73UqvnHZyT5 L.D6Y0unNPuCxvx7xudw5lfGQRJZLPRhXSbFm8UZN6j6MDSSZjv1lHFYx7oac2_VXK1ISC.kOmdy jgvvsh9hnG71Od.Qr9zS8gVEsqD_KmyVfjHGGE9OO5 X-Sonic-MF: X-Sonic-ID: d712eb05-240f-4b2d-85a7-d98c116fd395 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Mon, 1 Apr 2024 17:18:21 +0000 Original-Received: by hermes--production-ir2-7bc88bfc75-h6nxx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID aa71a80d8f2a1ba480ea6f0b41fc045e; Mon, 01 Apr 2024 17:18:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: <871q7pyv9f.fsf@djcbsoftware.nl> X-Mailer: WebService/1.1.22205 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.128.32; envelope-from=spacibba@aol.com; helo=sonic304-9.consmr.mail.bf2.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:317452 Archived-At: 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 >