electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.69k stars 1.74k forks source link

fpm Process failed: gtar failed (exit code 1) #7445

Closed gws0920 closed 1 year ago

gws0920 commented 1 year ago

I want to build MacwindowsLinux on gitlab-runner(Mac)

Succeeded on the terminal. but Failed on the gitlab-runner

build command:

vue-tsc --noEmit && vite build --mode staging && electron-builder -mwl

Error

[log] dist/avatarOne.a5c74835.png            256.00 KiB
...
... other log
...
[log] dist/index.7b49b836.js                 6910.19 KiB / gzip: 1915.56 KiB
[warn] 
(!) Some chunks are larger than 500 KiB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
[log] vite v3.0.4 building for staging...
[log] transforming...
[log] ✓ 1 modules transformed.
[log] rendering chunks...
[log] dist/electron/preload/index.js   2.20 KiB / gzip: 0.89 KiB
[log] dist/electron/preload/index.js.map 3.95 KiB
[log] vite v3.0.4 building for staging...
[log] transforming...
[log] ✓ 24 modules transformed.
[log] rendering chunks...
[log] dist/electron/main/index.js   110.[68](https://git.n.xiaomi.com/Nirvana/fileExport/-/jobs/14609151#L68) KiB / gzip: 26.34 KiB
  • electron-builder  version=23.3.3 os=22.3.0
  • artifacts will be published if draft release exists  reason=CI detected
  • loaded configuration  file=/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/electron-builder.json5
  • packaging       platform=darwin arch=x64 electron=19.0.11 appOutDir=release/23.2.24/mac
  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found
                                                Valid identities only
     0 valid identities found
  • building        target=DMG arch=x64 file=release/23.2.24/xxx(staging).dmg
  • building        target=macOS zip arch=x64 file=release/23.2.24/xxx(staging).zip
  • packaging       platform=linux arch=x64 electron=19.0.11 appOutDir=release/23.2.24/linux-unpacked
  • building        target=AppImage arch=x64 file=release/23.2.24/xxx(staging)_23.2.24.AppImage
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • packaging       platform=win32 arch=x64 electron=19.0.11 appOutDir=release/23.2.24/win-unpacked
  • building        target=deb arch=x64 file=release/23.2.24/xxx(staging)_23.2.24.deb
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • building block map  blockMapFile=release/23.2.24/xxx(staging).zip.blockmap
  • building block map  blockMapFile=release/23.2.24/xxx(staging).dmg.blockmap
  • building        target=nsis file=release/23.2.24/xxx(staging)_23.2.24.exe archs=x64 oneClick=false perMachine=false
  • building block map  blockMapFile=release/23.2.24/xxx(staging)_23.2.24.exe.blockmap
  ⨯ cannot execute  cause=exit status 1
                    out={:timestamp=>"2023-02-23T16:30:15.943[69](https://git.n.xiaomi.com/Nirvana/fileExport/-/jobs/14609151#L69)2+0800", :message=>"Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag", :level=>:warn}
    {:timestamp=>"2023-02-23T16:34:12.531874+0800", :message=>"Process failed: gtar failed (exit code 1). Full command was:[\"gtar\", \"-C\", \"/var/folders/0x/r9qw8fjj4wj3q9fhstg23yv80000gn/T/package-dir-staging-5151275341b88efe391ed24a1af5b1a5aa542f811d859453a304320adfff\", \"-I'/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/node_modules/app-builder-bin/mac/app-builder_amd64'\", \"--numeric-owner\", \"--owner\", \"0\", \"--numeric-owner\", \"--group\", \"0\", \"-cf\", \"/var/folders/0x/r9qw8fjj4wj3q9fhstg23yv80000gn/T/package-deb-build-b8fd00364e6ca5d4b1c6a88b343ea17e81e93c41213972e31e2146428a69/data.tar.xz\", \".\"]", :level=>:error}

                    command=/Users/xxx/Library/Caches/electron-builder/fpm/fpm-1.9.3-20150[71](https://git.n.xiaomi.com/Nirvana/fileExport/-/jobs/14609151#L71)5-2.2.2-mac/fpm -s dir --force -t deb -d libgtk-3-0 -d libnotify4 -d libnss3 -d libxss1 -d libxtst6 -d xdg-utils -d libatspi2.0-0 -d libuuid1 -d libsecret-1-0 --deb-recommends libappindicator3-1 --deb-compression xz --architecture amd64 --after-install /private/tmp/t-x42QXF/1-after-install --after-remove /private/tmp/t-x42QXF/2-after-remove --description '
     xxx --version 23.2.24 --package '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/23.2.24/xxx(staging)_23.2.24.deb' --name mi-camera-tools-staging --maintainer 'xxx <xxx@xxx.com>' --url '' --vendor 'xxx <xxx@xxx.com>' --deb-priority optional --license MIT --iteration 52 '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/23.2.24/linux-unpacked/=/opt/xxx(staging)' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/result.iconset/icon_16x16.png=/usr/share/icons/hicolor/16x16/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/result.iconset/icon_32x32.png=/usr/share/icons/hicolor/32x32/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/icon_48x48.png=/usr/share/icons/hicolor/48x48/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/icon_64x64.png=/usr/share/icons/hicolor/64x64/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/result.iconset/icon_[128](https://git.n.xiaomi.com/Nirvana/fileExport/-/jobs/14609151#L128)x128.png=/usr/share/icons/hicolor/128x128/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/result.iconset/icon_256x256.png=/usr/share/icons/hicolor/256x256/apps/mi-camera-tools-staging.png' '/usr/local/bin/builds/wqsDj5Zv/0/Nirvana/fileExport/release/${version}/.icon-set/result.iconset/icon_512x512.png=/usr/share/icons/hicolor/512x512/apps/mi-camera-tools-staging.png' '/private/tmp/t-x42QXF/3-xxx(staging).desktop=/usr/share/applications/mi-camera-tools-staging.desktop'
                    workingDir=
ERROR: Job failed: exit status 1

Multiple runs only succeed once

electron-builder.json5

/**
 * @see https://www.electron.build/configuration/configuration
 */
{
  "appId": "xxx(staging)",
  "productName":"xxx(staging)",
  "asar": true,
  "directories": {
    "output": "release/${version}"
  },
  "publish": [{
      "provider": "generic",
      "url": "http://10.13.2.154:80/" 
  }],
  "extraResources": [{
    "from": "./modules",
    "to": "modules"
  }],
  "files": [
    "dist"
  ],
  "mac": {
    "icon": "./build/icons/icon.icns",
    "artifactName": "${productName}.${ext}",
    "target" : [
      "dmg", "zip"
    ]
  },
  "win": {
    "icon": "./build/icons/icon.ico",
    "artifactName": "${productName}_${version}.${ext}",
    "requestedExecutionLevel": "highestAvailable",
    "target": [
      {
        "target": "nsis",
        "arch": [
          "x64"
        ]
      }
    ],
    "artifactName": "${productName}_${version}.${ext}"
  },
  "linux": {
    "icon": "./build/icons/icon.icns",
    "artifactName": "${productName}_${version}.${ext}",
    "target": [
      "AppImage",
      "deb",
    ]
  },
  "releaseInfo":{
    "releaseNotesFile":"./releaseLog/release-23.2.10.md"
  },
  "nsis": {
    "oneClick": false,
    "perMachine": false,
    "allowToChangeInstallationDirectory": true,
    "deleteAppDataOnUninstall": false
  }
}

package.json

{
  "name": "xxx-staging",
  "version": "23.2.24",
  "main": "dist/electron/main/index.js",
  "description": "xxx",
  "homepage": "",
  "author": "xxx<xxx@xxx.com>",
  "license": "MIT",
  "private": true,
  "scripts": {
    "dev": "vite",
    "build:staging": "vue-tsc --noEmit && vite build --mode staging && electron-builder -mwl",
    "buildLinux:staging": "export NODE_OPTIONS=--max-old-space-size=4096 && npm run build:staging -mwl",
    "build": "vue-tsc --noEmit && vite build && electron-builder",
    "electron:generate-icons": "electron-icon-builder --input=./public/MiCameraTools.png --output=build --flatten",
    "v": "node ./script/version.js",
    "p": "npm run update:base && node ./script/prePublish.js staging && npm run build:staging && node ./script/publish.js staging",
    "update:base": "npm i xxx"
  },
  "engines": {
    "node": ">=14.17.0"
  },
  "devDependencies": {
    "@intlify/vite-plugin-vue-i18n": "^6.0.0",
    "@types/node": "^18.7.18",
    "@types/request": "^2.48.8",
    "@vitejs/plugin-vue": "^3.0.1",
    "consola": "^2.15.3",
    "electron": "^19.0.8",
    "electron-builder": "^23.1.0",
    "electron-icon-builder": "^2.0.1",
    "sass": "^1.54.3",
    "sass-loader": "^13.0.2",
    "typescript": "^4.7.4",
    "unplugin-vue-components": "^0.22.3",
    "vite": "^3.0.3",
    "vite-plugin-electron": "^0.8.1",
    "vite-plugin-html": "^3.2.0",
    "vite-plugin-monaco-editor": "^1.0.10",
    "vite-plugin-windicss": "^1.8.7",
    "vue": "^3.2.37",
    "vue-tsc": "^0.39.4",
    "windicss": "^3.5.6"
  },
  "env": {
    "VITE_DEV_SERVER_HOST": "127.0.0.1",
    "VITE_DEV_SERVER_PORT": 3344
  },
  "keywords": [
    "electron",
    "rollup",
    "vite",
    "vue3",
    "vue"
  ],
  "dependencies": {
    "@antv/x6": "^1.33.1",
    "@antv/x6-vue-shape": "^1.4.2",
    "@vicons/carbon": "^0.12.0",
    "@vicons/ionicons4": "^0.12.0",
    "@vueuse/core": "^9.1.0",
    "axios": "^0.27.2",
    "compressing": "^1.6.2",
    "echarts": "^5.3.3",
    "electron-log": "^4.4.8",
    "electron-updater": "^5.2.1",
    "element-plus": "^2.2.17",
    "exceljs": "^4.3.0",
    "exif-js": "github:exif-js/exif-js",
    "fetch-blob": "^3.2.0",
    "formdata-node": "^5.0.0",
    "formdata-polyfill": "^4.0.10",
    "got": "^12.4.1",
    "iconv-lite": "^0.6.3",
    "json5": "^2.2.3",
    "monaco-editor": "^0.34.1",
    "mousetrap": "^1.6.5",
    "nanoid": "^4.0.0",
    "pinia": "^2.0.17",
    "sudo-prompt": "^9.2.1",
    "tough-cookie": "^4.1.2",
    "unplugin-auto-import": "^0.11.1",
    "vite-plugin-electron-renderer": "^0.12.1",
    "vite-plugin-style-import": "^2.0.0",
    "vue-i18n": "^9.2.2",
    "vue-router": "^4.1.3",
    "vue-virtualised": "^0.1.8",
    "xml-js": "^1.6.11"
  }
}
gws0920 commented 1 year ago

It may be caused by insufficient memory

vue-tsc --noEmit && vite build --mode staging && electron-builder -mw this successful.