From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
Subject: Re: Dev workflow in Emacs with containers
Date: Fri, 29 Nov 2024 18:20:25 +0000 [thread overview]
Message-ID: <87ttbp52c7.fsf@t14.reltub.ca> (raw)
In-Reply-To: <CAP_d_8WA8iut5tB_0roiFit8xh=-oeYqEenOE57_M+PLNLszDg@mail.gmail.com> (Yuri Khan's message of "Sat, 30 Nov 2024 00:32:49 +0700")
On Sat, Nov 30 2024, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> On Fri, 29 Nov 2024 at 21:41, Sébastien Gendre <seb@k-7.ch> wrote:
>
>> Emacs provide some great tools to integrate with the dev workflow:
>>
>> These tools are great when the complied/tested/debugged/run software is
>> local. But I use more and more the containers. Even for micro-controller
>> firmware dev.
>>
>> My questions are:
>>
>> What are your experience with using Emacs, the tools cited above and
>> containers ?
>
> Emacs integrates excellently with containerized tools.
>
>> Do you use a `.dir-locals.el` to set the commands run by Emacs to
>> debugg/compile/etc ? Or do you use a Makefile with pre-defined targets
>> for test, debug, build, etc ?
>
> 1. I have a Dockerfile or several that describes the build
> environment. If necessary, a different one that describes the
> runtime/debugging environment.
>
> 2. I have a docker-compose.yml which utilizes the image(s) built from
> Dockerfile(s) of step 1, and mounts the source tree, the build
> directory, etc into service containers. The compose file also arranges
> for the services to run as my user ID so that I don’t get root-owned
> files in my build tree.
>
> The purpose of the compose file is to remember all the docker run
> options for me so that I don’t have to specify them every time. I
> could alternatively use shell scripts.
>
> 3. I also have a Makefile that encapsulates the build logic. In some
> targets, it arranges for itself to execute in a service container
> (with a different target). The purpose of the Makefile is that I could
> run it either from Emacs or from local shell if I so desire.
>
> 4. .dir-locals.el to tell Emacs to use ‘docker-compose run --rm
> runtime gdb’ as my debugger and ‘docker-compose run --rm builder
> clangd’ as my language server, and ‘make build test’ as my compile
> command.
Yuri, would you be willing to share the stuff you mention?
TIA,
Leo
>
>> How do you manage when Emacs highlight a link to a file, but the
>> obtained path correspond to the container file system while Emacs can
>> access this file from the host file system ?
>
> Where practical, I prefer to mount my volumes at the same paths in the
> container as locally, this simplifies the mapping a lot. But in some
> cases I hook ‘compilation-filter’ to a function that replaces
> prefixes.
next prev parent reply other threads:[~2024-11-29 18:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 14:32 Dev workflow in Emacs with containers Sébastien Gendre
2024-11-29 17:32 ` Yuri Khan
2024-11-29 18:20 ` Leo Butler [this message]
2024-11-30 10:44 ` Yuri Khan
2024-11-30 18:21 ` Sébastien Gendre
2024-12-01 9:41 ` Yuri Khan
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=87ttbp52c7.fsf@t14.reltub.ca \
--to=leo.butler@umanitoba.ca \
--cc=help-gnu-emacs@gnu.org \
--cc=yuri.v.khan@gmail.com \
/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.