-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Renaming upper-case 'Sirupsen' to 'sirupsen' #384
Conversation
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 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 😸 |
@@ -1,8 +1,14 @@ | |||
// +build ignore | |||
// Do NOT include the above line in your code. This is a build contrainst used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"constraint"
Does it make sense to use Go 1.4 custom import path checking for this? https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs/edit |
@glasser I think the main issue here was that an import cycle was created in |
Any progress on this @aarongreenlee? |
@sirupsen This looks like a real issue but it would be a possibly breaking change. Any opinion here? |
How do you think this could break @stevvooe? This just changes the copy/paste examples to use lower-case, right? |
@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. |
People can still vendor an upper case S in sirupsen, however it's common On Fri, 18 Nov 2016, 19:53 Stephen Day, [email protected] wrote:
|
The real issue here is other dependencies vendoring with an upper case S. On Fri, 18 Nov 2016, 19:54 Toby Archer, [email protected]
|
@sirupsen Please, do the honors. I gave up my capital S long ago. |
Just renamed myself 🙈 |
💥 |
no more the first dependency listed on Godeps.json 💥 |
Note: this broke our glide dependencies with the following error:
changing our import from |
@hilljgo Thanks for the report! Seems like a low impact fix. |
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 |
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. |
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 |
Switch `github.com/Sirupsen/logrus` → `github.com/sirupsen/logrus` Rename was handled in sirupsen/logrus#384 in November 2016.
The logrus package import changed letter case: sirupsen/logrus#384 In c31b012 I opted to use the same case as Prometheus packages I depend on to avoid case conflicts. I'm about to start using Go's dep tool for dependency management, and the old logrus import prevents dep from completing its initialisation because newer Prometheus packages use the lowercase import path: golang/dep#797 Use the lowercase import path for consistency with the Prometheus packages.
The logrus package import changed letter case: sirupsen/logrus#384 In c31b012 I opted to use the same case as Prometheus packages I depend on to avoid case conflicts. I'm about to start using Go's dep tool for dependency management, and the old logrus import prevents dep from completing its initialisation because newer Prometheus packages use the lowercase import path: golang/dep#797 Use the lowercase import path for consistency with the Prometheus packages.
Use the new canonical project URL (note the lowercase 's') for logrus to prevent duplicate checkouts & imports of logrus. See: sirupsen/logrus#384
Use the new canonical project URL (note the lowercase 's') for logrus to prevent duplicate checkouts & imports of logrus. See: sirupsen/logrus#384
With: $ git mv vendor/github.com/{S,s}irupsen $ sed -i 's/Sirupsen/sirupsen/g' $(git grep -l Sirupsen) catching up with the upstream lowercasing [1,2,3,4]. Note the compatibility issues discussed in [3], some consumers may prefer to use the old uppercase version until they have time to update their other Logrus consumers to the new lowercase form. [1]: https://github.com/sirupsen/logrus/blame/v1.0.3/README.md#L6 [2]: sirupsen/logrus#384 [3]: sirupsen/logrus#570 (comment) [4]: sirupsen/logrus#553
With: $ git mv vendor/github.com/{S,s}irupsen $ sed -i 's/Sirupsen/sirupsen/g' $(git grep -l Sirupsen) catching up with the upstream lowercasing [1,2,3,4]. Because of the compatibility issues discussed in [3], some consumers may prefer to use the old uppercase version until they have time to update their other Logrus consumers to the new lowercase form. [1]: https://github.com/sirupsen/logrus/blame/v1.0.3/README.md#L6 [2]: sirupsen/logrus#384 [3]: sirupsen/logrus#570 (comment) [4]: sirupsen/logrus#553
sirupsen/logrus#384 github.com/Sirupsen/logrus => github.com/sirupsen/logrus
Renaming upper-case 'Sirupsen' to 'sirupsen'
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/logrus
andsirupsen/logrus
.