magit/with-editor

`magit-status' reports failed to provide feature ‘with-editor’

yuezhu opened this issue · 39 comments

When I ran magit-status, I got the error:

eval-buffer: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

The Magit was installed via ELPA, with version: magit-20201028.1912 and with-editor-20201030.1232.

I am using Emacs 27 HEAD on Mac:

GNU Emacs 27.1.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H2)) of 2020-10-30

When running magit-version, I got the same error:

eval-buffer: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

Backtrace:

Debugger entered--Lisp error: (error "Loading file /Users/yuezhu/.emacs.d/elpa/with-edit...")
  require(with-editor)
  eval-buffer(#<buffer  *load*-502204> nil "/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." nil t)  ; Reading at buffer position 2076
  load-with-code-conversion("/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." "/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." nil t)
  require(magit)
  eval-buffer(#<buffer  *load*> nil "/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." nil t)  ; Reading at buffer position 1102
  load-with-code-conversion("/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." "/Users/yuezhu/.emacs.d/elpa/magit-20201028.1912/ma..." nil t)
  autoload-do-load((autoload "magit-status" "Show the status of the current Git repository in a..." t nil) magit-status)
  command-execute(magit-status)

If I deleted the with-editor.elc, it works again. So, it looks like something is missing when byte compiling.

I don't know why that would happen. Please try to reinstall with-editor to see if this was a one time thing.

I switched to the Emacs 27 stable release, cleaned up the elpa directory and removed the use-package for magit, so that all ELPA packages other than magit were reinstalled. After this, when I ran package-install for magit, there is the same error in the Compile-Log buffer. And the issue still exists.

Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/async-20200809.501’

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/async-bytecomp.el at Fri Oct 30 12:59:05 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/async-20200809.501/’

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/async.el at Fri Oct 30 12:59:05 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/dired-async.el at Fri Oct 30 12:59:05 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/smtpmail-async.el at Fri Oct 30 12:59:05 2020

Compiling internal form(s) at Fri Oct 30 12:59:06 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232’

Compiling file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.el at Fri Oct 30 12:59:06 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/’

Compiling internal form(s) at Fri Oct 30 12:59:07 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753’

Compiling file /Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753/git-commit.el at Fri Oct 30 12:59:07 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753/’
git-commit.el:124:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
git-rebase.el:80:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-apply.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-bisect.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-blame.el:34:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-bookmark.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-branch.el:37:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-clone.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-commit.el:32:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-core.el:37:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-diff.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-ediff.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-extras.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-fetch.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-files.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-gitignore.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-imenu.el:39:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-log.el:32:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-margin.el:39:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-merge.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-notes.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-obsolete.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-patch.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-process.el:41:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-pull.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-push.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-reflog.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-refs.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-remote.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-repos.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-reset.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-sequence.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-stash.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-status.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-submodule.el:29:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-subtree.el:26:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-tag.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-transient.el:38:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-wip.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-worktree.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit.el:55:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

I switched to the Emacs 27 stable release, cleaned up the elpa directory and removed the use-package for magit, so that all ELPA packages other than magit were reinstalled.

Based on that information I am uncertain whether you made sure that with-editor was completely gone. Please remove elpa/with-editor-*. Exit emacs. Restart emacs. Reinstall with-editor.

Ah, I think I found a clue. So, I had (use-package vterm) before the (use-package magit). If I had (use-package vterm) after the (use-package magit), this issue won't happen.

Does the magit (or its dependencies) require vterm? I noticed that if I put (use-package vterm) before the (use-package magit), the vterm compiling buffer popped up when Emacs startup if I removed elpa directories and ELPA needs to install packages:

-- The C compiler identification is AppleClang 11.0.3.11030032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- No build type selected, defaulting to RelWithDebInfo
-- System libvterm detected
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/yuezhu/.emacs.d/elpa/vterm-20201004.2057/build
Scanning dependencies of target vterm-module
[ 25%] Building C object CMakeFiles/vterm-module.dir/vterm-module.c.o
[ 50%] Building C object CMakeFiles/vterm-module.dir/utf8.c.o
[ 75%] Building C object CMakeFiles/vterm-module.dir/elisp.c.o
[100%] Linking C shared module ../vterm-module.so
[100%] Built target vterm-module
/Users/yuezhu/.emacs.d/elpa/vterm-20201004.2057

See #81 and #85.

Thanks. I looked at #85. I am not super familiar with elisp programming, but is this still needed with the condition-case? 6735180#diff-d187f46d6db5e453fc7101791cb044483504b678151b081cd4ec00790b8a2f0dR105

Your output above indicates that compilation of vterm succeeds in your case. #85 in only needed when compilation fails. I mention it mainly to say "there are other problems caused by requiring vterm". #81 shows why we optionally require vterm when we compile ; with-editor can now hook into vterm and we want to load it so that the byte-compiler can warn us about incompatible changes if necessary.

I really have no idea why requiring vterm would cause with-editor.elc to stop providing its feature. I would recommend that you remove the complete elpa directory (and then restarting emacs) just to make sure that really deleting everything doesn't magically fix this. It that does not do it then you will have to manually remove with-editor.elc. That shouldn't affect performance too much.

Well or do that

Ah, I think I found a clue. So, I had (use-package vterm) before the (use-package magit). If I had (use-package vterm) after the (use-package magit), this issue won't happen.

I don't understand why that would make a difference, but if it does, great.

I really have no idea why requiring vterm would cause with-editor.elc to stop providing its feature. I would recommend that you remove the complete elpa directory (and then restarting emacs) just to make sure that really deleting everything doesn't magically fix this. It that does not do it then you will have to manually remove with-editor.elc. That shouldn't affect performance too much.

I have done rm -rf .emacs.d/elpa, and launched emacs, so that all packages would be fetched from ELPA and byte compiled again. Unfortunately the issue still exists:

Error (bytecomp): Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’ [41 times]

When the (use-package magit) comes before the (use-package vterm), the vterm module compile buffer would not pop up during emacs startup.

Well or do that

Ah, I think I found a clue. So, I had (use-package vterm) before the (use-package magit). If I had (use-package vterm) after the (use-package magit), this issue won't happen.

I don't understand why that would make a difference, but if it does, great.

Yep, it is fair for now. Please feel free to close this issue.

Try with emacs --debug-init, maybe that gives us some more information.

Please feel free to close this issue.

Let's keep it open a few days in case someone else has the same issue.

I removed other use-package statements from my init.el, and only have (use-package vterm) and (use-package magit). Then I did rm -rf elpa followed by emacs --debug-init from terminal, but still got the same error. Below is the entire content of *Compile-Log* buffer produced during emacs startup:

Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/bind-key-20200805.1727’

Compiling file /Users/yuezhu/.emacs.d/elpa/bind-key-20200805.1727/bind-key.el at Sun Nov  1 10:56:47 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/bind-key-20200805.1727/’

Compiling internal form(s) at Sun Nov  1 10:56:47 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156’

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-bind-key.el at Sun Nov  1 10:56:47 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/’

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-core.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-delight.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-diminish.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-ensure.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-jump.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package-lint.el at Sun Nov  1 10:56:47 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/use-package-20200721.2156/use-package.el at Sun Nov  1 10:56:47 2020

Compiling internal form(s) at Sun Nov  1 10:56:47 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/vterm-20201004.2057’

Compiling file /Users/yuezhu/.emacs.d/elpa/vterm-20201004.2057/vterm.el at Sun Nov  1 10:56:47 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/vterm-20201004.2057/’

Compiling internal form(s) at Sun Nov  1 10:56:48 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/async-20200809.501’

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/async-bytecomp.el at Sun Nov  1 10:56:48 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/async-20200809.501/’

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/async.el at Sun Nov  1 10:56:48 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/dired-async.el at Sun Nov  1 10:56:48 2020

Compiling file /Users/yuezhu/.emacs.d/elpa/async-20200809.501/smtpmail-async.el at Sun Nov  1 10:56:48 2020

Compiling internal form(s) at Sun Nov  1 10:56:48 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232’

Compiling file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.el at Sun Nov  1 10:56:48 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/’

Compiling internal form(s) at Sun Nov  1 10:56:50 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/transient-20201031.1243’

Compiling file /Users/yuezhu/.emacs.d/elpa/transient-20201031.1243/transient.el at Sun Nov  1 10:56:50 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/transient-20201031.1243/’

Compiling internal form(s) at Sun Nov  1 10:56:50 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/dash-20200803.1520’

Compiling file /Users/yuezhu/.emacs.d/elpa/dash-20200803.1520/dash.el at Sun Nov  1 10:56:50 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/dash-20200803.1520/’

Compiling internal form(s) at Sun Nov  1 10:56:50 2020
Leaving directory ‘/Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753’

Compiling file /Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753/git-commit.el at Sun Nov  1 10:56:50 2020
Entering directory ‘/Users/yuezhu/.emacs.d/elpa/git-commit-20200828.1753/’
Error (bytecomp): Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
git-rebase.el:80:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-apply.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-bisect.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-blame.el:34:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-bookmark.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-branch.el:37:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-clone.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-commit.el:32:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-core.el:37:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-diff.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-ediff.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-extras.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-fetch.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-files.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-gitignore.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-imenu.el:39:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-log.el:32:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-margin.el:39:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-merge.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-notes.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-obsolete.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-patch.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-process.el:41:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-pull.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-push.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-reflog.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-refs.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-remote.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-repos.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-reset.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-sequence.el:35:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-stash.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-status.el:33:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-submodule.el:29:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-subtree.el:26:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-tag.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-transient.el:38:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-wip.el:36:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit-worktree.el:30:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

In toplevel form:
magit.el:55:1:Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

Compiling internal form(s) at Sun Nov  1 10:57:26 2020

I have been able to reliably reproduce this error without having to have (use-package vterm) coming before (use-package magit):

  1. rm -rf vterm-*/{build,vterm-module.so}
  2. rm -f with-editor-*/with-editor.elc
  3. Byte compile file with-editor.el
  4. Restart emacs, run magit-status, and this error will occur.

If after step2, I ran load-library for vterm that causes the vterm module to be built beforehand, this issue won't occur. So, it is somehow related with (require 'vterm nil t) that needs the vterm module to be built. It might cause the byte compiler to terminate earlier without having gone through the entire with-editor.el.

From the byte compile call tree, it does not look like the byte compiler compiled the with-editor.el through the end, so the (provide 'with-editor) in the end is not compiled.

Call tree for /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.el sorted on name:

async-bytecomp-package-mode	??? (1 callers + 0 calls = 1)
  called by:
    <top level>
boundp	 <subr> (1 callers + 0 calls = 1)
  called by:
    <top level>
cl-intersection	<compiled function> (1 callers + 0 calls = 1)
  called by:
    <top level>
fboundp	 <subr> (1 callers + 0 calls = 1)
  called by:
    <top level>
message	 <subr> (1 callers + 0 calls = 1)
  called by:
    <top level>
nil	 <top level> (0 callers + 6 calls = 6)
  calls:
    message, async-bytecomp-package-mode, fboundp, cl-intersection, boundp,
    require
require	 <subr> (1 callers + 0 calls = 1)
  called by:
    <top level>

I still cannot reproduce this issue. You can probably work around it using (setq async-bytecomp-allowed-packages nil) early in your init file.

I am closing this and will wait for a second user having a similar issue before investigating more. Sorry.

I am also now having this issue, but it's related to Doom Emacs.

Failed to load with-editor package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load git-commit package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load magit package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load org package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load org-agenda package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load org-capture package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)
Failed to load org package incrementally, because: (error Loading file /home/bigdaddy/.config/emacs/.local/straight/build-28.0.50/with-editor/with-editor.elc failed to provide feature ‘with-editor’)

Though I think this is a bytecomp issue with Emacs itself. Maybe. Though it seems to all be with with-editor. I've tried removing and reinstalling and the issue still persists.

I can't capture the backtrace, but from how Doom loads things it seems to be triggering after magit is loaded

DOOM Incrementally loading transient
DOOM Incrementally loading magit
Entering debugger... ; <- where I start getting the backtraces popping up
DOOM Incrementally loading calendar
DOOM [editor/evil] Initialized evil-collection-calendar  [2 times]
DOOM Incrementally loading org-macs
DOOM Incrementally loading org-compat
DOOM Incrementally loading org-faces
DOOM Incrementally loading org-entities
DOOM Incrementally loading org-list
DOOM Incrementally loading org-pcomplete
DOOM Incrementally loading org-src
DOOM Incrementally loading org-footnote
DOOM Incrementally loading org-macro
DOOM Incrementally loading ob
DOOM Incrementally loading org

Emacs version: 28.0.50
git rev-parse --short HEAD output: 87b82a1969
From Emacs's system-configuration-options:

"--with-modules 
--with-gnutls 
--without-gconf 
--without-gsettings 
--with-imagemagick 
--with-json 
--with-x-toolkit=lucid 
--without-toolkit-scroll-bars 
--without-xaw3d 
--without-libsystemd"

From Emacs's system-configuration-features:

XPM 
JPEG 
TIFF 
GIF 
PNG 
RSVG 
CAIRO 
IMAGEMAGICK 
SOUND 
GPM 
DBUS 
GLIB 
NOTIFY 
INOTIFY 
ACL 
GNUTLS 
LIBXML2 
FREETYPE 
HARFBUZZ 
LIBOTF 
ZLIB 
LUCID 
X11 
XDBE 
XIM 
MODULES 
THREADS 
JSON 
PDUMPER 
LCMS2

Setting async-bytecomp-allowed-packages to nil does nothing for me.

This doesn't ring any bells. As you say it might be a doom-specific issue and I recommend you raise it with them.

No, because the error is similar to what @yuezhu had.

It's still

Error: Loading file /Users/yuezhu/.emacs.d/elpa/with-editor-20201030.1232/with-editor.elc failed to provide feature ‘with-editor’

except I'm using Doom. That's all that's different.

I could be an issue with bytecomp in Emacs, but it's clearly not Doom specific.

Try setting async-bytecomp-allowed-packages to nil very early in the init process and reinstall again. Maybe this mystery issue is caused by the kludge at the beginning of with-editor.el whose purpose is to prevent mystery issues. If its not that, then I really have no idea what could be causing this and you probably should ask someone else for help, because someone else might.

I tried setting that in the early-init.el and the issue still persisted. I'll try again in a bit.

dive commented

I have the same problem. (setq async-bytecomp-allowed-packages nil) does not help, clearing the straight cache and rebuilding everything help neither.

GNU Emacs 28.0.50 (build 2, aarch64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69)) of 2021-01-05
eval-buffer: Loading file /Users/dive/.config/emacs/straight/build/with-editor/with-editor.elc failed to provide feature ‘with-editor’
...
Debugger entered--Lisp error: (error "Loading file /Users/dive/.config/emacs/straight/bu...")
  require(with-editor)
  eval-buffer(#<buffer  *load*-193929> nil "/Users/dive/.config/emacs/straight/build/magit/mag..." nil t)  ; Reading at buffer position 2076
  load-with-code-conversion("/Users/dive/.config/emacs/straight/build/magit/mag..." "/Users/dive/.config/emacs/straight/build/magit/mag..." nil t)
  require(magit)
  eval-buffer(#<buffer  *load*> nil "/Users/dive/.config/emacs/straight/build/magit/mag..." nil t)  ; Reading at buffer position 1102
  load-with-code-conversion("/Users/dive/.config/emacs/straight/build/magit/mag..." "/Users/dive/.config/emacs/straight/build/magit/mag..." nil t)
  autoload-do-load((autoload "magit-status" "Show the status of the current Git repository in a..." t nil) magit-status)
  command-execute(magit-status)

I don't use package.el myself, but I do have an elpa based setup for testing purposes. I had not invoked that for some time but some weeks ago I did and I got the same error. I then removed the relevant packages and reinstalled them and afterwards the error was gone. Just one more data point that indicates the issue is real but also that it can be fixed.

By the way, I still recommend that affected users ask for help elsewhere. I am out of ideas and providing more details here is not likely to lead to any grand insights. What is needed now is a person who has run into a similar issue before and who recognizes the similarity when reading a description of what you are experiencing.

I mean I can summon @kyleam and @npostavs, but that's just two more people.

dive commented

FYI: I have tested it in different configurations. First of all, it works just fine in a clean environment:

rm -Rf ~/.config/emacs/elpa
emacs --no-window-system --no-init-file
(require 'package)
(add-to-list 'package-archives '( "melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
(package-install 'magit)

Then I narrowed problematic packages in my configuration to two: vterm and exec-path-from-shell. And it seems that the winner is vterm in my case. Without vterm everything works as expected. I did not dive deep into the problem, just disabled vterm temporary. magit is much more important to me than vterm 😇 But it seems that libvterm compilation process messes up with the environment.

Perhaps, it will help someone with the problem.

There's this other mystery bug concerning vterm: #85...

The fix for that was broken and I have now fixed the fix. Please let me know if that makes this issue go away. If so, then you probably have such a message in the *Message* buffer now: Error(vterm): ....

@dive does that 👍 mean that this fixed the issue for you and/or that you got that message?

Ergus commented

This issue is back for me

I am experiencing this issue as well (GNU Emacs, package.el).

I still don't know what is going on and how code in one of the packages that I am responsible could be to blame. [I am not saying it's not possible, I just don't see how it could be possible.] You will have to figure it out yourself and/or get help elsewhere.

  • with-editor.el actually does provide with-editor.
  • Maybe this is all triggered by with-editor requiring vterm. If so then, then the root case probably still is in vterm, simply loading vterm should not break other packages.
  • Maybe this is all triggered by with-editor requiring async. If so then, then the root case probably still is in async, simply loading async should not break other packages. Also with-editor and magit actually no longer require async, so even if this once was the trigger, now it isn't anymore. If async is still installed but not used by anything, then try removing it.

Empirical testing: Installing vterm after magit fixes the problem. I deleted the .emacs.d directory for each case, i.e. when installing one before/after the other.

FYI: In the spirit of science, I have repeated the experiment once again, and this time, magit worked in both cases, withvterm before after magit.

Silex commented

I had the same problem:

Compiling internal form(s) at Sat Dec 11 14:21:50 2021
Error (bytecomp): Loading file /home/silex/.emacs.d/elpa/with-editor-20211028.2105/with-editor.elc failed to provide feature ‘with-editor’ [59 times]

I found out that going to /home/silex/.emacs.d/elpa/with-editor-20211028.2105/ and byte-compiling the .el file fixed the problem.

Tiv0w commented

Noticed same problem as @Silex. Unfortunately, byte-recompiling with-editor.el did not do the trick.
I write here the steps I took if it can help someone in the future.
So instead of byte-recompiling, I simply removed all Magit related packages by hand (by rm -rfing the directories in .emacs.d/elpa). One restart to let Emacs reinstall the dependencies, and another to be sure everything was cleanly loaded.