Arm64 Build
Closed this issue ยท 49 comments
Current Behavior
When trying to build version 3.0.6
, I am getting this error:
Error
marcell@raspberry:/tmp/bridge/proton-bridge-3.0.6$ make
go build -tags='' -ldflags '-X github.com/ProtonMail/proton-bridge/v3/internal/constants.Version=3.0.6+git -X github.com/ProtonMail/proton-bridge/v3/internal/constants.Revision=f070314524 -X github.com/ProtonMail/proton-bridge/v3/internal/constants.BuildTime=2022-12-18T14:34:24+0000 -X "github.com/ProtonMail/proton-bridge/v3/internal/constants.FullAppName=Proton Mail Bridge"' -o "proton-bridge" "./cmd/Desktop-Bridge/"
# github.com/ProtonMail/gluon/internal/parser
/usr/bin/ld: cannot find -lparser: No such file or directory
/usr/bin/ld: cannot find -lparser_gen: No such file or directory
/usr/bin/ld: cannot find -lproto: No such file or directory
/usr/bin/ld: cannot find -lprotobuf: No such file or directory
/usr/bin/ld: cannot find -lantlr4-runtime: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:104: proton-bridge] Error 2
What was done
The only missing package/lib was ninja-build
and libsecret-1-dev and libsecret-1-0
however, both were installed.
Ah, damn, I totally missed the path "gluon". Thanks!
Now I have the built .a llibraries, however, I am not too sure how to link them to bridge when using "make"
Figured out, just copied the *.a files to /usr/lib and /usr/lib/aarch64-linux-gnu
Seems "bridge" was built and so far works, but I got some strange errors.
marcell@raspberry:/tmp/bridge/proton-bridge-3.0.6$ make
go build -tags='' -ldflags '-X github.com/ProtonMail/proton-bridge/v3/internal/constants.Version=3.0.6+git -X github.com/ProtonMail/proton-bridge/v3/internal/constants.Revision=f070314524 -X github.com/ProtonMail/proton-bridge/v3/internal/constants.BuildTime=2022-12-21T11:53:48+0000 -X "github.com/ProtonMail/proton-bridge/v3/internal/constants.FullAppName=Proton Mail Bridge"' -o "proton-bridge" "./cmd/Desktop-Bridge/"
mv proton-bridge bridge
cd internal/frontend/bridge-gui/bridge-gui && \
BRIDGE_APP_FULL_NAME="Proton Mail Bridge" \
BRIDGE_VENDOR="Proton AG" \
BRIDGE_APP_VERSION=3.0.6+git \
BRIDGE_REVISION=f070314524 \
BRIDGE_BUILD_TIME=2022-12-21T11:53:48+0000 \
BRIDGE_GUI_BUILD_CONFIG=Release \
BRIDGE_INSTALL_PATH=/tmp/bridge/proton-bridge-3.0.6/cmd/Desktop-Bridge/deploy/linux \
./build.sh install
++ realpath ../../../..
++ START_DIR=/tmp/bridge/proton-bridge-3.0.6/internal/frontend/bridge-gui/bridge-gui
+++ basename ../../../..
++ BASENAME=..
+++ dirname ../../../..
++ cd ../../..
+++ readlink ..
++ LNK=
++ '[' '' ']'
++ REALPATH=/tmp/bridge/proton-bridge-3.0.6/internal/..
++ cd /tmp/bridge/proton-bridge-3.0.6/internal/frontend/bridge-gui/bridge-gui
++ echo /tmp/bridge/proton-bridge-3.0.6/internal/..
+ BRIDGE_REPO_ROOT=/tmp/bridge/proton-bridge-3.0.6/internal/..
+ BRIDGE_INSTALL_PATH=/tmp/bridge/proton-bridge-3.0.6/cmd/Desktop-Bridge/deploy/linux
+ BRIDGE_APP_VERSION=3.0.6+git
+ BRIDGE_APP_FULL_NAME='Proton Mail Bridge'
+ BRIDGE_VENDOR='Proton AG'
+ BUILD_CONFIG=Release
++ echo ./cmake-build-Release
++ tr '[:upper:]' '[:lower:]'
+ BUILD_DIR=./cmake-build-release
+ VCPKG_ROOT=/tmp/bridge/proton-bridge-3.0.6/internal/../extern/vcpkg
+ git submodule update --init --recursive /tmp/bridge/proton-bridge-3.0.6/internal/../extern/vcpkg
error: pathspec '/tmp/bridge/proton-bridge-3.0.6/internal/../extern/vcpkg' did not match any file(s) known to git
+ check_exit 'Failed to initialize vcpkg as a submodule.'
+ '[' 1 -ne 0 ']'
+ echo 'Process failed: Failed to initialize vcpkg as a submodule.'
Process failed: Failed to initialize vcpkg as a submodule.
+ rm -r ./cmake-build-release
rm: cannot remove './cmake-build-release': No such file or directory
+ exit 1
You need to update https://github.com/ProtonMail/gluon/blob/dev/internal/parser/package.go with new entries for arm64 so that the Gluon library is linking against these symbols.
You may need to use a custom fork of the Gluon repo that you replace in the bridge's go.mod file.
Thanks for the tips.
I am not entirely sure how to update this file fore any new entries?
Would it be like this? (removing comments, and other entries)
package parser
#cgo LDFLAGS: -lparser -lparser_gen -lproto -lprotobuf -lantlr4-runtime
#cgo darwin,arm64 LDFLAGS: -Llib/Darwin/arm64 -framework CoreFoundation -liconv
import "C"
//go:generate swig -go -intgosize 64 -c++ parser.i
I can't say with certainty. I would expect adding a new entry (see below). would be enough.
//#cgo linux,arm64 LDFLAGS: -Llib/Linux/x86_64 -luuid
We currently don't test on ARM64. I would recommend you checkout the Gluon repository and see if you can run the unit test on your machine with those changes. Once you succeed at doing that it should work with Bridge.
Also don't forget to checkout the git sub modules (git submodule update --init --recursive
).
Thank you very much!
There are just way too many references to this repository and after updating them they there is always an error ;(
As @LBeernaertProton said, we don't build/test for ARM64. However, I can imagine it would be pretty straightforward to set up using a go workspace (see https://go.dev/blog/get-familiar-with-workspaces).
You'd have a top level directory for the workspace, in which you would clone both the bridge and the gluon repo. Then, you'd make changes as @LBeernaertProton described to build gluon for ARM64. Once that works and the unit tests all pass, you'd just have to edit the go.work to make bridge build against your local gluon version.
All going well, you won't have to make any changes to the bridge source code. Also, bridge should automatically find the compiled static archives produced by gluon; you don't have to move them to /usr/lib.
Hi @sqpp, Thank you for your interest in Bridge. I can just confirm what @LBeernaertProton and @jameshoulahan said, ARM64 is not officially supported, and is not on the short term plans. Because ARM64 build is mostly blocked by the Gluon library, it can make sense to bring this discussion to the Gluon repository. Some has already started under this issue.
with gluon's dependency for antlr removed, shouldn't support be available soon? once gluon has been updated to 0.15.0?
Hey @larivierec . Yes that is correct. Gluon v0.15 no longer has any direct C++ dependencies. As soon as we are able, we will release an update which includes this version of Gluon.
I am so thankful, because I pay for Proton as a Business owner and the only reason I cannot use SMTP on my Raspberry is that ProtonBridge is required. Thank you guys!
Hi @sqpp and others, we've bumped the v3
branch (which more or less tracks our internal v3 development branch) to include the new Gluon v0.15.0 version. ARM builds should now work.
For example, to build for Raspberry Pi, make sure you have Go 1.18+ and libsecret-1-dev
, as well as a supported secret store (e.g. pass
-- make sure you've initialized it correctly). You can download a newer Go release from here and add the bin
directory to your Pi's shell path.
Then check things work with make run-cli
. If you're presented with the Bridge shell, congrats! You should then find two executables, bridge
(the actual bridge app) and proton-bridge
(the launcher, which launches the bridge; ignore this if you have no need for it).
You can then run the bridge by giving it the -c
flag (instructing it to start the shell) or the --noninteractive
flag (instructing it to start as a pseudo-service).
NOTE: The v3
branch has undergone absolutely no release checks. We provide no stability guarantees of any kind.
Just to confirm all works great on Raspberry Pi 4.
Thank you once again for this quick fix!
Glad to hear it :)
As such, I'll close this issue.
confirmed works thanks :)
I still can't build it for arm64. I'm getting
github.com/docker/docker-credential-helpers/secretservice: build constraints exclude all Go files in /tmp/go/pkg/mod/github.com/!proton!mail/docker-credential-helpers@v1.1.0/secretservice
make: *** [Makefile:109: proton-bridge] Error 1
@primalmotion that's strange -- could you please dump the output of go env
here?
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/primalmotion/.cache/go-build"
GOENV="/home/primalmotion/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/[snip]/go/pkg/mod"
GOOS="linux"
GOPATH="/home/[snip]/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2934007703=/tmp/go-build -gno-record-gcc-switches"
`''`
Thanks. Looks like you're trying to build for ARM64 on an AMD64 machine. Cross-compilation is difficult when cgo is involved. If you want to build for ARM64, I'd suggest actually doing the build on the target machine.
correct. Good ol' CGO... I wanted to build that on my laptop as it's faster than on my phone :) but yeah let me try that
hum. I'm ending up with the original error of that ticket
/usr/local/go/pkg/tool/linux_arm64/link: running g++ failed: exit status 1
/bin/ld: cannot find -lparser
/bin/ld: cannot find -lparser_gen
/bin/ld: cannot find -lproto
collect2: error: ld returned 1 exit status
Where are these libs coming from? Their names are too generic to find a matching package
Those come from Gluon. However, as explained in this message, you'll need to ensure you're building against the v3
branch. Gluon used to have some C++ dependencies which needed to be compiled first; those have since been removed, but Bridge's master branch doesn't yet point to this newer version of Gluon.
Please be aware that the v3
branch has not undergone any of our standard pre-release checks. Use with caution.
that worked thanks!
i just ran into this same issue today, while trying to build the proton-bridge on my PinebookPro:
[mbohun@mbohunpinebookpro gluon.git]$ uname -a
Linux mbohunpinebookpro 6.1.12-1-MANJARO-ARM #1 SMP PREEMPT Tue Feb 14 22:16:04 UTC 2023 aarch64 GNU/Linux
[mbohun@mbohunpinebookpro gluon.git]$ dmesg -T | grep -i 'machine model'
[Tue Mar 7 18:44:33 2023] Machine model: Pine64 Pinebook Pro
[mbohun@mbohunpinebookpro gluon.git]$
...and after that i would like to try the same build on my RISC-V box:
[riscv@mbohun-unmatched src]$ uname -a
Linux mbohun-unmatched 5.18.8-200.0.riscv64.fc33.riscv64 #1 SMP Wed Jun 29 15:09:53 EDT 2022 riscv64 riscv64 riscv64 GNU/Linux
[riscv@mbohun-unmatched src]$ dmesg -T | grep -i 'machine model'
[Sun Mar 12 14:16:02 2023] Machine model: SiFive HiFive Unmatched A00
so more than happy to help/assist with building/testing/documenting for these two non-intel architectures.
Hi @mbohun, can you confirm you're on the v3
branch?
Hi @mbohun, can you confirm you're on the
v3
branch?
my apologies, i should be more specific: no i was not on the v3
branch, chronology:
- i started building proton-bridge
- i ran into this problem (the start of this issue), as i was googling for solution
- i made my above comment
- going to continue building proton-bridge (for arm64) tomorrow
- once i am done with arm64, i am going to attempt building it on riscv64
I built this on my PinePhone with the v3 branch and the instructions here: https://github.com/ProtonMail/proton-bridge/blob/master/BUILDS.md, and I'm getting an error in GNOME Online Accounts, complaining about the connection being PLAIN. I am using the correct server, correct username, correct password, and STARTTLS
PinePhone nice!. @julianfairfax You can change the IMAP security to use SSL instead of STARTTLS.
PinePhone nice!. @julianfairfax You can change the IMAP security to use SSL instead of STARTTLS.
That generates still shows the same error.
I built this on my PinePhone with the v3 branch and the instructions here: https://github.com/ProtonMail/proton-bridge/blob/master/BUILDS.md, and I'm getting an error in GNOME Online Accounts, complaining about the connection being PLAIN. I am using the correct server, correct username, correct password, and STARTTLS
@julianfairfax i wonder if you could clarify if that problem happens only with GNOME Online Accounts OR if it happens with all apps (Geary, Thuderbird, mutt, etc.) you tested with proton-bridge ?
i tested successfully that on my:
- PinePhone1.2 (postmarketOS/phosh stable)
- PinePhonePro (postmarketOS/phosh stable)
with Geary, HOWEVER i did point Geary running on the PinePhone-s over a ssh tunnel connected to an intel box running the proton-bridge (i was not running proton-bridge on PinePhone-s yet).
Basically i am just curious if you could narrow down the problem if it is specific to GNOME Online Accounts or if it is affecting other apps (Geary, Thuderbird, mutt, etc.) too.
I built this on my PinePhone with the v3 branch and the instructions here: https://github.com/ProtonMail/proton-bridge/blob/master/BUILDS.md, and I'm getting an error in GNOME Online Accounts, complaining about the connection being PLAIN. I am using the correct server, correct username, correct password, and STARTTLS
@julianfairfax i wonder if you could clarify if that problem happens only with GNOME Online Accounts OR if it happens with all apps (Geary, Thuderbird, mutt, etc.) you tested with proton-bridge ?
i tested successfully that on my:
* PinePhone1.2 (postmarketOS/phosh stable) * PinePhonePro (postmarketOS/phosh stable)
with Geary, HOWEVER i did point Geary running on the PinePhone-s over a ssh tunnel connected to an intel box running the proton-bridge (i was not running proton-bridge on PinePhone-s yet).
Basically i am just curious if you could narrow down the problem if it is specific to GNOME Online Accounts or if it is affecting other apps (Geary, Thuderbird, mutt, etc.) too.
It seems that it works fine when adding the account directly through Geary. So, this is an odd bug, but probably not necessarily related to ARM or even to the bridge itself; could be a GNOME Online Accounts bug. In any case, using it through Geary works for me.
Given this works now would you be willing to add arm64 builds to flatpak/flathub?
Given this works now would you be willing to add arm64 builds to flatpak/flathub?
I second that. Please :)
The flatpak build is an unofficial distribution of Bridge, we are not the maintainers. We currently have no plans to officially support flatpak.
@LBeernaertProton given that the build on Flathub currently has 55,000 installs just for the x86 build and considering ProtonMail's focus on privacy/security it would be great if Proton could consider making that an official distribution channel rather than having people get it from unofficial sources.
@baarkerlounger I personally agree with you and have advocated for this, but sadly at the moment we have "bigger fish to fry".
@LBeernaertProton would you be willing to make a arm64 .deb available on the official distribution channel?
This still refers to it being x86 only due to QT6 dependency https://proton.me/support/operating-systems-supported-bridge
I'm afraid this is not a priority for us at the moment.
Hi, I tried building proton-bridge on ARM using the V3-branch and make build-nogui
The build completes without an error but when I try to run bridge, I get this error:
sh-5.1# ./bridge --nogui
panic: runtime error: slice bounds out of range [154:128]
goroutine 1 [running]:
github.com/godbus/dbus.getSessionBusPlatformAddress()
/home/modcache/github.com/godbus/dbus@v4.1.0+incompatible/conn_other.go:30 +0x1c0
github.com/godbus/dbus.getSessionBusAddress()
/home/modcache/github.com/godbus/dbus@v4.1.0+incompatible/conn.go:96 +0x150
github.com/godbus/dbus.SessionBusPrivate()
/home/modcache/github.com/godbus/dbus@v4.1.0+incompatible/conn.go:101 +0x1c
github.com/godbus/dbus.SessionBus()
/home/modcache/github.com/godbus/dbus@v4.1.0+incompatible/conn.go:73 +0xfc
github.com/keybase/go-keychain/secretservice.NewService()
/home/modcache/github.com/cuthix/go-keychain@v0.0.0-20220405075754-31e7cee908fe/secretservice/secretservice.go:
73 +0x1c
github.com/ProtonMail/proton-bridge/v3/pkg/keychain.getSession()
/proton-bridge/pkg/keychain/helper_dbus_linux.go:43 +0x1c
github.com/ProtonMail/proton-bridge/v3/pkg/keychain.(*SecretServiceDBusHelper).Add(0x400016ea80?, 0x400031c8d0)
/proton-bridge/pkg/keychain/helper_dbus_linux.go:98 +0x34
github.com/ProtonMail/proton-bridge/v3/pkg/keychain.isUsable({0x1727590?, 0x22bb9b0}, {0x0?, 0x0})
/proton-bridge/pkg/keychain/helper_linux.go:89 +0x1e8
github.com/ProtonMail/proton-bridge/v3/pkg/keychain.init.0()
/proton-bridge/pkg/keychain/helper_linux.go:39 +0x60
For all the NORMAL people (Linux, PinePhone, arm64, riscv64, etc. users) , i compiled a little HOWTO, more than happy to make that into a proper wiki with a step-by-step guides, so people can easier configure, troubleshoot their setup:
i am testing these setup-s on number of diff devices:
arm64
- PinePhone1.2b
- PinePhonePro ee
- PineBookPro
- ROCKPro64
- PineTab2 (coming soon; May/June 2023)
riscv64
- HiFive Unmatched
- PineTab-V (coming soon; May/June 2023)
- STAR64 (coming soon; May/June 2023)
on a number of diff distros / OS-es:
- postmarketOS (sxmo, phosh, plasma, gnome-mobile)
- Fedora
- openSUSE Tumbleweed
- mobian (phosh)
- Ubuntu
- Debian
- NixOS [coming soon]
- OpenBSD [coming soon]
- Apache NuttX [coming soon - if possible]
@julianfairfax i wonder if you could share your simple 5-10 lines step-by-step build of proton-mail bridge on PinePhone?
We can try to build a Flatpak (for Flathub) too later.
NOTE: i keep adding more info (how to add Proton Calendar, etc. - i just have to find and copy my old notes)
@julianfairfax i wonder if you could share your simple 5-10 lines step-by-step build of proton-mail bridge on PinePhone? We can try to build a Flatpak (for Flathub) too later.
Just follow the steps here
NOTE: i keep adding more info (how to add Proton Calendar, etc. - i just have to find and copy my old notes)
You can't do that. Proton Calendar is end-to-end encrypted, and there's no bridge.
@mbohun : Would you be able to add the Librem 5 running PureOS to your project?
@colans Well, yes, but the problem is that i do not own a Librem5, when i wanted to order one (back in early 2021) it was already sold out (and i was not willing to pay like 2000USD for that "Librem5 USA" version; i can ask around, some of the Librem5 owners if they are willing to test these things on their device.
With all those other devices it is easy because i actually own those (well PineTab2, and PineTab-V those are only ordered, i haven't received those yet).
NOTE: i keep adding more info (how to add Proton Calendar, etc. - i just have to find and copy my old notes)
You can't do that. Proton Calendar is end-to-end encrypted, and there's no bridge.
@julianfairfax i am not entirely sure if i understand you correctly, but previously (apx. 2 months ago) i was able to go in that proton calendar web GUI into some settings and get a calendar URL that i then entered into Mozilla Thunderbird calendar configuration, and it was working OK (well, fine as in: i could view/read the Proton Calnedar entries (created in the proton web GUI in a browser, but i was not able to create/edit/delete any of the calendar entries in Mozilla thuinderbird).
@colans Well, yes, but the problem is that i do not own a Librem5, when i wanted to order one (back in early 2021) it was already sold out (and i was not willing to pay like 2000USD for that "Librem5 USA" version; i can ask around, some of the Librem5 owners if they are willing to test these things on their device.
I might be able to help as I want to get it running on mine. If you still want one, they're very close to shipping parity, being able to ship the regular one on demand after getting through the backlog (later this summer they're saying).