asticode / go-astilectron-bundler

Bundle your Astilectron app with ease

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to include a pre-downloaded version of astilectron.zip and electron.zip?

nikhilsaraf opened this issue · comments

I want my desktop app to have UI capabilities from the moment it is opened (double-clicked).

Now it "provisions" astilectron and electron, which includes downloading the files. This can take some time on a slow network and then the user is left waiting for "something to happen", which is not the best user experience.

I'm not sure how to configure this. I've added the following options in my bootstrap.Options:

Asset:         Asset,
AssetDir:      AssetDir,
RestoreAssets: RestoreAssets,

but that gave me the following error:
Screen Shot 2020-02-21 at 5 46 33 PM

I also tried by creating the folder vendor_astilectron_bundler in my project root with the files astilectron.zip and electron.zip but that did not help either.

Do I need to explicitly embed the two zip files into my golang binary or can astilectron-bundler take care of that for me at compile time?

Not sure what I'm doing wrong, your help will be greatly appreciated.

here's a link to my source code that initializes bootstrap.Options (without the above-mentioned code added):
https://github.com/stellar/kelp/blob/b725cbaf9c67e8d3b9aea29316c5ec22d168c81e/cmd/server.go#L267

Here's the link to my bundler.json:
https://github.com/stellar/kelp/blob/b725cbaf9c67e8d3b9aea29316c5ec22d168c81e/bundler.json

@nikhilsaraf the bundler should take care of this. Adding this to your bootstrap.Options is the first step indeed:

Asset:         Asset,
AssetDir:      AssetDir,
RestoreAssets: RestoreAssets,

Then run astilectron-bundler in the directory containing bundler.json.

But I guess that's already what you're doing.

A recent fix could provide more information. Could you :

  • fetch the last changes of go-astilectron-bundler and run go get -u ./...
  • fetch the last changes of go-astilectron-bootstrap and run go get -u ./...
  • run go install github.com/asticode/go-astilectron-bundler/astilectron-bundler
  • run your bundler like you did before but paste logs here
  • run your app and see if you have a different error ?

@asticode

The first run fails with the error:
LSOpenURLsWithRole() failed with error -10810 for the file /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/KelpUI-v1.8.1-4-g5e1568e6-dirty-darwin-amd64/Kelp.app.

I tried this again by removing the Asset, AssetDir, RestoreAssets fields and I got the same error, but for the first two runs. Maybe when I removed it it was downloading the electron and astilectron binaries so was not ready by the second run?

Anyhow, because of the LSOpenURLsWithRole error, it is not working with the new version of astilectron-bundler anymore. Additionally, on the "successful" run it does not load the local file pointed to in the homepage URL link, which is a regression from the previous version of astilectron that I was using.

- package: github.com/asticode/go-astilectron
  my old version: 8e68f812e8a2dd6655af42a8d6bc44856dd172be
  latest suggested version: 248bbedddea470f54b02968958c2d10292fadbec
- package: github.com/asticode/go-astilectron-bootstrap
  my old version: 25b8572859996696903f9417598ebc94d5d61035
  latest suggested version: 58dd5b61cd57cde9f6f9c301ded5373401b21dfb
- package: github.com/asticode/go-astilectron-bundler
  my old version: 155c2a10bbb1791fbafe89a9b64be05c64f16c81
  latest suggested version: cba668903da3fe0ecca788058636612b255887b2

Here's the log file (below) of the compilation from when I had the Asset, AssetDir, RestoreAssets fields passed to the bootstrap.Options.

generating the bundler.json file in / to create missing files for current platform ... done
generating the bind file in /cmd to create missing files for current platform ... 2020/02/25 15:41:09 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:09 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:09 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:09 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:09 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:09 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:09 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-darwin-x64.zip
2020/02/25 15:41:09 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:09 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:09 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:09 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_darwin_amd64.go
done

generating the bundler.json file in / to create missing files for all remaining platforms ... done
generating the bind file in /cmd to create missing files for all remaining platforms ... 2020/02/25 15:41:13 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:13 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:13 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:13 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:13 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:13 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:13 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-darwin-x64.zip
2020/02/25 15:41:13 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:13 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:13 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:13 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_darwin_amd64.go
2020/02/25 15:41:17 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:17 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:17 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:17 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:17 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:17 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:17 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-linux-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-linux-x64.zip
2020/02/25 15:41:17 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-linux-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:17 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:17 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:17 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_linux_amd64.go
2020/02/25 15:41:20 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:20 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:20 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:20 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:20 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:20 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:20 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-windows-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-win32-x64.zip
2020/02/25 15:41:20 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-windows-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:20 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:20 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:20 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_windows_amd64.go
done

