Skip to content

Conversation

cmcgee1024
Copy link
Member

@cmcgee1024 cmcgee1024 commented Apr 8, 2025

No description provided.

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024 cmcgee1024 marked this pull request as ready for review April 10, 2025 16:39
/// - swift-a.b-DEVELOPMENT-SNAPSHOT
struct ReleaseSnapshotParser: ToolchainSelectorParser {
static let regex: Regex<(Substring, Substring, Substring, Substring?)> =
static func regex() -> Regex<(Substring, Substring, Substring, Substring?)> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the motivation to making this a function? We'll incur the regex creation cost every call. Could this be a lazy static instead?

static let regex: Regex = {
 return try! Regex("^(?:swift-)?([0-9]+)\\.([0-9]+)-(?:snapshot|DEVELOPMENT-SNAPSHOT|SNAPSHOT)(?:-([0-9]{4}-[0-9]{2}-[0-9]{2}))?(?:-a)?$")
}

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's because Regex is not Sendable in its current state. A lot of swift code just constructs regexes where they are used, so this would be no different. Maybe someday Regex can be Sendable.

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a forum thread on this topic:

https://forums.swift.org/t/should-regex-be-sendable/69529/15


public class TestOutputHandler: SwiftlyCore.OutputHandler {
public actor TestOutputHandler: SwiftlyCore.OutputHandler {
public var lines: [String]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
public var lines: [String]
public private(set) var lines: [String]

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@cmcgee1024 cmcgee1024 merged commit 5645873 into swiftlang:main Apr 10, 2025
21 checks passed
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