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
Suppress redundant linkage warnings due to dependency linkage propagation #7404
Conversation
…deration and don't emit unnecessary warnings
…y linkage propagation
@swift-ci test |
@swift-ci test macos |
@@ -672,6 +672,11 @@ final class PackagePIFProjectBuilder: PIFProjectBuilder { | |||
impartedSettings[.OTHER_LDFLAGS, default: ["$(inherited)"]].append("-lc++") | |||
} | |||
|
|||
// radar://112671586 supress unnecessary warnings | |||
#if os(macOS) |
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.
I think the #if
is redundant here because this is essentially dead code on non-macOS today.
@@ -25,7 +25,7 @@ final class BuildSystemDelegateTests: XCTestCase { | |||
try XCTSkipIf(true, "test is only supported on macOS") | |||
#endif | |||
let (fullLog, _) = try executeSwiftBuild(fixturePath) | |||
XCTAssertTrue(fullLog.contains("ld: warning: ignoring duplicate libraries: '-lz'"), "log didn't contain expected linker diagnostics") | |||
XCTAssertFalse(fullLog.contains("ld: warning: ignoring duplicate libraries: '-lz'"), "log contains unnecessary linker warnings") |
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.
I don't think it's correct to change this test, it was supposed to ensure that linker warnings are properly propagated. We'll need to find a different linker warning that we can check for here or remove the test if appropriate.
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.
Thank you @neonichu I will talk with @MaxDesiatov and finalize it.
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.
I agree with Boris, with this PR as it is we're losing test coverage here. This test needs to change to check for a different warning.
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.
Talked with @MaxDesiatov and made changes appropriately for the above test case.
@swift-ci test |
@swift-ci test macos |
Fixtures/Miscellaneous/DoNotFilterLinkerDiagnostics/Package.swift
Outdated
Show resolved
Hide resolved
@swift-ci test |
@swift-ci test windows |
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.
Sure.
@swift-ci test windows |
…tion (#7404) Suppress redundant linkage warnings due to dependency linkage propagation rdar://112671586 ### Motivation: Improve user experience by suppressing redundant linkage warnings ### Modifications: Pass "-no_warn_duplicate_libraries" to linker. ### Result: We should not see warnings such as "ld: warning: ignoring duplicate libraries: '-lsqlite3'" --------- Co-authored-by: Max Desiatov <[email protected]> (cherry picked from commit e73cb5b)
**Explanation**: Improve user experience by suppressing redundant linkage warnings due to dependency linkage propagation **Scope**: We should not see warnings such as "ld: warning: ignoring duplicate libraries: '-lsqlite3'" **Risk**: No risks **Testing**: Tests continue passing. **Issue**: rdar://112671586 **Reviewer**: @MaxDesiatov and @neonichu **Co-authored-by**: Max Desiatov <[email protected]> (cherry picked from commit e73cb5b) Original PR #7404
Suppress redundant linkage warnings due to dependency linkage propagation rdar://112671586
Motivation:
Improve user experience by suppressing redundant linkage warnings
Modifications:
Pass "-no_warn_duplicate_libraries" to linker.
Result:
We should not see warnings such as "ld: warning: ignoring duplicate libraries: '-lsqlite3'"