                         }
                     }
 
-                    if let DEVELOPER_DIR = environment["DEVELOPER_DIR"],
-                       let root = try? AbsolutePath(validating: DEVELOPER_DIR)
-                        .appending(component: "Platforms")
-                        .appending(component: "Windows.platform") {
-                        if let info = WindowsPlatformInfo(reading: root.appending(component: "Info.plist"),
-                                                          diagnostics: nil, filesystem: localFileSystem) {
-                            let path: AbsolutePath =
-                            root.appending(component: "Developer")
-                                .appending(component: "Library")
-                                .appending(component: "XCTest-\(info.defaults.xctestVersion)")
-
-                            xctest = [
-                                "-I", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: path).pathString,
-                                "-L", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: path).pathString,
-                            ]
-
-                            // Migration Path
-                            //
-                            // In order to support multiple parallel
-                            // installations of an SDK, we need to ensure that
-                            // we can have all the architecture variant
-                            // libraries available.  Prior to this getting
-                            // enabled (~5.7), we always had a singular
-                            // installed SDK.  Prefer the new variant which has
-                            // an architecture subdirectory in `bin` if
-                            // available.
-                            let implib: AbsolutePath =
-                                AbsolutePath("usr/lib/swift/windows/XCTest.lib", relativeTo: path)
-                            if localFileSystem.exists(implib) {
-                                xctest.append(contentsOf: ["-L", implib.parentDirectory.pathString])
-                            }
-
-                            extraSwiftCFlags = info.defaults.extraSwiftCFlags ??  []
+                    // The layout of the SDK is as follows:
+                    //
+                    // Library/Developer/Platforms/[PLATFORM].platform/Developer/Library/XCTest-[VERSION]/...
+                    // Library/Developer/Platforms/[PLATFORM].platform/Developer/SDKs/[PLATFORM].sdk/...
+                    //
+                    // SDKROOT points to [PLATFORM].sdk
+                    let platform = sdkroot.parentDirectory.parentDirectory.parentDirectory
+
+                    if let info = WindowsPlatformInfo(reading: platform.appending(component: "Info.plist"),
+                                                      diagnostics: nil, filesystem: localFileSystem) {
+                        let installation: AbsolutePath =
+                                platform.appending(component: "Developer")
+                                        .appending(component: "Library")
+                                        .appending(component: "XCTest-\(info.defaults.xctestVersion)")
+
+                        xctest = [
+                            "-I", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: installation).pathString,
+                            "-L", AbsolutePath("usr/lib/swift/windows/\(triple.arch)", relativeTo: installation).pathString,
+                        ]
+
+                        // Migration Path
+                        //
+                        // In order to support multiple parallel installations
+                        // of an SDK, we need to ensure that we can have all the
+                        // architecture variant libraries available.  Prior to
+                        // this getting enabled (~5.7), we always had a singular
+                        // installed SDK.  Prefer the new variant which has an
+                        // architecture subdirectory in `bin` if available.
+                        let implib: AbsolutePath =
+                            AbsolutePath("usr/lib/swift/windows/XCTest.lib", relativeTo: installation)
+                        if localFileSystem.exists(implib) {
+                            xctest.append(contentsOf: ["-L", implib.parentDirectory.pathString])
                         }
-                    }
-
-                    return [ "-sdk", root.pathString, ] + runtime + xctest + extraSwiftCFlags
+
+                        extraSwiftCFlags = info.defaults.extraSwiftCFlags ??  []
+                    }
+
+                    return [ "-sdk", sdkroot.pathString, ] + runtime + xctest + extraSwiftCFlags
                 }
             }
 

                // Windows uses a variable named SDKROOT to determine the root of
                // the SDK.  This is not the same value as the SDKROOT parameter
                // in Xcode, however, the value represents a similar concept.
                if let SDKROOT = environment["SDKROOT"], let root = try? AbsolutePath(validating: SDKROOT) {
                    var runtime: [String] = []
                    var xctest: [String] = []
                    var extraSwiftCFlags: [String] = []

                    if let settings = WindowsSDKSettings(reading: root.appending(component: "SDKSettings.plist"),
                                                         diagnostics: nil, filesystem: localFileSystem) {
                        switch settings.defaults.runtime {
                        case .multithreadedDebugDLL:

        if case let .custom(_, useXcrun) = searchStrategy, !useXcrun {
            xctestPath = nil
        } else {
            xctestPath = try Self.deriveXCTestPath(destination: self.destination, triple: triple, environment: environment)
        }

        self.configuration = .init(
