Skip to content

Fix hard-coded path to FoundationEssentialsTests resources #855

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 15, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented 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
Copy link
Contributor Author

xedin commented Aug 15, 2024

@jmschonfeld
Copy link
Contributor

Looks like Windows failed because this change isn't compatible with older versions of SwiftPM (note: this repo does not support cross-repo testing, tests are run using the SwiftPM from the most recent nightly toolchain)

FoundationEssentialsTests/JSONEncoderTests.swift:2411: Fatal error: Unexpectedly found nil while unwrapping an Optional value

@xedin
Copy link
Contributor Author

xedin commented Aug 15, 2024

@jmschonfeld I triggered Windows CI in my swift PR, if that passes we should be good to go.

@jmschonfeld
Copy link
Contributor

@jmschonfeld I triggered Windows CI in my swift PR, if that passes we should be good to go.

@xedin that won't be sufficient here I'm afraid. This package needs to build with the latest nightly toolchain because that's what our CI currently uses and what we use to develop at desk. We need a solution here that will work both with your change and without - even if your swift PR passes, CI in this repo will continue to fail since it's not using a just-built toolchain, and we will no longer be able to build just Foundation at desk

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 xedin force-pushed the fix-incorrect-foundation-resources-hardcode branch from 0d73517 to d14ceaf Compare August 15, 2024 16:26
@xedin
Copy link
Contributor Author

xedin commented Aug 15, 2024

@swift-ci please test

@jmschonfeld jmschonfeld merged commit 234f225 into main Aug 15, 2024
3 checks passed
@jmschonfeld jmschonfeld deleted the fix-incorrect-foundation-resources-hardcode branch August 15, 2024 17:03
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 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 <xedin@apache.org>
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