asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

Bundling Failed - Darwin #9

Closed gazzer82 closed 6 years ago

gazzer82 commented 6 years ago

Was excited to give this a go, but can't get the demo to bundle.

Followed the steps in the readme, but get the following error, any idea why?

Gareths-MBP:bin garethjeanne$ go get -u github.com/asticode/go-astilectron-demo/...
Gareths-MBP:bin garethjeanne$ go get -u github.com/asticode/go-astilectron-bundler/...
Gareths-MBP:bin garethjeanne$ cd $GOPATH/src/github.com/asticode/go-astilectron-demo
Gareths-MBP:go-astilectron-demo garethjeanne$ astilectron-bundler -v
DEBU[0000] Resetting                                    
DEBU[0000] Creating /var/folders/55/r0rp7crx4z9b36kmdxn1n5k00000gn/T/astibundler 
DEBU[0000] Creating /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/output 
DEBU[0000] Bundling for environment darwin/amd64        
DEBU[0000] Removing /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/output/darwin-amd64 
DEBU[0000] Creating /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/output/darwin-amd64 
DEBU[0000] Binding data                                 
DEBU[0000] Removing /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] Creating /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] /var/folders/55/r0rp7crx4z9b36kmdxn1n5k00000gn/T/astibundler/astilectron-0.12.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.12.0.zip 
DEBU[0000] Copying /var/folders/55/r0rp7crx4z9b36kmdxn1n5k00000gn/T/astibundler/astilectron-0.12.0.zip to /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/vendor/astilectron.zip 
DEBU[0000] /var/folders/55/r0rp7crx4z9b36kmdxn1n5k00000gn/T/astibundler/electron-darwin-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-darwin-x64.zip 
DEBU[0000] Copying /var/folders/55/r0rp7crx4z9b36kmdxn1n5k00000gn/T/astibundler/electron-darwin-amd64-1.8.1.zip to /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/vendor/electron.zip 
DEBU[0000] Generating /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/bind_darwin_amd64.go 
DEBU[0002] Building for os darwin and arch amd64        
DEBU[0002] Executing go build -ldflags -X "main.AppName=Astilectron demo" -X "main.BuiltAt=2017-11-24 12:01:31.964969674 +0000 GMT" -o /Users/garethjeanne/go/src/github.com/asticode/go-astilectron-demo/output/darwin-amd64/binary github.com/asticode/go-astilectron-demo 
FATA[0005] bundling failed: bundling for environment darwin/amd64 failed: building failed: # github.com/asticode/go-astilectron-demo
./bind_darwin_amd64.go:264: Asset redeclared in this block
    previous declaration at ./bind.go:3
./bind_darwin_amd64.go:413: RestoreAssets redeclared in this block
    previous declaration at ./bind.go:7
: exit status 2 

I'm running OSX - 10.12.6 GO Install is go1.8.3 darwin/amd64

Thanks!

Gareth

asticode commented 6 years ago

@gazzer82 this is a very nice find indeed. You have to remove $GOPATH/src/github.com/asticode/go-astilectron-demo/bind.go that is only there so that the package is buildable during go get and is a conflict afterwards.

I've also updated the README.

Does this fix your issue?

gazzer82 commented 6 years ago

Yup that got it, awesome, and thanks for your work on this!

asticode commented 6 years ago

cheers