-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signal-desktop: preload sqlcipher library from nixpkgs #131843
Conversation
351d207
to
34ad713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for the idea but we should think this through first. IIRC we initially decided against using SQLCipher from Nixpkgs due to concerns about compatibility (hopefully this shouldn't be an issue but I haven't looked into it - would be welcome if you have time to look into that and could provide some references) and sticking with upstream's decisions. That said better_sqlite3.node
is far from ideal...
Also: I'd like to have a dedicated maintainer for sqlcipher
in Nixpkgs. I can (co-)maintain it but I'd like to have a second maintainer, if possible.
pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
Outdated
Show resolved
Hide resolved
@primeos I looked into it a bit more now. Signal maintains their own fork of
This is the same version as the sqlcipher package in nixpkgs. Apart from that their build has more features enabled than we're currently using for the sqlcipher package. Theirs:
Ours:
I have been using Signal for the past hours and everything seems to be working fine so far.
I have never used |
34ad713
to
63ff307
Compare
63ff307
to
d476ae5
Compare
@primeos I opted to not change the sqlcipher package directly and instead override it for signal to make sure we can use the exact same build features as the upstream signal npm package. I think this shouldn't cause any trouble now, we're building the same source with the same features enabled, we just need to keep an eye on upstream for changes going forward unfortunately. |
d476ae5
to
0381348
Compare
@primeos Any thoughts on this? I'm using this since I opened the PR, and I've been updating it locally with the new Signal versions. No issues so far. |
@andresilva thanks for the ping and sorry about my delayed reply. I'm really upset about the way upstream handles this and was hoping that a proper upstream fix would be merged (IIRC signalapp/better-sqlite3#3 should fix it upstream). Anyway, I like the current approach and using I'll probably merge this within the next 7 days but I haven't completely made up my mind yet (usually things are much simpler to decide but in this case I'm still traumatized by the past issues due to stupid decisions by Signal-Desktop...). |
0381348
to
7fac589
Compare
Updated the PR to fix conflicts. FWIW I have subscribed to notifications on the upstream https://github.com/signalapp/better-sqlite3 repo and will keep an eye for changes there. |
Thanks for fixing this, it's been bugging me for months! |
@primeos if you haven't changed your mind about this PR I would like to merge it. |
@SuperSandro2000 yes, absolutely. Feel free to merge it, I haven't changed my mind. I just seem to be way too incompetent to remember to finally merge this PR... :o (sorry, again, @andresilva - I'm still adjusting to working full-time and getting around to my backlog of TODOs). With signalapp/better-sqlite3#3 finally merged we hopefully shouldn't need the |
I just gave it a very brief test as well while updating to version 5.22.0. LGTM so let's finally get it merged - at last... :) Huge thanks @andresilva! For the fix, the fast and detailed responses, and the testing. |
Motivation for this change
Fix #124901.
Preloading the packaged node sqlcipher lib was leading to errors like:
/bin/sh: symbol lookup error: /nix/store/igb91vpsqwpiw9kpppjhxhhlk4q4b4s5-signal-desktop-5.10.0/lib/Signal/resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node: undefined symbol: node_module_register
which prevented xdg-open calls to work and in turn having links fail to open in the browser. Preloading instead the sqlcipher library from the nixpkgs repo fixes the issue, and I could still open my existing database so I presume encryption is working.
I also needed to add json and fts5 feature support to the sqlcipher library since Signal uses these (these and more are included with the vanilla sqlite package).
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)