From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudi C Newsgroups: gmane.emacs.bugs Subject: bug#70071: [FR] Provide official install scripts without requiring root, e.g., by making a static build possible Date: Sat, 30 Mar 2024 16:25:49 +0330 Message-ID: References: <86r0ftdv6p.fsf@gnu.org> <87frw84iuc.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bde1110614e048ea" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29744"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70071@debbugs.gnu.org, Eli Zaretskii To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 13:57:16 2024 Return-path: Envelope-to: geb-bug-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 1rqYGo-0007V5-8q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 13:57:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqYGe-0007r1-8Y; Sat, 30 Mar 2024 08:57:04 -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 1rqYGc-0007qO-3r for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 08:57:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqYGb-0003md-OX for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 08:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqYGd-0006Yq-IR for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 08:57:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rudi C Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2024 12:57:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70071 X-GNU-PR-Package: emacs Original-Received: via spool by 70071-submit@debbugs.gnu.org id=B70071.171180339725162 (code B ref 70071); Sat, 30 Mar 2024 12:57:03 +0000 Original-Received: (at 70071) by debbugs.gnu.org; 30 Mar 2024 12:56:37 +0000 Original-Received: from localhost ([127.0.0.1]:44187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqYGB-0006Xl-SX for submit@debbugs.gnu.org; Sat, 30 Mar 2024 08:56:36 -0400 Original-Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]:53284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqYG9-0006XW-Na for 70071@debbugs.gnu.org; Sat, 30 Mar 2024 08:56:34 -0400 Original-Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-22222357d76so1863206fac.2 for <70071@debbugs.gnu.org>; Sat, 30 Mar 2024 05:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711803386; x=1712408186; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NxWHMRB4Z9iTdwVsX3TIbOFPvfqrHzYDJUTA6sNgPdw=; b=ckebZREh/xHaSHCTBMxZewOsW0hro5lblbdyJQBpsmxX4OqEUPsqo7iiMNKbwk299J DEexV2ZRgCN95WftjwWbcdsJjtdVt7AfxWbRrLcfSaIAZMvXolfqJRQy6PePx9bmy/r6 JmeeCZofnL/EJePa/9zeQKtql1e7TQ8VWZtD3cu42QUu7PzY8fzyhGUa29PU+88TadSe IlJhHxNtOKQAWibBAB4j10wmak8lIsAqnflwFhILmNH1MqCCWGde0soq97Rc1P+1PNSq rqTf1js+InvEoYhuoTo53rXcK2zxb7+LDk+RU2NJiPVjrBxlKyRjToeEhglajt/7jKW/ 50cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711803386; x=1712408186; h=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=NxWHMRB4Z9iTdwVsX3TIbOFPvfqrHzYDJUTA6sNgPdw=; b=rpkOxBJRATW9TQ8vuT0Ml/pOOhWEuiZcXDGcwQQKHgxz3YeqB1fCbAr/LzdcK389pJ ab8SbhOnZ+oWMPNDuxOUdqpvDw3csmGgBfx88bZ90MQRwonZytx/00wB5XsgBoCvE6RY wL0OHWeu5q2bYAfRLu/c8wxnm0W0tRDmKtsClMZGV7thdQscEMRNwKdH3hHGlkCd4NqB 3OlBZoz4khFxQqfQrPHH9VS4KN5t8Dv/bbv84K7kdV75fklJbNZuhf1ERrptvlRmpkjR VN2/T+vLquqIcpHpt3dweu7Gw0l2b9eQ5rLtnQdQX3pTNWrHgG4JzRp4nMrTDXu6mqn+ Hftg== X-Forwarded-Encrypted: i=1; AJvYcCUOeyIFcRMPkSFX4HvXiRJOYdnSs8Sc0uE3HgBWe+AB3t25boGacIa95p5YgAcySrl+9UIJtZrTW7nGfJWAM57VTqgFJnU= X-Gm-Message-State: AOJu0Yx5mGQRIoi1cWsPECi7aZg5gs0OZrFhbLSgHsq1Xrqps9cceryt k/Ve80/P1WETRS6Eh6eYgQaegryw97APmoZ6Yqaqfa/2bKpekTGHg89XtdKo+/iI7v+7ASJM1SH E46tpDphD6k2EKJODFDNiw0PyIZA= X-Google-Smtp-Source: AGHT+IFTE5CDPvuGhxOZn/YL7KOU9BihW4AlocQBIpYsNpI1nxUUVTJDjDeqx4yM0mStYMAmOazuW3EEzI9v2sd0Z/I= X-Received: by 2002:a05:6870:3306:b0:22d:fec2:86cc with SMTP id x6-20020a056870330600b0022dfec286ccmr4321229oae.41.1711803385895; Sat, 30 Mar 2024 05:56:25 -0700 (PDT) In-Reply-To: <87frw84iuc.fsf@yahoo.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282360 Archived-At: --000000000000bde1110614e048ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I just tried installing emacs yet again on a system. I used this script: ``` ( export PS4=3D'> ' setopt PIPE_FAIL PRINT_EXIT_VALUE ERR_RETURN SOURCE_TRACE XTRACE ## if test -n "${commands[brew]}" ; then export PATH=3D"$(perl -e 'print join(":", grep { index($_, "'"$(brew --prefix)"'") =3D=3D -1 } split(/:/, $ENV{PATH}))')" fi ## prefix_dir=3D~/emacs_ins mkdir -p "${prefix_dir}" cores_used=3D2 # url=3D' https://git.savannah.gnu.org/cgit/emacs.git/snapshot/emacs-c6cb6d8506916dd1= c17fba2d24ec63426c4afdbd.tar.gz ' url=3D'https://ftp.gnu.org/gnu/emacs/emacs-29.3.tar.gz' rm -rf ~/code/emacs_ins mkdir -p ~/code/emacs_ins cd ~/code/emacs_ins wget "$url" mkdir -p emacs tar xvzf emacs-*.tar.gz -C emacs --strip-components=3D1 #: You can use the `-C` option of the `tar` command to specify the directory where you want to extract the files. The `--strip-components=3D1` option will remove the top-level directory from the archive, so that the files are extracted directly into the `emacs` directory. cd emacs mkdir build && cd build config_opts=3D( --with-x-toolkit=3Dno --with-xpm=3Difavailable --with-jpeg=3Difavailable --with-gif=3Difavailable --with-tiff=3Difavailable --with-gnutls=3Difavailable ) ../configure --prefix=3D"${prefix_dir}" "${config_opts[@]}" make -j"${cores_used}" make -j"${cores_used}" install ) ``` I get this error (and this is after adding all those configure options which had previously caused errors): ``` checking for library containing tputs... no configure: error: The required function 'tputs' was not found in any library. The following libraries were tried (in order): libtinfo, libncurses, libterminfo, libcurses, libtermcap Please try installing whichever of these libraries is most appropriate for your system, together with its header files. For example, a libncurses-dev(el) or similar package. ``` So what should I do now? On Sat, Mar 30, 2024 at 4:49=E2=80=AFAM Po Lu wrote: > Rudi C writes: > > > My primary concern with your approach is that it requires numerous > > manual steps, each of which can introduce new points of failure. > > Would it be possible for you to provide a single script that I can run > > on Ubuntu (even on older versions with an outdated gcc, etc.) that > > will build Emacs under my home directory (~/)? > > Emacs supports "older operating systems" with "outdated GCC" (back to > 3.4.x) quite well, so I fail to see what the difficulty is with the > following two-liner: > > ./configure --prefix=3D$HOME > make -j `nproc` install > > which has been standard among autoconf-using programs since time > immemorial, if not earlier. > > > While I don't claim to have a deep understanding of these terms, my > > interpretation is that dynamic linking connects to the installed > > system libraries, making the binary heavily reliant on the specific > > conditions of its host operating system. > > This is not true or important, when two lines and a set of basic > development packages available on any self-respecting GNU/Linux > distribution should provide through their package repositories. > > > In contrast, a statically linked binary includes all of its > > dependencies within itself, allowing a single binary for Linux x86 to > > function on most other similar systems. A "portable" binary is one > > that can be downloaded using wget and executed without relying on any > > dependencies from the host operating system. Of course, no binary can > > be completely portable, and portability exists on a spectrum. However, > > some binaries are quite portable, such as those found at > > https://github.com/Mozilla-Ocho/llamafile. > > Statically linking against libc.a is inherently unreliable, but programs > dynamically linking against one specific version of the GNU C library, > and more often than not, other C libraries, will function normally on > systems with subsequent releases of the same. > > In any event, volunteers are welcome to provide such binary > distributions of Emacs, but, Emacs being a portable program without > numerous elusive dependencies or non-standard build systems, I very much > doubt the game will be worth the candle. > --000000000000bde1110614e048ea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I just tried installing emacs yet again on a system. I use= d this script:

