jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
837 stars 68 forks source link

async-bytecomp.el: Add lsp-mode #128

Closed leungbk closed 4 years ago

leungbk commented 4 years ago

lsp-mode has encountered similar compilation issues as helm and magit: https://github.com/emacs-lsp/lsp-mode/pull/1977

cc @yyoncho

thierryvolpiatto commented 4 years ago

If @yyoncho is ok, no problem ;-)

yyoncho commented 4 years ago

If I am reading the docs correctly after the change lsp-mode/lsp-protocol will be compiled async in clean env? If yes, this won't fix all of our issues. On our side, the most common issue is when the packages that depend on lsp-mode.el and lsp-protocol.el are compiled against the loaded version of lsp-mode.el and/or lsp-protocol.el.

leungbk commented 4 years ago

On our side, the most common issue is when the packages that depend on lsp-mode.el and lsp-protocol.el are compiled against the loaded version of lsp-mode.el and/or lsp-protocol.el.

I can resubmit this PR adding those packages also---lsp-scala, lsp-python-ms, etc.

yyoncho commented 4 years ago

I think that this is what we need, the list will be kind of huge though. Also, will this strategy help when the files are in multiple packages? E. g. if I select for updating FOO and BAR packages and FOO depends on BAR but package.el decides to download and bytecompile FOO first instead of BAR.

leungbk commented 4 years ago

I think that this is what we need, the list will be kind of huge though. Also, will this strategy help when the files are in multiple packages? E. g. if I select for updating FOO and BAR packages and FOO depends on BAR but package.el decides to download and bytecompile FOO first instead of BAR.

That's what the docstring of async-bytecomp-allowed-packages seems to say:

Packages in this list will be compiled asynchronously by `package--compile'. All the dependencies of these packages will be compiled async too, so no need to add dependencies to this list.

Is that right @thierryvolpiatto?

I've added all the lsp-foo I could find on Melpa. @yyoncho are there any other packages that come to mind?

thierryvolpiatto commented 4 years ago

Ivan Yonchovski notifications@github.com writes:

I think that this is what we need, the list will be kind of huge though. Also, will this strategy help when the files are in multiple packages? E. g. if I select for updating FOO and BAR packages and FOO depends on BAR but package.el decides to download and bytecompile FOO first instead of BAR.

No this will not help, the helm package manager try to handle this properly by always upgrading/compiling dependencies before selected packages, unfortunately package.el doesn't handle this and install/bytecompile in a random order, sometimes it works if you are lucky other times it fails.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

thierryvolpiatto commented 4 years ago

Brian Leung notifications@github.com writes:

On our side, the most common issue is when the packages that depend on lsp-mode.el and lsp-protocol.el are compiled against the loaded version of lsp-mode.el and/or
lsp-protocol.el.

I can resubmit this PR adding those packages also---lsp-scala, lsp-python-ms, etc.

What we could do also (suggested by S.Monnier some months ago) is to use by default 'all, and people who are not happy with this could customize async-bytecomp-allowed-packages as they like.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

thierryvolpiatto commented 4 years ago

Brian Leung notifications@github.com writes:

I think that this is what we need, the list will be kind of huge though. Also, will this strategy help when the files are in multiple packages? E. g. if I select for
updating FOO and BAR packages and FOO depends on BAR but package.el decides to download and bytecompile FOO first instead of BAR.

That's what the docstring of async-bytecomp-allowed-packages seems to say:

Packages in this list will be compiled asynchronously by `package--compile'. All the dependencies of these packages will be compiled async too, so no need to add
dependencies to this list.

Is that right @thierryvolpiatto?

Yes package--compile is adviced.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

thierryvolpiatto commented 4 years ago

Ivan Yonchovski notifications@github.com writes:

I think that this is what we need, the list will be kind of huge though.

I changed the default value of async-bytecomp-allowed-packages to 'all, that's mean that all packages will be compiled async when async-bytecomp-package-mode is enabled.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

leungbk commented 4 years ago

I changed the default value of async-bytecomp-allowed-packages to 'all, that's mean that all packages will be compiled async when async-bytecomp-package-mode is enabled.

Thanks!