From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ambrose Kofi Laing Newsgroups: gmane.emacs.bugs Subject: bug#66111: is there a problem with --prefix? Date: Wed, 20 Sep 2023 13:04:02 -0400 Message-ID: References: <83sf79auwz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000077e6760605cd5d0d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15160"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66111@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 20 20:04:13 2023 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 1qj1Yb-0003hV-D9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Sep 2023 20:04:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qj1YJ-00026X-0S; Wed, 20 Sep 2023 14:03:55 -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 1qj1YG-00023N-KS for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 14:03:52 -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 1qj1YG-0006Os-CP for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 14:03:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qj1YP-0006lF-SE for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 14:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ambrose Kofi Laing Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2023 18:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66111 X-GNU-PR-Package: emacs Original-Received: via spool by 66111-submit@debbugs.gnu.org id=B66111.169523301125938 (code B ref 66111); Wed, 20 Sep 2023 18:04:01 +0000 Original-Received: (at 66111) by debbugs.gnu.org; 20 Sep 2023 18:03:31 +0000 Original-Received: from localhost ([127.0.0.1]:60342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj1Xs-0006kC-5l for submit@debbugs.gnu.org; Wed, 20 Sep 2023 14:03:31 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:56648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj0co-00050H-MI for 66111@debbugs.gnu.org; Wed, 20 Sep 2023 13:04:32 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5041bb9ce51so128700e87.1 for <66111@debbugs.gnu.org>; Wed, 20 Sep 2023 10:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695229455; x=1695834255; 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=DNewmM+nznPGQyiL9GwKeK1YGxK/m8NRLvRQb71Gm0A=; b=bdwmSPMsyn1PsXWCzFyp9BMtoITGIzXqWz/OPfs4FYgXXXsDd3YSo30v9dW2p2+r+I X6GUyCYfNVUDr3bDOlmyo1MQgseanz22fsc8LRgZAJfYbPDsfs1JuEFJKqUxpMJBVj59 jq+18s7C5xze04jEtc81u8irSNEamWTpUFYjcKvIm/NYfGPZbg07WV1MweuiZNWHcJUD P8QhkSynftj8QK2XPLFvYo/PhVyU56mm6aLHsyOOMkjQLPskS7keZouuZztQDMjgsZE7 rAsM6vkwngpvQAzz2BLn07/P+rdrBN5MYGiBZrgUReznDbNQCH7QkuTQbcXeL/GBN9iU GNbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695229455; x=1695834255; 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=DNewmM+nznPGQyiL9GwKeK1YGxK/m8NRLvRQb71Gm0A=; b=u6CQlf5j1n7YzM2k+QI0303TubWhgMsFqru+MuzWQHFpzYB4BQ2WELOhpdu8uuixMv BHqGk4tQOPZRFz8fZ5M7DWDHjHCvU+lVU+eIjJQPSALze6n9DqEuqB2IDFgIbHja6IPF P+ZWrbT5LwNjhg343yoqEoLPhA5NauclgYRYZ9Zzznj8fSXw997tHyaCyHc0KTiSOq2P F8pK8B6imquN1JZf/sgljokl9M2LbLMb+XmFw2LehjJ0/4LDLtwZR+VjWoUFxpdInmzW OOo/iAE9QHKo9hEKjovEmBkdqxr9z9oOHhU0FQCMhrWOsdt4EVT5l5dXu3OKZtrlHTlO qNeQ== X-Gm-Message-State: AOJu0YzX1FTA7VuU3ZUn3t+zV/pRHPRsfECANZ1txLI1Crfxc81P81EN 5bFyayUp0MnyyblIZIwhEvEM0YkI0vzoBt0FJD4= X-Google-Smtp-Source: AGHT+IGQViajQSJl2N2VF4c0DixMRWsqW+t4t5SQqH6nhCgsAxxpIY9ijwwa4E9Cbs7ITeWKhQuIIVa6maXcw2eDJcE= X-Received: by 2002:a19:9110:0:b0:502:fd08:69f7 with SMTP id t16-20020a199110000000b00502fd0869f7mr2751371lfd.28.1695229454835; Wed, 20 Sep 2023 10:04:14 -0700 (PDT) In-Reply-To: <83sf79auwz.fsf@gnu.org> X-Mailman-Approved-At: Wed, 20 Sep 2023 14:03:27 -0400 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:270941 Archived-At: --00000000000077e6760605cd5d0d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Eli, Thanks for your response. I was indeed building from the tarball. I commented out the autogen.sh call, and still the installation went into /usr/local, instead of to the /nonstandard/location. So that was not the only problem. After fiddling with it some more I discovered the following (sequence of errors): - One of the arguments to my configure script was: --with-tree-sitter - libtree-sitter-dev was not available on my system [First Mistake] - I was running configure inside a bash shell script, and I had not put "se= t -e" at the top of that bash script. [Second Mistake] - As a result, configure correctly detected that libtree-sitter was missing and failed (and did not produce a Makefile). - Since I hadn't "set -e", the bash script went on ahead to run make anyway= , instead of stopping right there. - make did not find a Makefile, but found a GNUMakefile, and since there wa= s no Makefile, make ran configure (without arguments) to generate a Makefile, and naturally this invocation of configure did not include my setting of --prefix=3D/nonstandard/location from the previous call which failed. - Finally when the install happened, it went into /usr/local instead of /nonstandard/location. - To fix, this, I have to provide tree-sitter obviously, but the quick fix was to remove --with-tree-sitter from the arguments of configure. - Once that was done, configure ran correctly and generated a Makefile, I would assume including my setting of /nonstandard/location. By this time I had removed the autogen.sh call. - Then running configure and make and make install installed correctly to /nonstandard/location. So technically there is nothing wrong, but I can't help wondering if it would not be more helpful for the GNUMakefile to echo a message saying "I can't find a Makefile, please run configure yourself to generate one", instead of bein= g helpful and trying to run configure for me and not quite doing it the way I wanted. I know however that things like GNUMakefiles have a lot of history and this behavior is probably unlikely to change. Anyway, I'm all set now, thank you for your help!! Best, Ambrose On Wed, Sep 20, 2023 at 8:30=E2=80=AFAM Eli Zaretskii wrote: > > From: Ambrose Kofi Laing > > Date: Tue, 19 Sep 2023 13:59:26 -0400 > > > > I'm trying to install emacs_29.1 at a nonstandard location, with the > following commands: > > > > cd src/emacs-29.1 > > ./autogen.sh > > ./configure --prefix=3D/home/myname/my/custom/emacs29 > --with-native-compilation=3Daot - > > -with-imagemagick --with-json --with-tree-sitter --with-xft > --without-compress-install > > make -j 4 > > > > and I get an error message because of permission denied while trying to > write under /usr/local (that is > > where the script stops). In addition, there are two locations where it > says the following: > > > > make -C src BIN_DESTDIR=3D''/usr/local/bin/'' \ > > ELN_DESTDIR=3D'/usr/local/lib/emacs/29.1/' all > > I don't see how this could have happened. BIN_DESTDIR and ELN_DESTDIR > are set in the top-level Makefile.ion like this: > > ifeq (${ns_self_contained},no) > BIN_DESTDIR=3D'$(DESTDIR)${bindir}/' > ELN_DESTDIR =3D $(DESTDIR)${libdir}/emacs/${version}/ > else > BIN_DESTDIR=3D'${ns_appbindir}/' > ELN_DESTDIR =3D ${ns_applibdir}/ > endif > > Are you building the NS build on macOS? If not, the upper part of the > conditional above should be true for you, and the values should have > obeyed the --prefix value you used at configure time. > > However, I don't understand why you ran autogen.sh. Are you building > from the Emacs 29.1 release tarball? If so, the configure script is > already produced and provided in the tarball, you just need to run it. > Could you please unpack the Emacs 29.1 tarball in a fresh directory, > run the configure script without running autogen.sh, and then say > "make" and "make install", and see if the problem still happens. > > > This happens twice (please see below the ps under my signature for the > full transcript of "make > > install" to see the exact context in which it happens). It seems to be > that the --prefix does not override > > certain locations that it is supposed to? > > It should, and I see the code to do that in Makefile.in, so I wonder > why it didn't happen for you. > > > Are there other variables I need to set (other than the --prefix option > to configure) that will ensure that > > the compilation and installation will not try to write under /usr/local= ? > > Please show the part of top-level Makefile where bindir and other > variables are set. > --00000000000077e6760605cd5d0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,