```
(
export PS4=3D'>= '
setopt PIPE_FAIL PRINT_EXIT_VALUE ERR_RETURN SOURCE_TRACE XTRACE<= br>##
if test -n "${commands[brew]}" ; then
=C2=A0 =C2=A0 e= xport PATH=3D"$(perl -e 'print join(":", grep { index($_= , "'"$(brew --prefix)"'") =3D=3D -1 } split(/:/= , $ENV{PATH}))')"
fi
##
prefix_dir=3D~/emacs_ins
mkdir= -p "${prefix_dir}"

cores_used=3D2
# url=3D'https://git.savannah.gnu.org/cgit/emac= s.git/snapshot/emacs-c6cb6d8506916dd1c17fba2d24ec63426c4afdbd.tar.gz= 9;
url=3D'https://ftp.gnu.org/gnu/emacs/emacs-29.3.tar.gz'


rm -r= f ~/code/emacs_ins
mkdir -p ~/code/emacs_ins
cd ~/code/emacs_ins
<= br>wget "$url"
mkdir -p emacs
tar xvzf emacs-*.tar.gz -C em= acs --strip-components=3D1
#: You can use the `-C` option of the `tar` c= ommand to specify the directory where you want to extract the files. The `-= -strip-components=3D1` option will remove the top-level directory from the = archive, so that the files are extracted directly into the `emacs` director= y.

cd emacs

mkdir build && cd build

config_opt= s=3D(
=C2=A0--with-x-toolkit=3Dno
=C2=A0
=C2=A0--with-xpm=3Difavai= lable
=C2=A0--with-jpeg=3Difavailable
=C2=A0--with-gif=3Difavailable<= br>=C2=A0--with-tiff=3Difavailable
=C2=A0--with-gnutls=3Difavailable
= )
../configure --prefix=3D"${prefix_dir}" "${config_opts[= @]}"
make -j"${cores_used}"
make -j"${cores_used}= " install
)
```