compiling for (GOOS=darwin, GOARCH=amd64, GOARM=) ... successful
archiving binary file ... successful: build/20200225T234049Z/kelp-v1.8.1-4-g5e1568e6-dirty-darwin-amd64.tar
cleaning up binary: build/20200225T234049Z/kelp-v1.8.1-4-g5e1568e6-dirty/kelp ... successful

cleaning up kelp folder: build/20200225T234049Z/kelp-v1.8.1-4-g5e1568e6-dirty/ ... done


compiling UI for (GOOS=darwin, GOARCH=amd64, FLAG=) ... 2020/02/25 15:41:34 Bundling for environment darwin/amd64
2020/02/25 15:41:34 Binding data
2020/02/25 15:41:34 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:34 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:34 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:34 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:34 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:34 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:34 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-darwin-x64.zip
2020/02/25 15:41:34 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-darwin-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:34 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:34 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:34 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_darwin_amd64.go
2020/02/25 15:41:37 Removing /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64
2020/02/25 15:41:37 Creating /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64
2020/02/25 15:41:37 Building for os darwin and arch amd64 astilectron: 0.35.1 electron: 7.1.10
2020/02/25 15:41:37 Executing go build -ldflags -X "main.AppName=Kelp" -X "main.BuiltAt=2020-02-25 15:41:37.02135 -0800 PST m=+2.867132182" -X "main.VersionAstilectron=0.35.1" -X "main.VersionElectron=7.1.10" -X "github.com/stellar/kelp/cmd.version=358_gui_bundle_electron:v1.8.1-4-g5e1568e6-dirty" -X "github.com/stellar/kelp/cmd.gitBranch=358_gui_bundle_electron" -X "github.com/stellar/kelp/cmd.gitHash=5e1568e62066d7a472e507d78dd31eb837ccbf54-dirty" -X "github.com/stellar/kelp/cmd.buildDate=20200225T234049Z" -X "github.com/stellar/kelp/cmd.env=release" -o /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/binary github.com/stellar/kelp
2020/02/25 15:41:46 Creating /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/MacOS
2020/02/25 15:41:46 Moving /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/binary to /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/MacOS/Kelp
2020/02/25 15:41:46 Chmoding /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/MacOS/Kelp
2020/02/25 15:41:46 Creating /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/Resources
2020/02/25 15:41:46 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources/kelp-icon@2x.icns to /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/Resources/Kelp.icns
2020/02/25 15:41:46 Adding Info.plist to /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/darwin-amd64/Kelp.app/Contents/Info.plist
2020/02/25 15:41:46 Bundling for environment linux/amd64
2020/02/25 15:41:46 Binding data
2020/02/25 15:41:46 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:46 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:41:46 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:41:46 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:41:46 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:41:46 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:41:46 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-linux-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-linux-x64.zip
2020/02/25 15:41:46 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-linux-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:41:46 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:46 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:41:46 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_linux_amd64.go
2020/02/25 15:41:50 Removing /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/linux-amd64
2020/02/25 15:41:50 Creating /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/linux-amd64
2020/02/25 15:41:50 Building for os linux and arch amd64 astilectron: 0.35.1 electron: 7.1.10
2020/02/25 15:41:50 Executing go build -ldflags -X "main.AppName=Kelp" -X "main.BuiltAt=2020-02-25 15:41:50.272617 -0800 PST m=+16.118644586" -X "main.VersionAstilectron=0.35.1" -X "main.VersionElectron=7.1.10" -X "github.com/stellar/kelp/cmd.version=358_gui_bundle_electron:v1.8.1-4-g5e1568e6-dirty" -X "github.com/stellar/kelp/cmd.gitBranch=358_gui_bundle_electron" -X "github.com/stellar/kelp/cmd.gitHash=5e1568e62066d7a472e507d78dd31eb837ccbf54-dirty" -X "github.com/stellar/kelp/cmd.buildDate=20200225T234049Z" -X "github.com/stellar/kelp/cmd.env=release" -o /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/linux-amd64/binary github.com/stellar/kelp
2020/02/25 15:42:00 Moving /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/linux-amd64/binary to /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/linux-amd64/Kelp
2020/02/25 15:42:00 Bundling for environment windows/amd64
2020/02/25 15:42:00 Binding data
2020/02/25 15:42:00 Removing /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:42:00 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind
2020/02/25 15:42:00 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler
2020/02/25 15:42:00 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache
2020/02/25 15:42:00 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.35.1.zip
2020/02/25 15:42:00 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/astilectron-0.35.1.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/astilectron.zip
2020/02/25 15:42:00 /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-windows-amd64-7.1.10.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v7.1.10/electron-v7.1.10-win32-x64.zip
2020/02/25 15:42:00 Copying /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/cache/electron-windows-amd64-7.1.10.zip to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/vendor_astilectron_bundler/electron.zip
2020/02/25 15:42:01 Creating /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:42:01 Copying /Users/myuser/go/src/github.com/stellar/kelp/resources to /var/folders/cm/_06008yd2tz8b123br_5wzn00000gn/T/astibundler/bind/resources
2020/02/25 15:42:01 Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_windows_amd64.go
2020/02/25 15:42:03 Running rsrc for icon /Users/myuser/go/src/github.com/stellar/kelp/resources/kelp-icon@2x.ico into /Users/myuser/go/src/github.com/stellar/kelp/windows.syso
2020/02/25 15:42:03 Removing /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/windows-amd64
2020/02/25 15:42:03 Creating /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/windows-amd64
2020/02/25 15:42:03 Building for os windows and arch amd64 astilectron: 0.35.1 electron: 7.1.10
2020/02/25 15:42:03 Executing go build -ldflags -H "windowsgui" -X "main.AppName=Kelp" -X "main.BuiltAt=2020-02-25 15:42:03.788814 -0800 PST m=+29.635066489" -X "main.VersionAstilectron=0.35.1" -X "main.VersionElectron=7.1.10" -X "github.com/stellar/kelp/cmd.version=358_gui_bundle_electron:v1.8.1-4-g5e1568e6-dirty" -X "github.com/stellar/kelp/cmd.gitBranch=358_gui_bundle_electron" -X "github.com/stellar/kelp/cmd.gitHash=5e1568e62066d7a472e507d78dd31eb837ccbf54-dirty" -X "github.com/stellar/kelp/cmd.buildDate=20200225T234049Z" -X "github.com/stellar/kelp/cmd.env=release" -o /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/windows-amd64/binary github.com/stellar/kelp
2020/02/25 15:42:15 Moving /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/windows-amd64/binary to /Users/myuser/go/src/github.com/stellar/kelp/build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/windows-amd64/Kelp.exe
successful
archiving ui from build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty/KelpUI-v1.8.1-4-g5e1568e6-dirty-darwin-amd64 as kelp_ui-v1.8.1-4-g5e1568e6-dirty-darwin-amd64.zip ... successful: build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty-darwin-amd64.zip
cleaning up UI: build/20200225T234049Z/kelp_ui-v1.8.1-4-g5e1568e6-dirty ... successful
removing windows.syso file ... successful

