Subject: make bootstrap failing since 52b67740d10

From: Adam Sjøgren <[email-masked]>
Date: Sat, 01 Apr 2023 20:10:56 +0200

Hi,

When I try to build current master (f5891da70aa) of Emacs on Debian
unstable using this command:

  ./autogen.sh && ./configure -C --with-tree-sitter --with-xinput2 --without-pgtk --with-native-compilation=aot && make FAST=true -j12 bootstrap

It fails like this:

      ...
    ELC+ELN  org/org-goto.elc
    ELC+ELN  org/org-habit.elc

  In org-remove-timestamp-with-keyword:
  org.el:10218:14: Warning: ‘backward-delete-char’ is for interactive use only; use ‘delete-char’ instead.

  In org-fast-tag-selection:
  org.el:12009:22: Warning: ‘condition-case’ without handlers

  In org-delete-backward-char:
  org.el:16535:8: Warning: ‘backward-delete-char’ is for interactive use only; use ‘delete-char’ instead.
    ELC+ELN  org/org-id.elc
    ELC+ELN  org/org-indent.elc
    ELC+ELN  org/org-inlinetask.elc
    ELC+ELN  org/org-keys.elc
    ELC+ELN  org/org-lint.elc
    ELC+ELN  org/org-list.elc
    ELC+ELN  org/org-loaddefs.elc
    ELC+ELN  org/org-macs.elc
    ELC+ELN  org/org-mobile.elc
    ELC+ELN  org/org-mouse.elc
    ELC+ELN  org/org-num.elc
    ELC+ELN  org/org-pcomplete.elc
    ELC+ELN  org/org-persist.elc
    ELC+ELN  org/org-plot.elc
    ELC+ELN  org/org-protocol.elc
    ELC+ELN  org/org-refile.elc
    ELC+ELN  org/org-src.elc

  Error: native-ice ("org/org-plot.el" "block does not end with a branch" #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t) nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil 2) #s(comp-mvar (t) nil nil nil nil 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (call helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 4) plist-get) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t) nil nil nil nil 0)) (setimm #s(comp-mvar (t) nil nil nil nil 6) :transpose) (set #s(comp-mvar (t) nil nil nil nil 4) (callref funcall #s(comp-mvar (t) nil nil nil nil 4) #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t) nil nil nil nil 6))) (set #s(comp-mvar (t) nil nil nil nil 5) #s(comp-mvar (t) nil nil nil nil 4)) (setimm #s(comp-mvar (t) nil nil nil nil 6) #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (y 105 yes 105 t 105)))) nil nil nil nil #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil 1 72 nil nil) org-plot/gnuplot)
    mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0x5ee157d88517813>))
    debug-early-backtrace()
    debug-early(error (native-ice "org/org-plot.el" "block does not end with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6) #<hash-table eq 3/3 0x158fa72b618b>)) :closed nil :in-edges nil :out-edges nil :idom nil :df #<hash-table eql 0/65 0x158fa7483239> :post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil :no-ret nil) org-plot/gnuplot))
    signal(native-ice ("org/org-plot.el" "block does not end with a branch" #s(comp-block-lap :name bb_8 :insns ((comment "LAP TAG 83") (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) make-temp-file) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) "org-plot") (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 2) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) org-plot/goto-nearest-table) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) org-table-to-lisp) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 3))) (call helper_unbind_n #s(comp-mvar :typeset nil :valset nil :range ((1 . 1)) :neg nil :id nil :slot nil)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) plist-get) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 0)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6) :transpose) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) (callref funcall #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6))) (set #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 5) #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 4)) (setimm #s(comp-mvar :typeset (t) :valset nil :range nil :neg nil :id nil :slot 6) #<hash-table eq 3/3 0x158fa72b618b>)) :closed nil :in-edges nil :out-edges nil :idom nil :df #<hash-table eql 0/65 0x158fa7483239> :post-num nil :final-frame nil :sp 1 :addr 72 :non-ret-insn nil :no-ret nil) org-plot/gnuplot))
    comp--native-compile("org/org-plot.el")
    batch-native-compile()
    batch-byte+native-compile()
    command-line-1(("--eval" "(setq load-prefer-newer t byte-compile-warnings 'all)" "-l" "comp" "-f" "batch-byte+native-compile" "org/org-plot.el"))
    command-line()
    normal-top-level()
  Internal native compiler error: "org/org-plot.el", "block does not end with a branch", #s(comp-block-lap bb_8 ((comment "LAP TAG 83") (call helper_unbind_n #s(comp-mvar nil nil ((1 . 1)) nil nil nil)) (setimm #s(comp-mvar (t) nil nil nil nil 2) make-temp-file) (setimm #s(comp-mvar (t) nil nil nil nil 3) "org-plot") (set #s(comp-mvar (t) nil nil nil nil 2) (callref funcall #s(comp-mvar (t) nil nil nil nil 2) #s(comp-mvar (t) nil nil nil nil 3))) (call record_unwind_protect_excursion) (setimm #s(comp-mvar (t) nil nil nil nil 3) org-plot/goto-nearest-table) (set #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) (setimm #s(comp-mvar (t) nil nil nil nil 3) org-table-to-lisp) (set #s(comp-mvar (t) nil nil nil nil 3) (callref funcall #s(comp-mvar (t) nil nil nil nil 3))) ...) nil nil nil nil #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data ()) nil nil ...), #<symbol org-plot/gnuplot at 23521>
  make[4]: *** [Makefile:327: org/org-plot.elc] Error 255
  make[4]: *** Waiting for unfinished jobs....
  make[4]: Leaving directory '/tmp/emacs/lisp'
  make[3]: *** [Makefile:366: compile-main] Error 2
  make[3]: Leaving directory '/tmp/emacs/lisp'
  make[2]: *** [Makefile:533: lisp] Error 2
  make[2]: Leaving directory '/tmp/emacs'
  make[1]: *** [Makefile:1260: actual-bootstrap] Error 2
  make[1]: Leaving directory '/tmp/emacs'
  make[1]: Entering directory '/tmp/emacs'
  ***
  *** "make bootstrap" failed with exit status 2.
  ***
  *** You could try to:
  *** - run "make extraclean" and run "make" again (or, equivalently, run
  ***   "make bootstrap configure=default"), to rebuild Emacs with the
  ***   default configuration options, which might fix the problem
  *** - run "git clean -fdx" and run "make bootstrap" again, which might
  ***   fix the problem if "make bootstrap configure=default" did not
  ***   !BEWARE! "git clean -fdx" deletes all files that are not under
  ***   !BEWARE! version control, which means that all changes to such
  ***   !BEWARE! files will be lost and cannot be restored later
  *** - run "make V=1", which displays the full commands invoked by make,
  ***   to further investigate the problem
  *** - report the problem and ask for help by sending an email to
  ***   [email-masked], mentioning at least the build error
  ***   message, the platform, and the repository revision displayed by
  ***   "git rev-parse HEAD"
  ***
  make[1]: *** [Makefile:414: advice-on-failure] Error 2
  make[1]: Leaving directory '/tmp/emacs'
  make: *** [Makefile:1243: bootstrap] Error 2

I found 52b67740d10 using git bisect:

  52b67740d10df8ca539fdc2c7d50283997683141 is the first bad commit
  commit 52b67740d10df8ca539fdc2c7d50283997683141
  Author: Mattias Engdegård <[email-masked]>
  Date:   Sat Mar 25 15:38:00 2023 +0100

      Generalise a LAP optimisation rule

      * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
      Accept (stack-set 1) as equivalent to (discardN-preserve-tos 1) in a
      rule previously overlooked.  This is usually beneficial in code size
      and almost always shortens dynamic paths.

   lisp/emacs-lisp/byte-opt.el | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)

  Best regards,

    Adam

-- 
 "It's... It's a miracle! My personal gravity is back       Adam Sjøgren
  to normal!" "Glad to hear that. Now do your math."   [email-masked]