Closed aviav closed 3 weeks ago
what emacs and org version are you using?
what emacs and org version are you using?
Org mode version 9.6.15 (release_9.6.15 @ /usr/share/emacs/29.4/lisp/org/)
this happens because the eval
at the end of the stateless tests is dynamic by default, and because buttercup became strict recently about enforcing lexical binding.
However, once you change eval
to be lexical, you will (like me) probably get a boatload of errors from mariadb, mysql, and sqlserver complaining about how their commands are either missing, depreciated, have an outdated default, or format the output in such a way to break org-sql's parser.
There is actually a much broader underlying issue, which is that the elisp dependencies have almost no version control, or emacs or itself, or any of the binaries used for testing, which means things will break like this.
Tentative solution (based on my experience with another emacs package): use straight.el instead of cask, and use conda to pin the emacs version (and in this case the sql binaries). In this case docker will also be necessary to run multiple database versions at once. https://github.com/ndwarshuis/org-sql/pull/23 will also be moot if cask is removed.
Thanks for looking into this! Since I'm new to elisp and don't know which software versions were used to make the stateful tests pass when they did, it would seem inefficient to me if I tried to implement the switch from cask to straight.el. However, I agree with your perspective on the underlying problem.
In case there's nobody who intends to implement the switch of org-sql to straight.el for the time being, I'd appreciate it if my changes, including #23, were merged, because considering the current state of Emacs, Org Mode, and the byte compiler, I see the changes as improvements, and because they are not directly related to the stateful side of things.
In case the project that I'm currently using org-sql for turns out to be long-term useful to me, I'll re-evaluate looking into the straight.el switch and possibly I'll also re-evaluate looking into updating the ways in which org-sql interfaces with the databases, or initially just with Postgres, which is what I'm using.
fixed with 17cde13a3f6a8ef5adc486202c4e58970ef110d8
regarding cask vs straight, I left cask in root of the repo so people can still run cask install
. I added some options in the readme for how best to handle this, although I'm not sure which is the best given that specifying packages manually with straight is a pain and (usually) doesn't matter.
For posterity's sake, the place where this might matter is with bleeding-edge org-mode. org-sql currently uses an older version of org-ml which will totally break on org 9.7. This will probably be fixed soon but given the centrality of org-mode to both of these packages, having reliable versioning is an advantage.
Thanks for the heads-up! I'll be sure to nail down the Emacs version in my container that pushes the SQL, and keep the old container around until I got 9.7 to work, around the time it hits my Emacs
It's strange to me that this happens, because the top of
org-sql-test-stateful.el
has-*- lexical-binding: t; -*-
, and because stateless tests run successfully.The error occurs for me on current
master
regardless of whether I runmake stateful
,make compile
, ormake test
. The Docker Compose setup is running.The change I plan to make doesn't directly interact with the database, but in case this happens because of a regression, and not because of user error, I think it's better I write an issue.
I'd be happy to provide more details if needed.
PS: Buttercup version is
20240718.14
.Error log from
make test
: