Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New module path breaks go install of package with indirect dependency on mergo #240

Closed
jmikolay22 opened this issue Jun 20, 2023 · 13 comments

Comments

@jmikolay22
Copy link

I have an indirect dependency on this package via github.com/elwinar/rambler. When running:

go install github.com/elwinar/rambler@latest

I get the follow error now, due to the new module path for mergo

github.com/imdario/mergo: github.com/imdario/[email protected]: parsing go.mod:
        module declares its path as: dario.cat/mergo
                but was required as: github.com/imdario/mergo
@kiwansky
Copy link

We have the same issue on multiple projects.

@fa-gb
Copy link

fa-gb commented Jun 22, 2023

the root question: why?

image

@darccio
Copy link
Owner

darccio commented Jun 24, 2023

@jmikolay22 @kiwansky @fa-gb You need to modify your imports to match the new module URL dario.cat/mergo. Or provide PRs to the affected projects (I'm checking from my side anyway).

This change was announced a few weeks ago: #236

@darccio
Copy link
Owner

darccio commented Jun 24, 2023

@jmikolay22 In the particular case of rambler, it is quite curious, as cloning and installing just works:

imagen

It seems that installing a tool with go install $url@latest resolves to 1.0.0 instead of 0.3.11. go build seems to resolve it as expected to 0.3.11:

imagen

@darccio
Copy link
Owner

darccio commented Jun 24, 2023

@kiwansky I saw you opened the issue crossplane/crossplane-runtime#469. What other projects have you found affected by this change? Thanks!

@kiwansky
Copy link

kiwansky commented Jun 26, 2023

Only our closed source projects inside the company currently.
From our side we needed to update webdevops/go-replace to 22.10.0 looks like the same behavior as with rambler. So for us it's working again.

@ramonskie
Copy link

this is also happening in https://github.com/vmware-archive/texplate

ramonskie added a commit to cloudfoundry/bosh-bootloader that referenced this issue Jul 3, 2023
as texplate is archived and has not been updated since 2018. and currently has some golang lib issues.
darccio/mergo#240
@darccio
Copy link
Owner

darccio commented Jul 5, 2023

@ramonskie Running texplate's scripts/build seem to work. How are you installing?

@ramonskie
Copy link

i'm running it as go install github.com/pivotal-cf/texplate@latest

@darccio
Copy link
Owner

darccio commented Jul 6, 2023

@ramonskie go install seem to resolve versions in an unexpected way, while go build looks happy to use the exact version. Chek my previous comment: #240 (comment)

@ramonskie
Copy link

yeah its a strange issue. thanks for looking it up though

@andig
Copy link

andig commented Aug 23, 2023

Is there a related Go issue?

@darccio
Copy link
Owner

darccio commented Aug 24, 2023

Closing it with a suggestion from another issue:

Iinstead of replacing the imports, to use the replace statement in your go.mod while Sprig updates to use the new URL too.

module github.com/evcc-io/evcc

go 1.21

replace github.com/imdario/mergo => dario.cat/mergo v1.0.0

After this, remove from go.mod all the other references to mergo, and run:

go get -u
go mod tidy

It's possible that it will return a different warning, but it makes sense:

go: finding module for package dario.cat/mergo
go: found dario.cat/mergo in dario.cat/mergo v1.0.0
go: dario.cat/[email protected] used for two different module paths (dario.cat/mergo and github.com/imdario/mergo)

@darccio darccio closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants