-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Issue with using v2 in go module project #78
Comments
On Nov 21, 2018, 1:44 PM -0800, Ryan Sullivan ***@***.***>, wrote:
I'm attempting to upgrade my project to use mangos v2 and am having issues compiling it. My project is using the go modules feature. When I compile my application from a simlinked direectory in the normal $GOPATH/src/github.com/... location it can compile just fine.
When I try to compile when go module turned on from my ~/projects/... directory I see the following error: cannot find module for path nanomsg.org/go/mangos/v2
Is this library incompatible with go modules at this time? v1 works just fine which is confusing.
I have not tested modules yet. I’ll give it a shot, maybe I busted it somehow.
- Garrett
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks, I really appreciate it! |
You do know that the import path is not from github right??? Its nanomsg.org/go/mangos/v2 ... |
So this is bonkers. I think this is a bug in the new go module code: It seems to be attempting to download an intermediate path, which is invalid (and which we never import):
I'm not sure what is going on there. There is zero reason for it to be accessing the parent directory of go/mangos/v2 ... I've stashed a meta file there, but notably go/mangos isn't a legal import path, and is never used directly in my code. |
I've filed an issue against go itself: golang/go#28917 We'll see what they say. |
Btw, I will remind you that go modules are "experimental", so I don't necessarily consider them ready for "production use". |
Oh wow thanks for finding that. Yea I've been using the correct import but was running into the issue you found. And yea, I'm not using it in production yet. Just experimenting with them to work out kinks like this one. Thanks again though! |
It may be that we need to put a go.mod file in our project.. this was not clear from the go modules documentation. |
I would find that strange considering v1 works just fine. Unless v1 doesn't have a vanity url? I thought it did. |
So apparently v2 of a package is handled separately. I'll follow up with a go module. |
Hello, It seems we are still not able to use Mangos-v2 from a Go module. The simplest possible Go program (see below) fails to build:
I tried under Go 1.11.4, 1.11.5 and 1.12.beta1. I was hoping this would "fix itself" with 1.12, but no luck. :( Thank-you and sorry to bring this up again, I know the transition to Go modules is exasperating. |
I'll try to fix this sometime during the weekend. Probably I'll make a v3 module, and I may do this as a branch of the old v1 repo. I need to find some time to run experiments to make sure that I can do this safely without breaking things for other folks. |
I'm running behind... but haven't forgotten. Stay tuned. |
@gdamore I spent couple of hours on this and this issue seems to be related to the canonical import path feature (nanomsg.org/go/mangos/v2) does not seem to support module versioning >= v2. |
Did you try to import using nanomsg.org/mangos/v3 -- I've posted a v3 that is the same as v2, but supports modules. It's "alpha" because I'm not 100% sure I've done the right thing yet, but please give it a shot. I've spent more than a couple of hours trying to get import paths and vanity to work together. |
@gdamore Yes /v3 works! great! |
I suggest use Administrators need to do:
So for end users they can I did a test on this approach:
You can run |
@gdamore V3 is gone! and v2 is broken. |
v2 should be back, without modules support. Back to where we started this mess. No modules support for mangos at present. The golang people have offered me zero way to support both modules and legacy go get. Given a choice between breaking mangos for my existing users, and supporting modules, I choose to avoid breaking legacy users. I may elect not to support modules in Mangos until the go people fix their stuff to work. Alternatively, I may fork the project with a new name, and abandon further work on mangos. This would allow me to ditch the semver, which is partly responsible for the problems. I have lost several days trying to make this all work, and from what I can tell the Go people JUST DO NOT CARE and have happily gone forward with the modules plan, even though it is a BREAKING CHANGE. To say that I'm upset with the go modules project is a vast understatement. |
I'm tempted to just punt on this entirely, in "protest" over the handling of go modules in the 1.x release cycle if nothing else. Clearly this stuff works with non-module behavior. Just as clearly it fails to function with modules. This is absolutely, 100%, a breakage in the modules project, and I've suffered enough punishment over it. Maybe someone with enough clout/influence can go talk with the go people, and explain just how impolite it is to go around breaking stuff. For the record, this is probably about the third time that I've had to make changes to fix brokenness caused by changes in go. I'm sick and tired of the empty Go 1 promise, because they clearly didn't actually mean it. |
So upstream go has a bug fix coming that addresses this. Nothing more I can do about this. #81 covers this issue, so I'm closing this as a dup of that. In the meantime, I'm sorry, but mangos and modules are incompatible pending the fixes to go itself. |
fixes nanomsg#78 Issue with using v2 in go module project
I'm attempting to upgrade my project to use mangos v2 and am having issues compiling it. My project is using the go modules feature. When I compile my application from a simlinked direectory in the normal
$GOPATH/src/github.com/...
location it can compile just fine.When I try to compile the project with go modules turned on from my
~/projects/...
directory I see the following error:cannot find module for path nanomsg.org/go/mangos/v2
Is this library incompatible with go modules at this time? v1 works just fine which is confusing.
The text was updated successfully, but these errors were encountered: