Skip to content

Building Gitaly when updating a source installation from 14.3 to 14.4 fails because of a Go 1.16 dependency

Summary

Workhorse fails to build on my source installation when updating from 14-3-stable to 14-4-stable.

Steps to reproduce

  • Install or update a source installation on 14-3-stable
  • Try to update to 14-4-stable, the step
    sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production
    will fail

What is the current bug behavior?

> sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production
gmake: Entering directory '/home/git/gitlab/workhorse'
### Building gitlab-resize-image
go build -ldflags "-X main.Version=v14.4.1-1-g305ea394efd -X main.BuildTime=20211105.104649" -tags "tracer_static tracer_static_jaeger continuous_profiler_stackdriver" -o /home/git/gitlab/workhorse/gitlab-resize-image gitlab.com/gitlab-org/gitlab/workhorse/cmd/gitlab-resize-image
### Building gitlab-zip-cat
go build -ldflags "-X main.Version=v14.4.1-1-g305ea394efd -X main.BuildTime=20211105.104649" -tags "tracer_static tracer_static_jaeger continuous_profiler_stackdriver" -o /home/git/gitlab/workhorse/gitlab-zip-cat gitlab.com/gitlab-org/gitlab/workhorse/cmd/gitlab-zip-cat
### Building gitlab-zip-metadata
go build -ldflags "-X main.Version=v14.4.1-1-g305ea394efd -X main.BuildTime=20211105.104649" -tags "tracer_static tracer_static_jaeger continuous_profiler_stackdriver" -o /home/git/gitlab/workhorse/gitlab-zip-metadata gitlab.com/gitlab-org/gitlab/workhorse/cmd/gitlab-zip-metadata
### Building gitlab-workhorse
go build -ldflags "-X main.Version=v14.4.1-1-g305ea394efd -X main.BuildTime=20211105.104649" -tags "tracer_static tracer_static_jaeger continuous_profiler_stackdriver" -o /home/git/gitlab/workhorse/gitlab-workhorse gitlab.com/gitlab-org/gitlab/workhorse
gmake: Leaving directory '/home/git/gitlab/workhorse'
go: downloading gitlab.com/gitlab-org/gitaly/v14 v14.3.0-rc2.0.20211007055622-df7dadcc3f74
# gitlab.com/gitlab-org/gitaly/v14/internal/listenmux
/var/lib/git/go/pkg/mod/gitlab.com/gitlab-org/gitaly/v14@v14.3.0-rc2.0.20211007055622-df7dadcc3f74/internal/listenmux/mux.go:75:17: undefined: io.ReadAll
/var/lib/git/go/pkg/mod/gitlab.com/gitlab-org/gitaly/v14@v14.3.0-rc2.0.20211007055622-df7dadcc3f74/internal/listenmux/mux.go:81:3: not enough arguments to return
note: module requires Go 1.16
# gitlab.com/gitlab-org/gitaly/v14/internal/git/pktline
/var/lib/git/go/pkg/mod/gitlab.com/gitlab-org/gitaly/v14@v14.3.0-rc2.0.20211007055622-df7dadcc3f74/internal/git/pktline/read_monitor.go:79:17: undefined: io.Discard
note: module requires Go 1.16
gmake: *** [Makefile:55: gitlab-workhorse] Error 2
rake aborted!
workhorse make failed
/home/git/gitlab/lib/gitlab/setup_helper.rb:58:in `compile_into'
/home/git/gitlab/lib/tasks/gitlab/workhorse.rake:31:in `block (3 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:workhorse:install
(See full trace by running task with --trace)

Using Go 1.16 works.

What is the expected correct behavior?

Either working with Go 1.15 or bumping the dependency to 1.16

Possible fixes

The easiest fix should be bumping the dependency to Go 1.16.

Edited by Stan Hu