Note that reverting back to the old version of the three packages works correctly without the LSOpenURLsWithRole error (except that it now needs to download the electron binary first)

see the changes I made to upgrade to the latest version of astilectron-bundler:

nikhilsaraf/kelp@358_gui_bundle_electron~2...nikhilsaraf:358_gui_bundle_electron

  1. Did you run go install on the latest version of the bundler as I mentioned ? (go to the bundler project directory, get the latest changes then run go install github.com/asticode/go-astilectron-bundler/astilectron-bundler)

There seem to be missing steps for darwin.

  1. You seem to be binding files for each platform before doing what you call compiling. There's no need for that, binding is done during your compiling task (look for messages beginning with Generating /Users/myuser/go/src/github.com/stellar/kelp/cmd/bind_)

So I'm only using astilectron-bundler to generate the bind files and then using go build to build the golang binary.

For reference, this works for me using the older version of astilectron-bundler (except for the downloading of the two zip files: astilectron.zip and electron.zip). I needed to do it this way because I had some issue when trying to compile with astilectron-bundler directly , I can't remember what it was, maybe related to the LDFLAGS, not sure.


There seem to be missing steps for darwin.

What is the missing step for darwin?

It seems you're using both go build and astilectron-bundler to do what you call compiling in your script. I don't really see the point of using go build then. If the bundler is behaving as expected, you shouldn't have to bind manually, run go build and then run the bundler. You should simply run the bundler that will take care of everything.

Moreover, in the logs you've pasted, it seems your bash script is looking to only build for darwin, whereas the bundler is bundling for darwin, linux and windows.

I misread your building logs, there doesn't seem to be missing steps for darwin.

However I'd be interested to see the logs when you open the app (=> open /path/to/Kelp.app).

Correction: to see the logs when you open the app run /path/to/Kelp.app/Contents/MacOS/Kelp