-
Notifications
You must be signed in to change notification settings - Fork 207
[Macros on Darwin] Use device platform paths when building for the simulator #1400
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"Version": "13.0", | ||
"CanonicalName": "iphoneos13.0" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"Version": "15.0", | ||
"CanonicalName": "iphonesimulator15.0" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6869,8 +6869,14 @@ final class SwiftDriverTests: XCTestCase { | |
} | ||
|
||
func testPluginPaths() throws { | ||
let sdkRoot = testInputsPath.appending(component: "SDKChecks").appending(component: "iPhoneOS.sdk") | ||
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift", "-sdk", VirtualPath.absolute(sdkRoot).name, "-plugin-path", "PluginA", "-external-plugin-path", "PluginB#Bexe", "-load-plugin-library", "PluginB2", "-plugin-path", "PluginC"]) | ||
try pluginPathTest(platform: "iPhoneOS", searchPlatform: "iPhoneOS") | ||
try pluginPathTest(platform: "iPhoneSimulator", searchPlatform: "iPhoneOS") | ||
} | ||
|
||
func pluginPathTest(platform: String, searchPlatform: String) throws { | ||
let sdkRoot = testInputsPath.appending( | ||
components: ["PlatformChecks", "\(platform).platform", "Developer", "SDKs", "\(platform).sdk"]) | ||
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift", "-sdk", VirtualPath.absolute(sdkRoot).name, "-plugin-path", "PluginA", "-external-plugin-path", "Plugin~B#Bexe", "-load-plugin-library", "PluginB2", "-plugin-path", "PluginC"]) | ||
guard driver.isFrontendArgSupported(.pluginPath) && driver.isFrontendArgSupported(.externalPluginPath) else { | ||
return | ||
} | ||
|
@@ -6883,7 +6889,7 @@ final class SwiftDriverTests: XCTestCase { | |
let pluginAIndex = job.commandLine.firstIndex(of: .path(VirtualPath.relative(.init("PluginA")))) | ||
XCTAssertNotNil(pluginAIndex) | ||
|
||
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")))) | ||
Comment on lines
-6886
to
+6892
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, that's a good idea. |
||
XCTAssertNotNil(pluginBIndex) | ||
XCTAssertLessThan(pluginAIndex!, pluginBIndex!) | ||
|
||
|
@@ -6909,7 +6915,11 @@ final class SwiftDriverTests: XCTestCase { | |
XCTAssertNotNil(sdkLocalPluginPathIndex) | ||
XCTAssertLessThan(sdkPluginPathIndex!, sdkLocalPluginPathIndex!) | ||
|
||
let platformPath = sdkRoot.parentDirectory.parentDirectory.parentDirectory.appending(components: "Developer", "usr") | ||
let origPlatformPath = | ||
sdkRoot.parentDirectory.parentDirectory.parentDirectory.parentDirectory | ||
.appending(component: "\(searchPlatform).platform") | ||
|
||
let platformPath = origPlatformPath.appending(components: "Developer", "usr") | ||
let platformServerPath = platformPath.appending(components: "bin", "swift-plugin-server").pathString | ||
|
||
let platformPluginPath = platformPath.appending(components: "lib", "swift", "host", "plugins") | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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... 🤷