GNU bug report logs - #66111
is there a problem with --prefix?

Previous Next

Package: emacs;

Reported by: Ambrose Kofi Laing <aklaing <at> gmail.com>

Date: Wed, 20 Sep 2023 01:41:01 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66111 in the body.
You can then email your comments to 66111 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66111; Package emacs. (Wed, 20 Sep 2023 01:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ambrose Kofi Laing <aklaing <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 20 Sep 2023 01:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ambrose Kofi Laing <aklaing <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: is there a problem with --prefix?
Date: Tue, 19 Sep 2023 13:59:26 -0400
[Message part 1 (text/plain, inline)]
Hello,

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=/home/myname/my/custom/emacs29
> --with-native-compilation=aot --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=''/usr/local/bin/'' \
ELN_DESTDIR='/usr/local/lib/emacs/29.1/' all

And I don't think it should be trying to put anything under those two
directories?

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?

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 ?

Thanks for any pointers,

Ambrose

ps.

myhost:emacs-29.1$ make install
> make -C lib all
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lib'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lib'
> make -C lib-src all
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lib-src'
> make[1]: Nothing to be done for 'all'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lib-src'
> make -C src BIN_DESTDIR=''/usr/local/bin/'' \
> ELN_DESTDIR='/usr/local/lib/emacs/29.1/' all
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/src'
> make -C ../admin/charsets all
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make -C ../admin/unidata charscript.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'charscript.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/unidata emoji-zwj.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'emoji-zwj.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/unidata all EMACS="../../src/bootstrap-emacs"
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/charsets cp51932.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'cp51932.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make -C ../admin/charsets eucjp-ms.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'eucjp-ms.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/src'
> make -C lisp all
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make -C ../leim all EMACS="../src/emacs"
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/leim'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/leim'
> make -C ../admin/grammars all EMACS="../../src/emacs"
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/grammars'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/grammars'
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make[2]: Nothing to be done for 'compile-targets'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
>   GEN      autoloads
>   INFO     Scraping files for loaddefs...
>   INFO     Scraping files for loaddefs...done
>   INFO     Scraping files for loaddefs...
>   INFO     Scraping files for loaddefs...done
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make[2]: Nothing to be done for 'compile-targets'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/leim'
> make[2]: Nothing to be done for 'generate-ja-dic'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/leim'
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make[2]: Nothing to be done for 'compile-targets'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/misc'
> make[2]: 'org.texi' is up to date.
> make[2]: 'modus-themes.texi' is up to date.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/misc'
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/lisp'
> make -C doc/lispref info
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/lispref'
> make[1]: Nothing to be done for 'info'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/lispref'
> make -C doc/lispintro info
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/lispintro'
> make[1]: Nothing to be done for 'info'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/lispintro'
> make -C doc/emacs info
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/emacs'
> make[1]: Nothing to be done for 'info'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/emacs'
> make -C doc/misc info
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/misc'
> make[1]: Nothing to be done for 'info'.
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/doc/misc'
> make -C src BIN_DESTDIR=''/usr/local/bin/''
> ELN_DESTDIR='/usr/local/lib/emacs/29.1/'
> make[1]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/src'
> make -C ../admin/charsets all
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make -C ../admin/unidata charscript.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'charscript.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/unidata emoji-zwj.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'emoji-zwj.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/unidata all EMACS="../../src/bootstrap-emacs"
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/unidata'
> make -C ../admin/charsets cp51932.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'cp51932.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make -C ../admin/charsets eucjp-ms.el
> make[2]: Entering directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[2]: Nothing to be done for 'eucjp-ms.el'.
> make[2]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/admin/charsets'
> make[1]: Leaving directory
> '/home/myname/my/custom/emacs29/src/emacs-29.1/src'
> umask 022; /usr/bin/mkdir -p "/usr/local/share/info"
> /usr/bin/mkdir: cannot create directory ‘/usr/local/share/info’:
> Permission denied
> make: *** [Makefile:779: install-info] Error 1
> myhost:emacs-29.1$
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66111; Package emacs. (Wed, 20 Sep 2023 12:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 66111 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ambrose Kofi Laing <aklaing <at> gmail.com>
Cc: 66111 <at> debbugs.gnu.org
Subject: Re: bug#66111: is there a problem with --prefix?
Date: Wed, 20 Sep 2023 15:30:52 +0300
> From: Ambrose Kofi Laing <aklaing <at> gmail.com>
> 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=/home/myname/my/custom/emacs29 --with-native-compilation=aot -
>  -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=''/usr/local/bin/'' \
> ELN_DESTDIR='/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='$(DESTDIR)${bindir}/'
  ELN_DESTDIR = $(DESTDIR)${libdir}/emacs/${version}/
  else
  BIN_DESTDIR='${ns_appbindir}/'
  ELN_DESTDIR = ${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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66111; Package emacs. (Wed, 20 Sep 2023 18:04:01 GMT) Full text and rfc822 format available.

Message #11 received at 66111 <at> debbugs.gnu.org (full text, mbox):

From: Ambrose Kofi Laing <aklaing <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 66111 <at> debbugs.gnu.org
Subject: Re: bug#66111: is there a problem with --prefix?
Date: Wed, 20 Sep 2023 13:04:02 -0400
[Message part 1 (text/plain, inline)]
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 "set
  -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 was
  no Makefile, make ran configure (without arguments) to generate a
Makefile,
  and naturally this invocation of configure did not include my setting of
  --prefix=/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 being
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 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Ambrose Kofi Laing <aklaing <at> gmail.com>
> > 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=/home/myname/my/custom/emacs29
> --with-native-compilation=aot -
> >  -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=''/usr/local/bin/'' \
> > ELN_DESTDIR='/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='$(DESTDIR)${bindir}/'
>   ELN_DESTDIR = $(DESTDIR)${libdir}/emacs/${version}/
>   else
>   BIN_DESTDIR='${ns_appbindir}/'
>   ELN_DESTDIR = ${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.
>
[Message part 2 (text/html, inline)]

Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sat, 30 Sep 2023 23:30:02 GMT) Full text and rfc822 format available.

Notification sent to Ambrose Kofi Laing <aklaing <at> gmail.com>:
bug acknowledged by developer. (Sat, 30 Sep 2023 23:30:03 GMT) Full text and rfc822 format available.

Message #16 received at 66111-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Ambrose Kofi Laing <aklaing <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 66111-done <at> debbugs.gnu.org
Subject: Re: bug#66111: is there a problem with --prefix?
Date: Sat, 30 Sep 2023 16:29:15 -0700
Ambrose Kofi Laing <aklaing <at> gmail.com> writes:

> 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 "set
>   -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 was
>   no Makefile, make ran configure (without arguments) to generate a Makefile,
>   and naturally this invocation of configure did not include my setting of
>   --prefix=/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 being
> 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!!

The issue seems resolved, so I'm closing the bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Oct 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.