-
Notifications
You must be signed in to change notification settings - Fork 151
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
Comments
Thanks for the report and reproduction case. 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)))))))
OutputBootstrapping 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
|
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)))))))
OutputBootstrapping 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
|
Thanks for running the test. It does confirm that the output of the two (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))) |
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
|
In the opened emacs session, there's also a perhaps useful error message in the straight-byte-compilation buffer
straight-byte-compilation in the opened Emacs session
EDIT: Switching to Emacs 30 (emacs-git in AUR) makes the magit problem disappear |
@progfolio If applicable, could you please re-tag this issue as bug instead of support? |
Do we know what range of Emacs versions this happens with? Can you post the two versions of the byte-compiled file? |
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)))))))
OutputBootstrapping 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 |
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. |
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:
magit
:~/.emacs.d/straight/build/magit
and runmd5sum magit-transient.elc
to see the hash of the .elc file generated by byte compilation in straight.el(byte-compile-file "~/.emacs.d/straight/build/magit/magit-transient.el")
md5sum magit-transient.elc
again to see the md5 sum of the file generated by manual byte-compile-fileI'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#L2162There 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
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)}'
The text was updated successfully, but these errors were encountered: