Skip to content

Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget. #81940

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
Jun 4, 2025

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Jun 3, 2025

StdlibDeploymentTarget seems to be a better name.

rdar://152498657

@al45tair
Copy link
Contributor Author

al45tair commented Jun 3, 2025

@swift-ci Please smoke test

# will expand to the current `-target` platform if the macro defines a
# newer platform as its availability.
#
# There is a setting, SWIFT_STDLIB_ENABLE_STRICT_AVAILABILITY, which if set
# ON will cause us to use the "proper" availability instead.
string(REPLACE "SwiftStdlib" "SwiftStdlibCurrentOS" current "${def}")
string(REPLACE "SwiftStdlib" "DeploymentTarget" current "${def}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I am afraid the new name as is could become a little difficult to search in the code base (as the compiler code already use DeploymentTarget for a few symbols) -- filters could help (e.g. files under stdlib, or files ending with *.cmake), but I personally don't always add those (especially when I'm doing a quick search to assess issues).

Suggested change
string(REPLACE "SwiftStdlib" "DeploymentTarget" current "${def}")
string(REPLACE "SwiftStdlib" "SwiftStdlibDeploymentTarget" current "${def}")

If adding back a prefix is not desirable, I would suggest to document this choice in utils/availability-macros.def

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure this is such a problem in practice as you could always do a regex search for DeploymentTarget \d+\.\d+.

What do you think, @stephentyrone? Happy to change the name if we think it's worth doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided on reflection to change it to StdlibDeploymentTarget. I don't want to make it too long, but I think @edymtt is right that it's easier if it's a unique string (there are some hits in some of the Python code for StdlibDeploymentTarget, but I don't think that's particularly troublesome, and adding Swift as well just makes it really long).

Copy link
Contributor

Choose a reason for hiding this comment

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

Works for me.

`StdlibDeploymentTarget` seems to be a better name.

rdar://152498657
@al45tair al45tair force-pushed the eng/PR-152498657 branch from be65e53 to 42ca1b1 Compare June 4, 2025 09:41
@al45tair al45tair changed the title Rename SwiftStdlibCurrentOS to DeploymentTarget. Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget. Jun 4, 2025
@al45tair
Copy link
Contributor Author

al45tair commented Jun 4, 2025

@swift-ci Please smoke test

@al45tair al45tair merged commit 726aaf7 into swiftlang:main Jun 4, 2025
3 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.

3 participants