Building balenaEngine from source

I’ve been working on the balenaEngine repo for a while now and have made some minor changes to the main.go file located @ /cmd/balena-engine/.
The questions I have are as follows;

  1. Is running a make command in the root directory of the repo enough to build the project?
  2. Are there any other additional repos that need to be cloned before building balenaEngine from source?
  3. Once the build succeeds (assuming everything goes well), where can I locate the resultant tar.gz pack including all of the changes I’ve done?


Hi @nuwnjay,

yes, you can refer to the development documentation here: balena-engine/docs/contributing at master · balena-os/balena-engine · GitHub

We don’t diverge from upstream… when using the included Makefile all steps are run inside a development container (so it’s assumed you have a docker environment setup locally).

Use make balena to build the dynamic executable and automatically create all the symlinks.
Those build artifacts will be put into bundles/dynbinary-balena/ in the project directory. Note that it won’t create a tarball for you.

The repo vendors all code from the various subprojects, so no need to clone anything else.

Let me know if anything’s unclear :slight_smile:

I was actually trying to setup a GitHub Actions pipeline that would do builds in the background and spit out a tar ball (or other package) in the Releases.
This is so I can free up my local machine since my root folder is almost reaching full atm.

So far I’ve compiled the following:

And all builds seem successful even with my miniscule changes, which as I said was done on the main.go file located @ /cmd/balena-engine/.
I’ll try amending the final make command to make balena and see if the build passes.

But I do want to know if there is any possibility at all of extracting a tar ball with a CI/CD setup.


I would just add an extra step that copies the output from bundles/dynbinary-balena/ to a staging directory and replaces the balena-engine symlink in there with the balena-engine-dev binary (although that’s entirely cosmetic) and then just use tar to create the tarball you want…

that also allows you to put anything else you would like into it, like service files, documentation, etc.

1 Like

To be honest, most of that actually went over my head :sweat_smile:.
But I’ll take this one step at a time and update this thread with additional questions as I encounter issues.