-2

I'm unable to download my newly released go package from CircleCi. Locally it works. I'm able to verify that the tag I'm trying to use is available by visiting https://github.com/acme/my-lib/tree/v0.0.3

However, go get will not download it.

I have GOPRIVATE=github.com/acme/ I've also tried with github.com/acme/* also, the same result.

Running go get returns this

go: finding github.com/acme/my-lib v0.0.3
go: github.com/acme/my-lib@v0.0.3: unknown revision v0.0.3
go: error loading module requirements

go.mod

module github.com/acme/project

require (
          github.com/acme/my-lib v0.0.3
)

Why doesn't go recognize my tagged release when running from CircleCi`

I have also tried changing my .git/config:

[remote "origin"]
        # url = git@github.com:acme/my-lib.git
        url = https://github.com/acme/my-lib.git

Neither https or ssh works.

git ls-remote from desktop

git ls-remote https://github.com/acme/my-lib | ack v0.0.3
$SHA        refs/tags/v0.0.3

git ls-remote from circleci

git ls-remote https://github.com/acme/my-lib | grep v0.0.3
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
martins
  • 9,669
  • 11
  • 57
  • 85
  • ```go get -v go: finding github.com/acme/project v0.0.3 go: github.com/acme/project@v0.0.3: unknown revision v0.0.3 go: error loading module requirements ``` – martins Nov 20 '19 at 11:54
  • 1
    Why on earth would "github.com/acme/project" require "github.com/acme/project"? A module cannot require itself; not in any version. – Volker Nov 20 '19 at 12:14
  • Sorry, by mistake I replaced both the real project name and library name as `project`. I've updated the post now. – martins Nov 20 '19 at 12:40
  • 2
    If you can't `git ls-remote` from the container, it seems the issue is not with go modules, but with your github authentication. – JimB Nov 20 '19 at 14:29

1 Answers1

0

You need to configure Circle CI to be able to read additional private repositories: https://circleci.com/docs/2.0/gh-bb-integration/#enable-your-project-to-check-out-additional-private-repositories ?

To be able to create reproducible builds, have you considered vendoring in /acme/project: https://tip.golang.org/cmd/go/#hdr-Modules_and_vendoring ?

abh
  • 16
  • 1