Explorar o código

Revert "Cross Compile linux armhf/arm64 artifacts"

Eugene %!s(int64=2) %!d(string=hai) anos
pai
achega
6d3a71840b

+ 77 - 128
.github/workflows/build.yml

@@ -131,146 +131,101 @@ jobs:
     needs: Lint
     strategy:
       matrix:
-        include:
-          - build-arch: x64
-            arch: amd64
-          - build-arch: arm64
-            arch: arm64
-            triplet: aarch64-linux-gnu-
-          - build-arch: arm 
-            arch: armhf
-            triplet: arm-linux-gnueabihf-
-    env:
-      CC: ${{matrix.triplet}}gcc
-      CXX: ${{matrix.triplet}}g++
-      ARCH: ${{matrix.build-arch}}
-      npm_config_arch: ${{matrix.build-arch}}
-      npm_config_target_arch: ${{matrix.build-arch}}
+        build-arch: [ x64, arm64, armv7l ]
 
     steps:
     - name: Checkout
       uses: actions/checkout@v3
       with:
         fetch-depth: 0
-            
-    - name: Install Node
+
+    - name: Set up multiarch/qemu-user-static
+      run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
+      if: matrix.build-arch != 'x64'
+
+    - name: Install Node (x64)
       uses: actions/[email protected]
       with:
-        node-version: 18
+        node-version: 16
+      if: matrix.build-arch == 'x64'
 
-    - name: Install deps (amd64)
+    - name: Install deps (x64)
       run: |
         sudo apt-get update
-        sudo apt-get install libarchive-tools zsh 
-        
-    - name: Install npm_modules (amd64)
-      run: |
+        sudo apt-get install libarchive-tools zsh
         npm i -g yarn
         yarn --network-timeout 1000000
       if: matrix.build-arch == 'x64'
-      
-    - name: Setup Crossbuild (${{matrix.arch}})
-      run: |
-          sudo apt-get update -y && sudo apt-get install schroot sbuild debootstrap -y
-          sudo debootstrap --include=git,curl,gnupg,ca-certificates,crossbuild-essential-${{matrix.arch}},python-dev,python3-dev,libarchive-tools,cmake --variant=buildd --exclude=snapd --components=main,restricted,universe,multiverse --extractor=dpkg-deb bionic /build-chroot/
-          echo 'deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse' | sudo tee /build-chroot/etc/apt/sources.list >/dev/null
-          echo 'deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports bionic main restricted universe multiverse' | sudo tee -a /build-chroot/etc/apt/sources.list >/dev/null
-          curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee /build-chroot/etc/apt/trusted.gpg.d/nodesource.gpg >/dev/null
-          echo 'deb http://deb.nodesource.com/node_16.x bionic main' | sudo tee /build-chroot/etc/apt/sources.list.d/nodesource.list >/dev/null
-          echo "[build-chroot]
-          description=Ubuntu 18.04 Build chroot
-          type=directory
-          directory=/build-chroot
-          root-groups=root,sudo
-          profile=buildd
-          personality=linux
-          union-type=overlay" | sudo tee /etc/schroot/chroot.d/build-chroot.pref >/dev/null 
-          echo "/home           /home           none    rw,bind         0       0" | sudo tee -a /etc/schroot/buildd/fstab >/dev/null
 
