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 on Darwin] Use device platform paths when building for the simulator #1400

Merged

Conversation

DougGregor
Copy link
Member

To avoid having duplicated macro implementations in both the device and
simulator platforms, when building for a simulator platform, pass
-external-plugin-path that points into the device platform. There
is no need to have macro implementations in the simulator platforms.

Implements rdar://112563633

…mulator

To avoid having duplicated macro implementations in both the device and
simulator platforms, when building for a simulator platform, pass
`-external-plugin-path` that points into the *device* platform. There
is no need to have macro implementations in the simulator platforms.

Implements rdar://112563633
@DougGregor
Copy link
Member Author

@swift-ci please test

Comment on lines -6886 to +6892
let pluginBIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("PluginB#Bexe"))))
let pluginBIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("Plugin~B#Bexe"))))
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC we're only shell escaping the SDK paths, not the ones that were already passed in. Could we just rename PlatformChecks to eg. Platform Checks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, that's a good idea.


func pluginPathTest(platform: String, searchPlatform: String) throws {
let sdkRoot = testInputsPath.appending(
components: ["PlatformChecks", "\(platform).platform", "Developer", "SDKs", "\(platform).sdk"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't the SDK name normally contain the version?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does. That shouldn't matter, but just in case... I'll update it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, there's no where that matters currently but... 🤷

... to make sure we're not missing any odd corner cases here.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test Windows

@DougGregor DougGregor merged commit d01fb4c into swiftlang:main Jul 21, 2023
@DougGregor DougGregor deleted the macro-platform-paths-simulator-to-device branch July 21, 2023 03:00
This pull request was closed.
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