cozy / cozy-stack

Simple, Versatile, Yours
https://docs.cozy.io/en/cozy-stack/
GNU Affero General Public License v3.0
1.14k stars 138 forks source link

error: reference to undefined identifier ‘cron.Parse’ #1970

Closed lmeunier closed 5 years ago

lmeunier commented 5 years ago

Hello,

I've just tried to build cozy-stack from sources by following the steps provided in the CONTRIBUTING.md file.

The command go get -u github.com/cozy/cozy-stack fail with the following errors:

$ go get -u github.com/cozy/cozy-stack
# github.com/cozy/cozy-stack/model/job
Devel/go/src/github.com/cozy/cozy-stack/model/job/trigger_cron.go:20:24: error: reference to undefined identifier ‘cron.Parse’
   20 |  schedule, err := cron.Parse(infos.Arguments)
      |                        ^
Devel/go/src/github.com/cozy/cozy-stack/model/job/trigger_cron.go:34:24: error: reference to undefined identifier ‘cron.Parse’
   34 |  schedule, err := cron.Parse("@every " + infos.Arguments)
      |                        ^

Maybe this is related with the new version of https://github.com/robfig/cron. cron v3 has been released in June 2019 which contains some backwards-incompatible features.

Go version 1.12.2 on Fedora 30:

$ go version
go version go1.12.2 gccgo (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1) linux/amd64
nono commented 5 years ago

Thanks for the issue. github.com/robfig/cron v3 was released yesterday: https://github.com/robfig/cron/releases/tag/v3.0.0. And it has some incompatible changes.

It has been fixed by #1971.