Installing solely from debian apt repositories is problematic

I just spent 2 full days trying to debug this.

I noticed one thing: Debian 29.1 from bookworm backports doesn’t play nice with org-roam 2.2.1 package from debian bookworm stable repos.

Here is Debian 29.1 from bookworm-backports + elpa-org-roam package installed from from bookworm repos:

PROBLEM: OrgRoam backlinks buffer doesn’t show the all backlinks there actually are. As you can see, it lists only one of them.

PROBLEM2: In the OrgRoam backlinks buffer I cannot hit “Enter” and navigate to the backlinking node itself. Nor I can click on it and navigate there. Also doing M-x org-roam-buffer-visit-thing wasn’t working, it wasn’t enabling me to navigate to the backlinking node.

PROBLEM3: In the OrgRoam backlinks buffer, there are no chevron icons that enable me to hit button and expand the backlinking position, or sentence, in the backlinking node.

And here, as a proof, another org roam document also containing a link to “Human Languages” document:

As you can see, the “German” document doesn’t show up in the “Human Languages” document’s backlinks list.


Now, when I use Emacs 28.2 from bookworm stable (and not the 29.1 from the backports) + elpa-org-roam from bookworm stable I get the totality of the backlinks presented to me, as it supposed to:

I also get the totality of backlinks visible (along with the chevron icons that enable me to use button to expand the backlink references) when I use Emacs 29.1 from bookworm backports + org-roam from MELPA:


All in all, this sort of incoherent behavior was quite annoying, and it cost me 2 full days of absolute confusion. I am also disappointed that debian repository emacs from backports and the debian repository elpa-* packages don’t play well—debian is supposed to be stable and all, you know…

Hmm, I am using debian too - might I ask why are you mix and matching backports and stable?

out of context, but: Stable doesn’t mean bug free, it means a slow moving target, almost frozen though.

You should know better not to install from backports and complain packages in stable are broken, although some packages might be - but not in your case.

Org-roam 2.2.1 is old (for a young package that has gone through a rapid iteration). The current version is 2.2.2, [correction: released April 2022; last commit in early March 2023].

A couple of comments:

  • I am not sure if 2.2.1 was already present when Emacs 29.1 (I believe you mean Emacs 29.1, rather than Debian 29.1).
  • This means that 2.2.1 may not have been tested with 29.1.
  • The issue you experience seems to be related to the version of emacsql-sqlite that you use, which may or may not be tested for the combination of org-roam and Emacs versions you use

If possible, I think you should use the latest version, or the latest commit of, org-roam with Emacs 29 with built-in SQL (with the emacsql-builtin package).

I think I understand your frustration. But to me the struggle and new discovery and learning from it are part of the fun with choosing to use open software. So… to me your “2 full days of absolute confusion” is rather 2 days of trekking in the unknown territory – including the frustration, annoyance, and disappointment. At the end, you have learned new things.

In the spirit of learning, I do not know the philosophy behind Debian and its “stability”. Why not compile Emacs from source or use the latest stable version 29 and use MELPLA for packages like org-roam? This seems much easier to manage Emacs specific settings and packages. This is a pure question out of curiosity (I am not familiar with all the Linux distributions; I am just a hobbyist computer user).

Are you using org-roam from MELPA, or from the debian apt repositories?

Because why not? I never thought of there being harm in using backports in a debian system. It didn’t occur to me that there would be a problem, necessarily, when I use emacs 29.1 from bookworm-backports, and org-roam from bookworm stable repos.

Interesting information.

That’s my intuition as well.

I appreciate the offerings of sympathy. Thanks.

Yes. Looking back at those two days, it got me practice with reading the code and the documentation of Emacs packages. So I also try to reframe my experience in this manner. Consider my original post in this thread partly a product of the-moment’s-frustration.

I fancy the idea of relying on as little 3rd party package managers as possible. I am a bit information security aware person, and I am anxious about the kind of personal information that I input using Emacs all day long. Having to rely on MELPA (which is a third party repository with packages coming from many different contributors), in my opinion, increases the attack surface to my personal information. That’s why I was trying to use emacs packages solely from apt repos.


