How do you automate the rclone build process

Hello all

I have been interested in rclone for a while, and have been developing small apps in Go because I hope to one day add a feature or contribute to the source code of rclone. I have a good understanding of Go but still need to work on a few projects to expand my skillset. Go is not my first language.

I was wondering how you get so many binary builds for rclone; would love to replicate this for my projects. I was thinking about using docker (I love docker) or distrobox (not use yet) to set up a build environment via script because if I change the Go environment, to say Fedora or Windows, it does not build (cannot remember error off top of my head). Therefore I am stuck with a binary built for my system - I can also create deb files; I am using Ubuntu.

I am not a software developer by trade -- it's a hobby. So hope this isn't too obvious!

Thank you.

It is not too obvious, no! :slight_smile:

But the short answer is GitHub Actions. To do multiple builds like this, the matrix feature comes in handy.

You can dive into the full details of rclone's setup in .github/workflows/build.yml, which utilizes a Makefile and some other utilities.

For a regular developer, however, this is out of scope. Simple "go build" commands normally suffices. Using VSCode with Go extension is the definitive go-to developer setup in my opinion.

1 Like

This works beautifully for me (from the project root dir):

make compile_all

Ah, right, forgot about that one (I rarely use make). That seems like the spot on one-liner answer. :1st_place_medal:


Thanks. I will look into the build config. I may have to spend a little time learning GitHub Actions. I am already using GitHub for my projects so shouldn't be too complex to learn.

I am using VSCode too, so I will look at the Go extension too.

Cool. I thought this was just for the C programming language. I will read about this further.


If you want something simple to get started with without needing to spend too much learning about the build process rather than the actual app, you can try using goreleaser instead. Simplifies a lot of the build process and works both locally and on CI environments.

1 Like

Thanks for this and all input. I have a few great approaches to learn - as with everything in life, whichever is easiest and most efficient for me I will implement. Goreleaser look great.

Goreleaser is a good shout - the rclone build process is very complicated due to needing to build on native macOS and Windows. If you don't use CGO then you can use goreleaser and your life will be a lot simpler!

I use it on a less complicated project than rclone

If you want to check out how to use it look at the and the .goreleaser.yaml

Goreleaser has been a bit of a moving target over the years so that may not include the latest stuff, but it should get you going.

1 Like

Thanks all for input.

With a little trial and error and further reading, I have successfully implemented GoReleaser. More to learn but works well at present. Also needed to manually upgrade my Go from 1.18 (in my package manager) to the latest 1.22 for things to work well.

1 Like