Skip to content

Conversation

@fnussbaum
Copy link
Collaborator

In particular, do not install packages in alphabetical order. This means one can manually manage dependencies for packages installed via quelpa, addressing #17176. This change should be safe, also the order of package installations was approximately reversed before without obvious regressions (see this PR's first commit).

Note that we still use the alphabetically sorted list of packages in other contexts, such as when configuring packages, mostly for backward compatibility.

The installation order of packages got reversed in
fbe05e3. Appending is slower than cl-pushnew,
of course, but this is the same as what add-to-list did before, and it should
not be noticable with a few hundred packages.
In particular, do not install packages in alphabetical order. This means one can
manually manage dependencies for packages installed via quelpa recipes,
addressing syl20bnr#17176. This change should be safe, also the order of package
installations was reversed before without obvious regressions (see previous
commit).

Note that we still use the alphabetically sorted list of packages in other
contexts, such as when configuring packages, mostly for backward compatibility.
@fnussbaum fnussbaum force-pushed the install-packages-declared-order branch from e2f1e7d to 68c1a5d Compare November 14, 2025 16:51
@fnussbaum
Copy link
Collaborator Author

Installing packages in (reverse) alphabetic order is arbitrary, inflexible and can lead to problems as evidenced by #17176.

Consider also the openai layer:

(defconst openai-packages
'((openai :location (recipe :fetcher github :repo "emacs-openai/openai"))
(chatgpt :location (recipe :fetcher github :repo "emacs-openai/chatgpt"))
(codegpt :location (recipe :fetcher github :repo "emacs-openai/codegpt"))
(dall-e :location (recipe :fetcher github :repo "emacs-openai/dall-e"))))

Here, none of the packages are available on GNU/Non-GNU ELPA or MELPA, and chatgpt, codegpt and dall-e all depend on openai. Therefore, installation of those packages currently only succeeds because openai comes first in reverse alphabetical order.
After this PR, the installation succeeds because openai is declared first in openai-packages.

I skimmed through all instances of packages declared to get installed via quelpa, and it does not look like this change would break anything (in any case, it would be a simple matter to change the order of package declarations). In most other cases, the installation order should not make a difference.

@fnussbaum
Copy link
Collaborator Author

By the way, the reason for why we manually need to manage installation order for dependencies of quelpa-installed packages is that we cannot fetch the dependencies from package-alist in configuration-layer//filter-packages-with-deps-recur.

Perhaps we could, alternatively, first clone all of the quelpa packages without installing them, and then look up their dependencies to determine the installation order. But this would be a more involved change.

On the other hand, with the change of this PR, we would make the installation order of packages depend on the order of layers in dotspacemacs-configuration-layers, but I don't think this would matter in most normal use cases. Nevertheless, it might be better to fix the order of the layers in the context of package installation, for example alphabetically.

@fnussbaum
Copy link
Collaborator Author

Perhaps we could, alternatively, first clone all of the quelpa packages without installing them, and then look up their dependencies to determine the installation order.

This might indeed be better, I'll mark this PR as a draft. Sorry for the noise.

@fnussbaum fnussbaum marked this pull request as draft November 16, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant