You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mirror: fix non-determinism in case two packages have the same path
This code previously assumed that `go mod download -json` would not
produce two different versions of the same dependency with the same
path. This is typically a sensible assumption but no longer holds in
some niche scenarios. We use [replace](https://github.com/cockroachdb/cockroach/blob/65b2ed4fbdf5502f3fbe0af4ddbd30a7ac7eabb4/go.mod#L500) in `go.mod`
to effectively import two different versions of the same dependency
with the same path. This results in non-determinism in the mirroring
code with respect to which version of the dependency we select.
We now disambiguate with a path/version pair, which will be unique. We
also add some additional validation to check assumptions so if these
assumptions are ever broken in the future, the tool will fail loudly
instead of proceeding silently and performing a potentially harmful
operation.
Fixescockroachdb#143168
Epic: CRDB-17171
Release note: None
0 commit comments