Skip to content
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

[6.0] Suppress redundant linkage warnings #7414

Merged
merged 1 commit into from Mar 22, 2024
Merged

Conversation

pusukuri
Copy link
Contributor

@pusukuri pusukuri commented Mar 20, 2024

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

…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)
@pusukuri
Copy link
Contributor Author

@swift-ci test

@pusukuri
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Member

This PR is identical to the original one, was it submitted twice by mistake?

@bnbarham bnbarham changed the title Suppress redundant linkage warnings due to dependency linkage propaga… [6.0] Suppress redundant linkage warnings Mar 20, 2024
Copy link
Member

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is supposed to land in 6.0, it needs the base branch set accordingly instead of main.

@pusukuri pusukuri changed the base branch from main to release/6.0 March 20, 2024 20:18
@MaxDesiatov MaxDesiatov added diagnostics swift 6.0 Related to Swift 6.0 release branch labels Mar 20, 2024
@pusukuri
Copy link
Contributor Author

@MaxDesiatov it is done. Please take a look. Thanks

XCTAssertTrue(fullLog.contains("ld: warning: ignoring duplicate libraries: '-lz'"), "log didn't contain expected linker diagnostics")
XCTAssertTrue(fullLog.contains("ld: warning: search path 'foobar' not found"), "log didn't contain expected linker diagnostics")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, isn't this now not testing what it was before? ie. with the change to the fixture, we wouldn't expect the ignoring duplicate libraries warning with or without your actual change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to diagnostics handling in this PR is supposed to silence the warning we were previously testing for filtering linker diagnostics. Since that warning is always suppressed, we can no longer test for it and need to trigger a different warning, hence the changes to the fixture.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apparently got distracted from editing this. I saw the comment in the original PR, but do we have another test to check that duplicate libraries are now suppressed? I assume the argument would be that the command line tests are enough and that the purpose of this test was just to make sure we didn't filter linker diagnostics out? If so, sure 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have another test to check that duplicate libraries are now suppressed?

@pusukuri would you be able to add such test in a follow-up PR?

@MaxDesiatov MaxDesiatov self-requested a review March 21, 2024 21:41
@MaxDesiatov MaxDesiatov dismissed their stale review March 21, 2024 21:42

Base branch is now set correctly

@pusukuri pusukuri merged commit 3b8489a into release/6.0 Mar 22, 2024
5 checks passed
@pusukuri pusukuri deleted the pr-kishore-112671586 branch March 22, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics swift 6.0 Related to Swift 6.0 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants