Linter fixes #14041

issue kallewoof openend this issue on August 24, 2018
  1. kallewoof commented at 2:01 am on August 24, 2018: member

    The linters are apparently breaking left and right on local machines and need to be disabled by developers. Ping @practicalswift et al.

    I haven’t seen any information on this except a mention in IRC, so any hints or error logs on this would be appreciated.

  2. fanquake added the label Tests on Aug 24, 2018
  3. kallewoof commented at 3:04 am on August 24, 2018: member

    “A new circular dependency in the form of “policy/policy -> validation -> pow -> policy/policy” appears to have been introduced. ^—- failure generated from test/lint/lint-circular-dependencies.sh The command “test/lint/lint-all.sh” exited with 1.”

    0$ git diff master src/policy 
    1$
    

    Sidenote: I confusedly thought I’d somehow #included validation.h and fixed the circular dependency. It then congratulated me, told me ANOTHER circular dependency had been introduced in policy/fees (which I haven’t touched either), and then failed again.

  4. AkioNak commented at 7:06 am on August 24, 2018: contributor
    @kallewoof You can check whether pow.cpp does not include policy/policy.h . I think that the linter(lint-circular-dependencies.sh and circular-dependencies.py) treats *.cpp and *.h in the same way, and sometimes make a miss-judgement.
  5. AkioNak commented at 7:09 am on August 24, 2018: contributor
    @kallewoof I’m sorry, not policy.cpp but pow.cpp. I fixed previous message .
  6. kallewoof commented at 7:28 am on August 24, 2018: member
    @AkioNak I haven’t touched the files. The linters should only tell me about new issues, not old ones that I didn’t introduce.
  7. AkioNak commented at 7:51 am on August 24, 2018: contributor
    @kallewoof Oh, I see. That linter do not filter the result whether you touched any file or not.
  8. practicalswift commented at 7:56 am on August 24, 2018: contributor

    @kallewoof Thanks for the ping! Sounds bad. Let’s try to resolve that quickly!

    Pinging in @Empact who wrote the linter for circular dependencies and @sipa who wrote the original Python script that the linter uses.

    Please report any linter issues here!

  9. practicalswift commented at 8:00 am on August 24, 2018: contributor
    @kallewoof Do you know which linters that were causing problems and for whom? :-)
  10. Empact commented at 4:42 pm on August 24, 2018: member
    @kallewoof can you point to a branch where the issue exists?
  11. ryanofsky commented at 6:12 pm on August 24, 2018: member

    I think that the linter(lint-circular-dependencies.sh and circular-dependencies.py) treats *.cpp and *.h in the same way, and sometimes make a miss-judgement.

    This is true and I added an escape hatch for it in #10973: cbbb1d5cfb5fc47b84d6992aa6996b56f4b38a0d

  12. kallewoof commented at 5:05 am on August 27, 2018: member
  13. kallewoof commented at 7:29 am on August 27, 2018: member
  14. Empact commented at 0:58 am on August 28, 2018: member
    I take it it was a circular dependency then?
  15. AkioNak commented at 2:13 am on August 28, 2018: contributor

    @Empact This is not a circular inclusion. I reproduced this error by specifying 3 cpp filenames to circular-dependencies.py on @kallewoof ’s signet branch as following:

    0$ cd src
    1$ ../contrib/devtools/circular-dependencies.py policy/policy.cpp validation.cpp pow.cpp
    
  16. practicalswift commented at 8:33 am on August 29, 2018: contributor

    The linter issues seems limited to circular dependencies detection judging from the information in this PR?

    If so the statement “linters are apparently breaking left and right on local machines and need to be disabled by developers” was a false alarm I guess? :-)

    If there are any linter issues beyond the circular dependencies stuff I’d like to know about them so that I can fix them quickly! :-)

  17. kallewoof commented at 9:44 am on August 29, 2018: member
    @practicalswift No, the statement stands. I was just posting a case of my own, but the reports were from other people. I will add information as I hear about it.
  18. practicalswift commented at 10:47 am on August 29, 2018: contributor
    @kallewoof Are there any bug reporters from IRC that we can ping in to this GitHub conversation to get clarification on the specifics? :-)
  19. MarcoFalke commented at 11:00 am on August 29, 2018: member
    Closing for now, we can create a new issue or fix issues as they come up.
  20. MarcoFalke closed this on Aug 29, 2018

  21. ryanofsky commented at 11:51 am on August 29, 2018: member

    I’ve had to work around issues in my prs as new linters have been added.

    It would be nice if before adding a new linter, you tested it on open PRs that have been updated recently, and notified failing PR authors so they could look into errors and fix things or report problems with the linter.

  22. practicalswift commented at 11:56 am on August 29, 2018: contributor
    @ryanofsky Ah, just to clarify – so these were issues discovered by the linters rather than problems in the linters? :-) Have you encountered any issues in the linters themselves?
  23. ryanofsky commented at 12:56 pm on August 29, 2018: member

    @ryanofsky Ah, just to clarify – so these were issues discovered by the linters rather than problems in the linters? :-) Have you encountered any issues in the linters themselves?

    Yes, there is the bug in the circular dependencies linter described above: #14041 (comment), a bug in the format-strings linter fixed in #10443 (61ab4c17eebf9b73267c992fb664d603620f9e81), and a bug in include-guards linter fixed in #10102 (0f956d6b0d26c92a1656976b0518e0a469033e47).

    But to me it is irrelevant whether bug is in the linter or not. For example, the linter bugs I found were pretty easy to fix, but I spent hours refactoring code and introducing a callback mechanism in pr/fee.18 (#10443) to avoid referencing CTxMemPoolEntry in fees_input.h and introducing a new circular dependency.

    It would be nice to get warnings when a new linter is added that breaks PRs, so issues can be fixed in advance and don’t result in PRs being left conflicted while lint issues are debugged. Since linters are fast to run and don’t require building, it seems like it would be very easy to write a script that would check a new linter against a list of PRs and capture all the errors, so PR authors could have advance warning about problems.

  24. practicalswift commented at 1:16 pm on August 29, 2018: contributor

    @ryanofsky Yes, that would be the ideal way to do it when introducing new linters! I’ll look what I can do to make that happen :-)

    When scripting that - should I perhaps fetch all PR:s without merge conflicts and build errors that have been updated during the N last days? If so, what would be an appropriate number for N? :-)

  25. practicalswift commented at 11:17 pm on August 30, 2018: contributor
    Fixes to macOS linter issues can be found in PR #14115. Please review :-)
  26. practicalswift commented at 7:44 am on September 5, 2018: contributor
    This seemed urgent - please review #14115 to get this fixed :-)
  27. MarcoFalke referenced this in commit 97ccd2b84e on Sep 5, 2018
  28. kallewoof commented at 0:51 am on September 10, 2018: member
    You’re being incessant. People will review things as time permits.
  29. UdjinM6 referenced this in commit 889990fbef on Jul 29, 2020
  30. UdjinM6 referenced this in commit 8e05f8b288 on Jul 29, 2020
  31. PastaPastaPasta referenced this in commit 481254c86d on Jul 29, 2020
  32. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me