Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[relay-compiler] Build linux arm64 #3880

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ jobs:
artifact-name: relay-bin-linux-x64
packages: musl-tools
features: vendored
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
build-name: relay
artifact-name: relay-bin-linux-arm64
packages: musl-tools:arm64 gcc:arm64 cpp:arm64 gcc-9:arm64 binutils:arm64
features: vendored
- target: x86_64-apple-darwin
os: macos-latest
build-name: relay
Expand Down Expand Up @@ -141,6 +147,26 @@ jobs:
run: yarn gulp setCompilerMainVersion
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- name: Configure Multiarch for Linux ARM64
if: matrix.target.target == 'aarch64-unknown-linux-musl'
# Following https://askubuntu.com/a/1307721 for Ubuntu 20.04
run: |
sudo dpkg --add-architecture arm64

sudo sed -i "s/deb h/deb [arch=amd64] h/g" /etc/apt/sources.list
echo "# arm64 repositories" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-security multiverse" | sudo tee -a /etc/apt/sources.list

sudo apt-get update
- name: Install packages
if: matrix.target.os == 'ubuntu-latest' && matrix.target.packages
run: sudo apt install ${{ matrix.target.packages }} -y
Expand Down Expand Up @@ -173,6 +199,11 @@ jobs:
with:
name: relay-bin-linux-x64
path: artifacts/linux-x64
- name: Download artifact relay-bin-linux-arm64
uses: actions/download-artifact@v2
with:
name: relay-bin-linux-arm64
path: artifacts/linux-arm64
- name: Download artifact relay-bin-macos-x64
uses: actions/download-artifact@v2
with:
Expand All @@ -192,6 +223,7 @@ jobs:
working-directory: artifacts
run: |
chmod +x linux-x64/relay
chmod +x linux-arm64/relay
chmod +x macos-x64/relay
chmod +x macos-arm64/relay

Expand Down
2 changes: 2 additions & 0 deletions packages/relay-compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if (process.platform === 'darwin' && process.arch === 'x64') {
binary = path.join(__dirname, 'macos-arm64', 'relay');
} else if (process.platform === 'linux' && process.arch === 'x64') {
binary = path.join(__dirname, 'linux-x64', 'relay');
} else if (process.platform === 'linux' && process.arch === 'arm64') {
binary = path.join(__dirname, 'linux-arm64', 'relay');
} else if (process.platform === 'win32' && process.arch === 'x64') {
binary = path.join(__dirname, 'win-x64', 'relay.exe');
} else {
Expand Down
2 changes: 2 additions & 0 deletions vscode-extension/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function getBinaryPathRelativeToPackageJson() {
binaryPathRelativeToPackageJson = path.join('macos-arm64', 'relay');
} else if (process.platform === 'linux' && process.arch === 'x64') {
binaryPathRelativeToPackageJson = path.join('linux-x64', 'relay');
} else if (process.platform === 'linux' && process.arch === 'arm64') {
binaryPathRelativeToPackageJson = path.join('linux-arm64', 'relay');
} else if (process.platform === 'win32' && process.arch === 'x64') {
binaryPathRelativeToPackageJson = path.join('win-x64', 'relay.exe');
} else {
Expand Down