cockroachdb / errors

Go error library with error portability over the network
Apache License 2.0
2.07k stars 66 forks source link

Limited compatibility with go < 1.15.10 #78

Closed kernfeld-cockroach closed 3 years ago

kernfeld-cockroach commented 3 years ago

When one uses go < 1.15.10 to run go mod tidy, go mod vendor, and possible other go mod * commands in errors or any project that transitively depends on errors, one encounters a failure of the form:

> go mod tidy
github.com/cockroachdb/errors/errbase imports
    io/fs: package io/fs is not in GOROOT (/Users/paulkernfeld/.gvm/gos/go1.14/src/io/fs)

The following snippet from the Go Modules Reference might explain this behavior:

go mod tidy acts as if all build tags are enabled, so it will consider platform-specific source files and files that require custom build tags, even if those source files wouldn’t normally be built.

kernfeld-cockroach commented 3 years ago

A correction: go mod tidy actually does work in go ≥ 1.15.10.

@knz hypothesizes that this is related to https://github.com/golang/go/issues/46143

knz commented 3 years ago

Given that CI is happy with go 1.13 to 1.16, I'm going to close this issue.

kernfeld-cockroach commented 3 years ago

Given that CI is happy with go 1.13 to 1.16, I'm going to close this issue.

Are you saying that it's not important that users of this library be able to successfully run go mod tidy or go mod vendor? I find that counterintuitive because we often use those commands at Cockroach.

knz commented 3 years ago

CI runs successfully with go 1.15.13. I am not too concerned with compatibility with 1.15.9 and prior if 1.15.13 works.