electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

building windows app on centos linux, error : write EPIPE

Open qld-cf opened this issue 3 years ago • 16 comments

os: linux centos target: windows exe

repo: https://github.com/electron-userland/electron-webpack-quick-start

demo can not build exe on centos linux

error: • downloading url=https://github.com/electron/electron/releases/download/v8.2.0/electron-v8.2.0-win32-x64.zip size=71 MB parts=8 • downloaded url=https://github.com/electron/electron/releases/download/v8.2.0/electron-v8.2.0-win32-x64.zip duration=34.806s • file source doesn't exist from=/root/test/electron-webpack-quick-start/static • default Electron icon is used reason=application icon is not set • building target=nsis file=dist/electron-webpack-quick-start Setup 0.0.0.exe archs=x64 oneClick=true perMachine=false Error: write EPIPE at afterWriteDispatched (internal/stream_base_commons.js:156:25) at writeGeneric (internal/stream_base_commons.js:147:3) at Socket._writeGeneric (net.js:785:11) at Socket._write (net.js:797:8) at writeOrBuffer (_stream_writable.js:352:12) at Socket.Writable.write (_stream_writable.js:303:10) at Socket.Writable.end (_stream_writable.js:567:10) at Socket.end (net.js:591:31) at /root/test/electron-webpack-quick-start/node_modules/builder-util/src/util.ts:197:26 at new Promise () at spawnAndWrite (/root/test/electron-webpack-quick-start/node_modules/builder-util/src/util.ts:180:10) at NsisTarget.executeMakensis (/root/test/electron-webpack-quick-start/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:560:11) at NsisTarget.computeScriptAndSignUninstaller (/root/test/electron-webpack-quick-start/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:340:5) at NsisTarget.buildInstaller (/root/test/electron-webpack-quick-start/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:278:103) at NsisTarget.finishBuild (/root/test/electron-webpack-quick-start/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:110:7) at async Promise.all (index 1)

qld-cf avatar Feb 24 '21 10:02 qld-cf

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jun 05 '21 01:06 stale[bot]

someboby has solution? pls

qld-cf avatar Jul 06 '21 03:07 qld-cf

Have same issue.

Monsterlin2018 avatar Jul 28 '21 07:07 Monsterlin2018

same

kuhippo avatar Jul 28 '21 13:07 kuhippo

same

yuzhou721 avatar Aug 09 '21 07:08 yuzhou721

I just got this same error after not changing any code in CI when it previously ran without an issue.

tysoncadenhead avatar Aug 13 '21 21:08 tysoncadenhead

centos7 electron 12.1.2 electron-builder 22.11.5

截屏2021-09-26 下午4 58 02

sujiewen avatar Sep 26 '21 08:09 sujiewen

Has anyone solved it?

sujiewen avatar Sep 26 '21 09:09 sujiewen

Has anyone solved it?

@sujiewen 有2个办法 1. 使用docker容器来构建 2. 更换nsis版本 我都用过 最后倾向于使用docker容器来构建,可以跨端

yuzhou721 avatar Oct 05 '21 02:10 yuzhou721

Has anyone solved it?

@sujiewen 有2个办法 1. 使用docker容器来构建 2. 更换nsis版本 我都用过 最后倾向于使用docker容器来构建,可以跨端 能把方法详细说明下吗?谢谢

sujiewen avatar Oct 12 '21 12:10 sujiewen

I encountered the same problem, and finally found that it was because the .cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis file did not have execute permission, and chmod with execute permission was OK.

Larry-Arun avatar Feb 28 '22 08:02 Larry-Arun

我这边发现是makensis执行缺少部分依赖(去对应平台的makensis执行文件目录,命令行手动执行一下会有提示),安装一下就好了。

zhaihongbin avatar Apr 07 '22 01:04 zhaihongbin

我这边发现是makensis执行缺少部分依赖(去对应平台的makensis执行文件目录,命令行手动执行一下会有提示),安装一下就好了。

确实是少了两个依赖

./makensis: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./makensis)
./makensis: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./makensis)

dddreee avatar Jun 15 '22 10:06 dddreee

Has anyone solved it?I just got this same error .

yinhui427 avatar Sep 23 '22 02:09 yinhui427

Commented by @yuzhou721:

有2个办法:1)使用 Docker 容器来构建

There're 2 solutions: 1) Use Docker Containers for building action

