Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Error while building with GO111MODULE=on #26

Closed
alexcourouble opened this issue Jun 24, 2019 · 2 comments · Fixed by #37
Closed

Error while building with GO111MODULE=on #26

alexcourouble opened this issue Jun 24, 2019 · 2 comments · Fixed by #37
Labels
bug Something isn't working

Comments

@alexcourouble
Copy link

ambiguous import: error while building/installing with GO111MODULE=on:

../../go/pkg/mod/github.com/edgexfoundry/[email protected]/models/event.go:19:2: unknown import path "github.com/ugorji/go/codec": ambiguous import: found github.com/ugorji/go/codec in multiple modules:
	github.com/ugorji/go v1.1.4 (/Users/acourouble/go/pkg/mod/github.com/ugorji/[email protected]/codec)
	github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 (/Users/acourouble/go/pkg/mod/github.com/ugorji/go/[email protected])

It seems like edgexfoundry/go-mod-core-contracts is dependent on github.com/ugorji/go v1.1.4.

And cobra is dependent on github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8.

This error breaks building with GO111MODULE=on. The current workaround is to build and install with GO111MODULE=off.

@alexcourouble alexcourouble added the bug Something isn't working label Jun 24, 2019
@nkstanchev
Copy link
Contributor

I propose to have an interim workaround for building with go modules via the replace directive as proposed here and here

@ugorji
Copy link

ugorji commented Jul 2, 2019

FYI: I just released a go-codec production release - version 1.1.7 (finally)

First, it resolves the go.mod impasse where we had different import paths (github.com/ugorji/go and github.com/ugorji/go/codec) causing the ambiguous import error.

This is now fixed by leveraging import cycles to ensure that either one works well and resolves to the same bits.

Please let me know if seeing any issues. If all is well over the next few days, I will close this github issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants