#1110127 emacs still native compiles vm files, breaks calling VM mode

#1110127#5
Date:
2025-07-30 10:59:46 UTC
From:
To:
Using VM and Emacs 1:30.1+1-6 on trixie.


The package vm does not manage to disable the native compilation of
the vm files although these three equal files
/etc/emacs/site-start.d/50vm.el
/usr/share/emacs/site-lisp/vm.in/vm-init.el
/usr/share/emacs/site-lisp/vm/vm-init.el
include code to disable it:
sets (add-to-list deny-list "/vm.*\\.el"))))

It's known, that the VM related .el files should not be native
compiled, but the code does not work for me on trixie.


When starting emacs this variable is set correctly:
native-comp-jit-compilation-deny-list is a variable defined in ‘comp-run.el’.
Its value is ("/vm.*\\.el")
Original value was nil


During the first start of emacs only two files

vm-vars-ad20775e-4324f36e.eln
vm-version-b3914858-f21047de.eln

are created, but when entering the VM mode
additional vm-* files are created:

vm-macro-ec3583de-6ca893e2.eln
vm-message-1742e25e-f28ea9a7.eln
vm-misc-279b86ec-9d6dd826.eln
vm-vars-ad20775e-4324f36e.eln
vm-version-b3914858-f21047de.eln


After exiting emacs and starting again, entering the VM mode
it fails with:
Symbol’s value as variable is void: vm-update-virtual-messages

This makes the VM mode unusable.

My current workaround is to disable the whole compilation, after I've
once have all files compiled and manually removed the vm* files in the
eln cache. I'm using this in my ~/.emacs:
(setq native-comp-jit-compilation nil)


I'm happy to help debugging this futher detail if you tell me how I can do this.

#1110127#10
Date:
2025-07-30 12:31:08 UTC
From:
To:
Thomas Lange writes ("Bug#1110127: emacs still native compiles vm files, breaks calling VM mode"):

Hi.

Are you on amd64?  I don't know why this works for me, and in the
autopkgtest, and not for you.

Do you have a formal Steps to Reproduce that start with a clean trixie
chroot ?

I would welcome any help you (or anyone else) can give me to debug
this.  I'm not really an expert on this area of Emacs.

Thanks for sharing.

Hrm.  I wish I knew where to start.  I will see if some of the Debian
Emacs maintainers can help...

Ian.

#1110127#15
Date:
2025-07-30 12:45:58 UTC
From:
To:
    >> Using VM and Emacs 1:30.1+1-6 on trixie.

    > Are you on amd64?  I don't know why this works for me, and in the
    > autopkgtest, and not for you.
Yes, I'm on amd64.

    > Do you have a formal Steps to Reproduce that start with a clean trixie
    > chroot ?
I will try with an empty ~/.emacs am empty ~/.vm during the next days.

#1110127#20
Date:
2025-07-30 15:26:10 UTC
From:
To:
Hello Thomas,

I don't know why this is happening, but I thought I'd mention that I'd
run something like

    find /usr/share/emacs -name "vm*.elc"

to look for stale .elc files.  We've been having some issues with that
for buster->bookworm->trixie upgrades.

#1110127#25
Date:
2025-08-01 10:16:50 UTC
From:
To:
I did not found any stale vm files after I did
apt purge vm.


A new trixie installation in a KVM virtual machine shows the same problem.

First start of emacs creates
vm-vars-ad20775e-4324f36e.eln
vm-version-b3914858-f21047de.eln

When I call the vm mode, the other vm-*eln files are created.
After exiting emacs and then calling vm in the new emacs
it fails with:
Symbol’s value as variable is void: vm-update-virtual-messages

#1110127#30
Date:
2025-08-01 11:45:53 UTC
From:
To:
Additional info for the test on a clean trixie installation.

User has no ~/.emacs no .vm config file.

When starting emacs for the first time this variable is set correctly:
native-comp-jit-compilation-deny-list is a variable defined in ‘comp-run.el’.
Its value is ("/vm.*\\.el")
Original value was nil

But the these two files are created:
  vm-vars-ad20775e-4324f36e.eln
  vm-version-b3914858-f21047de.eln

When calling emacs again the variable
native-comp-jit-compilation-deny-list is not defined any more!
That seems to be the problem.

strace shows that the second call of emacs reads
/etc/emacs/site-start.d/vm*el and  also
vm-vars*.eln
vm-version*.eln
from the users eln cache.

But why is the deny-list not defined any more?

#1110127#35
Date:
2025-08-21 18:04:30 UTC
From:
To:
I upgraded bookworm to trixie and emacs vm stopped working properly.

After

apt purge vm
apt install vm

I'm able to read my emails once, but after that I get error

Invalid function: vm-increment

#1110127#40
Date:
2025-09-26 12:27:34 UTC
From:
To:
I'm now using this workaround on a new trixie installation. I only
supresses the compilation of the el files for vm, but still compiles
other lisp files.

In my ~/.emacs I have this line

(setq native-comp-jit-compilation-deny-list '("/vm.*\.el"))

at the very beginning. I didn't manage to modify
/etc/emacs/site-start.d/50vm.el
so the line above is not needed in ~/.emacs.

#1110127#45
Date:
2025-10-20 11:43:19 UTC
From:
To:
Dear Maintainer,

I use emacs and VM as my mail client.  Terribly old-fashioned but I've got used to being able to edit messages for archival...

I upgraded my laptop from bookworm to trixie on 16th October.  VM crashed as soon as I tried to load mail.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Tried to revert VM alone to an older version, but that caused other problems.  Finally reverted all emacs packages to those from bullseye stable.

   * What was the outcome of this action?

That got it working.  I probably should have tried to go back less far: I did not try taking the whole of emacs back to the 'oldstable' archive, which would have been less disruptive and may well have worked.