Th= anks for your response.=C2=A0 I was indeed building from the tarball.
=

I commented out the autogen.sh call, and still the inst= allation went into
/usr/local, instead of to the /nonstandard/location.= =C2=A0 So that was not the only
problem.=C2=A0 After fiddling wit= h it some more I discovered the following (sequence of errors):

- On= e of the arguments to my configure script was: --with-tree-sitter

- = libtree-sitter-dev was not available on my system [First Mistake]

- = I was running configure inside a bash shell script, and I had not put "= ;set
=C2=A0 -e" at the top of that bash script. [Second Mistake]
- As a result, configure correctly detected that libtree-sitter was mi= ssing and failed (and did not produce a Makefile).

- Since I hadn= 9;t "set -e", the bash script went on ahead to run make anyway,=C2=A0 instead of stopping right there.

- make did not find a Make= file, but found a GNUMakefile, and since there was
=C2=A0 no Makefile, m= ake ran configure (without arguments) to generate a Makefile,
=C2=A0 and= naturally this invocation of configure did not include my setting of
= =C2=A0 --prefix=3D/nonstandard/location from the previous call which failed= .

- Finally when the install happened, it went into /usr/local inste= ad of
=C2=A0 /nonstandard/location.

- To fix, this, I have to pro= vide=C2=A0 tree-sitter obviously, but the quick
=C2=A0 fix was to remove= --with-tree-sitter from the arguments of configure.

- Once that was= done, configure ran correctly and generated a Makefile, I
=C2=A0 would = assume including my setting of /nonstandard/location.=C2=A0 By this time I = had removed the autogen.sh call.

- Then running configure and make a= nd make install installed correctly to
=C2=A0 /nonstandard/location.
=
So technically there is nothing wrong, but I can't help wondering i= f it would
not be more helpful for the GNUMakefile to echo a message say= ing "I can't find
a Makefile, please run configure yourself to = generate one", instead of being
helpful and trying to run configure= for me and not quite doing it the way I
wanted.=C2=A0 I know however th= at things like GNUMakefiles have a lot of history
and this behavior is p= robably unlikely to change.

Anyway, I'm all set now, thank you f= or your help!!

Best,

Ambrose

On = Wed, Sep 20, 2023 at 8:30=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ambrose Kofi Laing <aklaing@gmail.com>
> Date: Tue, 19 Sep 2023 13:59:26 -0400
>
> I'm trying to install emacs_29.1 at a nonstandard location, with t= he following commands:
>
>=C2=A0 cd src/emacs-29.1
>=C2=A0 ./autogen.sh
>=C2=A0 ./configure --prefix=3D/home/myname/my/custom/emacs29 --with-nat= ive-compilation=3Daot -
>=C2=A0 -with-imagemagick --with-json --with-tree-sitter --with-xft --wi= thout-compress-install
>=C2=A0 make -j 4
>
> and I get an error message because of permission denied while trying t= o write under /usr/local (that is
> where the script stops).=C2=A0 In addition, there are two locations wh= ere it says the following:
>
> make -C src BIN_DESTDIR=3D''/usr/local/bin/'' \
> ELN_DESTDIR=3D'/usr/local/lib/emacs/29.1/' all

I don't see how this could have happened.=C2=A0 BIN_DESTDIR and ELN_DES= TDIR
are set in the top-level Makefile.ion like this:

=C2=A0 ifeq (${ns_self_contained},no)
=C2=A0 BIN_DESTDIR=3D'$(DESTDIR)${bindir}/'
=C2=A0 ELN_DESTDIR =3D $(DESTDIR)${libdir}/emacs/${version}/
=C2=A0 else
=C2=A0 BIN_DESTDIR=3D'${ns_appbindir}/'
=C2=A0 ELN_DESTDIR =3D ${ns_applibdir}/
=C2=A0 endif

Are you building the NS build on macOS?=C2=A0 If not, the upper part of the=
conditional above should be true for you, and the values should have
obeyed the --prefix value you used at configure time.

However, I don't understand why you ran autogen.sh.=C2=A0 Are you build= ing
from the Emacs 29.1 release tarball?=C2=A0 If so, the configure script is already produced and provided in the tarball, you just need to run it.
Could you please unpack the Emacs 29.1 tarball in a fresh directory,
run the configure script without running autogen.sh, and then say
"make" and "make install", and see if the problem still= happens.

> This happens twice (please see below the ps under my signature for the= full transcript of "make
> install" to see the exact context in which it happens).=C2=A0 It = seems to be that the --prefix does not override
> certain locations that it is supposed to?

It should, and I see the code to do that in Makefile.in, so I wonder
why it didn't happen for you.

> Are there other variables I need to set (other than the --prefix optio= n to configure) that will ensure that
> the compilation and installation will not try to write under /usr/loca= l ?

Please show the part of top-level Makefile where bindir and other
variables are set.
--00000000000077e6760605cd5d0d--