I get this e= rror (and this is after adding all those configure options which had previo= usly caused errors):
```
checking for library containing tputs= ... no
configure: error: The required function 'tputs' was not f= ound in any library.
The following libraries were tried (in order):
= =C2=A0 libtinfo, libncurses, libterminfo, libcurses, libtermcap
Please t= ry installing whichever of these libraries is most appropriate
for your = system, together with its header files.
For example, a libncurses-dev(el= ) or similar package.
```

So what should I = do now?=C2=A0


On Sat, Mar 30, 2024 at 4:49=E2=80=AFAM P= o Lu <luangruo@yahoo.com> w= rote:
Rudi C <= ;rudiw= illalwaysloveyou@gmail.com> writes:

> My primary concern with your approach is that it requires numerous
> manual steps, each of which can introduce new points of failure.
> Would it be possible for you to provide a single script that I can run=
> on Ubuntu (even on older versions with an outdated gcc, etc.) that
> will build Emacs under my home directory (~/)?

Emacs supports "older operating systems" with "outdated GCC&= quot; (back to
3.4.x) quite well, so I fail to see what the difficulty is with the
following two-liner:

=C2=A0 ./configure --prefix=3D$HOME
=C2=A0 make -j `nproc` install

which has been standard among autoconf-using programs since time
immemorial, if not earlier.

> While I don't claim to have a deep understanding of these terms, m= y
> interpretation is that dynamic linking connects to the installed
> system libraries, making the binary heavily reliant on the specific > conditions of its host operating system.

This is not true or important, when two lines and a set of basic
development packages available on any self-respecting GNU/Linux
distribution should provide through their package repositories.

> In contrast, a statically linked binary includes all of its
> dependencies within itself, allowing a single binary for Linux x86 to<= br> > function on most other similar systems. A "portable" binary = is one
> that can be downloaded using wget and executed without relying on any<= br> > dependencies from the host operating system. Of course, no binary can<= br> > be completely portable, and portability exists on a spectrum. However,=
> some binaries are quite portable, such as those found at
> https://github.com/Mozilla-Ocho/llamafile.

Statically linking against libc.a is inherently unreliable, but programs dynamically linking against one specific version of the GNU C library,
and more often than not, other C libraries, will function normally on
systems with subsequent releases of the same.

In any event, volunteers are welcome to provide such binary
distributions of Emacs, but, Emacs being a portable program without
numerous elusive dependencies or non-standard build systems, I very much doubt the game will be worth the candle.
--000000000000bde1110614e048ea--