tutao / tutanota

Tuta is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
https://tuta.com
GNU General Public License v3.0
6.06k stars 524 forks source link

regarding ARM64: Architecture detection and OpenSSL-linux-arm64 inclusion #6268

Closed ghost closed 10 months ago

ghost commented 10 months ago

Describe the bug

  1. Building on ARM64 with node desktop --custom-desktop-release will throw an error, saying that the architecture is not supported. So the arm64 architecture doesn't get detected the right way.
jonah@gentle ~/tutanota $ node desktop --custom-desktop-release
Custom desktop release - setting platform to linux
file:///home/jonah/tutanota/desktop.js:51
            throw new Error(`Platform ${opts.platform} on ${opts.architecture} is not supported`)
                  ^

Error: Platform linux on arm64 is not supported
    at Command.<anonymous> (file:///home/jonah/tutanota/desktop.js:51:10)
    at Command.listener [as _actionHandler] (/home/jonah/tutanota/node_modules/commander/lib/command.js:481:17)
    at /home/jonah/tutanota/node_modules/commander/lib/command.js:1237:65
    at Command._chainOrCall (/home/jonah/tutanota/node_modules/commander/lib/command.js:1153:12)
    at Command._parseCommand (/home/jonah/tutanota/node_modules/commander/lib/command.js:1237:27)
    at Command.parseAsync (/home/jonah/tutanota/node_modules/commander/lib/command.js:916:16)
    at file:///home/jonah/tutanota/desktop.js:56:3

Node.js v21.4.0

caused by: https://github.com/tutao/tutanota/blob/ce7bc4172d3d70c590d4ef150b5a9c340251c087/desktop.js#L50-L52

  1. There still is no OpenSSL-linux-arm64 with a libcrypto.a in it which makes the build on ARM64 fail, I have to get the OpenSSL-linux-arm64 from Signal's sqlcipher and put it there, then I have to make sure that it stays there by staying constantly alert and always checking (node desktop --custom-desktop-release will delete that directory approximately before it starts electron.)

logfile.txt

To Reproduce Steps to reproduce the behavior:

  1. Follow the BUILDING.md
  2. execute node desktop --custom-desktop-release, see issue 1. (after deleting the if-statement that is causing it in desktop.js, you can get to see issue 2.)

Expected behavior

  1. Supported architectures should be detected in the right way. (So that it'll be able to build.)
  2. better-sqlite3 should have full ARM64 support. (So that the build will actually succeed.)

Desktop (please complete the following information):

Additional context

Awesome that the tutanota team started tackling ARM64 support (as I've seen in recent commits) However, it seems to me that, over the years, building it on Linux ARM64 got harder and harder, First everything worked as expected, then one had to get signal's sqlcipher, and now the architecture isn't detected properly and one has to copy the OpenSSL-linux-arm64 WHILE the node desktop --custom-desktop-release command is executing, at around the end, that command will delete the libcrypto.a out of the OpenSSL-linux-arm64, which makes the build fail. Building has become very difficult.

Thanks for any future fixes in advance.

Signal's sqlcipher.tar.gz: https://github.com/signalapp/better-sqlite3/blob/587721adcf31e5872e0089a1bccc9a9342f46dd5/deps/sqlcipher.tar.gz

rezbyte commented 10 months ago

Duplicate of #4413.