linkage_checker: always report incorrect :no_linkage#22887
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts LinkageChecker so that formulas declaring dependencies as :no_linkage are always reported (and treated as failures in --test mode) when linkage is actually present, rather than only surfacing this under --strict.
Changes:
- Always display “Unexpected linkage for no_linkage dependencies” in
display_test_output, regardless ofstrict. - Treat
@unexpected_linkage_depsas a--testfailure condition even whenstrict: false.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?:no_linkageonly makes sense if there is actually no linkage. There shouldn't be any false positives here (though the linkage may differ on macOS/Linux which is possible to handle via on_system blocks).Just helps improve the metadata. Won't have a functional impact even if incorrect
:no_linkageas we don't use this data outside ofbrew linkageoutput. But helps keep a canonical representation of a formula.Among remaining that are strict-only:
@executable_pathare usually app bundles. This could be a potential issue when an app bundle includes copies of libraries, but we sometimes fix these up via symlinks so can be a false positive. Not sure if we can guarantee no usage of this.For declared deps, I think that will fail the test if a dependency is linked into library but not installed during test. Though I can't tell if there are any false positives here so will leave this strict-only.