-      if: matrix.build-arch != 'x64'
-
-    - name: Install node_modules & CrossBuild native modules for ${{matrix.arch}}
-      run: |
-          sudo schroot -c build-chroot -u root -- bash -c "apt-get update -y
-          dpkg --add-architecture ${{matrix.arch}}
-          apt-get install -y nodejs libfontconfig-dev:${{matrix.arch}} libsecret-1-dev:${{matrix.arch}} libnss3:${{matrix.arch}} libatk1.0-0:${{matrix.arch}} libatk-bridge2.0-0:${{matrix.arch}} libgdk-pixbuf2.0-0:${{matrix.arch}} libgtk-3-0:${{matrix.arch}} libgbm1:${{matrix.arch}}
-          export CC=${{matrix.triplet}}gcc CXX=${{matrix.triplet}}g++ LD=${{matrix.triplet}}ld 
-          if [[ ${{matrix.arch}} == 'arm64' ]]; then
-            export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig/
-          elif [[ ${{matrix.arch}} == 'armhf' ]]; then
-            export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/arm-linux-gnueabihf/pkgconfig/
-          fi
-          export ARCH=${{matrix.build-arch}} npm_config_arch=${{matrix.build-arch}} npm_config_target_arch=${{matrix.build-arch}}
-          npm i -g yarn
-          yarn --network-timeout 1000000 --arch=${{matrix.build-arch}} --target_arch=${{matrix.build-arch}}"
-      if: matrix.build-arch != 'x64'
-
-    - name: Webpack (${{matrix.arch}})
-      run: yarn run build --arch=${{matrix.build-arch}} --target_arch=${{matrix.build-arch}}
+    - name: Webpack (x64)
+      run: yarn run build
+      if: matrix.build-arch == 'x64'
 
-    - name: Prepackage plugins (${{matrix.arch}})
+    - name: Prepackage plugins (x64)
       run: scripts/prepackage-plugins.mjs
-      
-    - name: Build packages (${{matrix.arch}})
+      if: ${{matrix.build-arch == 'x64'}}
+
+    - name: Build packages (x64)
       run: scripts/build-linux.mjs
+      if: ${{matrix.build-arch == 'x64'}}
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
         USE_HARD_LINKS: false
         # DEBUG: electron-builder,electron-builder:*
-        
+
     - name: Build web resources
       run: zsh -c 'tar czf tabby-web.tar.gz (tabby-*|web)/dist'
       if: matrix.build-arch == 'x64'
 
-#     - name: Install deps and Build (arm64)
-#       uses: docker://multiarch/ubuntu-core:arm64-bionic
-#       with:
-#           args: >
-#             bash -c
-#             "apt update && apt install curl lsb-release gnupg -y &&
-#             curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
-#             apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
-#             git config --global --add safe.directory /github/workspace &&
-#             gem install public_suffix -v 4.0.7 &&
-#             gem install fpm --no-document &&
-#             npm i -g yarn &&
-#             cd /github/workspace &&
-#             yarn --network-timeout 1000000 &&
-#             yarn run build &&
-#             scripts/prepackage-plugins.mjs &&
-#             USE_SYSTEM_FPM=true scripts/build-linux.mjs"
-#       env:
-#         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-#         KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
-#         USE_HARD_LINKS: false
-#       if: matrix.build-arch == 'arm64' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
-
-#     - name: Install deps and Build (armv7l)
-#       uses: docker://multiarch/ubuntu-core:armhf-bionic
-#       with:
-#           args: >
-#             bash -c
-#             "apt update && apt install curl lsb-release gnupg -y &&
-#             curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
-#             apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
-#             git config --global --add safe.directory /github/workspace &&
-#             gem install public_suffix -v 4.0.7 &&
-#             gem install fpm --no-document &&
-#             npm i -g yarn &&
-#             cd /github/workspace &&
-#             sed -i '/    \"electron\":/c\    \"electron\": \"17.0.0\",' package.json &&
-#             yarn --network-timeout 1000000 &&
-#             yarn run build &&
-#             scripts/prepackage-plugins.mjs &&
-#             USE_SYSTEM_FPM=true scripts/build-linux.mjs"
-#       env:
-#         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-#         KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
-#         USE_HARD_LINKS: false
-#       if: matrix.build-arch == 'arm' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
-
-    - name: Upload symbols (amd64 only)
+    - name: Install deps and Build (arm64)
+      uses: docker://multiarch/ubuntu-core:arm64-bionic
+      with:
+          args: >
+            bash -c
+            "apt update && apt install curl lsb-release gnupg -y &&
+            curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
+            apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
+            git config --global --add safe.directory /github/workspace &&
+            gem install public_suffix -v 4.0.7 &&
+            gem install fpm --no-document &&
+            npm i -g yarn &&
+            cd /github/workspace &&
+            yarn --network-timeout 1000000 &&
+            yarn run build &&
+            scripts/prepackage-plugins.mjs &&
+            USE_SYSTEM_FPM=true scripts/build-linux.mjs"
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
+        USE_HARD_LINKS: false
+      if: matrix.build-arch == 'arm64' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
+
+    - name: Install deps and Build (armv7l)
+      uses: docker://multiarch/ubuntu-core:armhf-bionic
+      with:
+          args: >
+            bash -c
+            "apt update && apt install curl lsb-release gnupg -y &&
+            curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
+            apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
+            git config --global --add safe.directory /github/workspace &&
+            gem install public_suffix -v 4.0.7 &&
+            gem install fpm --no-document &&
+            npm i -g yarn &&
+            cd /github/workspace &&
+            sed -i '/    \"electron\":/c\    \"electron\": \"17.0.0\",' package.json &&
+            yarn --network-timeout 1000000 &&
+            yarn run build &&
+            scripts/prepackage-plugins.mjs &&
+            USE_SYSTEM_FPM=true scripts/build-linux.mjs"
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
+        USE_HARD_LINKS: false
+      if: matrix.build-arch == 'armv7l' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
+
+    - name: Upload symbols
       run: |
         sudo npm install -g @sentry/cli --unsafe-perm
         ./scripts/sentry-upload.mjs
