purpleidea / mgmt

Next generation distributed, event-driven, parallel config management!
https://purpleidea.com/tags/mgmtconfig/
GNU General Public License v3.0
3.58k stars 311 forks source link

lib: Move to go modules and shed a few tears #674

Closed purpleidea closed 2 years ago

purpleidea commented 2 years ago

The old system with vendor/ and git submodules worked great, unfortunately FUD around git submodules seemed to scare people away and golang moved to a go.mod system that adds a new lock file format instead of using the built-in git version. It's now almost impossible to use modern golang without this, so we've switched.

So much for the golang compatibility promise-- turns out it doesn't apply to the useful parts that I actually care about like this.

Thanks to frebib for his incredibly valuable contributions to this patch. This snide commit message is mine alone.

This patch also mixes in some changes due to legacy golang as we've also bumped the minimum version to 1.16 in the docs and tests.

purpleidea commented 2 years ago

I can't seem to make this work. Locally if I do this:

$ go-mod-upgrade 
   • Discovering modules...   
   ⨯ upgrade failed            error=Error running go command to discover modules: exit status 1 stderr=go list -m: loading module retractions for github.com/coreos/go-systemd@v0.0.0-20190321100706-95778dfbb74e: no matching versions for query "latest"
go list -m: loading module retractions for gopkg.in/fsnotify.v1@v1.4.7: version "v1.5.1" invalid: go.mod has non-....v1 module path "github.com/fsnotify/fsnotify" at revision v1.5.1

I get these scary errors. I've tried different things... Not sure how to fix this. It does build though. And the build errors here are different, but possible related??

@frebib I tried your branch as well and I get the same error locally...