Skip to content

save Package.resolved with a trailing newline #3822

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
Oct 28, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Oct 27, 2021

motivation: we lost the trailing newline when moving to COdable based encoder

changes: add trailing newline in POSIXy systems

rdar://83646952

motivation: we lost the trailing newline when moving to COdable based encoder

changes: add trailing newline in POSIXy systems

rdar://83646952
@tomerd
Copy link
Contributor Author

tomerd commented Oct 27, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Oct 27, 2021

cc @jakepetroules

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Oct 27, 2021
if toolsVersion >= .v5_6 {
let container = try V2(pins: pins, mirrors: mirrors)
data = try self.encoder.encode(container)
} else {
let container = try V1(pins: pins, mirrors: mirrors)
data = try self.encoder.encode(container)
}
#if !os(Windows)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason the Windows one shouldn't add with \r\n?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could, but i am not sure if a trailing newline is a convention on Windows

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — anyway it doesn't make a lot of difference provided that they work fine there without it. No reason not to merge, it would just be nicer to avoid the #if if there was a stock way of appending a platform line separator.

Copy link
Contributor

@abertelrud abertelrud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question about Windows in the source code comments but in general looks good.

@tomerd tomerd merged commit 5c3e6ac into swiftlang:main Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants