asticode / go-astilectron-demo

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

bundler: Add support for multiple GOPATH:s #12

Closed mewmew closed 6 years ago

mewmew commented 6 years ago

Hi,

I was hoping to try out the demo, and ran through the step by step installation instructions. However, on step 3 I received the following error message.

u@x220 ~/g/s/g/a/go-astilectron-demo> astilectron-bundler -v
DEBU[0000] Resetting                                    
DEBU[0000] Creating /tmp/astibundler                    
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/output 
DEBU[0000] Bundling for environment linux/amd64         
DEBU[0000] Removing /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 
DEBU[0000] Binding data                                 
DEBU[0000] Removing /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] Downloading https://github.com/asticode/astilectron/archive/v0.14.0.zip into /tmp/astibundler/astilectron-0.14.0.zip 
DEBU[0001] Copying /tmp/astibundler/astilectron-0.14.0.zip to /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor/astilectron.zip 
DEBU[0001] Downloading https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-linux-x64.zip into /tmp/astibundler/electron-linux-amd64-1.8.1.zip 
DEBU[0012] Copying /tmp/astibundler/electron-linux-amd64-1.8.1.zip to /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor/electron.zip 
DEBU[0012] Generating /home/u/goget/src/github.com/asticode/go-astilectron-demo/bind_linux_amd64.go 
DEBU[0015] Building for os linux and arch amd64         
DEBU[0015] Executing go build -ldflags -s -X "main.AppName=Astilectron demo" -X "main.BuiltAt=2017-12-05 21:45:53.270205606 +0100 CET m=+15.215371582" -o /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/binary home/u/goget/src/github.com/asticode/go-astilectron-demo 
FATA[0015] bundling failed: bundling for environment linux/amd64 failed: building failed: can't load package: package home/u/goget/src/github.com/asticode/go-astilectron-demo: cannot find package "home/u/goget/src/github.com/asticode/go-astilectron-demo" in any of:
    /home/u/go/src/home/u/goget/src/github.com/asticode/go-astilectron-demo (from $GOROOT)
    /home/u/goget/src/home/u/goget/src/github.com/asticode/go-astilectron-demo (from $GOPATH)
    /home/u/Desktop/go/src/home/u/goget/src/github.com/asticode/go-astilectron-demo
: exit status 1 

May this be related to me having multiple GOPATH:s?

u@x220 ~/g/s/g/a/go-astilectron-demo> go env | grep GOPATH
GOPATH="/home/u/goget:/home/u/Desktop/go"

Cheers, /u

mewmew commented 6 years ago

Ok, I tried to verify if the issue was caused by having multiple GOPATH:s, and it seems to be the case. I've updated the issue title accordingly.

u@x220 ~/g/s/g/a/go-astilectron-demo> /bin/bash
export[u@x220 go-astilectron-demo]$ export GOPATH=/home/u/goget
[u@x220 go-astilectron-demo]$ astilectron-bundler -v
DEBU[0000] Resetting                                    
DEBU[0000] Creating /tmp/astibundler                    
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/output 
DEBU[0000] Bundling for environment linux/amd64         
DEBU[0000] Removing /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64 
DEBU[0000] Binding data                                 
DEBU[0000] Removing /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] Creating /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor 
DEBU[0000] /tmp/astibundler/astilectron-0.14.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.14.0.zip 
DEBU[0000] Copying /tmp/astibundler/astilectron-0.14.0.zip to /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor/astilectron.zip 
DEBU[0000] /tmp/astibundler/electron-linux-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-linux-x64.zip 
DEBU[0000] Copying /tmp/astibundler/electron-linux-amd64-1.8.1.zip to /home/u/goget/src/github.com/asticode/go-astilectron-demo/vendor/electron.zip 
DEBU[0000] Generating /home/u/goget/src/github.com/asticode/go-astilectron-demo/bind_linux_amd64.go 
DEBU[0003] Building for os linux and arch amd64         
DEBU[0003] Executing go build -ldflags -s -X "main.AppName=Astilectron demo" -X "main.BuiltAt=2017-12-05 21:49:37.356429987 +0100 CET m=+3.150384134" -o /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/binary github.com/asticode/go-astilectron-demo 
DEBU[0012] Moving /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/binary to /home/u/goget/src/github.com/asticode/go-astilectron-demo/output/linux-amd64/Astilectron demo

Btw, cool demo! : )

asticode commented 6 years ago

@mewmew thanks for letting me know.

I've pushed a correction. Can you pull it, make the bundler again and tell me if that's better with your multiple GOPATHs?

mewmew commented 6 years ago

It works now. Thanks for the fix!