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

Added linux arm64 and armv7l to build workflows #6612

Merged
merged 9 commits into from
Sep 4, 2022
Merged

Conversation

Jai-JAP
Copy link
Contributor

@Jai-JAP Jai-JAP commented Jun 15, 2022

Closes #6355

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 27, 2022

The MacOS build error will be solved once merged as it relies on GITHUB_TOKEN secret which cant be set manually.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 27, 2022

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 27, 2022

We should continue improving this in a new branch on upstream tabby repo and not on my fork to avoid issues with GITHUB_TOKEN

@Eugeny
Copy link
Owner

Eugeny commented Aug 28, 2022

@Jai-JAP could you please update build-mac.js so that it disables the .publish electron-builder option when no GITHUB_TOKEN is set? That should fix it.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 29, 2022

publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never',
     ^^^^^^^

SyntaxError: Unexpected identifier

Getting this error on my test branch

Any ideas how to solve??

@Eugeny
Copy link
Owner

Eugeny commented Aug 29, 2022

It's the missing comma on the previous line.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 30, 2022

https://github.com/Eugeny/tabby/runs/8085803130?check_suite_focus=true#step:8:11

@Eugeny any ideas for this error?
Occurs only on Windows Builds.

@Eugeny
Copy link
Owner

Eugeny commented Aug 30, 2022

@Jai-JAP not sure what you mean? The windows build went through on the 1st try, the Linux arm64 build was stuck, but went through after a restart

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 30, 2022

@Eugeny
Copy link
Owner

Eugeny commented Aug 30, 2022

Oh that's fine, it's the Sentry CLI failing because SENTRY_TOKEN isn't available for the job - it doesn't affect the build in any way.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 30, 2022

Oh that's fine, it's the Sentry CLI failing because SENTRY_TOKEN isn't available for the job - it doesn't affect the build in any way.

Ohh I just got confused since this occurs only in windows

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Aug 31, 2022

This is now ready for merge after adding package cloud uploads for Linux arm builds
@Eugeny can you do it.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Sep 4, 2022

This is now ready for merge after adding package cloud uploads for Linux arm builds
@Eugeny can you do it.

@Eugeny

@Eugeny Eugeny merged commit e3232f1 into Eugeny:master Sep 4, 2022
@Eugeny
Copy link
Owner

Eugeny commented Sep 4, 2022

Thanks a lot for your work! It's now merged, but I've enabled ARM builds for releases only (as they're taking 1.5 hours each).

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Sep 5, 2022

What about uploading linux-arm{64,hf} and win-arm64 artifacts to packagecloud repo

@Eugeny
Copy link
Owner

Eugeny commented Sep 5, 2022

They should be uploaded automatically with the next release (the GH action uploads everything from the dist/ folder)

@Eugeny
Copy link
Owner

Eugeny commented Oct 27, 2022

@Jai-JAP unfortunately the arm64 build job for the latest release has timed out after 6 hours. Do you think there's a way to keep the resource build process (webpack etc) outside of QEMU and only let it handle the prepackage-plugins and electron-builder steps?

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Oct 28, 2022

That won't make it any faster but may be even slower as separating that step will need us to exit from the container and it will be reset. So the next time we need it, we need to re-install all the dependencies. So no improvement 😟

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Oct 28, 2022

Also seeing actions/runner-images#5631
We may get Linux arm64 runners soon. So let's wait for it for the while.

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Jun 18, 2023

@Eugeny I got a successful cross-build on my machine for both arm64 and armv7l within ~30 minutes using the steps below, but its not working on github actions using ubuntu-core docker image giving dependency errors when installing multiarch libs.

Tabby-crossbuild instructions


  • Setup chroot
    sudo debootstrap --include=git,curl,gnupg,ca-certificates,crossbuild-essential-arm64,crossbuild-essential-armhf,build-essential,libarchive-tools,cmake --variant=buildd --exclude=snapd --components=main,restricted,universe,multiverse --extractor=dpkg-deb --cache-dir=/tmp/debootstrap-cache/ bionic /srv/chroot/bionic-build/
    
    • else [Does not work due to Dependenciy issues]
      sudo apt install git curl gnupg crossbuild-essential-arm64 crossbuild-essential-armhf build-essential libarchive-tools cmake

  • schroot-config @ /etc/schroot/chroot/bionic-build
[bionic-build]
description=Ubuntu 18.04 Build chroot
aliases=build18
type=directory
directory=/srv/chroot/bionic-build
root-groups=root,sudo
profile=buildd
personality=linux
preserve-environment=false
union-type=overlay
debian.apt-update=true

  • Enter the chroot schroot -c bionic-build -d /root

  • Setup Multiarch
    echo "deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
    deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports bionic main restricted universe multiverse" > /etc/apt/sources.list
    apt update
    dpkg --add-architecture arm64 # or armhf
    

  • Install nodejs and yarn
    curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/nodesource.gpg
    curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/yarn.gpg
    echo "deb https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
    echo "deb https://deb.nodesource.com/node_16.x bionic main" > /etc/apt/sources.list.d/nodesource.list
    apt install -y nodejs yarn
    

  • Install build depends
    # arm64
    apt install libfontconfig-dev:arm64 libsecret-1-dev:arm64 libnss3:arm64 libatk1.0-0:arm64 libatk-bridge2.0-0:arm64 libgdk-pixbuf2.0-0:arm64 libgtk-3-0:arm64 libgbm1:arm64
    # armhf
    apt install libfontconfig-dev:arm64 libsecret-1-dev:armhf libnss3:armhf libatk1.0-0:armhf libatk-bridge2.0-0:armhf libgdk-pixbuf2.0-0:armhf libgtk-3-0:armhf libgbm1:armhf
    

  • Clone tabby
    git clone https://github.com/Eugeny/tabby
    cd tabby
    

  • Build
    export npm_config_target_arch=arm64 # or armv7l
    export npm_config_arch=arm64 # or armv7l
    export ARCH=arm64 # or armv7l
    export CC=aarch64-linux-gnu-gcc # or arm-linux-gnueabihf-gcc
    export CXX=aarch64-linux-gnu-g++ # or arm-linux-gnueabihf-g++
     
    yarn
    yarn run build
    node scripts/prepackage-plugins.mjs
    node scripts/build-linux.mjs
    

@Jai-JAP
Copy link
Contributor Author

Jai-JAP commented Jun 24, 2023

This is now implemented using a better way in #8613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding linux arm to CI workflows
2 participants