ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.14k stars 155 forks source link

windows make build-nogui with "pipe: Bad file descriptor" error #364

Closed forfcw closed 1 year ago

forfcw commented 1 year ago

When I build the proton service in windows , always got a "pipe: Bad file descriptor" It may be a cmake error, but is there a way to resolve it? Looking forward to your reply!

Error

PS D:\proton-bridge> make build-nogui
process_begin: CreateProcess(NULL, dirname D:/proton-bridge/Makefile, ...) failed.
Makefile:8: pipe: Bad file descriptor

process_begin: CreateProcess(NULL, basename D:/proton-bridge, ...) failed.
Makefile:50: pipe: Bad file descriptor
process_begin: CreateProcess(NULL, uname -m, ...) failed.
Makefile:94: pipe: Bad file descriptor

'sed' is not recognized as an internal or external command,
operable program or batch file.
cd ./utils/ && ./credits.sh bridge
'.' is not recognized as an internal or external command,
operable program or batch file.
make: *** [Makefile:300: internal/bridge/credits.go] Error 1

Steps to Reproduce

  1. make build-nogui

Version Information

  1. windows 10
  2. gnu make 4.3 installed by chocolatey
forfcw commented 1 year ago

I try to build in my ubuntu 20.04 with the GOOS set windows in Makefile, and got the error below rm -f ./*.syso windres --target=pe-x86-64 \ / -I ./internal/frontend/share/ \ -D ICO_FILE=bridge.ico \ -D EXE_NAME="proton-bridge" \ -D FILE_VERSION="3.0.19+git" \ -D ORIGINAL_FILE_NAME="" \ -D PRODUCT_VERSION="3.0.19+git" \ -D FILE_VERSION_COMMA=3,0,19 \ -D YEAR=2023 \ -o ./resource.syso dist/info.rc /bin/sh: 1: windres: not found make: *** [Makefile:170: resource.syso] Error 127

LBeernaertProton commented 1 year ago

Hey @forfcw to build bridge on windows you need to install mysys2. After that you need to run pacman -S --needed base-devel mingw-w64-x86_64-toolchain in the msys2 shell.

You should be able to build bridge for windows.

Note: You also need to export the Go root and binary paths.

forfcw commented 1 year ago

Hey @forfcw to build bridge on windows you need to install mysys2. After that you need to run pacman -S --needed base-devel mingw-w64-x86_64-toolchain in the msys2 shell.

You should be able to build bridge for windows.

Note: You also need to export the Go root and binary paths.

Thank u so much !!!

forfcw commented 1 year ago

Hey @forfcw to build bridge on windows you need to install mysys2. After that you need to run pacman -S --needed base-devel mingw-w64-x86_64-toolchain in the msys2 shell.

You should be able to build bridge for windows.

Note: You also need to export the Go root and binary paths.

sry to reopen, I still get a gcc_libinit_window error in MSYS2 with gcc 11.3.0 and make 4.4 # runtime/cgo gcc_libinit_windows.c: In function ‘_cgo_beginthread’: gcc_libinit_windows.c:136:27: error: implicit declaration of function ‘_beginthread’; did you mean ‘ _cgo_beginthread’? [-Werror=implicit-function-declaration] 136 | thandle = _beginthread(func, 0, arg); | ^~~~~~~~~~~~ | _cgo_beginthread cc1: all warnings being treated as errors make: *** [Makefile:109: proton-bridge] Error 1