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

Failed to require the module #1

Closed
hekinami opened this issue Feb 24, 2018 · 16 comments

Comments

@hekinami
Copy link

commented Feb 24, 2018

I followed the user guide and when try to (require 'greeting), the following message showed

ad-Advice-require: Loading file /home/hekinami/.emacs.d/elpa/helm-20180222.2124/helm-command.elc failed to provide feature ‘greeting’

And failed to require.

I tried to (load "greeting"), it returned t, but I cannot use the feature written in the modlue.

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Feb 24, 2018

The guide missed libc. You should have these:

In Cargo.toml:

[dependencies]
libc = "0.2.36"

In src/lib.rs:

extern crate libc;

Also, if you are on Linux, the symlinking should be

ln -s libgreeting.so greeting.so

I've updated the guide with these.

@hekinami

This comment has been minimized.

Copy link
Author

commented Feb 26, 2018

I can make it work with emacs 25.3 now, but still failed with emacs 26.0.91 with the same error messages.

I know 26 has not been released yet, are you already thinking about 26 support now or in your plan?

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Feb 26, 2018

It should work on 26. CI is set up to test both 25 and 26.

One possible issue may be module-file-suffix having a different value. Instead of (require 'greeting), can you try this?

;; Full path, including the extension
(module-load "/full/path/to/greeting.so")

Can you provide more details on your Emacs 26 setup? OS version, build configuration...

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Apr 22, 2018

@hekinami Do you still get the issue?

@hekinami

This comment has been minimized.

Copy link
Author

commented Apr 24, 2018

Yes. Please let me try after 26 was released, and will give you feedback then.

@hekinami

This comment has been minimized.

Copy link
Author

commented May 29, 2018

Hi, @ubolonton I have just tested in the new released 26.1. Unfortunately, there is still the same issue, when I try to (require 'greeting), we got:

Debugger entered--Lisp error: (error "Loading file /home/hekinami/.emacs.d/elpa/ac-racer-20170114.9/ac-racer.elc failed to provide feature ‘greeting’")
  #<subr require>(greeting nil nil)
  ad-Advice-require(#<subr require> greeting)
  apply(ad-Advice-require #<subr require> greeting)
  require(greeting)
  eval((require 'greeting) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24f263>)(eval-last-sexp nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24f263>) eval-last-sexp)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24f263>) eval-last-sexp)
  command-execute(eval-last-sexp)

and what we got if (require 'greeting) after use 'emacs -Q'

Debugger entered--Lisp error: (error "Loading file /usr/local/share/emacs/26.1/lisp/elec-pair.elc failed to provide feature ‘greeting’")
  require(greeting)
  eval((require 'greeting) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

And, by the way, this is the output of 'ls /home/hekinami/sandbox/greeting/target/debug'

build deps examples greeting.so incremental libgreeting.d libgreeting.so native

output of 'rustc --version'

rustc 1.26.0 (a77568041 2018-05-07)

@tumashu

This comment has been minimized.

Copy link

commented Jan 16, 2019

Any news? I have faced the same problem when I require emacs module :-(

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Mar 24, 2019

This seems to be an unresolved bug with Emacs 26 on Linux: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30106.

I'll check later Emacs versions.

@phst

This comment has been minimized.

Copy link

commented Mar 24, 2019

Are you sure it's that bug? The bug is marked as "done."

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Mar 25, 2019

I only skimmed through it. It has the same issue of load-history not being correctly modified. I didn't notice it was closed though.

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Mar 25, 2019

I can reproduce the error with Emacs 26.1 (with both threads and modules), but only on Ubuntu 16.04 (Xenial). On Ubuntu 14.04 (Trusty) and macOS it works fine.

It works on Emacs git snapshot (27.0.50).

Regarding the linked bug, the fix 694ee38f8b7 Fix module support if threads are disabled (Bug#30106) is not in 26.1.92.

@tumashu

This comment has been minimized.

Copy link

commented Apr 14, 2019

Does this problem relate 64OS and 32OS?

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Apr 14, 2019

Does this problem relate 64OS and 32OS?

Probably not.

I just tested 26.2. The bug still exists. We'll have to report this upstream.

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Apr 14, 2019

Even the C module mod-test in Emacs's source tree cannot be loaded.

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2019

Emacs commit 694ee38 fixed this.

It's in neither 26.1.92 nor 26.2, so you have to wait either for 27, or for the fix to be backported. I added notes to the guide.

@ubolonton ubolonton closed this Apr 16, 2019

@ubolonton

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2019

Thanks @phst btw 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.