Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRenaming upper-case 'Sirupsen' to 'sirupsen' #384
Conversation
aarongreenlee
self-assigned this
Jul 27, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aarongreenlee
Jul 27, 2016
Collaborator
Thank you for your contribution, @mnzt.
Tools like go get seem to be case insensitive. I wonder if GB would also benefit by becoming case insensitive.
I don't see any negative side effects to this pull request and will accept it as soon as the tests can pass.
Thanks again.
|
Thank you for your contribution, @mnzt. Tools like I don't see any negative side effects to this pull request and will accept it as soon as the tests can pass. Thanks again. |
aarongreenlee
added
the
needs-passing-tests
label
Jul 27, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Jul 27, 2016
Contributor
@aarongreenlee thank you for taking time to review the PR
It looks like a linter tool automatically removed the airbrake import, whoops!
I've noticed that logrus examples imports airbreak, which in turn imports logrus - to circumvent this issue I have added a build constraint flag. Hopefully all goes well on the following CI check
|
@aarongreenlee thank you for taking time to review the PR It looks like a linter tool automatically removed the airbrake import, whoops! I've noticed that logrus examples imports airbreak, which in turn imports logrus - to circumvent this issue I have added a build constraint flag. Hopefully all goes well on the following CI check |
glasser
reviewed
Aug 6, 2016
examples/hook/hook.go
| @@ -1,8 +1,14 @@ | ||
| // +build ignore | ||
| // Do NOT include the above line in your code. This is a build contrainst used |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glasser
reviewed
Aug 6, 2016
examples/hook/hook.go
| // +build ignore | ||
| // Do NOT include the above line in your code. This is a build contrainst used | ||
| // to prevent import loops in the code whilst go get'ting it. | ||
| // Read more about build contrains in golang here: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glasser
Aug 6, 2016
Contributor
Does it make sense to use Go 1.4 custom import path checking for this? https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs/edit
|
Does it make sense to use Go 1.4 custom import path checking for this? https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs/edit |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Aug 16, 2016
Contributor
@glasser I think the main issue here was that an import cycle was created in examples/hook.
|
@glasser I think the main issue here was that an import cycle was created in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Any progress on this @aarongreenlee? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevvooe
Nov 18, 2016
Collaborator
@sirupsen This looks like a real issue but it would be a possibly breaking change.
Any opinion here?
|
@sirupsen This looks like a real issue but it would be a possibly breaking change. Any opinion here? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sirupsen
Nov 18, 2016
Owner
How do you think this could break @stevvooe? This just changes the copy/paste examples to use lower-case, right?
|
How do you think this could break @stevvooe? This just changes the copy/paste examples to use lower-case, right? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevvooe
Nov 18, 2016
Collaborator
@sirupsen When this package changes to github.com/sirupsen/logrus, won't the builds fail if the only thing found in GOPATH is github.com/Sirupsen/logrus on a case sensitive filesystem?
For the most part, I am not against this change. If we are willing to risk possible breakage, it is for the better.
|
@sirupsen When this package changes to For the most part, I am not against this change. If we are willing to risk possible breakage, it is for the better. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Nov 18, 2016
Contributor
People can still vendor an upper case S in sirupsen, however it's common
practice to keep packages as lower case.
On Fri, 18 Nov 2016, 19:53 Stephen Day, notifications@github.com wrote:
@sirupsen https://github.com/Sirupsen When this package changes to
github.com/sirupsen/logrus, won't the builds fail if the only thing found
in GOPATH is github.com/Sirupsen/logrus on a case sensitive filesystem?For the most part, I am not against this change. If we are willing to risk
possible breakage, it is for the better.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#384 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AJoYeyCn7T3FTfu8oWgjWCFAUr3GT-Rbks5q_gIkgaJpZM4JO2SM
.
|
People can still vendor an upper case S in sirupsen, however it's common On Fri, 18 Nov 2016, 19:53 Stephen Day, notifications@github.com wrote:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Nov 18, 2016
Contributor
The real issue here is other dependencies vendoring with an upper case S.
Often at work I end up with two vendored lots of logrus - as half use the
common practice, and the over half use what's the in the documentation.
On Fri, 18 Nov 2016, 19:54 Toby Archer, tobyjames1234@googlemail.com
wrote:
People can still vendor an upper case S in sirupsen, however it's common
practice to keep packages as lower case.On Fri, 18 Nov 2016, 19:53 Stephen Day, notifications@github.com wrote:
@sirupsen https://github.com/Sirupsen When this package changes to
github.com/sirupsen/logrus, won't the builds fail if the only thing found
in GOPATH is github.com/Sirupsen/logrus on a case sensitive filesystem?For the most part, I am not against this change. If we are willing to risk
possible breakage, it is for the better.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#384 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AJoYeyCn7T3FTfu8oWgjWCFAUr3GT-Rbks5q_gIkgaJpZM4JO2SM
.
|
The real issue here is other dependencies vendoring with an upper case S. On Fri, 18 Nov 2016, 19:54 Toby Archer, tobyjames1234@googlemail.com
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevvooe
Nov 30, 2016
Collaborator
@sirupsen Please, do the honors. I gave up my capital S long ago.
|
@sirupsen Please, do the honors. I gave up my capital S long ago. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Just renamed myself |
sirupsen
merged commit 42b84f9
into
sirupsen:master
Nov 30, 2016
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ahmetb
commented
Nov 30, 2016
•
|
no more the first dependency listed on Godeps.json |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
hilljgo
Nov 30, 2016
Note: this broke our glide dependencies with the following error:
[WARN] Error updating github.com/sirupsen/logrus: The Remote does not match the VCS endpoint
changing our import from github.com/Sirupsen/logrus to github.com/sirupsen/logrus fixed it
hilljgo
commented
Nov 30, 2016
|
Note: this broke our glide dependencies with the following error:
changing our import from |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@hilljgo Thanks for the report! Seems like a low impact fix. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
hryx
Nov 30, 2016
I observed the same Glide issue as @hilljgo, but the problem ended up being exponentially more painful when vendoring several projects which also use Logrus.
If using the old name, Glide fails due to a mismatched remote URL. If using the new name, Go fails due to a case-insensitive import collision.
So the only option I've found, until those vendored projects all start using the lowercase s, is to lock to an older version of Logrus and tell Glide the remote URL explicitly:
- package: github.com/Sirupsen/logrus
version: a437dfd2463eaedbec3dfe443e477d3b0a810b3f
repo: https://github.com/sirupsen/logrus
hryx
commented
Nov 30, 2016
|
I observed the same Glide issue as @hilljgo, but the problem ended up being exponentially more painful when vendoring several projects which also use Logrus. If using the old name, Glide fails due to a mismatched remote URL. If using the new name, Go fails due to a So the only option I've found, until those vendored projects all start using the lowercase - package: github.com/Sirupsen/logrus
version: a437dfd2463eaedbec3dfe443e477d3b0a810b3f
repo: https://github.com/sirupsen/logrus |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bbrks
Dec 1, 2016
Contributor
Just leaving a comment here for anybody Googling errors.
case-insensitive import collision: "github.com/Sirupsen/logrus" and "github.com/sirupsen/logrus"
The fix is to lowercase all of your import statements for logrus.
One liner recursive find/replace:
find ./ -type f -name "*.go" -exec sed -i -e 's/github.com\/Sirupsen\/logrus/github.com\/sirupsen\/logrus/g' {} \;
Don't forget to run gofmt if your CI pipeline has it as a requirement! Uppercase and lowercase imports will be in a different order.
|
Just leaving a comment here for anybody Googling errors.
The fix is to lowercase all of your import statements for logrus. One liner recursive find/replace:
Don't forget to run gofmt if your CI pipeline has it as a requirement! Uppercase and lowercase imports will be in a different order. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Dec 1, 2016
Contributor
Note on the above @bbrks' comment, for https://getgb.io you'll need to unvendor (gb vendor delete github.com/Sirupsen/logrus) the uppercase named dependency and then vendor the lowercase named dependency (gb vendor fetch github.com/sirupsen/logrus).
There may be a small teething period of getting everything over to the correct naming - but it'll be worth it in the end
|
Note on the above @bbrks' comment, for https://getgb.io you'll need to unvendor ( There may be a small teething period of getting everything over to the correct naming - but it'll be worth it in the end |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cstockton
Dec 1, 2016
The import path is valid per the specification, if the tool doesn't work then they should fix it, if your builds don't work, you should fix them. Breaking every users build with the assumption they could simply vendor is .. ugh, very narrow sighted. Many people import libraries which use logrus, and don't control the import declarations of those libraries and are unable to update them. Meaning they are broke until the package maintainers react.
@sirupsen is this going to be reverted?
@mnzt What value was worth it in the end exactly for everyone? From my observation this was to fix YOUR builds failing:
The vendoring tool I use (GB) is case sensitive, and can become a massive pain in the 🍑 when Logrus is the only package with an upper-case name (as most other packages are in lower case, following https://blog.golang.org/package-names) - this often leads to build failures.
You didn't describe HOW your builds failed so perhaps your builds could be fixed. Instead deciding it was enough of a pain in the
cstockton
commented
Dec 1, 2016
•
|
The import path is valid per the specification, if the tool doesn't work then they should fix it, if your builds don't work, you should fix them. Breaking every users build with the assumption they could simply vendor is .. ugh, very narrow sighted. Many people import libraries which use logrus, and don't control the import declarations of those libraries and are unable to update them. Meaning they are broke until the package maintainers react. @sirupsen is this going to be reverted? @mnzt What
You didn't describe HOW your builds failed so perhaps your builds could be fixed. Instead deciding it was enough of a pain in the |
added a commit
that referenced
this pull request
Dec 1, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I've needed to revert this. This breaks way too many builds. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sirupsen
Dec 1, 2016
Owner
If there remains interest in this, we should do this under logrus/logrus.
|
If there remains interest in this, we should do this under |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tobbbles
Dec 2, 2016
Contributor
I believe the underlying issue here is where internal code 'externally' refers to {S,s}irupsen/logrus, rather than a local import, ie: ../../something. This causes issues in the examples folder however, meaning the examples become uncopyable.
A potential solution is to move the examples out of this repo into their own repo, meaning logrus as a package can consist exclusively of local imports - meaning users can vendor/go get via any case they desire.
|
I believe the underlying issue here is where internal code 'externally' refers to A potential solution is to move the examples out of this repo into their own repo, meaning |
iheitlager
referenced this pull request
Dec 19, 2016
Closed
Trying to suggest to fix casing to lower again #459
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
maxmeyer
commented
Mar 21, 2017
|
@sirupsen Any near plans about moving the repo? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nazieb
Mar 21, 2017
@sirupsen Is the plan moving the repo still on? If that's so, considering github.com/logrus is already taken, I suggest using github.com/go-logrus so we can get benefit of using something like gopkg.in
I've registered the org by the way, and will happily transfer it to you if you want.
nazieb
commented
Mar 21, 2017
|
@sirupsen Is the plan moving the repo still on? If that's so, considering github.com/logrus is already taken, I suggest using github.com/go-logrus so we can get benefit of using something like gopkg.in I've registered the org by the way, and will happily transfer it to you if you want. |
tobbbles commentedJul 18, 2016
•
edited
Edited 1 time
-
tobbbles
edited Jul 18, 2016 (most recent)
The reason for this is that most other packages use lower-case naming conventions.
The vendoring tool I use (GB) is case sensitive, and can become a massive pain in the🍑 when Logrus is the only package with an upper-case name (as most other packages are in lower case, following https://blog.golang.org/package-names) - this often leads to build failures.
Because Logrus has itself as an internal dependency, it vendors two folders,
Sirupsen/logrusandsirupsen/logrus.