Status Update: I have settled into using Emacs 29.1 from debian backports, along with many emacs packages installed from debian apt repositories, with a few exceptions. Since emacsql-sqlite, org-roam and emacs 29.1 don’t play nice together, I have installed org-roam from MELPA, and it installed emacsql as a dependency for itself. Following is a snapshot of my emacs packages that I see when I visit M-x list-packages:

 with-editor                    3.0.5          external              Use the Emacsclient as $EDITOR
  transient                      0.3.7          external              Emacs key and popup interface for complex keybindings
  swiper                         0.13.4         external              Isearch with an overview. Oh, man!
  smex                           3.0            external              M-x interface with Ido-style fuzzy matching.
  seq                            2.23           external              Sequence manipulation functions
  rainbow-delimiters             2.1.5          external              Highlight brackets according to their depth
  projectile                     2.7.0          external              Manage and navigate projects in Emacs easily
  org-roam                       2.2.1          external              A database abstraction layer for Org-mode
  magit-section                  3.3.0          external              Sections for read-only buffers
  magit                          3.3.0          external              A Git porcelain inside Emacs.
  lua-mode                       20210802       external              a major-mode for editing Lua scripts
  ivy                            0.13.4         external              Incremental Vertical completYon
  git-commit                     3.3.0          external              Edit Git commit messages
  emacsql-sqlite3                1.0.2          external              Yet another EmacSQL backend for SQLite
  emacsql-sqlite                 3.1.1          external              EmacSQL back-end for SQLite
  emacsql                        3.1.1          external              High-level SQL database front-end
  dash                           2.19.1         external              A modern list library for Emacs
  counsel                        0.13.4         external              Various completion functions using Ivy
  compat                         29.1.3.4       external              Emacs Lisp Compatibility Library
  emacsql                        20230417.1448  dependency            High-level SQL database front-end
  org-roam                       20230307.1721  installed             A database abstraction layer for Org-mode
  emacsql-sqlite-builtin         20230409.1847  installed             EmacSQL back-end for SQLite using builtin support

All the “external” items in this list are installed from debian apt repos.

Now, interestingly, in this setup, I am getting org-roam work as it is supposed to. All the problems about backlinks I mentioned in my original post have seemingly disappearaed (though I need more testing, it has since been a single day).

Here’s my org-roam config in my init.el file currently:

(use-package org-roam
  :ensure t
  ;; :init
  ;; (setq org-roam-database-connector 'emacsql-sqlite-builtin)
  :custom
  (org-roam-completion-everywhere t)
  (org-roam-directory (file-truename "~/Documents/org/roam/"))
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n g" . org-roam-graph)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)
         ;; Dailies
         ("C-c n j" . org-roam-dailies-capture-today)
         :map org-mode-map
         ("C-M-i" . completion-at-point))
  :config
  ;; ;; If you're using a vertical completion framework, you might want a more informative completion interface
  ;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode)
  (require 'org-roam-dailies)
  (require 'org-roam-protocol))

Now, one confusion I have is about org-roam-database-connector. Currently, as you can see I have that line commented-out, even though I have emacsql-sqlite-builtin package installed from melpa. Now, when I query the value of org-roam-database-connector I see its value is set to (out of my own involvement) sqlite-builtin. This confuses me. Because in the org-roam documentation, the possible values for that are listed as

  1. 'sqlite
  2. 'sqlite3
  3. 'emacsql-sqlite-builtin

The first one being the default value that org-roam supposed to assign (even though in my case I am seeing the default value as sqlite-builtin), the second one is recommended if you are using an emacs version lesser than 29 and you should install emacsql-sqlite3 package for that, and the third one is the recommended version for emacs versions greater and equal to 29, and you should install emacsql-sqlite-builtin package along with that. Where did the sqlite-builtin value come from for the db-connector, and why am I not seeing it documented as a possible value in the org-roam docs?

1 Like

The builtin option is new for org-roam and new for Emacs itself — it’s a new feature from 29 where sqlite c code can be compiled within Emacs (default option when you compile it from source if the relevant c library is available in the machine that does compiling).

Within Org-roam, there is a new piece of code that checks if the sqlite is available within Emacs and set the db-connector value to bultin. If not, it gets set to the previous default.

The reason for this not properly documented, I suspect, is because it is new. And Org-roam maintainers currently have been having a capacity issue (there is a GitHub issue that discuss this so it is no secret or anything; it’s been a known challenge for some time).

I am just typing all above in my mobile so I am not linking to the relevant sources of information or the part of Org-roam source to substantiate what I am saying — let me take some time to do so, if you and others wish to see more detail. Let me know.

2 Likes

Alright. Didn’t know that.