我确实使用了 Docker Desktop for Windows (WSL2 Backend) 来进行构建,但依旧出现相同问题。

I DOES use Docker Desktop for Windows with WSL2 backend for building, but the same problem still occurs ...


Environments

  • Microsoft Windows 11 Professional 22H2
  • Docker Desktop for Windows (WSL2 backend)
    • Version 4.13.1 (90346)
    • Engine: 20.10.20
    • Compose: v2.12.1
    • Credential Helper: v0.7.0
    • Kubernates: v1.25.2
    • Snyk: v1.1025.0
  • Microsoft Visual Studio Code v1.73.1 (system setup)
    • Dev Containers v0.264.0

Steps to reproduce

  1. Launch the build environment with Docker Container ...

    1. Pull the image electronuserland/builder:16-wine from DockerHub.
    2. Start a brand-new container with that image in Docker Desktop GUI.
      1. Click "Run" and expand "Optional Settings". For convince, we name it as motrix.
      2. DO NOT configure any other thing!
  2. Launch VSCode and attach the environment ...

    1. Click the buttom-left and choose "Attach to Running Container ...", a new window will automatically launched and attached to our motrix container.
    2. At the welcome page click "Clone Git Repository ...", you should clone agalwood/Motrix under /root and there will be a /root/Motrix folder after cloning.
  3. Upgrade Aria2 ...

    1. Run apt update && apt install -y p7zip-full for /usr/bin/7z, it will be used the next step.
    2. Download aria2-1.36.0-win-64bit-build2.7z with wget to any available folder outside /root/Motrix and extract it with 7z x aria2-1.36.0-win-64bit-build2.7z.
    3. Replace extra/win32/engine/aria2c.exe with aria2-1.36.0-win-64bit-build2/aria2c.exe.
  4. Build artifacts by running yarn && yarn build:github && yarn run electron-build -w --x64!

  5. Wait a moment, an error will occur when building "release-able files" (*.exe, *.msi, etc.).

Error logs

Following errors occured when yarn run electron-build -w --x64. There's no error in previous steps.

image

Log contents
root@192d286b808c:~/Motrix# yarn run electron-builder -w --x64
yarn run v1.22.19
$ /root/Motrix/node_modules/.bin/electron-builder -w --x64
  • electron-builder  version=22.11.7 os=5.15.74.2-microsoft-standard-WSL2
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=release/builder-effective-config.yaml
  • packaging       platform=win32 arch=x64 electron=11.4.9 appOutDir=release/win-unpacked
after build; disable sandbox
  • building        target=zip arch=x64 file=release/Motrix-1.6.11-win.zip
  • packaging       platform=win32 arch=ia32 electron=11.4.9 appOutDir=release/win-ia32-unpacked
after build; disable sandbox
  • building        target=zip arch=ia32 file=release/Motrix-1.6.11-ia32-win.zip
  • building        target=nsis file=release/Motrix Setup 1.6.11.exe archs=x64, ia32 oneClick=false perMachine=false
  • building        target=portable file=release/Motrix 1.6.11.exe archs=x64, ia32
Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:874:11)
    at Socket._write (node:net:886:8)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at Socket.Writable.end (node:internal/streams/writable:611:17)
    at Socket.end (node:net:655:31)
    at /root/Motrix/node_modules/builder-util/src/util.ts:204:25
    at new Promise (<anonymous>)
    at Object.spawnAndWrite (/root/Motrix/node_modules/builder-util/src/util.ts:183:10)
    at NsisTarget.executeMakensis (/root/Motrix/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:576:11)
    at NsisTarget.buildInstaller (/root/Motrix/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:302:5)
    at NsisTarget.finishBuild (/root/Motrix/node_modules/app-builder-lib/src/targets/nsis/NsisTarget.ts:129:9)
    at async Promise.all (index 8)
    at AsyncTaskManager.awaitTasks (/root/Motrix/node_modules/builder-util/src/asyncTaskManager.ts:65:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Dragon1573 avatar Nov 16 '22 14:11 Dragon1573

我这边发现是makensis执行缺少部分依赖(去对应平台的makensis执行文件目录,命令行手动执行一下会有提示),安装一下就好了。

确实是少了两个依赖

./makensis: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./makensis)
./makensis: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./makensis)

我也有同样的问题,但是我更新包,但是没有用。。 @zhaihongbin @dddreee

shencaobo avatar Mar 11 '24 08:03 shencaobo