GNU bug report logs - #36001
26.2; compile-mode.el/compilation-mode spontaneous behaviour

Previous Next

Package: emacs;

Reported by: Evgeniy Dushistov <dushistov <at> mail.ru>

Date: Thu, 30 May 2019 09:50:01 UTC

Severity: normal

Tags: confirmed

Merged with 25133

Found in versions 26.0.50, 26.2

To reply to this bug, email your comments to 36001 AT debbugs.gnu.org.

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#36001; Package emacs. (Thu, 30 May 2019 09:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evgeniy Dushistov <dushistov <at> mail.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 30 May 2019 09:50:01 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.2; compile-mode.el/compilation-mode spontaneous behaviour
Date: Thu, 30 May 2019 12:49:36 +0300
Hi,

compile-mode.el (compilation-mode) works in really spontaneous way.

I run compilation via:

(defun rust-compile ()
  "Compile using `cargo build`"
  (interactive)
  (compile "cargo build"))
 
Sometimes errors are highlighted, sometimes aren't.
For example I run compilation, and the first error is not highlighted:

https://user-images.githubusercontent.com/156697/58186628-f013bf80-7cbd-11e9-956b-741e64fabbe6.png

Then I switch buffer '*compilation*' and run M-x compilation-mode,
and error is highlighted in the right way:

https://user-images.githubusercontent.com/156697/58186629-f013bf80-7cbd-11e9-88c4-7a1fc90b08d8.png

Also jump to the error via C-x ` sometimes doesn't work (emacs insitead of jump to code,
asks where find source file), but after I would switch to '*compilation*' and
run M-x compilation-mode, C-x ` works again. 

These are spontaneous errors, I have ~10 good cases,
when all works fine vs 1 bad case, when rending or jump to source location works
only for subset of errors/warnings.


In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
 of 2019-04-12 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Arch Linux

Recent messages:
Mark saved where search started
Mark set
Undo!
Mark set
Saving file /home/evgeniy/bigdisk1/projects/rust-infra/swig/macroslib/src/lib.rs...
Formatted buffer with rustfmt.
Wrote /home/evgeniy/bigdisk1/projects/rust-infra/swig/macroslib/src/lib.rs
Cargo-Process exited abnormally with code 101
Quit [3 times]
Making completion list...

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

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

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

Major mode: Rust

Minor modes in effect:
  diff-auto-refine-mode: t
  lsp-ui-mode: t
  lsp-ui-doc-mode: t
  lsp-ui-sideline-mode: t
  column-enforce-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  company-mode: t
  lsp--managed-mode: t
  lsp-mode: t
  flymake-mode: t
  override-global-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
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/evgeniy/.emacs.d/elpa/cmake-mode-20180709.1426/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec epa epg
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils rect pulse dabbrev company-lsp
misearch multi-isearch vc-git diff-mode company-oddmuse company-keywords
company-etags etags company-gtags company-dabbrev-code company-dabbrev
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-bbdb lsp-ui lsp-ui-doc goto-addr
lsp-ui-imenu lsp-ui-peek lsp-ui-sideline lsp-clients lsp-elm lsp-dart
lsp-clojure lsp-go lsp-xml lsp-css lsp-intelephense lsp-vetur lsp-html
lsp-solargraph lsp-rust lsp-pyls column-enforce-mode elec-pair paren
cus-start cus-load company-rtags company-template rtags repeat tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice asm-mode cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs bookmark
company edmacro kmacro ra-emacs-lsp derived lsp cargo cargo-process
lsp-mode ewoc markdown-mode color noutline outline tree-widget wid-edit
xref url-util spinner pcase network-stream puny nsm rmc starttls tls
gnutls inline imenu filenotify f s em-glob esh-util dash-functional
flymake-proc flymake compile comint ansi-color ring warnings thingatpt
project rust-mode json map req-package view req-package-cycles
req-package-args req-package-hooks ht log4e rx dash el-get
el-get-autoloading el-get-list-packages el-get-dependencies el-get-build
el-get-status pp el-get-methods el-get-fossil el-get-svn el-get-pacman
el-get-github-zip el-get-github-tar el-get-http-zip el-get-http-tar
el-get-hg el-get-go el-get-git-svn el-get-fink el-get-emacswiki
el-get-http el-get-notify el-get-emacsmirror el-get-github el-get-git
el-get-elpa el-get-darcs el-get-cvs el-get-bzr el-get-brew
el-get-builtin el-get-apt-get el-get-recipes el-get-byte-compile subr-x
el-get-custom cl-extra help-mode el-get-core autoload radix-tree
lisp-mnt dired dired-loaddefs use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core cl finder-inf info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util cyril-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 491650 111898)
 (symbols 48 40933 1)
 (miscs 40 1396 3515)
 (strings 32 117161 17565)
 (string-bytes 1 3238003)
 (vectors 16 64057)
 (vector-slots 8 1158194 111302)
 (floats 8 309 1019)
 (intervals 56 9184 4079)
 (buffers 992 26))

