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

[BUG] go install instructions do not work #3056

Closed
whi-tw opened this issue Jul 27, 2024 · 8 comments · Fixed by #3081
Closed

[BUG] go install instructions do not work #3056

whi-tw opened this issue Jul 27, 2024 · 8 comments · Fixed by #3081

Comments

@whi-tw
Copy link
Contributor

whi-tw commented Jul 27, 2024

The Bug

The installation instructions state that dnscontrol can be installed with go install:

```shell
go install github.com/StackExchange/dnscontrol/v4@latest
```

However, because of the replace directives, this doesn't actually work:

❯ go version
go version go1.22.5 linux/amd64
❯ go install github.com/StackExchange/dnscontrol/v4@latest
go: github.com/StackExchange/dnscontrol/v4@latest (in github.com/StackExchange/dnscontrol/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

This is not a recently introduced issue: golang/go#44840, so either I'm missing something, or people haven't attempted this in a while!

@cafferata
Copy link
Collaborator

The replace directive was introduced in GitHub pull request #3002 here.

replace github.com/cloudflare/cloudflare-go => ./pkg/cloudflare-go

cc: @tlimoncelli

@tlimoncelli
Copy link
Contributor

Oh dang. I had no idea the "replace" directive would have that side-effect. Mea culpa!

We are using a custom version of cloudflare-go to add a particular feature. I do plan on submitting a PR to that project to add that feature so don't need a custom version. However that might take a while.

I propose we add a note that this is currently not working and will be fixed as part of #3056

@whi-tw
Copy link
Contributor Author

whi-tw commented Aug 7, 2024

Agreed - updating the docs seems like the best approach for now. I suppose the fact I'm the first person to raise it after two months suggests that this isn't inconveniencing (m)any people too much!

@jauderho
Copy link
Contributor

jauderho commented Aug 8, 2024

+1 from me.

I noticed this just the other day when I was trying to use go install too.

It appears to be a long standing issue with Go:

Looking forward to when the cloudflare-go changes get merged upstream.

@tlimoncelli
Copy link
Contributor

I'm optimistic Cloudflare will accept my PR: cloudflare/cloudflare-go#2833

@cafferata
Copy link
Collaborator

You were absolutely right! GitHub pull request cloudflare/cloudflare-go#2833 has been merged! 🚀 👏🏻

@cafferata
Copy link
Collaborator

DeleteRulesetRule() has been released in v0.102.0. 🥳

@jauderho
Copy link
Contributor

Confirmed that go install github.com/StackExchange/dnscontrol/v4@e8eca6a compiles just fine.

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

Successfully merging a pull request may close this issue.

4 participants