Skip to content

Conversation

finagolfin
Copy link
Member

as done originally in #25990 with the legacy C++ Driver, but since lost in the new swift-driver

This is another attempt to fix swiftlang/swift-driver#1562 and avoid the various workarounds that have been put in elsewhere to spackle over this root cause.

This worked for me with the compiler validation suite running natively on an Android device, with the exception of one SourceKit test. Let's run it through all the platforms on the CI before explaining fully what it's doing and adding a test to make sure it doesn't regress.

@finagolfin
Copy link
Member Author

@swift-ci please test

@finagolfin
Copy link
Member Author

swiftlang/swift-driver#1822
@swift-ci please test linux

1 similar comment
@finagolfin
Copy link
Member Author

swiftlang/swift-driver#1822
@swift-ci please test linux

FrontendOpts.UseSharedResourceFolder ? "swift" : "swift_static",
getPlatformNameForTriple(Triple));
// Check for eg <sdkRoot>/usr/lib/swift/linux/
if (llvm::sys::fs::exists(SDKResourcePath)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I initially tried simply checking if <sdkRoot>/usr/lib/swift/, ie a Swift resource directory, existed, but around 100 tests from the compiler validation suite failed with that, as they pass in a separate -sdk that simply has a Swift resource directory with a few different API notes or something, but does not contain the platform-specific files needed in <sdkRoot>/usr/lib/swift/<os>/. Actually checking for this OS-specific directory makes sure the Swift resource directory in -sdk contains the required platform-specific modules and libraries, and falls back to the Swift resource directory in the toolchain itself otherwise. However, that implies mixing and matching files from two different Swift resource directories, so maybe it will be better to enforce that only one Swift resource directory is used and modify all those tests instead?

For an example of such mixing already taking place, the Windows CI failed with this pull, right before trying to compile the trunk Foundation macros for the Windows host:

-- Check for working Swift compiler: T:/5/bin/swiftc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeTestSwiftCompiler.cmake:40 (message):
  The Swift compiler

    "T:/5/bin/swiftc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: 'T:/x86_64-unknown-windows-msvc/FoundationMacros/CMakeFiles/CMakeScratch/TryCompile-6u6j6e'
    
    Run Build Command(s): C:/PROGRA~1/MICROS~2/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_bc87d
    [1/2][ 50%][0.084s] T:\5\bin\swiftc.exe -target x86_64-unknown-windows-msvc -j 36 -num-threads 36 -c  -module-name cmTC_bc87d -sdk T:/toolchains/swift-6.0.3-RELEASE-windows10/LocalApp/Programs/Swift/Platforms/6.0.3/Windows.platform/Developer/SDKs/Windows.sdk -gnone -Xlinker /INCREMENTAL:NO -Xlinker /OPT:REF -Xlinker /OPT:ICF  -incremental -output-file-map CMakeFiles\cmTC_bc87d.dir\\output-file-map.json  T:\x86_64-unknown-windows-msvc\FoundationMacros\CMakeFiles\CMakeScratch\TryCompile-6u6j6e\main.swift
    FAILED: CMakeFiles/cmTC_bc87d.dir/main.swift.obj 
    T:\5\bin\swiftc.exe -target x86_64-unknown-windows-msvc -j 36 -num-threads 36 -c  -module-name cmTC_bc87d -sdk T:/toolchains/swift-6.0.3-RELEASE-windows10/LocalApp/Programs/Swift/Platforms/6.0.3/Windows.platform/Developer/SDKs/Windows.sdk -gnone -Xlinker /INCREMENTAL:NO -Xlinker /OPT:REF -Xlinker /OPT:ICF  -incremental -output-file-map CMakeFiles\cmTC_bc87d.dir\\output-file-map.json  T:\x86_64-unknown-windows-msvc\FoundationMacros\CMakeFiles\CMakeScratch\TryCompile-6u6j6e\main.swift
    <unknown>:0: warning: using (deprecated) legacy driver, Swift installation does not contain swift-driver at: 'C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\build\5\bin\swift-driver-new.exe'
    <unknown>:0: warning: option '-incremental' is only supported in swift-driver
    <unknown>:0: error: module compiled with Swift 6.0.3 cannot be imported by the Swift 6.2 compiler: T:/toolchains/swift-6.0.3-RELEASE-windows10/LocalApp/Programs/Swift/Platforms/6.0.3/Windows.platform/Developer/SDKs/Windows.sdk\usr\lib\swift\windows\Swift.swiftmodule\x86_64-unknown-windows-msvc.swiftmodule

    ninja: build stopped: subcommand failed.

The issue appears to be that they're trying to build the trunk Foundation macros with the freshly-built trunk 6.2 Swift compiler, but passing in a Swift 6.0.3 SDK with -sdk T:/toolchains/swift-6.0.3-RELEASE-windows10/LocalApp/Programs/Swift/Platforms/6.0.3/Windows.platform/Developer/SDKs/Windows.sdk to build it. The trunk Swift 6.2 compiler then quietly ignores that 6.0.3 Swift resource directory and likely uses the 6.2 Swift resource directory next to the toolchain instead. This pull, by enforcing that the Swift resource directory in the 6.0.3 -sdk that is passed in is used because <6.0.3-sdkRoot>/usr/lib/swift/windows/ exists, then fails because the 6.0.3 modules cannot be used with the trunk Swift 6.2 compiler.

@weliveindetail, do you know if that's merely a configuration mistake when building the Foundation and Testing macros on the Windows CI, which should be easily fixed, or something more complicated?

@@ -2258,6 +2259,18 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts, ArgList &Args,

if (const Arg *A = Args.getLastArg(OPT_resource_dir))
Opts.RuntimeResourcePath = A->getValue();
else if (!Triple.isOSDarwin() && Args.hasArg(OPT_sdk)) {
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 code explicitly follows what the original C++ Driver has long done when looking for the Swift runtime libraries, swiftrt.o, and a few other files found in the Swift resource directory:

if (const Arg *A = args.getLastArg(options::OPT_resource_dir)) {
    StringRef value = A->getValue();
    resourceDirPath.append(value.begin(), value.end());
  } else if (!getTriple().isOSDarwin() && args.hasArg(options::OPT_sdk)) {
    StringRef value = args.getLastArg(options::OPT_sdk)->getValue();
    resourceDirPath.append(value.begin(), value.end());
    llvm::sys::path::append(resourceDirPath, "usr");
    CompilerInvocation::appendSwiftLibDir(resourceDirPath, shared);
  } else {
    auto programPath = getDriver().getSwiftProgramPath();
    CompilerInvocation::computeRuntimeResourcePathFromExecutablePath(
        programPath, shared, resourceDirPath);
  }

Note how the SDK is only looked in if a non-Darwin -sdk is explicitly specified: Saleem later tried to expand that to Darwin also in #26361, but he may have never got it to work.

That C++ Driver setup now matches this Frontend setup, because the default in both is now to look relative to the compiler, which is done first in this Frontend here, ie usr/bin/../lib/swift/. If a -resource-dir is set, that is given first priority, then a non-Darwin -sdk is given second priority, ie the C++ Driver and the Frontend now match in where they look.

This is important for two reasons:

  1. The new swift-driver simply queries the Frontend and uses whatever Swift resource directory it uses, so now the new swift-driver finally matches the original C++ Driver's behavior, and piecemeal workarounds like that in [Unix] Go back to only checking the runtime resource path for swiftrt.o swift-driver#1822 can now be eliminated.
  2. The Frontend will now look in the same Swift resource directory for stdlib/corelibs swiftmodules as the swift-driver is looking for runtime libraries and swiftrt.o, eliminating any confusion between the two by centralizing the Swift resource directory lookup here. That already found one bug in the Windows CI, see my other code comment.

However, unlike the C++ Driver, my -sdk code below actually checks if the -sdk path contains a Swift resource directory for the platform triple and does not use the -sdk for this if not, falling back to the aforementioned default next to the compiler in that case. This is because an -sdk is not guaranteed to have a Swift resource directory and may have only a C/C++ sysroot.

We should probably tighten this up to require an explicit -sdk to have a Swift resource directory, with the only exception when an explicit -resource-dir is also specified, but I'm open to debate here. The C++ Driver doesn't even check if the non-Darwin -sdk has a Swift resource directory and simply assumes one is there, we can do a bit better than that.

@finagolfin
Copy link
Member Author

Alright, this tiny pull and the resulting swiftlang/swift-driver#1822 cleanup now pass the linux CI, have no effect on Darwin, and found a seeming bug in the Windows CI. I'm going to test this more in comparison to the C++ Driver and examine more tests to see if I can use it to flush out more cross-compilation bugs with an explicit non-Darwin -sdk.

In the meantime, the basic functionality works and is ready for review. I will add tests once the few remaining smaller design choices mentioned above are hammered out.

@artemcm, @etcwilde, and @compnerd, please take a look: I'm looking for feedback on both this current patch and the remaining issues and questions in my detailed comments above.

@finagolfin finagolfin marked this pull request as ready for review February 27, 2025 09:44
@finagolfin
Copy link
Member Author

swiftlang/swift-driver#1827
@swift-ci please build toolchain

@finagolfin
Copy link
Member Author

swiftlang/swift-driver#1827
@swift-ci please test source compatibility

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

1 similar comment
@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin
Copy link
Member Author

@finagolfin finagolfin marked this pull request as ready for review August 31, 2025 16:47
@finagolfin
Copy link
Member Author

Alright, this is getting close to the finish line, ready for some review and help on the last sticking points.

One of the tests consistently fails on macOS, which appears to be a pre-existing Darwin-specific bug that my test changes surfaced, unrelated to the two compiler changes in this pull because they change nothing when targeting Darwin. Specifically, I modify ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift to copy over a minimal SDK from the just-built compiler build directory and use that instead on linux, as the previous mixed approach won't work for targeting non-Darwin after this pull. However, that confuses the ClangImporter on macOS, as it sees the same shims in the passed in -sdk and the build directory's resource directory and complains:

[2025-08-27T14:35:41.397Z] RUN: at line 33: /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/bin/swift-frontend -target x86_64-apple-macosx13.0  -module-cache-path /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx13.0/clang-module-cache -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk'  -swift-version 4  -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'StdlibDeploymentTarget 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'StdlibDeploymentTarget 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'StdlibDeploymentTarget 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'StdlibDeploymentTarget 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'StdlibDeploymentTarget 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'StdlibDeploymentTarget 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'StdlibDeploymentTarget 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'StdlibDeploymentTarget 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'StdlibDeploymentTarget 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'StdlibDeploymentTarget 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'StdlibDeploymentTarget 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'StdlibDeploymentTarget 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'StdlibDeploymentTarget 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'StdlibDeploymentTarget 6.1:macOS 15.1.1' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'StdlibDeploymentTarget 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftStdlib 6.3:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'StdlibDeploymentTarget 6.3:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.0' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0'  -typo-correction-limit 10  -typecheck -verify -disable-objc-attr-requires-foundation-module /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/swift/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift -sdk /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk -I /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/ -module-cache-path /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/MCP -Xcc -v -dump-clang-diagnostics
[2025-08-27T14:35:41.397Z] + /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/bin/swift-frontend -target x86_64-apple-macosx13.0 -module-cache-path /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx13.0/clang-module-cache -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'StdlibDeploymentTarget 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'StdlibDeploymentTarget 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'StdlibDeploymentTarget 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'StdlibDeploymentTarget 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'StdlibDeploymentTarget 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'StdlibDeploymentTarget 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'StdlibDeploymentTarget 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'StdlibDeploymentTarget 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'StdlibDeploymentTarget 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'StdlibDeploymentTarget 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'StdlibDeploymentTarget 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'StdlibDeploymentTarget 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'StdlibDeploymentTarget 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'StdlibDeploymentTarget 6.1:macOS 15.1.1' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'StdlibDeploymentTarget 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftStdlib 6.3:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'StdlibDeploymentTarget 6.3:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.0' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 26.0, iOS 26.0, watchOS 26.0, tvOS 26.0, visionOS 26.0' -typo-correction-limit 10 -typecheck -verify -disable-objc-attr-requires-foundation-module /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/swift/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift -sdk /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk -I /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/ -module-cache-path /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/MCP -Xcc -v -dump-clang-diagnostics
[2025-08-27T14:35:41.397Z] swift runtime: unknown backtracing setting 'warnings'
[2025-08-27T14:35:41.397Z] clang importer redirected file mappings:
[2025-08-27T14:35:41.397Z] 
[2025-08-27T14:35:41.398Z] clang importer driver args: '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/bin/clang' '-fsyntax-only' '-fblocks' '-D__swift__=40150' '-fretain-comments-from-system-headers' '-isystem' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift' '-fPIC' '-fmodules' '-Xclang' '-fmodule-feature' '-Xclang' 'swift' '-fobjc-arc' '-x' 'objective-c' '-std=gnu11' '-D_ISO646_H_' '-D__ISO646_H' '-DSWIFT_SDK_OVERLAY_APPKIT_EPOCH=2' '-DSWIFT_SDK_OVERLAY_FOUNDATION_EPOCH=8' '-DSWIFT_SDK_OVERLAY2_SCENEKIT_EPOCH=3' '-DSWIFT_SDK_OVERLAY_GAMEPLAYKIT_EPOCH=1' '-DSWIFT_SDK_OVERLAY_SPRITEKIT_EPOCH=1' '-DSWIFT_SDK_OVERLAY_COREIMAGE_EPOCH=2' '-DSWIFT_SDK_OVERLAY_DISPATCH_EPOCH=2' '-DSWIFT_SDK_OVERLAY_PTHREAD_EPOCH=1' '-DSWIFT_SDK_OVERLAY_COREGRAPHICS_EPOCH=0' '-DSWIFT_SDK_OVERLAY_UIKIT_EPOCH=2' '-DSWIFT_CLASS_EXTRA=' '-D__SWIFT_ATTR_SUPPORTS_SENDABLE_DECLS=1' '-D__SWIFT_ATTR_SUPPORTS_SENDING=1' '-isysroot' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk' '-fmodules-cache-path=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/MCP' '-fmodules-validate-system-headers' '-Xclang' '-fmodule-format=obj' '-fapinotes-modules' '-fapinotes-swift-version=4' '-iapinotes-modules' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/apinotes' '-iapinotes-modules' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/apinotes' '-target' 'x86_64-apple-macosx13.0' '<swift-imported-modules>' '-mcx16' '-resource-dir' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang' '-fansi-escape-codes' '-working-directory' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces' '-v' '-I/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/'
[2025-08-27T14:35:41.398Z] 
[2025-08-27T14:35:41.398Z] Apple clang version 17.0.0 (https://github.com/swiftlang/llvm-project.git fa1f889407fc8cab29939ce419c9ee84bfee31fd)
[2025-08-27T14:35:41.398Z] Target: x86_64-apple-macosx13.0
[2025-08-27T14:35:41.398Z] Thread model: posix
[2025-08-27T14:35:41.398Z] InstalledDir: /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/bin
[2025-08-27T14:35:41.398Z] Build config: +assertions
[2025-08-27T14:35:41.398Z] clang importer cc1 args: '-cc1' '-working-directory' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces' '-Wundef-prefix=TARGET_OS_' '-fansi-escape-codes' '-ferror-limit' '19' '-Werror=undef-prefix' '-Wdeprecated-objc-isa-usage' '-Werror=deprecated-objc-isa-usage' '-disable-free' '-fsyntax-only' '-x' 'objective-c' '<swift-imported-modules>' '-tune-cpu' 'generic' '-target-cpu' 'penryn' '-target-feature' '+cx16' '-triple' 'x86_64-apple-macosx13.0.0' '-target-linker-version' '1115.7.3' '-fmodules-validate-system-headers' '-fimplicit-module-maps' '-isysroot' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk' '-resource-dir' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang' '-v' '-fmodule-format=obj' '-fmodules-cache-path=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/MCP' '-I' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/' '-isystem' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift' '-isystem' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/local/include' '-isystem' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang/include' '-internal-externc-isystem' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/include' '-internal-iframework' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/Frameworks' '-internal-iframework' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/SubFrameworks' '-internal-iframework' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/Library/Frameworks' '-fapinotes-swift-version=4' '-iapinotes-modules' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/apinotes' '-iapinotes-modules' '/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/apinotes' '-std=gnu11' '-fapinotes-modules' '-fexceptions' '-fskip-odr-check-in-gmf' '-fmodules' '-fbuiltin-headers-in-system-modules' '-fretain-comments-from-system-headers' '-fobjc-exceptions' '-fmax-type-align=16' '-fvisibility-inlines-hidden-static-local-var' '-fmodule-feature' 'swift' '-pic-level' '2' '-fencode-extended-block-signature' '-stack-protector' '1' '-fcompatibility-qualified-id-block-type-checking' '-fobjc-runtime=macosx-13.0.0' '-fobjc-arc' '-fobjc-runtime-has-weak' '-fobjc-weak' '-fgnuc-version=4.2.1' '-fblocks' '-ffp-contract=on' '-fno-experimental-relative-c++-abi-vtables' '-fno-file-reproducible' '-O0' '-fdebug-compilation-dir=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces' '-fcoverage-compilation-dir=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces' '-fregister-global-dtors-with-atexit' '-debugger-tuning=lldb' '-funwind-tables=2' '-clear-ast-before-backend' '-main-file-name' '<swift-imported-modules>' '-mframe-pointer=all' '-save-temps=obj' '-fdiagnostics-hotness-threshold=0' '-fdiagnostics-misexpect-tolerance=0' '-D' '__swift__=40150' '-D' '_ISO646_H_' '-D' '__ISO646_H' '-D' 'SWIFT_SDK_OVERLAY_APPKIT_EPOCH=2' '-D' 'SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH=8' '-D' 'SWIFT_SDK_OVERLAY2_SCENEKIT_EPOCH=3' '-D' 'SWIFT_SDK_OVERLAY_GAMEPLAYKIT_EPOCH=1' '-D' 'SWIFT_SDK_OVERLAY_SPRITEKIT_EPOCH=1' '-D' 'SWIFT_SDK_OVERLAY_COREIMAGE_EPOCH=2' '-D' 'SWIFT_SDK_OVERLAY_DISPATCH_EPOCH=2' '-D' 'SWIFT_SDK_OVERLAY_PTHREAD_EPOCH=1' '-D' 'SWIFT_SDK_OVERLAY_COREGRAPHICS_EPOCH=0' '-D' 'SWIFT_SDK_OVERLAY_UIKIT_EPOCH=2' '-D' 'SWIFT_CLASS_EXTRA=' '-D' '__SWIFT_ATTR_SUPPORTS_SENDABLE_DECLS=1' '-D' '__SWIFT_ATTR_SUPPORTS_SENDING=1' '-D' '__GCC_HAVE_DWARF2_CFI_ASM=1'
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/local/include"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/Frameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/SubFrameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/Library/Frameworks"
[2025-08-27T14:35:41.398Z] #include "..." search starts here:
[2025-08-27T14:35:41.398Z] #include <...> search starts here:
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang/include
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/include
[2025-08-27T14:35:41.398Z] End of search list.
[2025-08-27T14:35:41.398Z] clang -cc1 version 17.0.0 based upon LLVM 17.0.0 default target x86_64-apple-darwin24.1.0
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/local/include"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/Frameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/SubFrameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/Library/Frameworks"
[2025-08-27T14:35:41.398Z] #include "..." search starts here:
[2025-08-27T14:35:41.398Z] #include <...> search starts here:
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang/include
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/include
[2025-08-27T14:35:41.398Z] End of search list.
[2025-08-27T14:35:41.398Z] clang -cc1 version 17.0.0 based upon LLVM 17.0.0 default target x86_64-apple-darwin24.1.0
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/local/include"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/Frameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/System/Library/SubFrameworks"
[2025-08-27T14:35:41.398Z] ignoring nonexistent directory "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/Library/Frameworks"
[2025-08-27T14:35:41.398Z] #include "..." search starts here:
[2025-08-27T14:35:41.398Z] #include <...> search starts here:
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/clang/include
[2025-08-27T14:35:41.398Z]  /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/include
[2025-08-27T14:35:41.398Z] End of search list.
[2025-08-27T14:35:41.398Z] In file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:32:8: error: redefinition of module 'SwiftOverlayShims'
[2025-08-27T14:35:41.398Z]    32 | module SwiftOverlayShims {
[2025-08-27T14:35:41.398Z]       |        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:32:8: note: previously defined here
[2025-08-27T14:35:41.398Z]    32 | module SwiftOverlayShims {
[2025-08-27T14:35:41.398Z]       |        ^
[2025-08-27T14:35:41.398Z] In file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:37:8: error: redefinition of module '_SynchronizationShims'
[2025-08-27T14:35:41.398Z]    37 | module _SynchronizationShims {
[2025-08-27T14:35:41.398Z]       |        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:37:8: note: previously defined here
[2025-08-27T14:35:41.398Z]    37 | module _SynchronizationShims {
[2025-08-27T14:35:41.398Z]       |        ^
[2025-08-27T14:35:41.398Z] <unknown>:0: error: fatal error encountered while in -verify mode
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/swift/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift:36:8: error: unexpected error produced: failed to build module 'Swifty' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
[2025-08-27T14:35:41.398Z] import Swifty
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] <unknown>:0: error: unexpected error produced: fatal error encountered while in -verify mode
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:1: note: diagnostic produced elsewhere: in file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] extern module SwiftShims             "shims/module.modulemap"
[2025-08-27T14:35:41.398Z] ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:28:8: error: diagnostic produced elsewhere: redefinition of module '_SwiftConcurrencyShims'
[2025-08-27T14:35:41.398Z] module _SwiftConcurrencyShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:28:8: note: diagnostic produced elsewhere: previously defined here
[2025-08-27T14:35:41.398Z] module _SwiftConcurrencyShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:1: note: diagnostic produced elsewhere: in file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] extern module SwiftShims             "shims/module.modulemap"
[2025-08-27T14:35:41.398Z] ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:32:8: error: diagnostic produced elsewhere: redefinition of module 'SwiftOverlayShims'
[2025-08-27T14:35:41.398Z] module SwiftOverlayShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:32:8: note: diagnostic produced elsewhere: previously defined here
[2025-08-27T14:35:41.398Z] module SwiftOverlayShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:1: note: diagnostic produced elsewhere: in file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] extern module SwiftShims             "shims/module.modulemap"
[2025-08-27T14:35:41.398Z] ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:37:8: error: diagnostic produced elsewhere: redefinition of module '_SynchronizationShims'
[2025-08-27T14:35:41.398Z] module _SynchronizationShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:37:8: note: diagnostic produced elsewhere: previously defined here
[2025-08-27T14:35:41.398Z] module _SynchronizationShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:1: note: diagnostic produced elsewhere: in file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] extern module SwiftShims             "shims/module.modulemap"
[2025-08-27T14:35:41.398Z] ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:28:8: error: diagnostic produced elsewhere: redefinition of module '_SwiftConcurrencyShims'
[2025-08-27T14:35:41.398Z] module _SwiftConcurrencyShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:28:8: note: diagnostic produced elsewhere: previously defined here
[2025-08-27T14:35:41.398Z] module _SwiftConcurrencyShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:1: note: diagnostic produced elsewhere: in file included from /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/module.modulemap:1:
[2025-08-27T14:35:41.398Z] extern module SwiftShims             "shims/module.modulemap"
[2025-08-27T14:35:41.398Z] ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/shims/module.modulemap:32:8: error: diagnostic produced elsewhere: redefinition of module 'SwiftOverlayShims'
[2025-08-27T14:35:41.398Z] module SwiftOverlayShims {
[2025-08-27T14:35:41.398Z]        ^
[2025-08-27T14:35:41.398Z] /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test@2/branch-main/build/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/ModuleInterface/swift_build_sdk_interfaces/Output/track-system-dependencies.swift.tmp/sdk/usr/lib/swift/shims/module.modulemap:32:8: note: diagnostic produced elsewhere: previously defined here

@beccadax, I notice you added some extra shims checking in the ClangImporter before in #23287, which doesn't appear to have anything to do with this bug, but I wonder if you have any suggestions as a result.

The Windows CI got pretty far, but fails with a cryptic error when trying to run the XCTest tests:

[0/1][  0%][0.029s] Running XCTest functional test suite
no such file or directory
FAILED: CMakeFiles/check-xctest T:/x86_64-unknown-windows-msvc/XCTest/CMakeFiles/check-xctest 
C:\Windows\system32\cmd.exe /C "cd /D T:\x86_64-unknown-windows-msvc\XCTest && "C:\Program Files\CMake\bin\cmake.exe" -E env BUILT_PRODUCTS_DIR=T:/x86_64-unknown-windows-msvc/XCTest FOUNDATION_BUILT_PRODUCTS_DIR=T:/x86_64-unknown-windows-msvc/DynamicFoundation LIBDISPATCH_SRC_DIR=C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift-corelibs-libdispatch LIBDISPATCH_BUILD_DIR=T:/x86_64-unknown-windows-msvc/Dispatch LIBDISPATCH_OVERLAY_DIR=T:/x86_64-unknown-windows-msvc/Dispatch/src/swift SWIFT_EXEC=T:/5/bin/swiftc.exe SWIFT_FLAGS=-sdk "T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" -gnone -Xlinker /INCREMENTAL:NO -Xlinker /OPT:REF -Xlinker /OPT:ICF -v "C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python39_64/python.exe" T:/x86_64-unknown-windows-msvc/LLVM/./bin/llvm-lit.py -sv C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift-corelibs-xctest/Tests/Functional"
ninja: build stopped: subcommand failed.
Error: Error: cmake.exe exited with code 1.
Invocation:
  C:\Program Files\CMake\bin\cmake.exe --build T:\x86_64-unknown-windows-msvc\XCTest --target check-xctest

Previously, it failed when building, so I noticed that it was the one build that was special-cased not to use the just-built Windows Swift SDK and I just switched it over to use it and remove the VFS flags it alone was using, only for it to fail when running the tests now.

@compnerd, I notice you special-cased this Test-XCTest function alone last month: is this why, ie you were avoiding this same check-xctest error? Let me know if you know what's going on there and what you think of this pull, now that it's close to passing the CI.

@compnerd
Copy link
Member

compnerd commented Sep 2, 2025

@compnerd, I notice you special-cased this Test-XCTest function alone last month: is this why, ie you were avoiding this same check-xctest error? Let me know if you know what's going on there and what you think of this pull, now that it's close to passing the CI.

Hmm, I don't remember the full details of how the problem surfaced. I am hesitant to say that is the case though as build.ps1 wouldn't impact the Darwin builds. I think that there was something with missing flags in the test invocations and this felt more expedient/targeted and smaller. It is possible that I noticed a similar issue on Windows as on Darwin?

@finagolfin
Copy link
Member Author

@compnerd, those are two completely different CI errors, one for mac and another for Windows. There is no connection between them, I just raised them both in the same comment. I'll try isolating the XCTest testing issue alone in a separate pull and see what the error is when switching it to the SDK build without the compiler changes here, ie why you special-cased it previously.

@finagolfin
Copy link
Member Author

… non-Darwin platform runtime libraries and modules too

as done originally in swiftlang#25990 with the legacy C++ Driver, but since lost in the new swift-driver. Only difference
is this checks if a Swift resource directory exists in `-sdk` and falls back to the default if not.
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.

This driver no longer looks in a passed-in -sdk for the Swift modules and libraries
4 participants