Skip to content

Commit

Permalink
Merge pull request desktop#4198 from jkleinsc/arm64
Browse files Browse the repository at this point in the history
Add the ability to build arm64 builds
  • Loading branch information
niik authored Mar 29, 2018
2 parents 289ae93 + 8af1bfe commit 614f848
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"codemirror-mode-elixir": "1.1.1",
"deep-equal": "^1.0.1",
"dexie": "^2.0.0",
"dugite": "1.58.0",
"dugite": "1.61.0",
"electron-window-state": "^4.0.2",
"event-kit": "^2.0.0",
"file-uri-to-path": "0.0.2",
Expand Down
2 changes: 2 additions & 0 deletions app/src/lib/git/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ function getDescriptionForError(error: DugiteError): string {
return 'This branch cannot be deleted from the remote repository because it is marked as protected.'
case DugiteError.ProtectedBranchRequiredStatus:
return 'The push was rejected by the remote server because a required status check has not been satisfied.'
case DugiteError.BranchRenameFailed:
return 'The branch could not be renamed.'
default:
return assertNever(error, `Unknown error: ${error}`)
}
Expand Down
6 changes: 3 additions & 3 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ dom-matches@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dom-matches/-/dom-matches-2.0.0.tgz#d2728b416a87533980eb089b848d253cf23a758c"

dugite@1.58.0:
version "1.58.0"
resolved "https://registry.yarnpkg.com/dugite/-/dugite-1.58.0.tgz#55e2772251a0cdac6c6dbf6331aa267517041aa1"
dugite@1.61.0:
version "1.61.0"
resolved "https://registry.yarnpkg.com/dugite/-/dugite-1.61.0.tgz#d5dad047af478c1312f8b791eb56d9935e6fc47d"
dependencies:
checksum "^0.1.1"
mkdirp "^0.5.1"
Expand Down
15 changes: 13 additions & 2 deletions docs/contributing/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You will need to install these tools on your machine:
- One of Visual Studio 2015, Visual C++ Build Tools or Visual Studio 2017
- [Visual C++ Build Tools](http://go.microsoft.com/fwlink/?LinkId=691126)
- *Run `npm config set msvs_version 2015` to tell node to use this toolchain.*
- Visual Studio 2015
- Visual Studio 2015
- *Ensure you select the **Common Tools for Visual C++ 2015** feature as that is required by Node.js
for installing native modules.*
- *Run `npm config set msvs_version 2015` to tell node to use this toolchain.*
Expand Down Expand Up @@ -85,6 +85,17 @@ If you want to package Desktop for distribution, install these packages:
$ sudo apt install -y fakeroot dpkg rpm xz-utils xorriso zsync
```

### arm64 builds

Desktop can be built and run on arm64 (aarch64) hardware such as a Raspberry Pi 3.
In order to build for arm64, you will need the following:

* A computer with a 64-bit ARMv8 processor.
* A 64-bit OS. You can use [Ubuntu 16.04](#ubuntu-1604) and then follow the instructions
on setup there.
* Instead of running `yarn` to get all required dependencies on your machine, you will
instead need to run `script/install-arm64-deps.sh`.

## Verification

With these things installed, open a shell and install `yarn` (you might need
Expand Down Expand Up @@ -123,7 +134,7 @@ is as follows:
* Run `yarn build:dev` to create a development build of the app.
* Run `yarn start` to launch the application. Changes will be compiled in the
background. The app can then be reloaded to see the changes (Ctrl/Command+R).

**Optional Tip**: On macOS and Linux, you can use `screen` to avoid filling your terminal with logging output:

```shellsession
Expand Down
2 changes: 1 addition & 1 deletion script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function packageApp(
const options: packager.Options & IPackageAdditionalOptions = {
name: getExecutableName(),
platform: toPackagePlatform(process.platform),
arch: 'x64',
arch: process.env.TARGET_ARCH || 'x64',
asar: false, // TODO: Probably wanna enable this down the road.
out: getDistRoot(),
icon: path.join(projectRoot, 'app', 'static', 'logos', 'icon-logo'),
Expand Down
3 changes: 2 additions & 1 deletion script/dist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const path = require('path')
const fs = require('fs')
const os = require('os')

const packageInfo = require('../app/package-info')
const productName = packageInfo.getProductName()
Expand All @@ -16,7 +17,7 @@ function getDistRoot() {
function getDistPath() {
return path.join(
getDistRoot(),
`${getExecutableName()}-${process.platform}-x64`
`${getExecutableName()}-${process.platform}-${os.arch()}`
)
}

Expand Down
6 changes: 6 additions & 0 deletions script/install-arm64-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export TARGET_ARCH=arm64
yarn install --force --ignore-scripts
npm rebuild --arch=arm64 --target_arch=arm64
cd app && yarn install --force --ignore-scripts
npm rebuild --arch=arm64 --target_arch=arm64
cd .. && git submodule update --recursive --init && yarn compile:tslint

0 comments on commit 614f848

Please sign in to comment.