Skip to content
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

[Macros] Set -external-plugin-path when the toolchain is not Xcode #1320

Merged
merged 1 commit into from Apr 26, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 29, 2023

rdar://108525615

@rintaro rintaro marked this pull request as draft March 29, 2023 16:46
fileSystem.exists(xcodePluginPath)
{
commandLine.appendFlag(.externalPluginPath)
commandLine.appendFlag(xcodePluginPath.pathString + "#" + xcodePluginPath.pathString)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not safe because xcodePluginServerPath can contain #.
@artemcm I want to pass a pair of /path/to/usr/bin/swift-plugin-server and /path/to/usr/lib/swift/host/plugins paths.
Is squashedArgumentList usable for this purpose? Does swift-frontend have a way to correctly "unpack" those values?

@rintaro rintaro force-pushed the macros-external-plugin-path branch from faa70f5 to 7c0946f Compare March 29, 2023 20:50
// default toolchain.
if
isFrontendArgSupported(.externalPluginPath),
let darwinToolchain = toolchain as? DarwinToolchain,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we instead move this to addPlatformSpecificCommonFrontendOptions, please?

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

Could we please add a macOS-only test for this?
Other than that and moving to code to a toolchain-specific place, LGTM!

@rintaro rintaro force-pushed the macros-external-plugin-path branch from 7c0946f to 168d09b Compare April 25, 2023 21:29
@rintaro rintaro force-pushed the macros-external-plugin-path branch from 168d09b to 53ad3a9 Compare April 25, 2023 22:04
@rintaro
Copy link
Member Author

rintaro commented Apr 25, 2023

@swift-ci Please test

@rintaro rintaro marked this pull request as ready for review April 25, 2023 22:30
@rintaro rintaro merged commit 3f15981 into apple:main Apr 26, 2023
3 checks passed
@rintaro rintaro deleted the macros-external-plugin-path branch April 26, 2023 21:23
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.

None yet

2 participants