Skip to content

[Traits] Re-enable no unused dependencies assertion in TraitTests.swift #8360

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

Merged
merged 9 commits into from
Mar 17, 2025

Conversation

bripeticca
Copy link
Contributor

Fixes #8131

Previously this check was disabled since it introduced failures when testing with the 6.1 toolchain - due to the introduction of traits in resolution (#8205) and additional behaviour from the experimental prune dependencies flag, this check should now pass as expected.

Modifications:

Re-enabled the XCTAssertFalse(stderr.contains("warning:")) check in the TraitTests where necessary and propagated the pruneDependencies flag to the ManifestLoader init in areas it was previously missing to assure no warnings would be generated upon omitting them. Also re-added the enabled traits parameter done during a computation for required dependencies when creating the package builders in ModulesGraph+Loading.swift.

Result:

This check shouldn't fail anymore.

Previously this check was disabled since it introduced failures
when testing with another toolchain (6.1) - due to the introduction
of traits in resolution and additional behaviour from the
experimental prune dependencies flag, this check should now
pass in the TraitTests.
@bripeticca
Copy link
Contributor Author

@swift-ci please test

@bripeticca
Copy link
Contributor Author

@swift-ci please test linux self hosted

Additional testing added to ensure appropriate behaviour from
omitting unused dependencies, depending on various trait configurations
and unused dependency configurations.

Renamed dependenciesGuarded -> dependenciesTraitGuarded in `Manifest`
for better clarity on what the method is computing, with an improved
description.
@bripeticca
Copy link
Contributor Author

@swift-ci please test

@bripeticca
Copy link
Contributor Author

@swift-ci please smoke test Linux

@bripeticca
Copy link
Contributor Author

@swift-ci please test windows

@bripeticca
Copy link
Contributor Author

@swift-ci please smoke test linux

@bripeticca
Copy link
Contributor Author

@swift-ci please test

@bripeticca
Copy link
Contributor Author

@swift-ci please test

@bripeticca
Copy link
Contributor Author

@swift-ci please test windows

@bripeticca bripeticca merged commit bafe38b into swiftlang:main Mar 17, 2025
5 checks passed
@bripeticca bripeticca deleted the traittests_assertnowarning branch March 17, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TraitsTests fails when running in 6.1 toolchain
2 participants