-- 
/Evgeniy




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36001; Package emacs. (Thu, 30 May 2019 11:41:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Evgeniy Dushistov <dushistov <at> mail.ru>
Cc: 36001 <at> debbugs.gnu.org
Subject: Re: bug#36001: 26.2;
 compile-mode.el/compilation-mode spontaneous behaviour
Date: Thu, 30 May 2019 12:40:09 +0100
Evgeniy Dushistov <dushistov <at> mail.ru> writes:

> compile-mode.el (compilation-mode) works in really spontaneous way.
>
> I run compilation via:
>
> (defun rust-compile ()
>   "Compile using `cargo build`"
>   (interactive)
>   (compile "cargo build"))
>  
> Sometimes errors are highlighted, sometimes aren't.
> For example I run compilation, and the first error is not highlighted:
>
> https://user-images.githubusercontent.com/156697/58186628-f013bf80-7cbd-11e9-956b-741e64fabbe6.png
>
> Then I switch buffer '*compilation*' and run M-x compilation-mode,
> and error is highlighted in the right way:
>
> https://user-images.githubusercontent.com/156697/58186629-f013bf80-7cbd-11e9-88c4-7a1fc90b08d8.png
>
> Also jump to the error via C-x ` sometimes doesn't work (emacs insitead of jump to code,
> asks where find source file), but after I would switch to '*compilation*' and
> run M-x compilation-mode, C-x ` works again. 
>
> These are spontaneous errors, I have ~10 good cases,
> when all works fine vs 1 bad case, when rending or jump to source location works
> only for subset of errors/warnings.

Are you able to reproduce these issues starting from 'emacs -Q'?

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36001; Package emacs. (Thu, 30 May 2019 12:02:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Evgeniy Dushistov <dushistov <at> mail.ru>
Cc: 36001 <at> debbugs.gnu.org
Subject: Re: bug#36001: 26.2;
 compile-mode.el/compilation-mode spontaneous behaviour
Date: Thu, 30 May 2019 08:01:18 -0400
Evgeniy Dushistov <dushistov <at> mail.ru> writes:

> These are spontaneous errors, I have ~10 good cases,
> when all works fine vs 1 bad case, when rending or jump to source location works
> only for subset of errors/warnings.

Could you evaluate the code below, and then post the contents of the
*trace-output* buffer after a bad case happens.

    (defun bug-36001-clear-trace (&rest _)
      (with-current-buffer trace-buffer
        (let ((inhibit-read-only t))
          (erase-buffer))))
    (advice-add 'compile :before #'bug-36001-clear-trace)
    (trace-function-background 'compilation-filter)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36001; Package emacs. (Thu, 30 May 2019 13:59:01 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 36001 <at> debbugs.gnu.org
Subject: Re: bug#36001: 26.2; compile-mode.el/compilation-mode spontaneous
 behaviour
Date: Thu, 30 May 2019 16:58:28 +0300
[Message part 1 (text/plain, inline)]
On Thu, May 30, 2019 at 08:01:18AM -0400, Noam Postavsky wrote:
> Evgeniy Dushistov <dushistov <at> mail.ru> writes:
> 
> > These are spontaneous errors, I have ~10 good cases,
> > when all works fine vs 1 bad case, when rending or jump to source location works
> > only for subset of errors/warnings.
> 
> Could you evaluate the code below, and then post the contents of the
> *trace-output* buffer after a bad case happens.
> 
>     (defun bug-36001-clear-trace (&rest _)
>       (with-current-buffer trace-buffer
>         (let ((inhibit-read-only t))
>           (erase-buffer))))
>     (advice-add 'compile :before #'bug-36001-clear-trace)
>     (trace-function-background 'compilation-filter)

I attached two files,
one is *trace-output* another is *compilation*,
the first error is not marked as error:

> error...
>   --> macroslib/src/lib.rs:428:27

I uses rust-mode, it adds some regexps to
compilation-error-regexp-alist-alist:

https://github.com/rust-lang/rust-mode/blob/master/rust-mode.el


-- 
/Evgeniy
[trace-output (text/plain, attachment)]
[compilation (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36001; Package emacs. (Thu, 30 May 2019 14:11:02 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 36001 <at> debbugs.gnu.org
Subject: Re: bug#36001: 26.2; compile-mode.el/compilation-mode spontaneous
 behaviour
Date: Thu, 30 May 2019 17:10:27 +0300
On Thu, May 30, 2019 at 12:40:09PM +0100, Basil L. Contovounesios wrote:
> Evgeniy Dushistov <dushistov <at> mail.ru> writes:
> 
> > compile-mode.el (compilation-mode) works in really spontaneous way.
> >
> > I run compilation via:
> >
> > (defun rust-compile ()
> >   "Compile using `cargo build`"
> >   (interactive)
> >   (compile "cargo build"))
> >  
> > Sometimes errors are highlighted, sometimes aren't.
> > For example I run compilation, and the first error is not highlighted:
> >
> > https://user-images.githubusercontent.com/156697/58186628-f013bf80-7cbd-11e9-956b-741e64fabbe6.png
> >
> > Then I switch buffer '*compilation*' and run M-x compilation-mode,
> > and error is highlighted in the right way:
> >
> > https://user-images.githubusercontent.com/156697/58186629-f013bf80-7cbd-11e9-88c4-7a1fc90b08d8.png
> >
> > Also jump to the error via C-x ` sometimes doesn't work (emacs insitead of jump to code,
> > asks where find source file), but after I would switch to '*compilation*' and
> > run M-x compilation-mode, C-x ` works again. 
> >
> > These are spontaneous errors, I have ~10 good cases,
> > when all works fine vs 1 bad case, when rending or jump to source location works
> > only for subset of errors/warnings.
> 
> Are you able to reproduce these issues starting from 'emacs -Q'?
> 

I can reproduce it with:
emacs -Q 
M-: (load "~/.emacs.d/elpa/rust-mode-20190517.2037/rust-mode.el")

and then 
M-x compile
cargo build <-- command to run rust code compilation

Interesting, that `cargo build` works in deterministic way, it produces
the same output for the same code set on the Rust language.
So the content of *compilation* buffer is always the same,
except of course:
Compilation started at ...
Compilation exited abnormally with code 101 ...

But sometimes it renders ok, sometimes bad.
And if I run 
M-x compile
cat /tmp/saved-compilation-buffer-content.txt

the *compilation* rendering is always fine, no errors.


-- 
/Evgeniy




Merged 25133 36001. Request was from npostavs <at> gmail.com to control <at> debbugs.gnu.org. (Thu, 30 May 2019 16:36:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36001; Package emacs. (Thu, 30 May 2019 16:36:02 GMT) Full text and rfc822 format available.

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

From: npostavs <at> gmail.com
To: Evgeniy Dushistov <dushistov <at> mail.ru>
Cc: 36001 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#36001: 26.2;
 compile-mode.el/compilation-mode spontaneous behaviour
Date: Thu, 30 May 2019 12:35:50 -0400
[Message part 1 (text/plain, inline)]
merge 36001 25133
quit

Evgeniy Dushistov <dushistov <at> mail.ru> writes:

> the first error is not marked as error:
>
>> error...
>>   --> macroslib/src/lib.rs:428:27
>
> I uses rust-mode, it adds some regexps to
> compilation-error-regexp-alist-alist:
>
> https://github.com/rust-lang/rust-mode/blob/master/rust-mode.el

Thanks, I attach a simple reproducer based on this, run as

    emacs -Q -l bug-36001-reproducer.el -f bug-36001-reproducer

[bug-36001-reproducer.el (text/plain, attachment)]
[Message part 3 (text/plain, inline)]
The basic problem is that rust-mode is using a multiline regexp, so it's
the same bug#25133.

This bug report was last modified 6 years and 22 days ago.

Previous Next


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