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

De-duplicate consecutive libs when printing native-static-libs #113626

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Jul 12, 2023

This PR adds a de-duplicate step just before printing the native-static-libs.

This step de-duplicates all the consecutive libs based only on the relevant comparison elements (this exclude spans, ast elements, ...).

Fixes #113209

@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2023

r? @b-naber

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 12, 2023
@Urgau Urgau force-pushed the dedup-native-static-libs branch from d1fe664 to ad16606 Compare July 12, 2023 18:07
@bjorn3
Copy link
Member

bjorn3 commented Jul 16, 2023

Some libraries need to be present multiple times to handle circular dependencies. Whatever logic you use for this printing please make sure that it also works for rustc doing linking of a dylib or executable too.

@Urgau
Copy link
Member Author

Urgau commented Jul 16, 2023

Some libraries need to be present multiple times to handle circular dependencies. Whatever logic you use for this printing please make sure that it also works for rustc doing linking of a dylib or executable too.

As stated in the PR description, this PR only removes consecutive libs and does not touch libs that are present multiple times but not consecutive. That means that instead of generating (before this PR):

-lunwind -lunwind -lunwind -lsystemd -lunwind

we would now generate:

-lunwind -lsystemd -lunwind

Given this I don't think there is any issues with circular dependencies since linker args are still present (just not consecutively duplicated).

@bjorn3
Copy link
Member

bjorn3 commented Jul 16, 2023

Right, no objections in that case.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 16, 2023

📌 Commit ad16606 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2023
@bors
Copy link
Contributor

bors commented Jul 16, 2023

⌛ Testing commit ad16606 with merge 55be59d...

@bors
Copy link
Contributor

bors commented Jul 16, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 55be59d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 16, 2023
@bors bors merged commit 55be59d into rust-lang:master Jul 16, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 16, 2023
@Urgau Urgau deleted the dedup-native-static-libs branch July 16, 2023 14:11
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (55be59d): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.4%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 657.596s -> 657.74s (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

many unexpected duplicates in --print native-static-libs output in some configurations
7 participants