Building OSS version from source

Hi

I’m trying to build the OSS version of Drone from source (which is the only way to get it as far as I know). I want to test run this version before considering upgrading to the Enterprise version.
I’m following the simple guide here: drone/BUILDING_OSS at master · drone/drone (github.com)

I have installed the newest version of Go for Windows, cloned the repository, cd’ed into the repo.
When I run the command

go install -tags "oss nolimit" github.com/drone/drone/cmd/drone-server

I would expect $GOPATH/bin to contain the compiled binary.

Instead, I get this error

package github.com/drone/drone/cmd/drone-server
        imports github.com/drone/drone/store/template:
        build constraints exclude all Go files in
        C:\Users\<my_username>\go\src\drone\store\template

Go version:

$ go version
go version go1.16.4 windows/amd64

How do I resolve this issue? Does it only work on Linux?

I have never used Go before, any help is greatly appreciated.

Edit:
I tried to build from source via WSL2 (Windows Subsystem for Linux), but it gave a similar error

$ go version
go version go1.13.8 linux/amd64
build github.com/drone/drone/store/template:
cannot load github.com/drone/drone/store/template: no Go source files

You can use the following to install drone, Overview | Drone you dont need to build it from source. Here are the steps to run drone against a github repoistory with docker GitHub | Drone

Thank for the reply.

I already have followed that guide and successfully set up Drone locally with a Gitea instance. However, I’m quite sure that the installation guide in the docs that you link to is for the Enterprise version. Whereas I want to install the Open Source Edition.

This is from the FAQ (Enterprise | Drone)

Where do I download the Open Source Edition?
There is no official distribution of the Open Source Edition. You can build the Open Source Edition from source using the oss build tags.

There looks to be something up with master, i will look into that. To get you running you can build of the latest released version git reset v2.0.1 --hard then retry the build go install -tags "oss nolimit" github.com/drone/drone/cmd/drone-server

1 Like

Thanks a lot my friend!
I was able to build it now by resetting to v2.0.1. Much appreciated.

Excellent, glad it worked.

there should be a fix going in later today for master.

1 Like