miketheprogrammer/go-thrust

Bundle thrust dependencies in binary

Closed this issue · 5 comments

Hi!

Is there a way to create an application that bundles thrust within the binary?

Currently when I build a binary and start them on a different pc it downloads Downloading https://github.com/breach/thrust/releases/download/v0.7.6/thrust-v0.7.6-darwin-x64.zip

gwoo commented

Great question. I have not found the answer yet either. Would be great to get some information into the README.

You need to use your own ThrustProvisioner class.I'll provide more details
as soon as I can.
On Jul 17, 2015 2:06 PM, "GWoo" notifications@github.com wrote:

Great question. I have not found the answer yet either. Would be great to
get some information into the README.


Reply to this email directly or view it on GitHub
#57 (comment)
.

Awesome! Thank you, I'll be looking forward to it =)

Ah, so you question was about, within the binary. Unfortunately that is not possible. Not unless you create your own linking process and somehow start two processes from the same binary.

Anyway, the best way to handle distribution is an installer of some sort, and to create a custom provisioner with the code that you distribute.

For example, in pretty much any of the tutorials i use a custom tutorial provisioner which sets the base directory as the home directory.

thrust.SetProvisioner(tutorial.NewTutorialProvisioner())

Inside the implementation of the provisioner is

spawn.SetBaseDirectory("") // Means use the users home directory
return spawn.Bootstrap()

So now the steps are

  1. Create your OS specific bundles
    a. Cross Compile GoThrust Application.
    b. Download Thrust Binaries from Thrust releases on GitHub
    c. tar.gz together with an install.md or something, or create an installer. i.e. bash, or windows installer, or mac pkg
  2. Distribute to your friends for testing, and then the world.

ok thank you. That's a shame, love the whole single binary distribution ;)