Skip to content

replace directives not working for changing a package name #305

Description

@manfredlift

I have a Go repo where a package has a replace rule such as:

replace github.com/google/martian/v3 v3.2.1 => internal.dev.com/internal/martian/v3 v3.0.0-20201029001542-dd3e191f6e3c

With puku it generated dependencies like:

go_mod_download(
    name = "internal.dev.com_internal_martian_v3_dl",
    labels = ["go_replace_directive"],
    licences = ["Apache-2.0"],
    module = "internal.dev.com/internal/martian/v3",
    version = "v3.0.0-20201029001542-dd3e191f6e3c",
)

go_repo(
    download = ":internal.dev.com_internal_martian_v3_dl",
    labels = ["go_replace_directive"],
    module = "github.com/google/martian/v3",
)

But when I try to compile my package with the latest go-rules (v1.21.5) then I get errors like:

    ///third_party/go/github.com_google_martian_v3//parse:parse
Error building target ///third_party/go/github.com_google_martian_v3//parse:parse: exit status 1
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 23, column 2: could not import github.com/google/martian/v3 (open : no such file or directory)
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 38, column 9: undefined: martian
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 39, column 9: undefined: martian
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 47, column 24: undefined: martian
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 48, column 24: undefined: martian
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 81, column 36: undefined: martian
pkg/darwin_arm64/github.com/google/martian/v3/parse/parse.go, line 88, column 37: undefined: martian

Any suggestions? 🙏

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions