emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
255 stars 28 forks source link

Setting build-step stops adding drone to load-path? #97

Closed arichiardi closed 3 years ago

arichiardi commented 3 years ago

Hi Jonas, I am describing in the title the symptom but I am not sure what's the cause.

I have this in my .gitmodules:

[submodule "helm"]
  path = lib/helm
  url = git@github.com:emacs-helm/helm.git
  build-step = EMACSLOADPATH='~/.emacs.d/lib/async:~/.emacs.d/lib/popup:' make

It seems that the make compiles the files all correctly but no when I inspect load-path I don't see lib/helm.

I tried to edebug borg-activate and apparently what fails to happen is the last push.

Not sure though it is the right code path though. Anything I can try that comes to mind?

Thanks a lot (again and again I know) for this borg!

tarsius commented 3 years ago

Nothing relevant changed in borg during the last six months so it probably got broken elsewhere.

Try without the explicit build-step. Helm's Makefile creates an autoloads file but maybe that file fails to add the file to the load-path. Have a look at the current helm-autoloads.el before making borg create a new one.

Add debug statements to borg-activate and maybe others to find out which code paths are being taken.

tarsius commented 3 years ago

My guess is that you are using Emacs 28 and that it has a regression that causes the load-path not to be set in the autoloads files anymore. So also check those files after borg recreated them.

You "fix borg compilation" commit might do the trick because it gives up on generating autoload files (generally speaking a bad idea), causing borg-activate to fall through to the final clause.

arichiardi commented 3 years ago

I am indeed on Emacs 28 and ok I will try to debug more. I did not know that it was the autoload responsibility to do that, if that's the case maybe this is a problem in helm, which correctly produces one.

arichiardi commented 3 years ago

So this exists:

$ cat helm-autoloads.el | grep load-path
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
arichiardi commented 3 years ago

And this is after I have added the build-step.

$ cat helm-autoloads.el | grep load-path

At this point I suspect the build step is compiling something different, but the only output I see from make at the .emacs.d root is:

--- [helm] ---

  Running ‘EMACSLOADPATH=$HOME/.emacs.d/lib/async:$HOME/.emacs.d/lib/popup: make’...
  Running ‘EMACSLOADPATH=$HOME/.emacs.d/lib/async:$HOME/.emacs.d/lib/popup: make’...done

I am not going to try to avoid $HOME to see if the problem is shell expansion.

arichiardi commented 3 years ago

No scratch that, I think helm does not generate that for some reason, I will open an issue there, thank you!

arichiardi commented 3 years ago

Ended up doing this:

[submodule "helm"]
  path = lib/helm
  url = git@github.com:emacs-helm/helm.git
  build-step = EMACSLOADPATH='~/.emacs.d/lib/async:~/.emacs.d/lib/popup:' make
  build-step = borg-update-autoloads

Thanks for this build-step feature. It is amazingly flexible.