bradyt / dart-server

An Emacs minor mode for the Dart server
GNU General Public License v3.0
0 stars 0 forks source link

File mode specification error: (void-function dart-log) #5

Open oivvio opened 5 years ago

oivvio commented 5 years ago

I've tried both the installation methods (MELPA and git clone)

I get this when trying to activate dart-mode

File mode specification error: (void-function dart-log)
bradyt commented 5 years ago

@oivvio , thank you for the report. Can you try again after M-x toggle-debug-on-error RET to see if it creates a backtrace with more information? Or (setq debug-on-error t).

I'm also curious what settings you have in your init file relevant to dart-mode. This function dart-log is defined in dart-mode.el, so not sure how we're getting void-function.

If those ideas don't help us find the issue, maybe we can find a way to help me reproduce the issue, as I've never seen this error message before.

bradyt commented 5 years ago

I've created a docker image that installs emacs and dart-mode, and opens a dart file, at https://github.com/bradyt/docker-emacs/tree/void-function-dart-log. I cannot reproduce the error. Until I have clarification on how to reproduce the error, I am closing issue.

twlz0ne commented 5 years ago

Same here.

Debugger entered--Lisp error: (void-function dart-log)
  dart-log("Error running (\"/usr/local/bin/dart\" \"/var/folders/3c/800j6mnd1b7d3fk7vhh8rmw00000gn/T/dart-mode.81qW4w\"):\n[proxychains] DLL init: proxychains-ng 4.13\n")
  dart--try-process("/usr/local/bin/dart" "/var/folders/3c/800j6mnd1b7d3fk7vhh8rmw00000gn/T/dart-mode.81qW4w")
  #f(compiled-function () #<bytecode 0x41e98221>)()
  funcall(#f(compiled-function () #<bytecode 0x41e98221>))
  eval((funcall (function #f(compiled-function () #<bytecode 0x41e98221>))))
  custom-initialize-reset(dart-sdk-path (funcall (function #f(compiled-function () #<bytecode 0x41e98221>))))
  custom-declare-variable(dart-sdk-path (funcall (function #f(compiled-function () #<bytecode 0x41e98221>))) "The absolute path to the root of the Dart SDK." :group dart-mode :type directory :package-version (dart-mode . "1.0.0"))
  byte-code("\300\301!\210\302\303\304\305\306DD\307\310\311\312\313\314\315&\011\207" [make-variable-buffer-local dart--do-it-again-callback custom-declare-variable dart-sdk-path funcall function #f(compiled-function () #<bytecode 0x41e98221>) "The absolute path to the root of the Dart SDK." :group dart-mode :type directory :package-version (dart-mode . "1.0.0")] 10)
  require(dart-mode)

The error triggered while evaluating (defcustom dart-sdk-path ...), I think it's because the dart-log function is defined after this expression.

twlz0ne commented 5 years ago

@bradyt I think maybe the following code should be added to your docker image to simulate the process error:

+(setq dart-debug t)
+(define-advice dart--run-process (:override (executable &rest args) return-nil)
+  nil)

 (unless (package-installed-p 'dart-mode)
     (package-refresh-contents)
     (package-install 'dart-mode))
bradyt commented 5 years ago

@twlz0ne I'm still not able to reproduce.

twlz0ne commented 5 years ago

@bradyt There is no dart in your docker image, following code returns nil:

https://github.com/bradyt/dart-mode/blob/d5776f1e9bfeb45eb30723eba3030691a8491545/dart-mode.el#L261-L265

no-dark-in-docker-emacs

That's why you not able to reproduce.

bradyt commented 5 years ago

Okay. Is there a use case for your define-advice expression?

bradyt commented 5 years ago

You can add the following to the Dockerfile to reproduce your error.

RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list \
    && apt-get update && apt-get install -y dart \
    && rm -rf /var/lib/apt/lists/*
twlz0ne commented 5 years ago

@bradyt Able to reproduce now:

docker-emacs--void-function-dart-log

https://github.com/twlz0ne/docker-emacs/commit/82d36542c12562c5988078f98adc7d1ed71aa9cd

bradyt commented 3 years ago

I am hoping that https://github.com/bradyt/dart-server/issues/13 was a duplicate of this issue, and that the associated merged pull request at https://github.com/bradyt/dart-server/pull/14 fixes both issues.

I don't know when I'll get around to check this against the errors with the Docker reproduces above. If anyone gets around to checking those before I do, or otherwise thinks I should go ahead and close this issue, please let us know.