Influxdb: influxdata/platform dependencies break 3rd party code

Created on 17 Jan 2019  路  8Comments  路  Source: influxdata/influxdb

The current released versions of this package still depend on github.com/influxdata/platform which has a broken go.mod file that includes two packages it doesn't actually depend on.

github.com/influxdata/platform has been archived so we can't submit a PR against it.

The fix however is really simple and can be seen here: https://github.com/stevenh/platform/commit/68363ea408d246b08ef29d67259161de3c6188c4

Can we please get this fixed to unbreak all 3rd party code.

Most helpful comment

Just to confirm that's now working for me @mark-rushakoff thanks a lot for the quick fix, much appreciated!

All 8 comments

@stevenh I'd like to get this fixed for you ASAP, but I'm not sure if that's the right solution here.

The modules are indeed indirect dependencies:

go mod why -m launchpad.net/gocheck labix.org/v2/mgo
go: finding github.com/SermoDigital/jose/jwt latest
go: finding github.com/SermoDigital/jose/jws latest
# launchpad.net/gocheck
github.com/influxdata/platform/nats
github.com/nats-io/nats-streaming-server/server
github.com/hashicorp/go-msgpack/codec
github.com/hashicorp/go-msgpack/codec.test
labix.org/v2/mgo/bson
labix.org/v2/mgo/bson.test
launchpad.net/gocheck

# labix.org/v2/mgo
github.com/influxdata/platform/nats
github.com/nats-io/nats-streaming-server/server
github.com/hashicorp/go-msgpack/codec
github.com/hashicorp/go-msgpack/codec.test
labix.org/v2/mgo/bson

I think those dependencies will still be pulled in when go tries to resolve the full dependency tree with go mod vendor or perhaps some other go mod commands.

Since those two repositories are just test dependencies, and it should be safe to build without them, can you try

go mod edit -replace=labix.org/v2/mgo=/dev/null -replace=launchpad.net/gocheck=/dev/null

In your project that depends on platform?

We're internally discussing whether we can just remove the nats code now, to eliminate those dependencies. If so, we'll "backport" that over to platform, which will eliminate the bzr dependencies.

Cool thanks for the update, its interesting that once manually removing it from the go.mod go get and go vendor work as expected in influxdata/platform so I suspect it would also then work in packages which depend on platform too.

Tried the go mod edit ... listed above and this doesn't work go get -u=patch just errors with:

go get -u=patch
go: parsing /dev/null/go.mod: open /dev/null/go.mod: not a directory
go: parsing /dev/null/go.mod: open /dev/null/go.mod: not a directory
go: error loading module requirements

Okay. I'm going to temporarily unarchive platform to merge in your change to remove the bzr dependencies. It will break our CI check that go mod tidy is a no-op, but that should be fine.

I doubt that anyone else will experience any issues as a result of removing those lines, but it's a remote possibility that we will need to revert those changes, if builds against platform are somehow otherwise broken.

influxdb@master will stay as-is, with the bzr dependencies, until we remove nats.

On a side note, go mod vendor working from platform, without bzr available, may be https://github.com/golang/go/issues/27063.

Dropping mgo and gocheck requirements and replacing platform with the version in my fork allowed me to perform a successful go get -u=patch on our project

go mod edit -droprequire=labix.org/v2/mgo
go mod edit -droprequire=launchpad.net/gocheck
go mod edit -replace=github.com/influxdata/platform=github.com/stevenh/[email protected]

Just to confirm that's now working for me @mark-rushakoff thanks a lot for the quick fix, much appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corylanou picture corylanou  路  42Comments

beckettsean picture beckettsean  路  83Comments

srfraser picture srfraser  路  90Comments

phemmer picture phemmer  路  60Comments

beckettsean picture beckettsean  路  44Comments