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

Fix autoload error on MELPA install #116

Merged

Conversation

nukosuke
Copy link
Contributor

MELPAからインストールしたパッケージでDDSKKを立ちあげようとしたところ、以下のように skk-autoloadsが見つからず起動に失敗しました。(ddskk-autoloads.elで存在します)

Cannot open load file: No such file or directory, skk-autoloads

そこで、skk-autoloads.elが見つからない場合は無視するようにしました。
お手数ですがご確認いただけますでしょうか 🙇


環境: macOS Mojave (10.14.6), GNU Emacs 27.0.50

Cannot open load file: No such file or directory, skk-autoloads
@tkita
Copy link
Member

tkita commented Feb 27, 2020

MELPA を使っていないので(申し訳ない)分からないのですが、MELPA によるインストールってバイトコンパイルされるのでしょうか? されるのであればどのタイミングでしょうか?
そのバイトコンパイルでも #74 のような warning が発生しているのでしょうか? また、それを解消するのが理想なのでしょうか?
私は make インストールしか使っていませんので、MELPA 関係はまったく理解しておりません。

Copy link
Member

@tats tats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(when (featurep 'skk-autoloads)
(require 'skk-autoloads))

featurepだとロード前はnilなので、このコードだとロードできないのでは?

#117のとおり、そもそも
skk-autoloadsをrequireしていること自体がどうなのかという話はありますが、
とりあえずエラーを回避するには、locate-libraryで存在確認するか
ignore-errorsで囲んでエラーを無視するか、といったあたりでしょうか。

@tkita
Copy link
Member

tkita commented Feb 27, 2020

無知なことを承知の上で、どなたか教えてください。
せっかく travis あるので、MELPA 版もテストできないのでしょうか?
これが可能なら、merge 前に判明できたと思われます。

@conao3
Copy link
Member

conao3 commented Feb 27, 2020

もちろんできます。MELPAのクリーンビルドがあるので、それで確認するのが簡単だと思います。

またMELPAが壊れるのはしょうがないと理解しています。
#90 の通り、MELPAについては私が面倒見るので、MELPAを気にせずmasterを変更してもらえればと思います。

skk.elのコメントを見る限り、 featurep についてはこのままで動くと思います。このPRをcheckoutしてもらって、makeでインストールしても正常動作するか確認していただけますでしょうか。

https://github.com/skk-dev/ddskk/blob/master/skk.el#L78-L90

  ;; skk の起動時、*-autoloads は下記の2種類のうちどちらかに限って存在する。
  ;;                | make でインストール     | MELPA 経由でインストール
  ;;   ファイル名   | skk-autoloads.el        | ddskk-autoloads.el
  ;;   provide 宣言 | あり (SKK-MK が生成)    | なし
  ;;
  ;; 単なる require だと MELPA 版 で Required feature skk-autoloads was
  ;;   not provided となってしまうため featurep で確認してから [featurep は
  ;;   ファイル内に provide 宣言がなければ nil を返す] require している。
  ;;
  ;; leim-list.el と skk-setup.el にも単なる require 'skk-autoloads が存在する
  ;;   が、MELPA 経由でインストールした DDSKK は両 el を使用しないため影響ない。
  (when (featurep 'skk-autoloads)
    (require 'skk-autoloads))

@tkita tkita merged commit b9385ed into skk-dev:master Feb 27, 2020
@tats
Copy link
Member

tats commented Feb 27, 2020

skk.elのコメントを見る限り、 featurep についてはこのままで動くと思います。

skk.elも同じ誤りをしていて、単にskk-autoloadsがロードされなくなって
いるだけではないでしょうか。

@tkita
Copy link
Member

tkita commented Feb 27, 2020

先日の私による commit 前の状況でいえば、インストーラたる emacs インスタンスの SKK-MK-compile() で load skk-autoloads.el したあとの compile-elisp-modules() なので (featurep 'skk-autoloads) は t です。

@conao3
Copy link
Member

conao3 commented Feb 27, 2020

手元で試しましたが、load-pathに入っているかどうかを確かめているのではないんですね。。
@tats さんのコメント通り skk.el のコメントがそもそも間違えているようです。
requireの第3引数をtにしておいてエラーを無視するほうが良さそうです。

@tkita
Copy link
Member

tkita commented Feb 27, 2020

@tats さま、さきほどの私の発言は無視してください。
(また文脈を読み違えました)

@conao3
Copy link
Member

conao3 commented Feb 27, 2020

MELPA を使っていないので(申し訳ない)分からないのですが、MELPA によるインストールってバイトコンパイルされるのでしょうか? されるのであればどのタイミングでしょうか?
そのバイトコンパイルでも #74 のような warning が発生しているのでしょうか? また、それを解消するのが理想なのでしょうか?

MELPA版は初回インストール時にバイトコンパイルされます。以後、バイトコンパイルされたファイルがロードされます。
ちなみにMELPA版では次のようなワーニングが出ます。

ワーニングについての考え方は #74 と同じです。ワーニングが出ること自体を問題にはしていませんが、積極的に放置する理由もないという立場です。

Leaving directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/cdb-20200210.1326’

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/cdb-20200210.1326/cdb.el at Thu Feb 27 20:55:31 2020
Entering directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/cdb-20200210.1326/’

Compiling no file at Thu Feb 27 20:55:31 2020
Leaving directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/ccc-20151205.1343’

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ccc-20151205.1343/ccc.el at Thu Feb 27 20:55:31 2020
Entering directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/ccc-20151205.1343/’

Compiling no file at Thu Feb 27 20:55:34 2020
Leaving directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314’

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/context-skk.el at Thu Feb 27 20:55:34 2020
Entering directory ‘/Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/’

In end of data:
context-skk.el:354:1:Warning: the function ‘skk-latin-mode’ is not known to
    be defined.

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-abbrev.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-act.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-annotation.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-annotation.el:1891:1:Warning: the following functions are not known to be defined:
    skk-treat-strip-note-from-word, skk-tooltip-show-at-point,
    skk-henkan-in-minibuff, skk-kakutei, skk-quote-char,
    skk-get-jisyo-buffer, skk-quote-semicolon

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-auto.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-auto.el:145:1:Warning: the following functions are not known to be defined:
    skk-get-jisyo-buffer, skk-splice-in

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-azik.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-cdb.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-cdb.el:79:1:Warning: the following functions are not known to be defined:
    skk-compute-henkan-lists, skk-nunion

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-comp.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-comp.el:606:1:Warning: the following functions are not known to be defined:
    skk-start-henkan, skk-emulate-original-map,
    skk-hiragana-to-katakana, skk-katakana-to-hiragana,
    skk-get-jisyo-buffer, skk-insert, skk-search-progs

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-cursor.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-cus.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-cus.el:347:1:Warning: the function ‘skk-adjust-user-option’ is not known
    to be defined.

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-dcomp.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-dcomp.el:672:1:Warning: the following functions are not known to be defined:
    skk-detach-extent, skk-katakana-to-hiragana

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-decor.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-decor.el:134:1:Warning: the function ‘skk-treat-strip-note-from-word’ is
    not known to be defined.

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-develop.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-emacs.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-emacs.el:788:1:Warning: the following functions are not known to be defined:
    skk-jisx0208-latin-mode, skk-toggle-kana, skk-latin-mode

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-gadget.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-gadget.el:501:1:Warning: the following functions are not known to be defined:
    skk-set-henkan-point-subr, skk-start-henkan, skk-time-difference,
    skk-nunion, skk-search, skk-henkan-in-minibuff,
    skk-henkan-face-off

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-hint.el at Thu Feb 27 20:55:34 2020

In end of data:
skk-hint.el:226:1:Warning: the function ‘skk-katakana-to-hiragana’ is not
    known to be defined.

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-inline.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-isearch.el at Thu Feb 27 20:55:34 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-jisx0201.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-jisx0213.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-jisyo-edit-mode.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-kakasi.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-kcode.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-leim.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-look.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-macs.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-num.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-search-web.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-server-completion.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-server.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-show-mode.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-sticky.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-study.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-tankan.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-tut.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-vars.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-version.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk-viper.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/skk.el at Thu Feb 27 20:55:35 2020

Compiling file /Users/conao/dev/forks/melpa/sandbox/elpa/ddskk-20200220.1314/tar-util.el at Thu Feb 27 20:55:35 2020

@nukosuke nukosuke deleted the hotfix/fix-autoload-error-on-melpa-ver branch February 28, 2020 02:35
@nukosuke
Copy link
Contributor Author

なるほど。。。featurepの仕様を理解できてませんでした。
確認不足のままPRを開いてしまい申しわけありませんでした。みなさんフォローありがとうございます!
現在のmasterで動作することを確認できました 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants