Skip to content

Fails to install package with local replace directives and multiple modules #150

Open
@douglascamata

Description

bingo version output:

v0.9

go version output:

go version go1.21.5 darwin/arm64

What happened:

Tried to install the latest po-lint package with bingo get -v -l github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest.

What you expected to happen:

To have po-lint installable, even though it has a few replace clauses.

How to reproduce it (as minimally and precisely as possible):

bingo get -v -l github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest

Logs (use bingo get -v <thing you do> for verbose output):

Click to see lots of logs!
getting target github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest (module  )
exec 'go mod init -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint-e.tmp.mod _'
exec 'go get -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint-e.tmp.mod -d github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest'
exec 'go env GOMODCACHE'
resolveInGoModCache: /Users/doolivei/go/pkg/mod/cache/download/github.com/prometheus-operator/prometheus-operator/cmd/po-lint/@v directory does not exists
resolveInGoModCache: /Users/doolivei/go/pkg/mod/cache/download/github.com/prometheus-operator/prometheus-operator/cmd/@v directory does not exists
resolveInGoModCache: Found /Users/doolivei/go/pkg/mod/cache/download/github.com/prometheus-operator/prometheus-operator/@v directory
exec 'go env GOPATH'
exec 'go mod init -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint.tmp.mod _'
exec 'go list -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint.tmp.mod -mod=mod -f={{.Name}} github.com/prometheus-operator/prometheus-operator/cmd/po-lint'
Error: get: po-lint.mod: getting github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest: install: : go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/operator imports
	github.com/prometheus-operator/prometheus-operator/pkg/informers imports
	github.com/prometheus-operator/prometheus-operator/pkg/client/informers/externalversions: github.com/prometheus-operator/prometheus-operator/pkg/client@v0.70.0: replacement directory ./pkg/client does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/operator imports
	github.com/prometheus-operator/prometheus-operator/pkg/informers imports
	github.com/prometheus-operator/prometheus-operator/pkg/client/versioned: github.com/prometheus-operator/prometheus-operator/pkg/client@v0.70.0: replacement directory ./pkg/client does not exist
: error while running command 'go get -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint.tmp.mod -d github.com/prometheus-operator/prometheus-operator/cmd/po-lint@v0.70.0'; err: exit status 1
Usage:
  bingo get [flags] [<package or binary>[@version1 or none,version2,version3...]]

Examples:
bingo get github.com/fatih/faillint
bingo get github.com/fatih/faillint@latest
bingo get github.com/fatih/faillint@v1.5.0
bingo get github.com/fatih/faillint@v1.1.0,v1.5.0
bingo get github.com/fatih/faillint@none // this will be deleted 

Options:
      --go string       Path to the go command. (default "go")
  -h, --help            help for get
      --insecure        Use -insecure flag when using 'go get'
  -l, --link            If enabled, bingo will also create soft link called <tool> that links to the current <tool>-<version> binary.
                        Use Variables.mk and variables.env if you want to be sure that what you are invoking is what is pinned.
  -n, --name string     The -n flag instructs to get binary and name it with given name instead of default,
                        so the last element of package directory. Allowed characters [A-z0-9._-]. If -n is used and no package/binary is specified,
                        bingo get will return error. If -n is used with existing binary name, copy of this binary will be done. Cannot be used with -r
  -r, --rename string   The -r flag instructs to get existing binary and rename it with given name. Allowed characters [A-z0-9._-]. 
                        If -r is used and no package/binary is specified or non existing binary name is used, bingo will return error. Cannot be used with -n.
  -t, --timeout uint    The maximum time (in minutes) to wait for each go command before killing it.
                        Set this flag to 0 to indefinitely wait on them. (default 5)

Global Flags:
  -m, --moddir string   Directory where separate modules for each binary will be maintained. 
                        Feel free to commit this directory to your VCS to bond binary versions to your project code. 
                        If the directory does not exist bingo logs and assumes a fresh project. (default ".bingo")
  -v, --verbose         Print more

get: po-lint.mod: getting github.com/prometheus-operator/prometheus-operator/cmd/po-lint@latest: install: : go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1beta1: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring@v0.70.0: replacement directory ./pkg/apis/monitoring does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/operator imports
	github.com/prometheus-operator/prometheus-operator/pkg/informers imports
	github.com/prometheus-operator/prometheus-operator/pkg/client/informers/externalversions: github.com/prometheus-operator/prometheus-operator/pkg/client@v0.70.0: replacement directory ./pkg/client does not exist
go: github.com/prometheus-operator/prometheus-operator/cmd/po-lint imports
	github.com/prometheus-operator/prometheus-operator/pkg/admission imports
	github.com/prometheus-operator/prometheus-operator/pkg/operator imports
	github.com/prometheus-operator/prometheus-operator/pkg/informers imports
	github.com/prometheus-operator/prometheus-operator/pkg/client/versioned: github.com/prometheus-operator/prometheus-operator/pkg/client@v0.70.0: replacement directory ./pkg/client does not exist
: error while running command 'go get -modfile=/Users/doolivei/code/obsctl-reloader-rules-checker/.bingo/po-lint.tmp.mod -d github.com/prometheus-operator/prometheus-operator/cmd/po-lint@v0.70.0'; err: exit status 1

Anything else we need to know:

The replace clauses in po-lint are replacing external packages with ones that are local to the po-lint repo. These packages are within other Go modules that live in the same repo (github.com/prometheus-operator/prometheus-operator/pkg/client and github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions