ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.14k stars 155 forks source link

Unable to `make build-nogui` on arm64 Linux (Debian bullseye) #349

Closed nyvanga closed 1 year ago

nyvanga commented 1 year ago

Expected Behavior

Compile ARM binary.

Version v2.3.0 works fine with this method. And v3.0.18 works fine on x86_64 as-well.

Current Behavior

Failes during make build-nogui with:

# github.com/ProtonMail/proton-bridge/v3/cmd/Desktop-Bridge
/usr/local/go/pkg/tool/linux_arm64/link: running g++ failed: exit status 1
/usr/bin/ld: cannot find -lparser
/usr/bin/ld: cannot find -lparser_gen
/usr/bin/ld: cannot find -lproto
/usr/bin/ld: cannot find -lprotobuf
/usr/bin/ld: cannot find -lantlr4-runtime
collect2: error: ld returned 1 exit status

make: *** [Makefile:105: proton-bridge] Error 1
The command '/bin/sh -c DEBIAN_FRONTEND=noninteractive &&     set -e &&     apt-get update -qq &&     apt-get install -qq --no-install-recommends         libglvnd-dev libsecret-1-dev &&     tar -xzf v3.0.18.tar.gz &&     cd proton-bridge-3.0.18 &&     make build-nogui' returned a non-zero code: 2

Steps to Reproduce

  1. Create Dockerfile with this content:
    
    FROM golang

WORKDIR /build/

ADD https://github.com/ProtonMail/proton-bridge/archive/refs/tags/v3.0.18.tar.gz /build

RUN DEBIAN_FRONTEND=noninteractive && \ set -e && \ apt-get update -qq && \ apt-get install -qq --no-install-recommends \ libglvnd-dev libsecret-1-dev && \ tar -xzf v3.0.18.tar.gz && \ cd proton-bridge-3.0.18 && \ make build-nogui

2. Run: `docker build .` on an ARM Linux
   2b. Alternatively use buildx: `docker buildx build --platform linux/arm64 .`

## Version Information

v3.0.18

## Context (Environment)

Debian bullseye on ARM:

$ uname -a Linux DevPi 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux

$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye


Docker:

$ docker version Client: Docker Engine - Community Version: 23.0.1 API version: 1.42 Go version: go1.19.5 Git commit: a5ee5b1 Built: Thu Feb 9 19:46:41 2023 OS/Arch: linux/arm64 Context: default

Server: Docker Engine - Community Engine: Version: 23.0.1 API version: 1.42 (minimum version 1.12) Go version: go1.19.5 Git commit: bc3805a Built: Thu Feb 9 19:46:41 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.18 GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0


Golang container image:

$ docker image inspect golang [ { "Id": "sha256:902ab5bca0a25dc8572441706342dfe63b0c7394e6d518ceabaee05910351d2a", "RepoTags": [ "golang:latest" ], "RepoDigests": [ "golang@sha256:2edf6aab2d57644f3fe7407132a0d1770846867465a39c2083770cf62734b05d" ], "Parent": "", "Comment": "", "Created": "2023-02-15T22:39:44.763753147Z", "Container": "8d008a0c0f6f82f444360a62140f2f7a872147fa90059186bc47001075f80b70", "ContainerConfig": { "Hostname": "8d008a0c0f6f", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.20.1", "GOPATH=/go" ], "Cmd": [ "/bin/sh", "-c", "#(nop) WORKDIR /go" ], "Image": "sha256:2d39b6f744cf381636f4f2e66405eb63d6318ab3a05b3db868679b65e155bab6", "Volumes": null, "WorkingDir": "/go", "Entrypoint": null, "OnBuild": null, "Labels": {} }, "DockerVersion": "20.10.17", "Author": "", "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "GOLANG_VERSION=1.20.1", "GOPATH=/go" ], "Cmd": [ "bash" ], "Image": "sha256:2d39b6f744cf381636f4f2e66405eb63d6318ab3a05b3db868679b65e155bab6", "Volumes": null, "WorkingDir": "/go", "Entrypoint": null, "OnBuild": null, "Labels": null }, "Architecture": "arm64", "Variant": "v8", "Os": "linux", "Size": 746060030, "VirtualSize": 746060030, "GraphDriver": { "Data": { "LowerDir": "/var/lib/docker/overlay2/9cc3d4ed208a7806196d446ba8069fa00f1959d3320d47ce594ff6beba952a98/diff:/var/lib/docker/overlay2/00543b5eb553188c538c4448518b3b3d080c96b45eb2baca577002bff392bcd9/diff:/var/lib/docker/overlay2/63ecb4a957fcdf1ded79b9e870998b446a3c55eb863082e32dd0da49581db16c/diff:/var/lib/docker/overlay2/0f49ef38cdff45c87dc3b015f4c941bd0901f8b9d267321d9871849bd3e1f7c4/diff:/var/lib/docker/overlay2/5a4db380ddebe6f2b8db389f783d22bf9a3cc6e80837a1cab320491900af1146/diff:/var/lib/docker/overlay2/cf78edc0aba19d97df58d2675a18d438e94e26ef7939e59ff1247cad9194a5e1/diff", "MergedDir": "/var/lib/docker/overlay2/2584e2ad7053c4f842179f549498b821aadb45ce2b9504c4f0fd75433fc2b5d3/merged", "UpperDir": "/var/lib/docker/overlay2/2584e2ad7053c4f842179f549498b821aadb45ce2b9504c4f0fd75433fc2b5d3/diff", "WorkDir": "/var/lib/docker/overlay2/2584e2ad7053c4f842179f549498b821aadb45ce2b9504c4f0fd75433fc2b5d3/work" }, "Name": "overlay2" }, "RootFS": { "Type": "layers", "Layers": [ "sha256:29284a104249116504b6952c57fce2df8954c31d06d4c9747cbd7a0b2afc6fc7", "sha256:791bbde8b96bbe910b41bde28fefa7c21aaba4b742f4a0f36ba7fa1423b6680d", "sha256:beaf68924af7d08f2f5ef563fb3068e834a0e061dd281471d20e9a6a7584ecf2", "sha256:765e013775a6bfb6b6f52c2d70c396820885954faea11de84c5cdbd77bb0ae7d", "sha256:d3b8089d0168d886bf93124a5550f00cae89a5f060a5346f54b5fcc2c4cc7233", "sha256:6084594bb55844840e8fc8d359fab3c05c58a13fc5cdc8aad69a5e071d8aa6d7", "sha256:7f3fc15f5fbc71fd9ea37b34a707277a2890183f595affd7ddaae2f4005101fa" ] }, "Metadata": { "LastTagTime": "0001-01-01T00:00:00Z" } } ]

jameshoulahan commented 1 year ago

Hi there, indeed builds on ARM64 as of v3.0.18 aren't working. However, you can build directly from the development branch v3 as outlined in this issue. Please note, the v3 branch hasn't undergone any of our usual release checks -- use with caution.