asticode / go-astilectron

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)
MIT License
4.9k stars 344 forks source link

linux bundle failed #374

Closed passerbyo closed 2 years ago

passerbyo commented 2 years ago

2022/07/15 03:18:43 Building for os linux and arch amd64 astilectron: 0.51.0 electron: 11.4.3 2022/07/15 03:18:43 Executing go build -ldflags -X "main.AppName=Astilectron demo" -X "main.BuiltAt=2022-07-15 03:18:43.836555438 -0400 EDT m=+6.584818528" -X "main.VersionAstilectron=0.51.0" -X "main.VersionElectron=11.4.3" -o /root/go/GOCODE/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/binary github.com/asticode/go-astilectron-demo 2022/07/15 03:19:18 bundling failed: bundling for environment linux/amd64 failed: building failed: # github.com/asticode/go-astilectron-demo /root/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /usr/bin/ld: i386 architecture of input file `/tmp/go-link-4158473790/000000.o' is incompatible with i386:x86-64 output collect2: error: ld returned 1 exit status

asticode commented 2 years ago

Have you tried building other go binaries on this machine ?

passerbyo commented 2 years ago

Have you tried building other go binaries on this machine ?

yes , they all work normally. And i build go astilectron demo successfully before

passerbyo commented 2 years ago

https://stackoverflow.com/questions/56547970/go-pkg-tool-linux-amd64-link-running-gcc-failed-exit-status-1-usr-bin-ld-can

passerbyo commented 2 years ago

https://stackoverflow.com/questions/56547970/go-pkg-tool-linux-amd64-link-running-gcc-failed-exit-status-1-usr-bin-ld-can

i try this eay to solve the bug,but it does not works

asticode commented 2 years ago

Is your machine a 32 bits machine ?

passerbyo commented 2 years ago

Is your machine a 32 bits machine ?

no,my machine is pure amd64

─# uname -a Linux kali 5.15.0-kali3-amd64

you can download my machine to run on vmware from following link.

https://kali.download/virtual-images/kali-2022.2/kali-linux-2022.2-vmware-amd64.7z

from https://www.kali.org/get-kali/#kali-virtual-machines.

my go version go1.17.10 linux/amd64

passerbyo commented 2 years ago

when i excuse go main.go

go-astilectron/example/main.go

it shows privilege errors on root account linux system.


2022/07/15 05:30:45 removing /root/go/GOCODE/src/github.com/asticode/go-astilectron/example/example/vendor/electron-linux-amd64-v11.4.3.zip
2022/07/15 05:30:45 Listening...
2022/07/15 05:30:45 Executing...
2022/07/15 05:30:45 Starting cmd /root/go/GOCODE/src/github.com/asticode/go-astilectron/example/example/vendor/electron-linux-amd64/electron /root/go/GOCODE/src/github.com/asticode/go-astilectron/example/example/vendor/astilectron/main.js 127.0.0.1:42633 false
2022/07/15 05:30:45 Stderr says: [8156:0715/053045.892228:FATAL:electron_main_delegate.cc(253)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
2022/07/15 05:30:45 '/root/go/GOCODE/src/github.com/asticode/go-astilectron/example/example/vendor/electron-linux-amd64/electron' exited with code: -1
2022/07/15 05:30:45 App has crashed
2022/07/15 05:30:45 Stopping...
2022/07/15 05:30:45 astikit: stopping worker...
2022/07/15 05:30:45 main: creating window failed: context canceled
exit status 1```
passerbyo commented 2 years ago

375