Skip to content

[Build] BuildPlan: Always discover test modules through their aggrega… #7879

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 1 commit into from
Aug 14, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 13, 2024

…te products

Motivation:

Fixes a situation when tests were build for both host and target even though they should have been built only for the host (i.e. when one of the modules depends on a macro).

Modifications:

  • Adjusted BuildPlan.computeDestinations to never add test modules to successor list of a package and allow test products to always iterate their module dependencies instead.

Result:

If one of the test targets depends on a macro we'd never attempt to build others for "target".

@xedin
Copy link
Contributor Author

xedin commented Aug 14, 2024

@swift-ci please test

…te products

Fixes a situation when tests were build for both host and target
even though they should have been built only for the host (i.e. when
one of the modules depends on a macro).
@xedin xedin force-pushed the too-many-test-modules-too-little-time branch from f2e7318 to 7c2ef8b Compare August 14, 2024 00:34
@xedin
Copy link
Contributor Author

xedin commented Aug 14, 2024

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Aug 14, 2024

@swift-ci please test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Aug 14, 2024

@swift-ci please test Linux platform

Copy link
Contributor

@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.

Great catch 👍

@xedin xedin merged commit 6481220 into swiftlang:main Aug 14, 2024
5 checks passed
xedin added a commit that referenced this pull request Aug 15, 2024
xedin added a commit that referenced this pull request Aug 15, 2024
xedin added a commit to xedin/swift-package-manager that referenced this pull request Aug 15, 2024
swiftlang#7879)

…te products

### Motivation:

Fixes a situation when tests were build for both host and target even
though they should have been built only for the host (i.e. when one of
the modules depends on a macro).

### Modifications:

- Adjusted `BuildPlan.computeDestinations` to never add `test` modules
to successor list of a package and allow `test` products to always
iterate their module dependencies instead.

### Result:

If one of the test targets depends on a macro we'd never attempt to
build others for "target".
xedin added a commit to swiftlang/swift-foundation that referenced this pull request Aug 15, 2024
SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.
xedin added a commit to swiftlang/swift-foundation that referenced this pull request Aug 15, 2024
SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.
jmschonfeld pushed a commit to swiftlang/swift-foundation that referenced this pull request Aug 15, 2024
SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.
xedin added a commit to swiftlang/swift-foundation that referenced this pull request Aug 27, 2024
SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.

(cherry picked from commit d14ceaf)
xedin added a commit to swiftlang/swift-foundation that referenced this pull request Aug 28, 2024
SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.

(cherry picked from commit d14ceaf)
jmschonfeld pushed a commit to jmschonfeld/swift-foundation that referenced this pull request Sep 4, 2024
…ng#855)

SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.
parkera pushed a commit to swiftlang/swift-foundation that referenced this pull request Sep 5, 2024
…901)

SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.

Co-authored-by: Pavel Yaskevich <[email protected]>
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
…ng#855)

SwiftPM used to incorrectly build tests for both host and target.
That has been fixed by swiftlang/swift-package-manager#7879.

The fix makes sure that if there are any direct macro dependencies
in test targets xctest bundle is only built for "host".

This means that the hard-coded resources path needs to be updated
to include "-tool" suffix.
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.

2 participants