session-desktop
session-desktop copied to clipboard
FreeBSD support
Describe the bug There is no version for FreeBSD.
To Reproduce Go to https://getsession.org/download/.
Other information (please complete the following information):
- Device: PC
- OS: FreeBSD 12.2 helloSystem
Electron isn't officially supported on FreeBSD (yet? https://github.com/electron/electron/issues/3797), so until then you would need to patch Session to use https://github.com/tagattie/FreeBSD-Electron instead (hoping there'snt any other dependencies that require patches too)
What's a .freebsd binary? Should it be able to run on freebsd?
I am wondering the same thing...
https://github.com/getferdi/ferdi/pull/1503#issuecomment-899422987
Well, I got a freebsd file but no idea how to use it.
Using https://github.com/tagattie/FreeBSD-Electron/releases/ (and downgrading harfbuzz due to a bug) Electron does run on FreeBSD:
Electron should appear in the official FreeBSD Packages soon (again) after the build is fixed.
Taking app.asar.unpacked
and app.asar
from the AppImage for Linux, it looks like Session needs a compiled library, better_sqlite3.node
:
FreeBSD% file /home/user/Desktop/Session.app/Resources/app/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node
/home/user/Desktop/Session.app/Resources/app/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e7b6cc11fd1878eea6387bd3bb3663082cdce83f, with debug_info, not stripped
How can https://github.com/signalapp/better-sqlite3 be built for FreeBSD?
After reading https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules, using
FreeBSD% sudo pkg install node npm # node-16.10.0, npm-6.14.8
FreeBSD% cd /tmp
FreeBSD% sudo chown -R $USER /tmp/node_modules
FreeBSD% /usr/local/bin/npm rebuild --nodedir=/home/user/Desktop/Session.app/Resources/usr/local/share/electron12/node_headers better-sqlite3
FreeBSD% file node_modules/better-sqlite3/build/Release/better_sqlite3.node
node_modules/better-sqlite3/build/Release/better_sqlite3.node: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, with debug_info, not stripped
FreeBSD% cp node_modules/better-sqlite3/build/Release/better_sqlite3.node /home/user/Desktop/Session.app/Resources/app/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node
Now it starts to run but ends up in a crash loop:
FreeBSD% ~/Desktop/Session.app/Session
Set Windows Application User Model ID (AUMID) { appUserModelId: 'com.loki-project.messenger-desktop' }
NODE_ENV development
NODE_APP_INSTANCE undefined
NODE_CONFIG_DIR /usr/home/user/Desktop/Session.app/Resources/app/app.asar/config
NODE_CONFIG {}
userData: /usr/home/user/.config/Session-development
config/get: Did not find user config file, cache is now empty object
config/get: Did not find ephemeral config file, cache is now empty object
making app single instance
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"app ready","time":"2021-10-23T20:35:18.739Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"starting version 1.7.3","time":"2021-10-23T20:35:18.740Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"key/initialize: Generating new encryption key, since we did not find it on disk","time":"2021-10-23T20:35:18.745Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"config/set: Saving user config to disk","time":"2021-10-23T20:35:18.747Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"migrateDatabase: Migration without cipher change failed {}","time":"2021-10-23T20:35:18.807Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"migrateDatabase: migrateSchemaVersion failed {}","time":"2021-10-23T20:35:18.808Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"Database startup error: TypeError: Cannot read property 'prepare' of null\n at getSQLiteVersion ([REDACTED]/app.asar/app/sql.js:135:33)\n at updateSchema ([REDACTED]/app.asar/app/sql.js:801:25)\n at Object.initialize ([REDACTED]/app.asar/app/sql.js:1321:5)\n at showMainWindow ([REDACTED]/app.asar/main.js:682:7)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async App.<anonymous> ([REDACTED]/app.asar/main.js:648:5)","time":"2021-10-23T20:35:18.808Z","v":0}
{"name":"log","hostname":"FreeBSD","pid":7065,"level":30,"msg":"config/remove: Deleting user config from disk","time":"2021-10-23T20:35:18.955Z","v":0}
Unhandled Promise Rejection: TypeError: Cannot read property 'prepare' of undefined
at getById (/usr/home/user/Desktop/Session.app/Resources/app/app.asar/app/sql.js:1489:44)
at Object.getItemById (/usr/home/user/Desktop/Session.app/Resources/app/app.asar/app/sql.js:1456:10)
at getSpellCheckSetting (/usr/home/user/Desktop/Session.app/Resources/app/app.asar/main.js:80:26)
at showMainWindow (/usr/home/user/Desktop/Session.app/Resources/app/app.asar/main.js:688:44)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async App.<anonymous> (/usr/home/user/Desktop/Session.app/Resources/app/app.asar/main.js:648:5)
{"name":"log","hostname":"FreeBSD","pid":7065,"level":50,"msg":"Unhandled Promise Rejection: TypeError: Cannot read property 'prepare' of undefined\n at getById ([REDACTED]/app.asar/app/sql.js:1489:44)\n at Object.getItemById ([REDACTED]/app.asar/app/sql.js:1456:10)\n at getSpellCheckSetting ([REDACTED]/app.asar/main.js:80:26)\n at showMainWindow ([REDACTED]/app.asar/main.js:688:44)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async App.<anonymous> ([REDACTED]/app.asar/main.js:648:5)","time":"2021-10-23T20:35:19.070Z","v":0}
This would be awesome! By chance, has anyone revisited this in a while?