syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.63k stars 4.89k forks source link

How can I pin a specific package version or commit, e.g. for org-mode? #16520

Closed komali2 closed 1 week ago

komali2 commented 1 month ago

There's some kind of bug in org-mode that makes org-roam-db-sync fail on files with certain kinds of links. The recommended fix https://github.com/org-roam/org-roam/issues/2361 seems to be to pin org mode to a specific versions. use-package and doom emacs users have shared how to do this, however I'm not clear on how to do this in spacemacs from my configuration.

One option would possibly be to override the layer package: https://develop.spacemacs.org/doc/FAQ.html#how-to-override-a-layer-package however I feel like I'm probably missing an easier solution.

Many years ago a method to do this was issued as a PR: https://github.com/syl20bnr/spacemacs/pull/6575 but closed without merge.

Is there a way in spacemacs to pin a package version similar to doom's (package! org :pin "5890ac") ?

komali2 commented 1 month ago

For now I've changed within layers/+emacs/org/packages.el

I set (org :location elpa :min-version "9.7.8") to instead be (org :location elpa :version "9.6.7") , then ran package-delete on org, then restarted emacs, then did package-recompile-all , and that seemed to work. I feel like there's probably a better way though.

fnussbaum commented 2 weeks ago

The recommended fix https://github.com/org-roam/org-roam/issues/2361 seems to be to pin org mode to a specific versions

From reading that issue it seems it should actually work with newer Org versions, and is rather a matter of ensuring correct byte-compilation. I also had trouble when when upgrading to Org 9.7, as predicted in https://yhetil.org/emacs-devel/8735112ttw.fsf@localhost/T/#u. I think the same underlying problem led to this issue being reported, although there is actually nothing wrong with org-appear.

smile13241324 commented 1 week ago

I don't think we have a proper way to pin package versions, the actual idea in Spacemacs is to use the latest and greatest package versions all the time. Assuming that incompatibilities are solved fast and happen very seldomly.

If it happens anyway then changing the layer is the right way to go.

fnussbaum commented 1 week ago

If it happens anyway then changing the layer is the right way to go.

That is the most flexible way I think. One other way that I just used for persp-mode (which introduced an annoying bug/feature after the latest update that I planned to investigate at some later point) is rolling back the package update and then adding the package to dotspacemacs-frozen-packages to keep it from updating.