unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33394: 27.0.50; trampver cannot determine repository version
@ 2018-11-15  9:45 Geoffrey Ferrari
  2018-11-15 11:40 ` Michael Albinus
  2020-04-01  4:09 ` Clément Pit-Claudel
  0 siblings, 2 replies; 9+ messages in thread
From: Geoffrey Ferrari @ 2018-11-15  9:45 UTC (permalink / raw)
  To: 33394

[-- Attachment #1: Type: text/plain, Size: 7680 bytes --]

The error can be reproduced (after starting with 'emacs -Q') by running:

(require 'tramp)

This produces the error message:

Debugger entered--Lisp error: (file-missing "Setting current directory" "No
such file or directory"
"/build/emacs-snapshot-zZJlNJ/emacs-snapshot-201811...")
  call-process("git" nil (t nil) nil "rev-parse" "--abbrev-ref" "HEAD")

emacs-repository-branch-git("/build/emacs-snapshot-zZJlNJ/emacs-snapshot-201811...")
  emacs-repository-get-branch(nil)
  byte-code("\3011\21\0\302\30\303\304\305\306!\307\"!)0\207\210\310\207"
[inhibit-message (error) t emacs-repository-get-branch
locate-dominating-file locate-library "tramp" ".git" nil] 4)
  (defconst tramp-repository-branch (byte-code
"\3011\21\0\302\30\303\304\305\306!\307\"!)0\207\210\310\207"
[inhibit-message (error) t emacs-repository-get-branch
locate-dominating-file locate-library "tramp" ".git" nil] 4)
("/usr/share/emacs/27.0.50/lisp/net/trampver.elc" . 601))
  require(trampver)

byte-code("\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\310\312\313\314\315\316&\13\210\317\320\321\322\323DD\324\310\305\325\326&\7\210\317\327\321\322\330DD\331..."
[require tramp-compat trampver cl-lib custom-declare-group tramp nil "Edit
remote files with a combination of ssh, scp, ..." :group files comm :link
(custom-manual "(tramp)Top") :version "22.1" custom-declare-variable
tramp-mode funcall function #f(compiled-function () #<bytecode 0x13d8e7d>)
"Whether Tramp is enabled.\nIf it is set to nil, all..." :type boolean
tramp-verbose #f(compiled-function () #<bytecode 0x13d8e89>) "Verbosity
level for Tramp messages.\nAny level x in..." integer
tramp-backup-directory-alist #f(compiled-function () #<bytecode 0x13d8e95>)
"Alist of filename patterns and backup directory na..." (repeat (cons
(regexp :tag "Regexp matching filename") (directory :tag "Backup directory
name"))) tramp-auto-save-directory #f(compiled-function () #<bytecode
0x13d8ea1>) "Put auto-save files in this directory, if set.\nThe..."
(choice (const :tag "Use default" nil) (directory :tag "Auto save directory
name")) tramp-encoding-shell #f(compiled-function () #<bytecode 0x13d8eb5>)
"Use this program for encoding and decoding command..." (file :must-match
t) tramp-encoding-command-switch #f(compiled-function () #<bytecode
0x13d8ecd>) "Use this switch together with `tramp-encoding-shel..." string
tramp-encoding-command-interactive #f(compiled-function () #<bytecode
0x13d8ee1>) "Use this switch together with `tramp-encoding-shel..." "24.1"
(choice (const nil) string)] 12)
  require(tramp)
  eval((require 'tramp) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)


The issue can be traced to the definition of tramp-repository-branch in
trampver.el. This calls:

(emacs-repository-get-branch
(locate-dominating-file (locate-library "tramp") ".git"))

However, (locate-dominating-file (locate-library "tramp") ".git")
evaluates to nil, meaning that above is equivalent to
(emacs-repository-get-branch nil).

This causes the function emacs-repository-get-branch (in version.el) to
rely on the variable source-directory i.e. which references the source
directory where the emacs
binary was built, which of course does not exist on an end user's system.



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1)
 of 2018-11-11, unofficial emacs-snapshot build:
http://emacs.secretsauce.net built on lilbastard
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid

Recent messages:
Waiting for git...
Entering debugger...
Mark set
Back to top level
uncompressing trampver.el.gz...done
Note: file is write protected
Quit
Mark set
Quit
Mark activated

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/27.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.0.50/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/27.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.0.50/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-snapshot-zZJlNJ/emacs-snapshot-20181111+emacs-26.1-3391-ga004d3bbbae=.
-fstack-protector-strong
 -Wformat -Werror=format-security -Wall -fno-omit-frame-pointer'
 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF
XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LCMS2 GMP

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils jka-compr thingatpt help-fns
radix-tree cl-print debug backtrace help-mode easymenu find-func
tramp-compat tramp-loaddefs ucs-normalize shell pcomplete comint
ansi-color ring parse-time format-spec advice auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map seq byte-opt
gv bytecomp byte-compile cconv cl-loaddefs cl-lib elec-pair mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 225554 12946)
 (symbols 48 22184 1)
 (strings 32 34717 2545)
 (string-bytes 1 968285)
 (vectors 16 38460)
 (vector-slots 8 767680 15958)
 (floats 8 51 275)
 (intervals 56 852 6)
 (buffers 992 13))

[-- Attachment #2: Type: text/html, Size: 9864 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15  9:45 bug#33394: 27.0.50; trampver cannot determine repository version Geoffrey Ferrari
@ 2018-11-15 11:40 ` Michael Albinus
  2018-11-15 11:56   ` Geoffrey Ferrari
  2020-04-01  4:09 ` Clément Pit-Claudel
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2018-11-15 11:40 UTC (permalink / raw)
  To: Geoffrey Ferrari; +Cc: 33394

Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> writes:

Hi Geoffrey,

> The issue can be traced to the definition of tramp-repository-branch
> in
> trampver.el. This calls:
>
> (emacs-repository-get-branch
> (locate-dominating-file (locate-library "tramp") ".git"))
>
> However, (locate-dominating-file (locate-library "tramp") ".git")
> evaluates to nil, meaning that above is equivalent to
> (emacs-repository-get-branch nil).
>
> This causes the function emacs-repository-get-branch (in version.el)
> to
> rely on the variable source-directory i.e. which references the source
> directory where the emacs
> binary was built, which of course does not exist on an end user's
> system.

Yes. However, the initial value of tramp-repository-branch is

--8<---------------cut here---------------start------------->8---
  (ignore-errors
    ;; Suppress message from `emacs-repository-get-branch'.
    (let ((inhibit-message t))
      ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1.
      (with-no-warnings
	(emacs-repository-get-branch
	 (locate-dominating-file (locate-library "tramp") ".git")))))
--8<---------------cut here---------------end--------------->8---

I'm wondering why you see an error, although the code is wrapped by
`ignore-errors'.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15 11:40 ` Michael Albinus
@ 2018-11-15 11:56   ` Geoffrey Ferrari
  2018-11-15 12:56     ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Geoffrey Ferrari @ 2018-11-15 11:56 UTC (permalink / raw)
  To: michael.albinus; +Cc: 33394

[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

Thanks Michael. On further investigation, I've found that this minimal code
(after starting with emacs -Q) produces the same unexpected error:

(condition-case nil
(emacs-repository-get-branch nil)
  (error nil))

I don't think I can investigate further as condition-case is not a lisp
function.

Kind regards

Geoff

On Thu, 15 Nov 2018 at 11:40, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> writes:
>
> Hi Geoffrey,
>
> > The issue can be traced to the definition of tramp-repository-branch
> > in
> > trampver.el. This calls:
> >
> > (emacs-repository-get-branch
> > (locate-dominating-file (locate-library "tramp") ".git"))
> >
> > However, (locate-dominating-file (locate-library "tramp") ".git")
> > evaluates to nil, meaning that above is equivalent to
> > (emacs-repository-get-branch nil).
> >
> > This causes the function emacs-repository-get-branch (in version.el)
> > to
> > rely on the variable source-directory i.e. which references the source
> > directory where the emacs
> > binary was built, which of course does not exist on an end user's
> > system.
>
> Yes. However, the initial value of tramp-repository-branch is
>
> --8<---------------cut here---------------start------------->8---
>   (ignore-errors
>     ;; Suppress message from `emacs-repository-get-branch'.
>     (let ((inhibit-message t))
>       ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1.
>       (with-no-warnings
>         (emacs-repository-get-branch
>          (locate-dominating-file (locate-library "tramp") ".git")))))
> --8<---------------cut here---------------end--------------->8---
>
> I'm wondering why you see an error, although the code is wrapped by
> `ignore-errors'.
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 2519 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15 11:56   ` Geoffrey Ferrari
@ 2018-11-15 12:56     ` Michael Albinus
  2018-11-15 13:10       ` Geoffrey Ferrari
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2018-11-15 12:56 UTC (permalink / raw)
  To: Geoffrey Ferrari; +Cc: 33394

Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> writes:

Hi Geoffrey,

> Thanks Michael. On further investigation, I've found that this minimal
> code (after starting with emacs -Q) produces the same unexpected
> error:
>
> (condition-case nil
> (emacs-repository-get-branch nil)
>   (error nil))

You're right. After setting `default-directory' and `source-directory'
to "/not/existing" I see the same error. `call-process' seems to break
the `condition-case' jail.

> I don't think I can investigate further as condition-case is not a
> lisp function.

I've hardened trampver.el, committed to the master branch. Could you,
pls, check?

> Kind regards
>
> Geoff

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15 12:56     ` Michael Albinus
@ 2018-11-15 13:10       ` Geoffrey Ferrari
  2018-11-15 13:19         ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Geoffrey Ferrari @ 2018-11-15 13:10 UTC (permalink / raw)
  To: michael.albinus; +Cc: 33394

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Thanks, Michael.

I no longer get an error message with the new version of trampver, so this
seems to have fix it. Of course, the two constants tramp-repository-branch
and tramp-repository-version now both have the value nil on an end user
system, but I assume that's both acceptable and intended.

Kind regards,

Geoff

On Thu, 15 Nov 2018 at 12:57, Michael Albinus <michael.albinus@gmx.de>
wrote:

> Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> writes:
>
> Hi Geoffrey,
>
> > Thanks Michael. On further investigation, I've found that this minimal
> > code (after starting with emacs -Q) produces the same unexpected
> > error:
> >
> > (condition-case nil
> > (emacs-repository-get-branch nil)
> >   (error nil))
>
> You're right. After setting `default-directory' and `source-directory'
> to "/not/existing" I see the same error. `call-process' seems to break
> the `condition-case' jail.
>
> > I don't think I can investigate further as condition-case is not a
> > lisp function.
>
> I've hardened trampver.el, committed to the master branch. Could you,
> pls, check?
>
> > Kind regards
> >
> > Geoff
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 1744 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15 13:10       ` Geoffrey Ferrari
@ 2018-11-15 13:19         ` Michael Albinus
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Albinus @ 2018-11-15 13:19 UTC (permalink / raw)
  To: Geoffrey Ferrari; +Cc: 33394-done

Version: 27.1

Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> writes:

> Thanks, Michael.

Hi Geoffrey,

> I no longer get an error message with the new version of trampver, so
> this seems to have fix it. Of course, the two constants
> tramp-repository-branch and tramp-repository-version now both have the
> value nil on an end user system, but I assume that's both acceptable
> and intended.

Yes, that's all we could expect in that case.

Thanks for reporting and testing! I'm closing the bug.

> Kind regards,
>
> Geoff

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2018-11-15  9:45 bug#33394: 27.0.50; trampver cannot determine repository version Geoffrey Ferrari
  2018-11-15 11:40 ` Michael Albinus
@ 2020-04-01  4:09 ` Clément Pit-Claudel
  2020-04-01 10:13   ` Michael Albinus
  2020-04-01 13:03   ` Noam Postavsky
  1 sibling, 2 replies; 9+ messages in thread
From: Clément Pit-Claudel @ 2020-04-01  4:09 UTC (permalink / raw)
  To: 33394; +Cc: Michael Albinus

Thanks for the fix, Michael.

I'm still seeing a variant of this bug when git is not available:

$ PATH= /usr/local/bin/emacs -Q --batch --eval '(setq debug-on-error t)' --eval "(require 'tramp)"
Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "git")
  call-process("git" nil (t nil) nil "rev-parse" "--abbrev-ref" "HEAD")
  emacs-repository-branch-git("/build/emacs/master/")
  emacs-repository-get-branch("/build/emacs/master/")
  byte-code("\3021$\0\303\304\305\306!\307\"\206\17\0\10\1\31\211;\205\37\0\310\1!\205\37\0\311\1!)\266\2020\207\210\312\207" [source-directory inhibit-message (error) t locate-dominating-file locate-library "tramp" ".git" file-directory-p emacs-repository-get-branch nil] 4)
  (defconst tramp-repository-branch (byte-code "\3021$\0\303\304\305\306!\307\"\206\17\0\10\1\31\211;\205\37\0\310\1!\205\37\0\311\1!)\266\2020\207\210\312\207" [source-directory inhibit-message (error) t locate-dominating-file locate-library "tramp" ".git" file-directory-p emacs-repository-get-branch nil] 4) ("/usr/local/share/emacs/28.0.50/lisp/net/trampver.e..." . 601))
  require(trampver)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312\311\313\314\315\316\317&\13\207" [require tramp-compat tramp-integration trampver cl-lib custom-declare-group tramp nil "Edit remote files with a combination of ssh, scp, ..." :group files comm :link (custom-manual "(tramp)Top") :version "22.1"] 12)
  require(tramp)
  eval((require 'tramp) t)
  command-line-1(("--eval" "(setq debug-on-error t)" "--eval" "(require 'tramp)"))
  command-line()
  normal-top-level()

Btw, I'm not sure why that error escapes your ignore-errors form.

Clément.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2020-04-01  4:09 ` Clément Pit-Claudel
@ 2020-04-01 10:13   ` Michael Albinus
  2020-04-01 13:03   ` Noam Postavsky
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Albinus @ 2020-04-01 10:13 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 33394

Clément Pit-Claudel <cpitclaudel@gmail.com> writes:

Hi Clément,

> Thanks for the fix, Michael.
>
> I'm still seeing a variant of this bug when git is not available:
>
> Btw, I'm not sure why that error escapes your ignore-errors form.

Thanks for reporting. I've pushed a fix to master, which should avoid
this. I won't push it now to the emacs-27 branch, this will happen after
the release of Emacs 27.1.

The next ELPA version of Tramp, 2.4.3.4, will contain this patch.

> Clément.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#33394: 27.0.50; trampver cannot determine repository version
  2020-04-01  4:09 ` Clément Pit-Claudel
  2020-04-01 10:13   ` Michael Albinus
@ 2020-04-01 13:03   ` Noam Postavsky
  1 sibling, 0 replies; 9+ messages in thread
From: Noam Postavsky @ 2020-04-01 13:03 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 33394, Michael Albinus

Clément Pit-Claudel <cpitclaudel@gmail.com> writes:

> I'm still seeing a variant of this bug when git is not available:
>
> $ PATH= /usr/local/bin/emacs -Q --batch --eval '(setq debug-on-error t)' --eval "(require 'tramp)"
> Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "git")
>   call-process("git" nil (t nil) nil "rev-parse" "--abbrev-ref" "HEAD")
>   emacs-repository-branch-git("/build/emacs/master/")
>   emacs-repository-get-branch("/build/emacs/master/")
>   byte-code("\3021$\0\303\304\305\306!\307\"\206\17\0\10\1\31\211;\205\37\0\310\1!\205\37\0\311\1!)\266\2020\207\210\312\207"
> [source-directory inhibit-message (error) t locate-dominating-file
> locate-library "tramp" ".git" file-directory-p
> emacs-repository-get-branch nil] 4)
>   (defconst tramp-repository-branch (byte-code

> Btw, I'm not sure why that error escapes your ignore-errors form.

See https://debbugs.gnu.org/40109#8

Essentially, the innermost condition-case handler takes precedence.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-01 13:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-15  9:45 bug#33394: 27.0.50; trampver cannot determine repository version Geoffrey Ferrari
2018-11-15 11:40 ` Michael Albinus
2018-11-15 11:56   ` Geoffrey Ferrari
2018-11-15 12:56     ` Michael Albinus
2018-11-15 13:10       ` Geoffrey Ferrari
2018-11-15 13:19         ` Michael Albinus
2020-04-01  4:09 ` Clément Pit-Claudel
2020-04-01 10:13   ` Michael Albinus
2020-04-01 13:03   ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).