Subject: bug#59226: 29.0.50; unable to load package-vc.el if package-vc-selected-packages is non-nil

From: Richard Kim <[email-masked]>
Date: Sat, 19 Nov 2022 09:23:50 -0800

Spacemacs <https://github.com/syl20bnr/spacemacs> is one large emacs
setup designed to be the initialization code, i.e., emacs
--init-directory spacemacs-directory.  It uses use-package to install
typically hundreds of packages.

straight.el <https://github.com/radian-software/straight.el> is an
alternative to package.el where packages are installed by cloning git
(or other) repositories and building packages from source directly.
This is similar to package-vc.el. The key difference is that the git
clone directories are not added to load-path. Rather a new directory
is created where symlinks to *.el files are used plus byte compiled
files, e.g., following would be added to load-path:

    $ cd .../spacemacs/.local/straight/build-29.0-102921/dash/
    $ ls -l
    total 360
    -rw-rw-r-- 1 kimr kimr   2936 Oct 29 22:04 dash-autoloads.el
    lrwxrwxrwx 1 kimr kimr     63 Oct 29 22:04 dash.el ->
/home/kimr/.emacs.d/sm-ms/.local/straight/repos/dash.el/dash.el
    -rw-rw-r-- 1 kimr kimr 147632 Oct 29 22:04 dash.elc
    -rw-rw-r-- 1 kimr kimr 198812 Oct 29 22:04 dash.info
    lrwxrwxrwx 1 kimr kimr     65 Oct 29 22:04 dash.texi ->
/home/kimr/.emacs.d/sm-ms/.local/straight/repos/dash.el/dash.texi
    -rw-rw-r-- 1 kimr kimr    617 Oct 29 22:04 dir
    $

I have an update to my previous email. I think I'm understanding
better how package-vc is supposed to work. So please disregard my
previous question on activation. Instead I would like to share that
package-vc seems to work fine except for packages that house *.el
files within a sub-directory, e.g., magit or git-commit packages which
use lisp sub-directories. For these packages I either have to install
magit package using package.el (even though I installed it via
package-vc) or I would have to manually add the lisp sub-directory to
load-path in my startup file. If I do that, then magit and git-commit
packages installed via package-vc work.  Following is what I currently
have in my startup file to be able to use package-vc installed magit
and git-commit packages.

    (add-to-list 'load-path "~/.emacs.d/sm-my/elpa/29.0/site/git-commit/lisp")
    (add-to-list 'load-path "~/.emacs.d/sm-my/elpa/29.0/site/magit/lisp")

In my typical spacemacs setup, I have between 300 and 400 hundred
packages installed. I think more than half were installed via
package-vc and rest were installed via pacakge.el. I'm trying to see
if I can use package-vc to install all packages.