Vault: Fail build latest master on go 1.13 (gomod) - "github.com/apache/[email protected] used for two different module paths (git.apache.org/thrift.git and github.com/apache/thrift)"

Created on 14 Sep 2019  路  11Comments  路  Source: hashicorp/vault

Bug
Unable to build + run latest test; using go 1.13; hitting error for thrift module

Bug Reproduce
Steps to reproduce the behavior:

  1. Run make bootstrap
  2. Run make test
  3. See error
$ make test
==> Checking that build is using go version >= 1.12.7...
==> Using go version 1.13...
go: github.com/apache/[email protected] used for two different module paths (git.apache.org/thrift.git and github.com/apache/thrift)
make: *** [prep] Error 1

Expected behavior
Able to build + run test

Environment:

  • OSX
  • go 1.13
  • go mod enabled (code is outside of zGOPATH)
enhancement releasbuild

Most helpful comment

Solution is to remove the "replace" command in go.mod:

diff --git a/go.mod b/go.mod
index f10a14f5f..a1b4f8ddc 100644
--- a/go.mod
+++ b/go.mod
@@ -2,8 +2,6 @@ module github.com/hashicorp/vault

 go 1.12

-replace git.apache.org/thrift.git => github.com/apache/thrift v0.12.0
-
 replace github.com/hashicorp/vault/api => ./api

All 11 comments

Solution is to remove the "replace" command in go.mod:

diff --git a/go.mod b/go.mod
index f10a14f5f..a1b4f8ddc 100644
--- a/go.mod
+++ b/go.mod
@@ -2,8 +2,6 @@ module github.com/hashicorp/vault

 go 1.12

-replace git.apache.org/thrift.git => github.com/apache/thrift v0.12.0
-
 replace github.com/hashicorp/vault/api => ./api

Vault hasn't switched to Go 1.13, and just removing the replace breaks CI running on Go 1.12.x. A clean fix involves updating the various dependencies that reference the old thrift URL. That is a fairly large update (number of packages changing) that we'll be looking at in our next dev cycle.

I'm observing this build fault on go1.12 currently. Is there a known resolution for this now to build on 1.12.8?

@the-maldridge There's no known resolution because it's not a known problem :-)

All of us are dev'ing against Go 1.12 and our CI builds against it. Are you using some branch or tag of Vault instead of master?

@jefferai Good point. I'm building from release tag 1.2.2 on Go 1.12.8/amd64. The specific build error I get is:

go: git.apache.org/[email protected]: unknown revision v0.12.0

Given that a similar error is the subject of this issue I raised my issue here. I can open a new ticket if you'd like.

Update, found what was wrong: git.apache.org is gone.

Yes it is, which is why we have the replace statement. Not sure why it isn't working for you.

Likely because at 1.2.2 that replace did not exist. I will add it and try again.

Ah, in the OP you said you were using latest, which I assumed to mean master since you are building from source.

Ah fair point, I was building from the latest release, not from master. I build from source as the provided binaries require glibc.

@the-maldridge remove the "replace" line in go.mod (or build from master as of some time yesterday). It seems that directive isn't needed anymore and causes problems with Go 1.13.

(Edit: remove the _thrift_ replace directive.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emk picture emk  路  79Comments

dreamcat4 picture dreamcat4  路  77Comments

sochoa picture sochoa  路  39Comments

Luzifer picture Luzifer  路  37Comments

mwitkow picture mwitkow  路  142Comments