Skip to content

Conversation

@speednoisemovement
Copy link
Contributor

In #85465, I didn't realize that we actually do the trimming in multiple places.

This change:

utils/build.ps1 Outdated

$PinnedToolchain = [IO.Path]::GetFileNameWithoutExtension($PinnedBuild)
# Use a shorter name in paths to avoid going over the path length limit.
$NormalizedToolchainName = $PinnedToolchain -replace 'swift-(.+?)-a-windows10.*', '$1'
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that NormalizedToolchainName really is helpful, especially at a global level. It doesn't tell you why it is useful or what the normalisation is. This really is the version toolchain identifier.

The regex doesn't entirely work though, consider the following reasonable value: swift-6.2.1-RELEASE-windows10.exe. This should give us 6.2.1 (or perhaps 6.2.1-RELEASE if we are trying to match the fact that we retain the DEVELOPMENT-SNAPSHOT for the development snapshots, but the versioning there would result in collisions otherwise I think).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to $ToolchainVersionIdentifier

Per offline conversation, adjusted the regex to no longer require -a. The example above would end up being 6.2.1-RELEASE but DEVELOPMENT-SNAPSHOT-2025-11-03 is now DEVELOPMENT-SNAPSHOT-2025-11-03-a–slightly longer, but still under for a typical long path

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