unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
@ 2021-11-07 16:19 dick.r.chiang
  2021-11-07 16:24 ` Lars Ingebrigtsen
  2021-11-07 17:25 ` Andy Moreton
  0 siblings, 2 replies; 5+ messages in thread
From: dick.r.chiang @ 2021-11-07 16:19 UTC (permalink / raw)
  To: 51665

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-electric-tests-can-no-longer-by-byte-compiled.patch --]
[-- Type: text/x-diff, Size: 1363 bytes --]

From 386db51dab930280a6d2ce5f46583913bce279e5 Mon Sep 17 00:00:00 2001
From: dickmao <dick.r.chiang@gmail.com>
Date: Sun, 7 Nov 2021 11:01:59 -0500
Subject: [PATCH] electric-tests can no longer by byte compiled

As much as I enjoy this scut work, I'm happy for patch authors to
validate changes via a self-administered testing system.  So-called
CI (continuous integration) systems require a paradigm shift from
Wall-esque patches to branch-based schemes, however.

While such a shift could appear daunting, all that is really required
is an email from leadership to start submitting changesets to Github
or Gitlab.  The leveraging of nonfree infrastructure, while at odds
with GNU dogma, would be as salutary and expeditious as a flat-earther
resigning himself to a modern vaccine.

* test/lisp/electric-tests.el: Avoid byte compiling.
---
 test/lisp/electric-tests.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 686641c1b3..c3d5d25d2b 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -999,4 +999,9 @@ electric-layout-mode-newline-between-parens-without-e-p-m-2
     (should (equal (buffer-string) "int main () {\n  \n}"))))
 
 (provide 'electric-tests)
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
+
 ;;; electric-tests.el ends here
-- 
2.26.2


[-- Attachment #2: Type: text/plain, Size: 7281 bytes --]




In Commercial Emacs 28.0.50 (build 23, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
 of 2021-11-07 built on dick
Repository revision: 06a65356ee535b54c513fef6e8689ea383da5ea2
Repository branch: dev
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.4 LTS

Configured using:
 'configure --prefix=/home/dick/.local --with-tree-sitter 'CFLAGS=-g3 -O2
 -I/home/dick/.local/include/' LDFLAGS=-L/home/dick/.local/lib
 PKG_CONFIG_PATH=/home/dick/.local/lib/pkgconfig'
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
TREE-SITTER LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM GTK3 ZLIB
Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Magit

Minor modes in effect:
  async-bytecomp-package-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  projectile-mode: t
  flx-ido-mode: t
  override-global-mode: t
  global-hl-line-mode: t
  winner-mode: t
  tooltip-mode: t
  show-paren-mode: t
  mouse-wheel-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
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode
/home/dick/.emacs.d/elpa/hydra-20170924.2259/lv hides /home/dick/.emacs.d/elpa/lv-20191106.1238/lv
/home/dick/.emacs.d/elpa/magit-3.3.0/magit-section-pkg hides /home/dick/.emacs.d/elpa/magit-section-3.3.0/magit-section-pkg
/home/dick/org-gcal.el/org-gcal hides /home/dick/.emacs.d/elpa/org-gcal-0.3/org-gcal
/home/dick/.emacs.d/lisp/json hides /home/dick/emacs/lisp/json
/home/dick/.emacs.d/elpa/transient-0.3.6/transient hides /home/dick/emacs/lisp/transient
/home/dick/.emacs.d/elpa/hierarchy-20171221.1151/hierarchy hides /home/dick/emacs/lisp/emacs-lisp/hierarchy

Features:
(shadow sort bbdb-message footnote mail-extr emacsbug sendmail make-mode rect
pulse eieio-opt speedbar ezimage dframe shortdoc cc-langs cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
help-fns radix-tree find-func magit-extras mule-util ag vc-svn find-dired
face-remap magit-patch-changelog magit-patch magit-submodule magit-obsolete
magit-popup async-bytecomp async magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff
git-commit log-edit pcvs-util add-log magit-core magit-margin magit-transient
magit-process with-editor server magit-mode transient gnus-notifications
gnus-fun notifications gnus-kill gnus-dup disp-table utf-7 mm-archive
url-cache misearch multi-isearch vc-git diff-mode vc-dispatcher bug-reference
tramp-archive tramp-gvfs tramp-cache zeroconf nnrss nnfolder nndiscourse
benchmark rbenv nnhackernews nntwitter nntwitter-api bbdb-gnus gnus-demon nntp
nnmairix nnml nnreddit gnus-topic url-http url-auth url-gw network-stream
gnutls nsm request virtualenvwrapper gud s json-rpc python tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete
ls-lisp format-spec gnus-score score-mode gnus-bcklg gnus-srvr gnus-cite
anaphora bbdb-mua bbdb-com bbdb bbdb-site timezone gnus-delay gnus-draft
gnus-cache gnus-agent gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime
dig gnus-sum shr kinsoku svg dom nndraft nnmh gnus-group mm-url gnus-undo
use-package use-package-delight use-package-diminish gnus-start gnus-dbus dbus
xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message yank-media rmc puny dired-x dired
dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win paredit-ext
paredit subed subed-vtt subed-srt subed-common subed-mpv subed-debug
subed-config inf-ruby ruby-mode smie company pcase haskell-interactive-mode
haskell-presentation-mode haskell-process haskell-session haskell-compile
haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation
haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support noutline outline flymake-proc
flymake warnings etags fileloop generator xref project dabbrev
haskell-customize hydra lv use-package-ensure solarized-theme
solarized-definitions projectile lisp-mnt mail-parse rfc2231 ibuf-ext ibuffer
ibuffer-loaddefs thingatpt magit-autorevert autorevert filenotify magit-git
magit-section magit-utils crm dash rx grep compile comint ansi-color gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils text-property-search time-date flx-ido flx
google-translate-default-ui google-translate-core-ui facemenu color ido
google-translate-core google-translate-tk google-translate-backend
use-package-bind-key bind-key auto-complete easy-mmode advice edmacro kmacro
popup cus-edit pp cus-load wid-edit emms-player-mplayer emms-player-simple
emms emms-compat cl-extra use-package-core derived hl-line winner ring
help-mode finder-inf json-reformat-autoloads json-snatcher-autoloads
sml-mode-autoloads tornado-template-mode-autoloads info package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt
bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tree-sitter tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer
select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer 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
emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple
abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp
files window 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 cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 924019 149092)
 (symbols 48 40983 2)
 (strings 32 184227 36524)
 (string-bytes 1 6445698)
 (vectors 16 98473)
 (vector-slots 8 2603918 139526)
 (floats 8 1998 2420)
 (intervals 56 7261 1570)
 (buffers 992 39))

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

* bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
  2021-11-07 16:19 bug#51665: 28.0.50; [PATCH] Get electric-tests to pass dick.r.chiang
@ 2021-11-07 16:24 ` Lars Ingebrigtsen
  2021-11-07 18:31   ` Jim Porter
  2021-11-07 17:25 ` Andy Moreton
  1 sibling, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-07 16:24 UTC (permalink / raw)
  To: dick.r.chiang; +Cc: 51665

dick.r.chiang@gmail.com writes:

> Subject: [PATCH] electric-tests can no longer by byte compiled

Isn't that the bug, though?  We've been trying to find out why.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
  2021-11-07 16:19 bug#51665: 28.0.50; [PATCH] Get electric-tests to pass dick.r.chiang
  2021-11-07 16:24 ` Lars Ingebrigtsen
@ 2021-11-07 17:25 ` Andy Moreton
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Moreton @ 2021-11-07 17:25 UTC (permalink / raw)
  To: 51665

On Sun 07 Nov 2021, dick.r.chiang@gmail.com wrote:

> From 386db51dab930280a6d2ce5f46583913bce279e5 Mon Sep 17 00:00:00 2001
> From: dickmao <dick.r.chiang@gmail.com>
> Date: Sun, 7 Nov 2021 11:01:59 -0500
> Subject: [PATCH] electric-tests can no longer by byte compiled
>
> As much as I enjoy this scut work, I'm happy for patch authors to
> validate changes via a self-administered testing system.  So-called
> CI (continuous integration) systems require a paradigm shift from
> Wall-esque patches to branch-based schemes, however.
>
> While such a shift could appear daunting, all that is really required
> is an email from leadership to start submitting changesets to Github
> or Gitlab.  The leveraging of nonfree infrastructure, while at odds
> with GNU dogma, would be as salutary and expeditious as a flat-earther
> resigning himself to a modern vaccine.

Please stop writing this snide and sneering commentary, as you have done
in many recent messages. 

Whatever your views are on the philosophy, code base or working style
of the project, a commit message is not the right place for that.

Please learn to communicate in a less unpleasant style.

   AndyM







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

* bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
  2021-11-07 16:24 ` Lars Ingebrigtsen
@ 2021-11-07 18:31   ` Jim Porter
  2021-11-07 20:19     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Porter @ 2021-11-07 18:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen, dick.r.chiang; +Cc: 51665

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

On 11/7/2021 8:24 AM, Lars Ingebrigtsen wrote:
> dick.r.chiang@gmail.com writes:
> 
>> Subject: [PATCH] electric-tests can no longer by byte compiled
> 
> Isn't that the bug, though?  We've been trying to find out why.

I've been tinkering with this and I *think* the issue is with the hook I 
added at global scope:

   (add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))

In the attached patch, I moved this into a fixture function for the 
`whitespace-chomping-dont-cross-comments' test and it works for me (i.e. 
electric-tests pass both with and without byte-compilation). Hopefully 
this resolves the issue, though I'm unclear on *why* this was occurring 
in the first place; maybe there's a bug in the byte-compiler...?

(As an aside, I vaguely recall adding that hook at global scope because 
multiple tests failed without it, but it was a while since I wrote that 
patch and I may be misremembering. In any case, it seems that at least 
today, changing the comment style is only needed for that one test, so I 
think it makes sense to do it in a fixture solely for that test.)

[-- Attachment #2: 0001-Fix-electric-tests.patch --]
[-- Type: text/plain, Size: 1381 bytes --]

From 6df04751816f268124b3fab19ef5c9d2cd983002 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Sun, 7 Nov 2021 10:22:54 -0800
Subject: [PATCH] ; Fix electric-tests

* test/lisp/electric-tests.el
(whitespace-chomping-dont-cross-comments):
Move 'c-toggle-comment-style' to here.
---
 test/lisp/electric-tests.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 686641c1b3..1e32dbfb60 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -32,9 +32,6 @@
 (require 'elec-pair)
 (require 'cl-lib)
 
-;; When running tests in c-mode, use single-line comments (//).
-(add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))
-
 (defun call-with-saved-electric-modes (fn)
   (let ((saved-electric (if electric-pair-mode 1 -1))
         (saved-layout (if electric-layout-mode 1 -1))
@@ -431,7 +428,9 @@ whitespace-chomping-dont-cross-comments
   :bindings '((electric-pair-skip-whitespace . chomp))
   :test-in-strings nil
   :test-in-code nil
-  :test-in-comments t)
+  :test-in-comments t
+  :fixture-fn (lambda () (when (eq major-mode 'c-mode)
+                           (c-toggle-comment-style -1))))
 
 (define-electric-pair-test whitespace-skipping-for-quotes-not-outside
   "  \"  \"" "\"-----" :expected-string "\"\"  \"  \""
-- 
2.25.1


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

* bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
  2021-11-07 18:31   ` Jim Porter
@ 2021-11-07 20:19     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-07 20:19 UTC (permalink / raw)
  To: Jim Porter; +Cc: 51665, dick.r.chiang

Jim Porter <jporterbugs@gmail.com> writes:

> I've been tinkering with this and I *think* the issue is with the hook
> I added at global scope:
>
>   (add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))

In general, doing an add-hook with a non-symbol function isn't
supported -- it may end up adding the function more than once if it
first loads the uncompiled file, and then loads the compiled file, I
think?  (Because the lambda will have been turned into a byte-code
object.)  So it seems logical that inhibiting byte compilation also made
the problem go away.

Anyway, your patch is the right fix here, so I've pushed it to Emacs 29
now.

> (As an aside, I vaguely recall adding that hook at global scope
> because multiple tests failed without it, but it was a while since I
> wrote that patch and I may be misremembering. In any case, it seems
> that at least today, changing the comment style is only needed for
> that one test, so I think it makes sense to do it in a fixture solely
> for that test.)

Seems to work for me too here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-11-07 20:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-07 16:19 bug#51665: 28.0.50; [PATCH] Get electric-tests to pass dick.r.chiang
2021-11-07 16:24 ` Lars Ingebrigtsen
2021-11-07 18:31   ` Jim Porter
2021-11-07 20:19     ` Lars Ingebrigtsen
2021-11-07 17:25 ` Andy Moreton

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).