@@ -290,37 +245,31 @@ jobs:
         dir: 'dist'
 
     - uses: actions/upload-artifact@master
-      name: Upload AppImage (${{matrix.arch}})
-      with:
-        name: Linux AppImage (${{matrix.arch}})
-        path: dist/*.AppImage
-    
-    - uses: actions/upload-artifact@master
-      name: Upload DEB (${{matrix.arch}})
+      name: Upload DEB
       with:
-        name: Linux DEB (${{matrix.arch}})
+        name: Linux DEB (${{matrix.build-arch}})
         path: dist/*.deb
 
     - uses: actions/upload-artifact@master
-      name: Upload RPM (${{matrix.arch}})
+      name: Upload RPM
       with:
-        name: Linux RPM (${{matrix.arch}})
+        name: Linux RPM (${{matrix.build-arch}})
         path: dist/*.rpm
 
     - uses: actions/upload-artifact@master
-      name: Upload Pacman Package (${{matrix.arch}})
+      name: Upload Pacman Package
       with:
-        name: Linux Pacman (${{matrix.arch}})
+        name: Linux Pacman (${{matrix.build-arch}})
         path: dist/*.pacman
 
     - uses: actions/upload-artifact@master
-      name: Upload Linux tarball (${{matrix.arch}})
+      name: Upload Linux tarball
       with:
-        name: Linux tarball (${{matrix.arch}})
+        name: Linux tarball (${{matrix.build-arch}})
         path: dist/*.tar.gz
 
     - uses: actions/upload-artifact@master
-      name: Upload web tarball (amd64 only)
+      name: Upload web tarball
       with:
         name: Web tarball
         path: tabby-web.tar.gz

+ 2 - 0
HACKING.md

@@ -17,6 +17,8 @@ First, from within the `tabby` directory install the dependencies via yarn:
 yarn
 ```
 
+**Note: For compiling for Linux armv7l, you need to downgrade electron to 17.0.0 in package.json present in root directory of tabby source**
+
 ```
 # Linux (Debian/Ubuntu here as an example)
 sudo apt install libfontconfig-dev libsecret-1-dev libarchive-tools libnss3 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 cmake

+ 1 - 1
app/lib/pty.ts

@@ -1,4 +1,4 @@
-import * as nodePTY from 'node-pty'
+import * as nodePTY from '@tabby-gang/node-pty'
 import { v4 as uuidv4 } from 'uuid'
 import { ipcMain } from 'electron'
 import { Application } from './app'

+ 1 - 1
app/package.json

@@ -16,7 +16,7 @@
   },
   "dependencies": {
     "@electron/remote": "2.0.10",
-    "node-pty": "^0.11.0-beta32",
+    "@tabby-gang/node-pty": "^0.11.0-beta.203",
     "any-promise": "^1.3.0",
     "electron-config": "2.0.0",
     "electron-debug": "^3.2.0",

+ 1 - 1
app/webpack.config.main.mjs

@@ -47,7 +47,7 @@ const config = {
         mz: 'commonjs mz',
         npm: 'commonjs npm',
         'node:os': 'commonjs os',
-        'node-pty': 'commonjs node-pty',
+        '@tabby-gang/node-pty': 'commonjs @tabby-gang/node-pty',
         path: 'commonjs path',
         util: 'commonjs util',
         'source-map-support': 'commonjs source-map-support',

+ 1 - 1
scripts/build-linux.mjs

@@ -9,7 +9,7 @@ process.env.ARCH = (process.env.ARCH || process.arch) === 'arm' ? 'armv7l' : pro
 
 builder({
     dir: true,
-    linux: ['deb', 'tar.gz', 'rpm', 'pacman', 'appimage'],
+    linux: ['deb', 'tar.gz', 'rpm', 'pacman'],
     armv7l: process.env.ARCH === 'armv7l',
     arm64: process.env.ARCH === 'arm64',
     config: {

+ 1 - 1
scripts/sentry-upload.mjs

@@ -9,7 +9,7 @@ sh.exec(`${sentryCli} releases new ${vars.version}`)
 if (process.platform === 'darwin') {
     for (const path of [
         'app/node_modules/@serialport/bindings/build/Release/bindings.node',
-        'app/node_modules/node-pty/build/Release/pty.node',
+        'app/node_modules/@tabby-gang/node-pty/build/Release/pty.node',
         'app/node_modules/fontmanager-redux/build/Release/fontmanager.node',
         'app/node_modules/macos-native-processlist/build/Release/native.node',
     ]) {

+ 4 - 6
scripts/vars.mjs

@@ -3,8 +3,6 @@ import * as fs from 'fs'
 import * as semver from 'semver'
 import * as childProcess from 'child_process'
 
-process.env.ARCH = ((process.env.ARCH || process.arch) === 'arm') ? 'armv7l' : process.env.ARCH || process.arch
-
 import * as url from 'url'
 const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
 
@@ -60,21 +58,21 @@ export const keygenConfig = {
         win32: {
             x64: 'f481b9d6-d5da-4970-b926-f515373e986f',
             arm64: '950999b9-371c-419b-b291-938c5e4d364c',
-        }[process.env.ARCH],
+        }[process.env.ARCH ?? process.arch],
         darwin: {
             arm64: '98fbadee-c707-4cd6-9d99-56683595a846',
             x86_64: 'f5a48841-d5b8-4b7b-aaa7-cf5bffd36461',
             x64: 'f5a48841-d5b8-4b7b-aaa7-cf5bffd36461',
-        }[process.env.ARCH],
+        }[process.env.ARCH ?? process.arch],
         linux: {
             x64: '7bf45071-3031-4a26-9f2e-72604308313e',
             arm64: '39e3c736-d4d4-4fbf-a201-324b7bab0d17',
             armv7l: '50ae0a82-7f47-4fa4-b0a8-b0d575ce9409',
             armhf: '7df5aa12-04ab-4075-a0fe-93b0bbea9643',
-        }[process.env.ARCH],
+        }[process.env.ARCH ?? process.arch],
     }[process.platform],
 }
 
 if (!keygenConfig.product) {
-    throw new Error(`Unrecognized platform ${process.platform}/${process.env.ARCH}`)
+    throw new Error(`Unrecognized platform ${process.platform}/${process.env.ARCH ?? process.arch}`)
 }