-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Debug why a private linter was not added to the list #1276
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
@alexisvisco thanks for your issue. I just quickly tried, seems like it's showing for me. Can you share your steps ?
|
Strange, I was not using the right config, unfortunately, it does not work as you because I get an output from golangci: I don't know why it's outputting that because you were able to add it 🤔 |
Might be related to version. I used master branches with one small changes to make sure same x/tools version in your tool and golangci-lint. With your above config, I just ran the check. Can you share version details as well? |
I was pretty sure the exact same versions are present...
|
You are right, seems like there is some issue with v1.29.0. I didn't see any related commits, which could affect this one. Can you try with master branches (in golangci-lint and in your logwercase) as well ? |
I am experiencing the same behavior. Update: |
This might be related: golang/go#19569 |
Looks like CGO_ENABLED is the culprit.
So custom plugins will never work with release versions because the release binary is compiled with CGO_ENABLED=0 However, the docker images could work if the golangci-lint binary in them was compiled with CGO_ENABLED=1 |
@mattysweeps thanks for your detailed explaination. You are right, the release binaries are built with CGO_ENABLED=0 only. This might be something we can improve. |
Should the binary produced during the installation of golanci-lint not by default support plugins since it is a feature of the linter? |
Yeah, I am completely agreed with you. Just found related issue here #1182 though. |
@alexisvisco seems like there is nothing we can do here, except update docs :). Please let me know if it's fine. |
I encountered the same problem when dealing with golangci-lint custom plugin feature. so for private linter, we have to build the golangci-lint with CGO_ENABLED=1 flag from source code to leverage this feature. But I think the extra step breaks the feature since the purpose of go plugin is to load packages without rebuilding the main binary. If we have to rebuild it, why not create a intree plugin instead of the custom one. Please correct me if there's something wrong. :) |
@sayboras correct me, if I wrong, please. If I want to use a private plugin I need to compile |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
current solution requires golangci-lint install per go get because cgo needs to be enabled for plugings golangci/golangci-lint#1276
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This just caught me out after following guide for new-linters which doesn't mention that the release binaries are incompatible with this, making support for plugins a little mute as consumers will always need to create a custom build of golangci-lint. Has there been any thoughts on creating release builds with |
This comment was marked as off-topic.
This comment was marked as off-topic.
Unassigned myself due to lack of cycles. |
Hi, I am using a private linter but it doesn't appear in the list of linters.
There is an option to known why a private linter is not added? https://golangci-lint.run/contributing/debug/ Does not help me ...
The text was updated successfully, but these errors were encountered: