From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Dev workflow in Emacs with containers Date: Sat, 30 Nov 2024 00:32:49 +0700 Message-ID: References: <87h67qnmae.fsf@k-7.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20478"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Users list for the GNU Emacs text editor To: =?UTF-8?Q?S=C3=A9bastien_Gendre?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 29 18:34:40 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1tH4t5-000578-C3 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 29 Nov 2024 18:34:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tH4ra-00064O-Aq; Fri, 29 Nov 2024 12:33:06 -0500 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 1tH4rY-0005uh-Qf for help-gnu-emacs@gnu.org; Fri, 29 Nov 2024 12:33:04 -0500 Original-Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tH4rX-0001ZS-7X for help-gnu-emacs@gnu.org; Fri, 29 Nov 2024 12:33:04 -0500 Original-Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-4af122fb98aso470152137.1 for ; Fri, 29 Nov 2024 09:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732901581; x=1733506381; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2/jjk2oTRPxRucR9Dk33nSaFLp6AyLK8oAnu09+JpdA=; b=WW/xduG/GfbkefXD0I0rKfYlIGe1df27mJpkr1JxHaWQR2hvHXoEyZNzMeVpEAPYYv IxSxok+EBzs/XhPxWFQxrAvHpaYOTEkBnqGH4OW0+wsbuen3NdGrgr/jb+gN/y3C2I6I E3DcEmfJbpeqscPHXo2I9umm7Rl/CExV5Qd4U3AAj2HK7Pu/L3gB++AA494WXxBQOaLH 6ttEyEHC7Vk8+ZU0w7anmDCqXIgUEUTQeSuVHcymgiJO9aylJaLPAAksygCcUPTd0AML R145ZtplajpLsQja/XYgHWhUskunF07/b0VvZjoyjPP++t9GZaJWIuF24AR77+1QriQ1 GYcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732901581; x=1733506381; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2/jjk2oTRPxRucR9Dk33nSaFLp6AyLK8oAnu09+JpdA=; b=TSJ5F9Bjnt+zbJTLyaARPCnsGx0TV3pOc0qGpdpSM3WusK8xd2ZdYxQpLkxDkQwgG7 IO20Mo8aAP79uta88yBqWqlwUlRfNdFjakzAFlxXAY0umXQi0Zunu8udfkiSJ/tZ3ype 3+tEzSMVoPybujZl6oS+/EauBo7xuWHDiicJa43dd2F7Wguap8R7ClEncOJDAbtbQlPr 3SNfOnb426ixw68NPi0+4axAfGfBnS2QW7haioexrGX5lDKTgUyXw/n5yR221xWQbHfL 1QcnwV6WBeVqGX2i5DADbIRRmE1c0MCdsU1iGmheREuRW3YP9qkprq9X3urd3PL2oyia BRmg== X-Gm-Message-State: AOJu0YwJbBDW+dJzS1uB5YIzbod5/UQ4tPp6xHtKEZ5KfzLuj8q3aHPa wM/GQ0I68sqY45/eb0xHYeL0MYhnhzwNx4KO0fk+Q2QDPaq4TBZrCW75E4nQg/ooF1OrNr39HoY 5ZPRFlhqMHHo41zwhl7gHsRNZtR0JJibS X-Gm-Gg: ASbGncvTgw18ZCbWyvqCviPl1aWGd0F2ptu8oXTPi7XaK0dAoQ6WKNz3VA3Rj45foIK FhLz4PAZEGwTIQ5cHhvRMhFXVKr9DLS0= X-Google-Smtp-Source: AGHT+IEKyF1z9CDz1UkRTcayUVi7aUbAsPluJCjJojgUThwCW6jQElrYHhwM1+314GV+Z0IXmY/iLzc1w18/1uTFF/U= X-Received: by 2002:a05:6102:3a0d:b0:4af:5682:bc19 with SMTP id ada2fe7eead31-4af5682bf17mr10635642137.1.1732901581488; Fri, 29 Nov 2024 09:33:01 -0800 (PST) In-Reply-To: <87h67qnmae.fsf@k-7.ch> Received-SPF: pass client-ip=2607:f8b0:4864:20::e2a; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe2a.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148441 Archived-At: On Fri, 29 Nov 2024 at 21:41, S=C3=A9bastien Gendre 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=E2=80=99t get root-owne= d 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=E2=80=99t 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 =E2=80=98docker-compose run --rm runtime gdb=E2=80=99 as my debugger and =E2=80=98docker-compose run --rm bu= ilder clangd=E2=80=99 as my language server, and =E2=80=98make build test=E2=80= =99 as my compile command. > 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 =E2=80=98compilation-filter=E2=80=99 to a function that replac= es prefixes.