[K/N] Use topological order for resolved libraries#5889
Conversation
Code Owners
|
New changes affect files owned by this reviewer. Re-review required.
|
Could you please also drop the other calls to |
|
/dry-run |
|
THIS IS A DRY RUN Quality gate is triggered at https://buildserver.labs.intellij.net/build/932359132 — use this link to get full insight. Quality gate was triggered with the following revisions:
|
|
Quality gate finished successfully. |
Replace the BFS-based traversal in KotlinLibraryResolverResultImpl with a DFS-based one to ensure that resolved libraries are returned in topological order (dependencies before dependents). This change also introduces explicit cyclic dependency detection during resolution. The explicit call to legacyKlibReverseTopoSort in NativeSecondStageCompilationConfig is removed as the resolved library list provided by the resolver is now already sorted correctly. This change speeds up our link step with 5000+ klibs by 10x, as it now does not rely on parsing the dependencies from manifest properties.
The legacyKlibReverseTopoSort function, which performed topological sorting by manually parsing KLIB manifest properties, is no longer needed now that the KLIB resolver returns libraries in the correct order. This commit: - Removes legacyKlibReverseTopoSort from LegacyKlibDependencyUtils.kt. - Removes remaining call sites in the Kotlin/Native compiler and stub generator. - Deletes LegacyKlibTopoSortSanityTest.kt as it is no longer relevant. ^KT-70118
7959186 to
06bc8e8
Compare
New changes affect files owned by this reviewer. Re-review is required.
For internal PRs, review can be finalized by adding /final to the approving message.
|
/dry-run |
|
Failed to process command due to an unexpected exception. |
|
/dry-run |
|
THIS IS A DRY RUN Quality gate is triggered at https://buildserver.labs.intellij.net/build/936545097 — use this link to get full insight. Quality gate was triggered with the following revisions:
|
|
Quality gate finished successfully. |
|
/safe-merge |
|
Quality gate is triggered at https://buildserver.labs.intellij.net/build/937397776 — use this link to get full insight. Quality gate was triggered with the following revisions:
|
|
Quality gate finished successfully. |
Replace the BFS-based traversal in KotlinLibraryResolverResultImpl with a DFS-based one to ensure that resolved libraries are returned in topological order (dependencies before dependents). This change also introduces explicit cyclic dependency detection during resolution.
The explicit call to legacyKlibReverseTopoSort in
NativeSecondStageCompilationConfig is removed as the resolved library list provided by the resolver is now already sorted correctly.
This change speeds up our link step with 5000+ klibs by 10x, as it now does not rely on parsing the dependencies from manifest properties.