Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magit-transient.el has differing checksums when compiled with straight when compared to (byte-compile-file) #1081

Open
sethidden opened this issue Apr 23, 2023 · 9 comments
Labels

Comments

@sethidden
Copy link

sethidden commented Apr 23, 2023

Hello.

This is an issue related to the findings found in this comment: magit/magit#4676 (comment)

In the linked issue, the straight-generated .elc files make the issue appear, but manually running (byte-compile-file) to replace the straight .elc file resolves the issue.

This brings me here, thinking straight may be causing this.

Repro steps:

  1. Install magit:
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
	(url-retrieve-synchronously
	 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
	 'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)

; in my case this is in literate org config, but I don't think that affects this issue
(use-package magit :straight t)
  1. Wait for straight to build the package
  2. Go to ~/.emacs.d/straight/build/magit and run md5sum magit-transient.elc to see the hash of the .elc file generated by byte compilation in straight.el
  3. Go back to emacs and run (byte-compile-file "~/.emacs.d/straight/build/magit/magit-transient.el")
  4. Run md5sum magit-transient.elc again to see the md5 sum of the file generated by manual byte-compile-file
  5. Result: The md5sums are different

I'm layman when it comes to Emacs, but here are some things that I've found that could be useful:

  • The transient--with-supsended-override that causes the magit error is a macro: https://github.com/magit/transient/blob/0ae0de43590b5b6984a83f9e044e7c426455ac6e/lisp/transient.el#L2162

  • There seems to be some special handling of macros in straight? I lack the proper judgement here

    straight.el/straight.el

    Lines 65 to 67 in 039e5c9

    ;; Note that we use `eval-and-compile' even for macros, because
    ;; otherwise libraries which load the byte-compiled version of this
    ;; file won't be able to use those macros.

  • It's possible to diff two binary files like this, but I'm not sure if it could be useful:
    cmp -l emacs-transient.elc.straight emacs-transient.elc.byte-compile-file | gawk '{printf %08X %02X %02Xn, , strtonum(0), strtonum(0)}'

@progfolio
Copy link
Contributor

Thanks for the report and reproduction case.
Unfortunately, I'm unable to reproduce this with Emacs 30 on my end.
Could you try evaluating the following test case in your *scratch* buffer?
It will install everything in a temporary, clean test environment and automates the steps you've listed above. When it finishes, the *straight-bug-report-process* should pop up. Please share the entire buffer contents here.

Test Case
(straight-bug-report
  :user-dir "straight.magit-byte-comp"
  :post-bootstrap 
  (straight-use-package 'magit)
  (let*
      ((default-directory
        (straight--build-dir "magit"))
       (f
        (expand-file-name "./magit-transient.elc")))
    (message "straight.el: %s"
             (with-temp-buffer
               (insert-file-contents f)
               (secure-hash 'md5
                            (buffer-substring-no-properties
                             (point-min)
                             (point-max)))))
    (delete-file f)
    (cl-assert
     (not
      (file-exists-p f)))
    (byte-compile-file
     (substring f 0 -1))
    (message "bytecomp.el: %s"
             (with-temp-buffer
               (insert-file-contents f)
               (secure-hash 'md5
                            (buffer-substring-no-properties
                             (point-min)
                             (point-max)))))))
  • Test run at: 2023-04-23 09:10:52
  • system-type: gnu/linux
  • straight-version: prerelease (HEAD -> master, origin/master, origin/develop, origin/HEAD, develop) 039e5c9 2023-03-12
  • emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.8) of 2023-04-14
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/master, origin/develop, origin/HEAD) 039e5c9 2023-03-12
Cloning magit...
Cloning magit...done
Building magit...
Building magit → Cloning compat...
Building magit → Cloning compat...done
Building magit → Building compat...
Building magit → Building compat...done
Building magit → Cloning dash.el...
Building magit → Cloning dash.el...done
Building magit → Building dash...
Building magit → Building dash...done
Building magit → Building git-commit...
Building magit → Building git-commit → Cloning transient...
Building magit → Building git-commit → Cloning transient...done
Building magit → Building git-commit → Building transient...
Building magit → Building git-commit → Building transient...done
Building magit → Building git-commit → Cloning with-editor...
Building magit → Building git-commit → Cloning with-editor...done
Building magit → Building git-commit → Building with-editor...
Building magit → Building git-commit → Building with-editor...done
Building magit → Building git-commit...
Building magit → Building git-commit...done
Building magit → Building magit-section...
Building magit → Building magit-section...done
Building magit...
Building magit...done

straight.el: 6346c5dc72b73b49e028b91f03af5509
bytecomp.el: 6346c5dc72b73b49e028b91f03af5509
Packages:
"straight"                n/a                  develop 039e5c9 2023-03-12
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 989fc42a 2023-04-17
"gnu-elpa-mirror"         n/a                  master dcae75c 2023-04-10
"nongnu-elpa"             n/a                  main 0120f3d 2023-03-14
"el-get"                  melpa                master 22c83206 2023-03-19
"emacsmirror-mirror"      n/a                  master a6e6b49 2023-04-17
"magit"                   melpa                main 158c13a7 2023-04-23
"compat"                  gnu-elpa-mirror      master 2748abd 2023-04-20
"dash"                    melpa                master b6eef1a 2023-04-16
"git-commit"              melpa                main 158c13a7 2023-04-23
"transient"               melpa                main 0ae0de4 2023-03-15
"with-editor"             melpa                main df74385 2023-04-12
"magit-section"           melpa                main 158c13a7 2023-04-23

@sethidden
Copy link
Author

I see, thanks for the handy script :)

Here are my results:

Test Case
(straight-bug-report
  :user-dir "straight.magit-byte-comp"
  :post-bootstrap 
  (straight-use-package 'magit)
  (let*
      ((default-directory
	 (straight--build-dir "magit"))
       (f
	(expand-file-name "./magit-transient.elc")))
    (message "straight.el: %s"
	     (with-temp-buffer
	       (insert-file-contents f)
	       (secure-hash 'md5
			    (buffer-substring-no-properties
			     (point-min)
			     (point-max)))))
    (delete-file f)
    (cl-assert
     (not
      (file-exists-p f)))
    (byte-compile-file
     (substring f 0 -1))
    (message "bytecomp.el: %s"
	     (with-temp-buffer
	       (insert-file-contents f)
	       (secure-hash 'md5
			    (buffer-substring-no-properties
			     (point-min)
			     (point-max)))))))
  • Test run at: 2023-04-23 15:12:56
  • system-type: gnu/linux
  • straight-version: prerelease (HEAD -> master, origin/master, origin/develop, origin/HEAD) 039e5c9 2023-03-12
  • emacs-version: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6) of 2023-01-03
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/master, origin/develop, origin/HEAD) 039e5c9 2023-03-12
Cloning magit...
Cloning magit...done
Building magit...
Building magit → Cloning compat...
Building magit → Cloning compat...done
Building magit → Building compat...
Building magit → Building compat...done
Building magit → Cloning dash.el...
Building magit → Cloning dash.el...done
Building magit → Building dash...
Building magit → Building dash...done
Building magit → Building git-commit...
Building magit → Building git-commit → Cloning transient...
Building magit → Building git-commit → Cloning transient...done
Building magit → Building git-commit → Building transient...
Building magit → Building git-commit → Building transient...done
Building magit → Building git-commit → Cloning with-editor...
Building magit → Building git-commit → Cloning with-editor...done
Building magit → Building git-commit → Building with-editor...
Building magit → Building git-commit → Building with-editor...done
Building magit → Building git-commit...
Building magit → Building git-commit...done
Building magit → Building magit-section...
Building magit → Building magit-section...done
Building magit...
Building magit...done

straight.el: c72ce88c6712e5857a8bb1d3b89d02aa
bytecomp.el: e8a3d9f20bddb44eb1e6cdd5b2b20758
Packages:
"straight"                n/a                  develop 039e5c9 2023-03-12
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 989fc42a 2023-04-17
"gnu-elpa-mirror"         n/a                  master dcae75c 2023-04-10
"nongnu-elpa"             n/a                  main 0120f3d 2023-03-14
"el-get"                  melpa                master 22c83206 2023-03-19
"emacsmirror-mirror"      n/a                  master a6e6b49 2023-04-17
"magit"                   melpa                main 158c13a7 2023-04-23
"compat"                  gnu-elpa-mirror      master 2748abd 2023-04-20
"dash"                    melpa                master b6eef1a 2023-04-16
"git-commit"              melpa                main 158c13a7 2023-04-23
"transient"               melpa                main 0ae0de4 2023-03-15
"with-editor"             melpa                main df74385 2023-04-12
"magit-section"           melpa                main 158c13a7 2023-04-23

@progfolio
Copy link
Contributor

Thanks for running the test. It does confirm that the output of the two elc files are different on your version of Emacs. Can you try running the following test case to see if your original error is still reproducible? This one will launch an interactive Emacs session, install everything, and call magit-remote in magit's repo. Then you can try your modifying the URL to see if the error is thrown.

(straight-bug-report
  :user-dir "straight.magit-byte-comp.interactive"
  :interactive t
  :preserve t
  :post-bootstrap
  (straight-use-package 'magit)
  (let ((default-directory (straight--repos-dir "magit")))
    (call-interactively #'magit-remote)))

@sethidden
Copy link
Author

sethidden commented Apr 23, 2023

Unfortunately the error is still reproducible. I ran the script, and when the transient opened, I pressed "s" (to edit pushRemote git variable), typed in "foo" and pressed enter, which caused the error.

Messages buffer of the opened Emacs session
For information about GNU Emacs and the GNU system, type C-h C-a.
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for nongnu-elpa recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...done
Test run with version: prerelease (HEAD -> develop, origin/master, origin/develop, origin/HEAD) 039e5c9 2023-03-12
Cloning magit...done
Building magit...
Building magit → Cloning compat...done
Building magit → Building compat...done
Building magit → Cloning dash.el...done
Building magit → Building dash...done
Building magit → Building git-commit...
Building magit → Building git-commit → Cloning transient...done
Building magit → Building git-commit → Building transient...done
Building magit → Building git-commit → Cloning with-editor...done
Building magit → Building git-commit → Building with-editor...done
Building magit → Building git-commit...done
Building magit → Building magit-section...done
Building magit...done
Turning on magit-auto-revert-mode...done
Packages:
"straight"                n/a                  develop 039e5c9 2023-03-12
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 989fc42a 2023-04-17
"gnu-elpa-mirror"         n/a                  master dcae75c 2023-04-10
"nongnu-elpa"             n/a                  main 0120f3d 2023-03-14
"el-get"                  melpa                master 22c83206 2023-03-19
"emacsmirror-mirror"      n/a                  master a6e6b49 2023-04-17
"magit"                   melpa                main 158c13a7 2023-04-23
"compat"                  gnu-elpa-mirror      master 2748abd 2023-04-20
"dash"                    melpa                master b6eef1a 2023-04-16
"git-commit"              melpa                main 158c13a7 2023-04-23
"transient"               melpa                main 0ae0de4 2023-03-15
"with-editor"             melpa                main df74385 2023-04-12
"magit-section"           melpa                main 158c13a7 2023-04-23

Invalid function: transient--with-suspended-override
Quit

@sethidden
Copy link
Author

sethidden commented Apr 23, 2023

In the opened emacs session, there's also a perhaps useful error message in the straight-byte-compilation buffer

In end of data:
magit-transient.el:85:6: Warning: the function
    ‘transient--with-suspended-override’ is not known to be defined.
magit-section-pkg.el:1:2: Warning: the function ‘define-package’ is not known
    to be defined.
straight-byte-compilation in the opened Emacs session
$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/straight/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/straight/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/straight/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/straight/straight-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/straight/straight-ert-print-hack.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/straight/straight-x.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/straight/straight.el...
Done (Total of 3 files compiled, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/compat/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/compat/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/compat/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-25.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-26.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-27.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-28.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-29.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-macs.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat-tests.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/compat/compat.el...
Done (Total of 6 files compiled, 3 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/dash/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/dash/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/dash/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/dash/dash-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/dash/dash.el...
Done (Total of 1 file compiled, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/transient/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/transient/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/transient/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/transient/transient-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/transient/transient.el...
Done (Total of 1 file compiled, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/with-editor/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/with-editor/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/with-editor/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/with-editor/with-editor-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/with-editor/with-editor.el...
Done (Total of 1 file compiled, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/git-commit-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/git-commit-pkg.el...

In end of data:
git-commit-pkg.el:1:2: Warning: the function ‘define-package’ is not known to
    be defined.
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/git-commit/git-commit.el...

In toplevel form:
git-commit.el:130:1: Error: Cannot open load file: No such file or directory, magit-section
Done (Total of 1 file compiled, 1 failed, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/magit-section-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/magit-section-pkg.el...

In end of data:
magit-section-pkg.el:1:2: Warning: the function ‘define-package’ is not known
    to be defined.
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit-section/magit-section.el...
Done (Total of 2 files compiled, 1 skipped)

$ /usr/bin/emacs -Q -L /tmp/straight.magit-byte-comp.interactive/straight/build/magit/ --batch --eval \
 "(let ((default-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/\"))
  (normal-top-level-add-subdirs-to-load-path)
  (byte-recompile-directory \"/tmp/straight.magit-byte-comp.interactive/straight/build/magit/\" 0 'force))"
Checking /tmp/straight.magit-byte-comp.interactive/straight/build/magit/...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/git-rebase.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-apply.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-autoloads.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-autorevert.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-base.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-bisect.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-blame.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-bookmark.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-branch.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-bundle.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-clone.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-commit.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-core.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-diff.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-ediff.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-extras.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-fetch.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-files.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-git.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-gitignore.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-log.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-margin.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-merge.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-mode.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-notes.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-patch.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-pkg.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-process.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-pull.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-push.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-reflog.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-refs.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-remote.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-repos.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-reset.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-sequence.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-sparse-checkout.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-stash.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-status.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-submodule.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-subtree.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-tag.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-transient.el...

In end of data:
magit-transient.el:85:6: Warning: the function
    ‘transient--with-suspended-override’ is not known to be defined.
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-wip.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit-worktree.el...
Compiling /tmp/straight.magit-byte-comp.interactive/straight/build/magit/magit.el...
Done (Total of 45 files compiled, 1 skipped)

EDIT: Switching to Emacs 30 (emacs-git in AUR) makes the magit problem disappear

@sethidden
Copy link
Author

@progfolio If applicable, could you please re-tag this issue as bug instead of support?

@raxod502
Copy link
Member

Do we know what range of Emacs versions this happens with? Can you post the two versions of the byte-compiled file?

@progfolio progfolio added bug and removed support labels May 27, 2023
@sethidden
Copy link
Author

sethidden commented Nov 10, 2023

Sorry for disappearing. I can't repro this on Emacs 29 anymore (stable ver at time I'm writing). Should I close it or would you like me to install Emacs 28 and post some more info?

Test case from #1081 (comment) ran on Emacs 29 (stable):

Test Case
(straight-bug-report
  :user-dir "straight.magit-byte-comp"
  :post-bootstrap 
  (straight-use-package 'magit)
  (let*
      ((default-directory
	(straight--build-dir "magit"))
       (f
	(expand-file-name "./magit-transient.elc")))
    (message "straight.el: %s"
	     (with-temp-buffer
	       (insert-file-contents f)
	       (secure-hash 'md5
			    (buffer-substring-no-properties
			     (point-min)
			     (point-max)))))
    (delete-file f)
    (cl-assert
     (not
      (file-exists-p f)))
    (byte-compile-file
     (substring f 0 -1))
    (message "bytecomp.el: %s"
	     (with-temp-buffer
	       (insert-file-contents f)
	       (secure-hash 'md5
			    (buffer-substring-no-properties
			     (point-min)
			     (point-max)))))))
  • Test run at: 2023-11-10 19:33:02
  • system-type: darwin
  • straight-version: prerelease (HEAD -> master, origin/master, origin/HEAD) 9b11112 2023-08-08
  • emacs-version: GNU Emacs 29.1 (build 2, aarch64-apple-darwin22.6.0, NS appkit-2299.70 Version 13.5.2 (Build 22G91)) of 2023-09-25
Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Looking for gnu-elpa-mirror recipe -> Cloning melpa...
Looking for gnu-elpa-mirror recipe -> Cloning melpa...done
Looking for nongnu-elpa recipe -> Cloning gnu-elpa-mirror...
Looking for nongnu-elpa recipe -> Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe -> Cloning nongnu-elpa...
Looking for emacsmirror-mirror recipe -> Cloning nongnu-elpa...done
Looking for emacsmirror-mirror recipe -> Cloning el-get...
Looking for emacsmirror-mirror recipe -> Cloning el-get...done
Looking for straight recipe -> Cloning emacsmirror-mirror...
Looking for straight recipe -> Cloning emacsmirror-mirror...done
Building straight...
Building straight...done

Test run with version: prerelease (HEAD -> develop, origin/develop) b3760f5 2023-10-21
Cloning magit...
Cloning magit...done
Building magit...
Building magit -> Cloning compat...
Building magit -> Cloning compat...done
Building magit -> Building compat...
Building magit -> Building compat -> Cloning seq...
Building magit -> Building compat -> Cloning seq...done
Building magit -> Building compat -> Building seq...
Building magit -> Building compat -> Building seq...done
Building magit -> Building compat...
Building magit -> Building compat...done
Building magit -> Cloning dash.el...
Building magit -> Cloning dash.el...done
Building magit -> Building dash...
Building magit -> Building dash...done
Building magit -> Building git-commit...
Building magit -> Building git-commit -> Cloning transient...
Building magit -> Building git-commit -> Cloning transient...done
Building magit -> Building git-commit -> Building transient...
Building magit -> Building git-commit -> Building transient...done
Building magit -> Building git-commit -> Cloning with-editor...
Building magit -> Building git-commit -> Cloning with-editor...done
Building magit -> Building git-commit -> Building with-editor...
Building magit -> Building git-commit -> Building with-editor...done
Building magit -> Building git-commit...
Building magit -> Building git-commit...done
Building magit -> Building magit-section...
Building magit -> Building magit-section...done
Building magit...
Building magit...done

straight.el: 287207f7d84dbd0c76a95c3036e1b56c
bytecomp.el: 287207f7d84dbd0c76a95c3036e1b56c
Packages:
"straight"                n/a                  develop b3760f5 2023-10-21
"org-elpa"                n/a                  n/a
"melpa"                   n/a                  master 99a54ba0 2023-11-10
"gnu-elpa-mirror"         n/a                  master 3e9da80 2023-11-08
"nongnu-elpa"             n/a                  main e9d06c3 2023-11-07
"el-get"                  melpa                master a5ba5852 2023-10-20
"emacsmirror-mirror"      n/a                  master f0ec948 2023-11-07
"magit"                   melpa                main 02630b51 2023-11-09
"compat"                  gnu-elpa-mirror      master 8aa70e8 2023-11-08
"seq"                     gnu-elpa-mirror      master 4355cde 2023-09-10
"dash"                    melpa                master 6db80c7 2023-08-01
"git-commit"              melpa                main 02630b51 2023-11-09
"transient"               melpa                main b4a2963 2023-11-04
"with-editor"             melpa                main fcd186d 2023-09-17
"magit-section"           melpa                main 02630b51 2023-11-09

EDIT 12 Nov 2023: Can't repro this on Emacs 28.2 as I used to. Maybe because I'm on Mac. I'll test at the original machine when I can access it in a week

@raxod502
Copy link
Member

Up to you - it is okay to leave it open in case someone else comes along who can help, we will probably close eventually if that never happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants