emacsorphanage/req-package

req-package doesn't install single packages via el-get

aspiers opened this issue · 27 comments

There seem to be two issues here:

  1. There is no concrete example in the documentation of how to use :loader. Should it be (req-package foo :loader el-get), or (req-package foo :loader 'el-get), or maybe even (req-package foo :loader (el-get))?
  2. I've tried all of these and none of them work.

I looked into the elisp:

 (defun req-package-providers-prepare (package &optional loader)
  "Prepare PACKAGE - install if it is present using LOADER if specified."
  (condition-case e
      (if (functionp loader)
          (funcall loader package)

If loader is el-get and package is a single symbol (e.g. 'xrdb-mode), then this will effectively attempt (el-get 'xrdb-mode). But the first parameter to el-get gets treated as the SYNC parameter, so el-get treats its PACKAGES parameter as nil, and nothing gets installed.

Hello. Sorry for the delay. Just came back from vacation. I will investigate it soon

Thanks, looking forward to your thoughts!

I made a quick fix, but it's not compatible with current version. You should use keywords to specify loaders from now on.

Thanks a lot! But please can you also document how to use it? I have no clue right now...

Ah, just came up with understanding that this is not gonna work. The reason is keywords are used for arguments parsing..

Need to introduce something like a list of known keywords, I think

And of course, I'll document it

@aspiers please, check it out, I hope it works for you now

I'm trying aspiers/emacs@15fb700 but it doesn't install xrdb-mode at all, so the autoload fails.

And there's nothing relevant shown by M-x req-package--log-open-log.

Let me try the same in hour

On Wed, Feb 24, 2016, 8:03 PM Adam Spiers notifications@github.com wrote:

And there's nothing relevant shown by M-x req-package--log-open-log.


Reply to this email directly or view it on GitHub
#29 (comment).

Hm. It works for me. Are you sure you're on the latest req-package?

Yes I upgraded, reloaded all elisp files, and then even restarted emacs ...

On 24 February 2016 at 15:14, Edward Knyshov notifications@github.com
wrote:

Hm. It works for me. Are you sure you're on the latest req-package?


Reply to this email directly or view it on GitHub
#29 (comment).

May I ask you your emacs version?

On Wed, Feb 24, 2016 at 11:48 PM Adam Spiers notifications@github.com
wrote:

Yes I upgraded, reloaded all elisp files, and then even restarted emacs ...

On 24 February 2016 at 15:14, Edward Knyshov notifications@github.com
wrote:

Hm. It works for me. Are you sure you're on the latest req-package?


Reply to this email directly or view it on GitHub
<#29 (comment)
.


Reply to this email directly or view it on GitHub
#29 (comment).

And also req-package snapshot version could help a lot

On Thu, Feb 25, 2016 at 12:53 AM Edward Knyshov edvorg@gmail.com wrote:

May I ask you your emacs version?

On Wed, Feb 24, 2016 at 11:48 PM Adam Spiers notifications@github.com
wrote:

Yes I upgraded, reloaded all elisp files, and then even restarted emacs
...

On 24 February 2016 at 15:14, Edward Knyshov notifications@github.com
wrote:

Hm. It works for me. Are you sure you're on the latest req-package?


Reply to this email directly or view it on GitHub
<#29 (comment)
.


Reply to this email directly or view it on GitHub
#29 (comment).

  • GNU Emacs 24.5.1 (x86_64-suse-linux-gnu, GTK+ Version 3.14.3) of 2015-11-13 on cumulus2
  • req-package-20160223.2200 from MELPA

@aspiers your req-package version is old, take new one req-package-20160224.331
Look at the badge on readme page

package-refresh-contents

@edvorg Before testing, I checked to make sure that req-package-20160223.2200 had the fixes in, and it did AFAICS. But I can try a newer one too.

Also, as req-package is a macro, you should recompile (clean up and compile again) all your configuration files using it.

My config files aren't compiled, so a restart of emacs already covers this case. It's still definitely not working, even with req-package-20160225.155:

https://github.com/aspiers/emacs/blob/master/.emacs.d/init.d/as-config-langs.el#L11

req-package--log-open-log says:

16:39:31 [INFO ] installing package xrdb-mode

but el-get clearly shows that xrdb-mode is not installed, and it's not on the filesystem anywhere.

I am still seeing this with req-package-20160227.1005 ! Please can you reopen this issue? It is not fixed. I have looked closer and identified the following issues:

  • req-package-providers-el-get-present is cached via defconst, so if el-get is loaded after req-package, req-package mistakenly thinks el-get is not available.
  • req-package-providers-prepare calls (funcall installer package) and then ignores the result. So if the installer fails, req-package silently fails.
  • Even if the funcall succeeds, the (require package nil t) code which comes immediately after it is part of the ELSE clause of the if, so the package only gets required if installer was nil. Huh?

As discussed by private email, I'll try to fix these. However would be really helpful if you could explain whether that ELSE clause is there intentionally, and if so, what the reason is - it looks backwards to me :-)

Another problem: the code doesn't ensure that the el-get package gets added to load-path. This only happens the times when req-package actually invoked el-get to install the package. On other times, it sees it's already installed, and doesn't do what's required to add it to the load-path, so the require would fail even if it wasn't in the ELSE clause.

@aspiers

req-package-providers-el-get-present is cached via defconst, so if el-get is loaded after req-package, req-package mistakenly thinks el-get is not available.

agree, this requires a better check for el-get presence, maybe just try to require it

req-package-providers-prepare calls (funcall installer package) and then ignores the result. So if the installer fails, req-package silently fails.

as you can see this code is wrapped into condition case and expecting to get an error if something fails in installer.

Even if the funcall succeeds, the (require package nil t) code which comes immediately after it is part of the ELSE clause of the if, so the package only gets required if installer was nil. Huh?

afair this thing tries to cover the case when we just have some *.el file on load-path. not a good solution, because this code loads this el file. We better should solve it with new providers system somehow.