Client: Building on Aarch64?

Created on 17 May 2017  路  6Comments  路  Source: keybase/client

pine64@pinebook 禄 go get github.com/keybase/client/go/keybase 
# github.com/keybase/client/go/logger
go/src/github.com/keybase/client/go/logger/redirect_stderr_nix.go:15: undefined: syscall.Dup2

Looks related to https://github.com/hlandau/acme/issues/40 https://github.com/golang/go/issues/11981.

Cheers!

Most helpful comment

I've sent in a pull request that should hopefully be accepted soon.

This will only enable building the CLI. To get GUI support, Electron 1.8.x needs to be used, and that's still in beta. Also the tooling for building packages needs to be modified some, since they assume 64bit means building amd64 and 32bit means building x86 in the bash scripts.

Realistically, arm and aarch64 support should be easy to add as well once the change goes in.

All 6 comments

Still seeing this. Any news?

I've sent in a pull request that should hopefully be accepted soon.

This will only enable building the CLI. To get GUI support, Electron 1.8.x needs to be used, and that's still in beta. Also the tooling for building packages needs to be modified some, since they assume 64bit means building amd64 and 32bit means building x86 in the bash scripts.

Realistically, arm and aarch64 support should be easy to add as well once the change goes in.

Excellent! The patch is in and I successfully built a client via a slightly modified clean_build_kbstage.sh (replacing staging with production), as well as via linux/build_binaries.sh production with the following config:

export GOARCH=arm64
export debian_arch=aarch64
export electron_arch=aarch64
build_one_architecture

kbfs couldn't be built; it builds kbfs and electron together (with prerelease). I stripped out electron and hit the same syscall issue in kbfs.

Correction: kbfs hasn't yet been updated to pull this version?

Kbfs might not have the updated vendor yet, I've been modifying it myself manually.

It looks like the latest versions need go 1.9, but once you have go 1.9 installed, I was able to build it, though it took a bit - including the electron app, however, I'm not sure if it's because of trying electron 1.8.1 or I'm missing something else, but I can't quite get the secure chat to work. It just sits there saying securing... over and over - looks like some issue with the js based on the logs.

So I guess once there is a decently stable electron 1.8, we should be able to build for arm64 with very few issues.

~/go/src/github.com/keybase/client $ git diff
diff --git a/packaging/clean_build_kbstage.sh b/packaging/clean_build_kbstage.sh
index 05873c57c..b083432fd 100755
--- a/packaging/clean_build_kbstage.sh
+++ b/packaging/clean_build_kbstage.sh
@@ -22,4 +22,4 @@ ln -s "$(cd .. ; pwd)" "$GOPATH/src/github.com/keybase/client"

 # Build the staging binary.
 echo Building kbstage...
-go build -a -tags staging -o "$build_dir/kbstage" github.com/keybase/client/go/keybase
+go build -a -tags production -o "$build_dir/kbstage" github.com/keybase/client/go/keybase
diff --git a/packaging/linux/build_binaries.sh b/packaging/linux/build_binaries.sh
index cddbfbfa2..a417aee85 100755
--- a/packaging/linux/build_binaries.sh
+++ b/packaging/linux/build_binaries.sh
@@ -177,3 +177,12 @@ if [ -z "${KEYBASE_SKIP_32_BIT:-}" ] ; then
 else
   echo SKIPPING 32-bit build
 fi
+
+if [ -z "${KEYBASE_SKIP_ARM64:-}" ] ; then
+  export GOARCH=arm64
+  export debian_arch=arm64
+  export electron_arch=arm64
+  build_one_architecture
+else
+  echo SKIPPING arm64 build
+fi
diff --git a/shared/package.json b/shared/package.json
index 919cad6f0..2557cd21c 100644
--- a/shared/package.json
+++ b/shared/package.json
@@ -134,7 +134,7 @@
     "css-loader": "0.28.7",
     "del": "3.0.0",
     "devtron": "1.4.0",
-    "electron": "1.7.8",
+    "electron": "1.8.1",
     "electron-download": "git://github.com/keybase/electron-download#keybase-fixes-off-410",
     "electron-packager": "9.1.0",
     "eslint": "4.7.2",
diff --git a/shared/yarn.lock b/shared/yarn.lock
index f9e0c7d91..e03d28e39 100644
--- a/shared/yarn.lock
+++ b/shared/yarn.lock
@@ -196,9 +196,9 @@
     react-treebeard "^2.0.3"
     redux "^3.6.0"

-"@types/node@^7.0.18":
-  version "7.0.42"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.42.tgz#051ff1cdbd1e1b7523ba425bc388147483344dbf"
+"@types/node@^8.0.24":
+  version "8.0.34"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.34.tgz#55f801fa2ddb2a40dd6dfc15ecfe1dde9c129fe9"

 abab@^1.0.3:
   version "1.0.3"
@@ -3225,11 +3225,11 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.18:
   version "1.3.18"
   resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.18.tgz#3dcc99da3e6b665f6abbc71c28ad51a2cd731a9c"

[email protected]:
-  version "1.7.8"
-  resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.8.tgz#27b791a6895171a7d52991b99442cdbd10a3539d"
[email protected]:
+  version "1.8.1"
+  resolved "https://registry.yarnpkg.com/electron/-/electron-1.8.1.tgz#19b6f39f2013e204a91a60bc3086dc7a4a07ed88"
   dependencies:
-    "@types/node" "^7.0.18"
+    "@types/node" "^8.0.24"
     electron-download "^3.0.1"
     extract-zip "^1.0.3"

Is what I have here locally to make it work. And then I just build it as follows (note: I build ON an aarch64 box)

KEYBASE_SKIP_64_BIT=1 KEYBASE_SKIP_32_BIT=1 ./build_binaries.sh production

HURRAY!

thanks, everyone! just built keybase with go1.9 on an aarch64 / armv8 machine via:

go get github.com/keybase/client/go/keybase
go build -tags production github.com/keybase/client/go/keybase

and I now have a working binary at

./go/bin/keybase

Was this page helpful?
0 / 5 - 0 ratings