Skip to content

Fix macro template #7281

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
Jan 23, 2024
Merged

Fix macro template #7281

merged 1 commit into from
Jan 23, 2024

Conversation

neonichu
Copy link
Contributor

No description provided.

@neonichu neonichu self-assigned this Jan 22, 2024
@neonichu
Copy link
Contributor Author

@swift-ci please test

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.

Is there anything that was broken by the lack of this line? If this code didn't compile, couldn't we detect it with an end-to-end test that runs package init with this template and then swift build?

@MaxDesiatov MaxDesiatov added needs tests This change needs test coverage swift package init Package templates command changes labels Jan 22, 2024
@neonichu
Copy link
Contributor Author

Is there anything that was broken by the lack of this line?

Yes, we were generating the import XCTest without any whitespace between it and the previous statement, leading to broken code.

If this code didn't compile, couldn't we detect it with an end-to-end test that runs package init with this template and then swift build?

In theory yes, in practice we cannot end-to-end test macros today because we can't download swift-syntax on CI and we also don't have all the necessary components in the toolchain to attempt to use that as a replacement.

@neonichu
Copy link
Contributor Author

[8/20] Testing IntegrationTests.SwiftPMTests/testBinaryTargets
Cancelling nested steps due to timeout
Sending interrupt signal to process
script returned exit code 143

@neonichu
Copy link
Contributor Author

@swift-ci please test linux

@neonichu
Copy link
Contributor Author

Looks like macOS self-hosted is also hanging?

@neonichu
Copy link
Contributor Author

My guess would be that it's related to #7269?

@neonichu
Copy link
Contributor Author

My guess would be that it's related to #7269?

Actually, all tests should have individual scratch directories, so it doesn't seem super likely for this to be the cause. Can't repro locally, either.

@neonichu
Copy link
Contributor Author

@swift-ci please test linux

@neonichu
Copy link
Contributor Author

@swift-ci please test macOS

@neonichu neonichu merged commit 1f1e5e6 into main Jan 23, 2024
@neonichu neonichu deleted the fix-macro-template branch January 23, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests This change needs test coverage swift package init Package templates command changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants