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.devel Subject: Re: Alternatives for reliable build environments for emacs? Date: Thu, 28 Oct 2021 23:07:25 +0700 Message-ID: References: <87bl39cnr4.fsf@tanaka.verona.se> 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="31076"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Joakim Verona Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 28 18:33:47 2021 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 1mg8La-0007pz-3n for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Oct 2021 18:33:46 +0200 Original-Received: from localhost ([::1]:51456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mg8LZ-0004Cp-1I for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Oct 2021 12:33:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mg7wO-0000GR-1w for emacs-devel@gnu.org; Thu, 28 Oct 2021 12:07:44 -0400 Original-Received: from mail-ua1-x92d.google.com ([2607:f8b0:4864:20::92d]:42897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mg7wK-00062q-87 for emacs-devel@gnu.org; Thu, 28 Oct 2021 12:07:43 -0400 Original-Received: by mail-ua1-x92d.google.com with SMTP id v20so12495946uaj.9 for ; Thu, 28 Oct 2021 09:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7qkK01bz/N2DOAh4XcHEGyqGqOHic1D89LesbbWf4yM=; b=b5CMq6eGUNZ0CQjs+ecNv0LRhRUIR9itoTlLZtFIthWgdJLBlMzzN0ANVsw80aDPU0 AuPEBDIon5l8km0E+HJKC07C6e1hAWg09q/gPz8kfHwWStr9685yR1pRTCoY3ZiBjYjH OIG7A6FBzWSiHSDqVvqT9XtHsqIYgHFD/sCdPMdO/W35vRrLA6/EBRKG5GDH/t0/G6ZG vtuJXp5PG+ZZ9vJAxoCf1COT8nWZVCITa3CZawPRYV6oYSYfgaBxgwPRYz3wx9Z6C4SO TFEyG9hVYrhSQ1SSu3+Ygv6Fp20bvBEE7SV39DmH348UaooV6Md/z+ulDZR32N9fkbnB wI2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7qkK01bz/N2DOAh4XcHEGyqGqOHic1D89LesbbWf4yM=; b=UKa3m7+3Ucg5mCVG/6razpfxEgk9MVtpL0kf1ofIBBNkdNEtB/QZKa4Y0iM49tpZS9 FTDl3AIO1s6CKpNYPWLm1NJHybA8ZTZX0QUbr/7770Z3FNea6nG8Q//frAOGwE9lpXI/ UVC++27WZ+Ht4QXKPwVwpvrhlOMDLD4K567SYGjeat4OkI61IiBEEkCu6imKvmP2DxaI 09ehbuD7/BBnoddBO0N+VCRl7aDidbIgoTq3XTM/DGfNyn3MXbaXdF8Xo9WiqbLqvgJm knw6F+zil4MP8qGCbWvF+CkoS9T5RzdnSJsadeNk4A41rlMtF/WxuRHN/waQVM4vVV61 JPQg== X-Gm-Message-State: AOAM530hHgNKcBlMjSYttqgVJQqvi/gPad/NbTq0hp133cciai+l4Sra sY0nHlKfkMpVAwc+ENNjyclhn9LndW3iHxHR+1Q/fVmsEZ0= X-Google-Smtp-Source: ABdhPJwe0nr+nVmZVdLu8E2H8tKCrDiTM2ZGceTkVBG1WIM/KpoJBfG1lpQd8cUWf5fWWO/d2gaCzxJk7ajjnFvIZjY= X-Received: by 2002:a67:6e03:: with SMTP id j3mr4712440vsc.31.1635437257694; Thu, 28 Oct 2021 09:07:37 -0700 (PDT) In-Reply-To: <87bl39cnr4.fsf@tanaka.verona.se> Received-SPF: pass client-ip=2607:f8b0:4864:20::92d; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x92d.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:278124 Archived-At: On Thu, 28 Oct 2021 at 19:57, wrote: > I'm finding it increasingly difficult to build emacs in my distro, > Fedora(Ok, I havent managed to build emacs using distro dependencies for > a long time) > > What are the alternatives? > I have tried guix and docker but not yet flatpak. > > These are nice because you can pin the dependency versions, to make sure > you have a reproducible build environment. > > These all have the drawback that they are inconvenient when making local > modifications to the emacs source, at least for me. Way back in the days > when my original build environment worked, I automatically merged some > branches and applied local patchs with stgit, and its these kind of > things I've found awkward with the above mentioned containerized build > systems. I=E2=80=99m not an Emacs developer but the issue is familiar. I use Docker = for similar cases: (1) building software targeting an older version of the distribution than is installed on my host system, or (2) building software using newer versions of the toolchain than I=E2=80=99m comfortable installing on my host machine. The trick is that you keep the toolchain and build dependencies in the container, but bind-mount the source and build trees so they are not parts of the container image. This way, you work with the source tree using your local tools; the container is completely disposable. I=E2=80=99d use the following workspace layout: =E2=80=A6/emacs-workspace build/ =E2=86=90 out-of-tree build directory docker/ =E2=86=90 separate directory so nothing gets into Docker build= context Dockerfile emacs/ =E2=86=90 source tree .env =E2=86=90 see below docker-compose.yml =E2=86=90 convenience wrapper Makefile =E2=86=90 convenience wrapper over docker-compose Sample configuration files below are completely untested and provided only to give an idea. docker/Dockerfile: ``` FROM ubuntu:20.04 # whatever distro is closest to yours RUN apt-get update && \ apt-get install --yes \ build-essential gdb \ =E2=80=A6more toolchain and dependencies=E2=80=A6 RUN adduser ubuntu # non-privileged build user if not already provided by = image ``` docker-compose.yaml: ``` version: "3.7" services: builder: build: context: docker/ user: ${DOCKER_UID:-1000}:${DOCKER_GID:-1000} volumes: - ./build:/home/ubuntu/build - ./emacs:/home/ubuntu/emacs - /tmp/.X11-unix:/tmp/.X11-unix ``` .env: ``` # If your local user ID or group ID is different from those in the containe= r, # specify them here # DOCKER_UID=3D1001 # DOCKER_GID=3D1001 ``` Makefile: ``` DOCKER_RUN =3D docker-compose run \ --rm \ --user=3Dubuntu \ --workdir=3D/home/ubuntu/emacs \ builder CONFIGURE_FLAGS =3D =E2=80=A6 configure: $(DOCKER_RUN) ./configure $(CONFIGURE_FLAGS) build: $(DOCKER_RUN) make debug: $(DOCKER_RUN) gdb --args ../build/emacs $(ARGS) ```