SystemCrafters / crafted-emacs

A sensible base Emacs configuration.
MIT License
739 stars 117 forks source link

[chemacs2] some packages can not be activated, reinstalled every time #213

Closed oatmealm closed 2 years ago

oatmealm commented 2 years ago

I'm not sure what is the problem, but I'm seeing this behavior every time I launch crafted with chemacs2. It seems to be packages related to my additions in config.org...

emacs --with-profile crafted
Loading /home/uri/src/crafted-emacs/bootstrap/crafted-package.el (source)...
Loading /home/uri/src/crafted-emacs/bootstrap/crafted-package.el (source)...done
Loading /home/uri/src/crafted-emacs/bootstrap/crafted-package-bootstrap.el (source)...
Loading /home/uri/src/crafted-emacs/bootstrap/crafted-package-bootstrap.el (source)...done
Unable to activate package ‘flycheck’.
Required package ‘dash-2.12.1’ is unavailable
Unable to activate package ‘sideline-flycheck’.
Required package ‘flycheck-0.14’ is unavailable
Unable to activate package ‘shrink-path’.
Required package ‘s-1.6.1’ is unavailable
Unable to activate package ‘magit-popup’.
Required package ‘dash-2.13.0’ is unavailable
Unable to activate package ‘helpful’.
Required package ‘dash-2.18.0’ is unavailable
Unable to activate package ‘guix’.
Required package ‘dash-2.11.0’ is unavailable
Unable to activate package ‘flycheck’.
Required package ‘dash-2.12.1’ is unavailable
Unable to activate package ‘elisp-refs’.
Required package ‘dash-2.12.0’ is unavailable
Unable to activate package ‘shrink-path’.
Required package ‘s-1.6.1’ is unavailable
Unable to activate package ‘doom-modeline’.
Required package ‘shrink-path-0.2.0’ is unavailable
Unable to activate package ‘citeproc’.
Required package ‘dash-2.13.0’ is unavailable
Unable to activate package ‘citeproc’.
Required package ‘dash-2.13.0’ is unavailable
Unable to activate package ‘citar’.
Required package ‘citeproc-0.9’ is unavailable
Unable to activate package ‘bui’.
Required package ‘dash-2.11.0’ is unavailable
jeffbowman commented 2 years ago

Right after bootstraping package you should see: crafted-init: package archives stale, refreshing in the background. Usually, when you see the Required package 'foo...' is unavailable has to do with the package archives not being current. You could try running (package-refresh-contents) and see if that helps on the restart. It should be doing that automatically, but if we aren't seeing the message above, then probably not.

oatmealm commented 2 years ago

I'm actually seeing that the packages were installed in ~/.config/crafted-emacs/elpa/ where i have my customizations... while the original packages were probably initialy installed in ~/.emacs.d/elpa... and are still there.

package-user-dir is a variable defined in package.el.gz.

Value
"/home/xxx/.config/crafted-emacs/elpa/"

Original Value
"~/src/crafted-emacs/elpa"

Looking at crafted-package-bootstrap.el I see:

(customize-set-variable 'package-user-dir
                        (expand-file-name "elpa/" crafted-config-path))

which changes the installation path... I'm not sure whats happeing....

jeffbowman commented 2 years ago

This is following the same pattern as with the straight package manager, moving the installed packages to the crafted-config-path. This helps (or should help) keep the user-emacs-directory fairly clean. If you look in crafted-defaults.el you'll see other things we move to the crafted-config-path keeping with this same philosophy. Haven't found everything that needs to move yet, but as things are discovered, they can be added to the list of things in crafted-defaults.el... the only real downside is if a user doesn't use crafted-defaults in their configuration.

Back on this topic, I'll have to dig more into how chemacs2 works under the hood. The package-user-dir is moved (as you have found in the bootstrap code) early enough that all packages should be installed in the crafted-config-path. It seems to work just fine when not using chemacs2 and I hadn't noticed anything amiss with my testing using chemacs2 but I'll have to follow up on that and see what I can find out.

oatmealm commented 2 years ago

I've deleted and re-pulled craft into ~/src/, keeping my customizations in ~/.config/crafted-emacs and it seems to be working as expected now. I'll close for a while and report if it shows up again. Thanks!

jeffbowman commented 2 years ago

Closing per the last comment.