@@ -727,11 +727,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
727
727
728
728
/// Test the libSwiftScan dependency scanning.
729
729
func testDependencyScanning( ) throws {
730
- #if os(macOS) && arch(arm64)
731
- // Temporarily disabled on Apple Silicon
732
- throw XCTSkip ( )
733
- #endif
734
- let ( stdLibPath, shimsPath, toolchain, hostTriple) = try getDriverArtifactsForScanning ( )
730
+ let ( _, _, toolchain, hostTriple) = try getDriverArtifactsForScanning ( )
735
731
736
732
// The dependency oracle wraps an instance of libSwiftScan and ensures thread safety across
737
733
// queries.
@@ -760,12 +756,22 @@ final class ExplicitModuleBuildTests: XCTestCase {
760
756
let cHeadersPath : String = testInputsPath + " /ExplicitModuleBuilds/CHeaders "
761
757
let swiftModuleInterfacesPath : String = testInputsPath + " /ExplicitModuleBuilds/Swift "
762
758
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
763
- let scannerCommand = [ " -scan-dependencies " ,
764
- " -I " , cHeadersPath,
765
- " -I " , swiftModuleInterfacesPath,
766
- " -I " , stdLibPath. description,
767
- " -I " , shimsPath. description,
768
- main. pathString] + sdkArgumentsForTesting
759
+ var driver = try Driver ( args: [ " swiftc " ,
760
+ " -I " , cHeadersPath,
761
+ " -I " , swiftModuleInterfacesPath,
762
+ " -experimental-explicit-module-build " ,
763
+ " -working-directory " , path. pathString,
764
+ " -disable-clang-target " ,
765
+ main. pathString] + sdkArgumentsForTesting,
766
+ env: ProcessEnv . vars)
767
+ let resolver = try ArgsResolver ( fileSystem: localFileSystem)
768
+ var scannerCommand = try driver. dependencyScannerInvocationCommand ( ) . 1 . map { try resolver. resolve ( $0) }
769
+ // We generate full swiftc -frontend -scan-dependencies invocations in order to also be
770
+ // able to launch them as standalone jobs. Frontend's argument parser won't recognize
771
+ // -frontend when passed directly via libSwiftScan.
772
+ if scannerCommand. first == " -frontend " {
773
+ scannerCommand. removeFirst ( )
774
+ }
769
775
770
776
// Here purely to dump diagnostic output in a reasonable fashion when things go wrong.
771
777
let lock = NSLock ( )
@@ -815,7 +821,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
815
821
816
822
/// Test the libSwiftScan dependency scanning.
817
823
func testDependencyScanReuseCache( ) throws {
818
- let ( stdLibPath , shimsPath , toolchain, hostTriple) = try getDriverArtifactsForScanning ( )
824
+ let ( _ , _ , toolchain, hostTriple) = try getDriverArtifactsForScanning ( )
819
825
try withTemporaryDirectory { path in
820
826
let cacheSavePath = path. appending ( component: " saved.moddepcache " )
821
827
let main = path. appending ( component: " testDependencyScanning.swift " )
@@ -830,13 +836,22 @@ final class ExplicitModuleBuildTests: XCTestCase {
830
836
let cHeadersPath : String = testInputsPath + " /ExplicitModuleBuilds/CHeaders "
831
837
let swiftModuleInterfacesPath : String = testInputsPath + " /ExplicitModuleBuilds/Swift "
832
838
let sdkArgumentsForTesting = ( try ? Driver . sdkArgumentsForTesting ( ) ) ?? [ ]
833
- let scannerCommand = [ " -scan-dependencies " ,
834
- " -disable-implicit-concurrency-module-import " ,
835
- " -I " , cHeadersPath,
836
- " -I " , swiftModuleInterfacesPath,
837
- " -I " , stdLibPath. description,
838
- " -I " , shimsPath. description,
839
- main. pathString] + sdkArgumentsForTesting
839
+ var driver = try Driver ( args: [ " swiftc " ,
840
+ " -I " , cHeadersPath,
841
+ " -I " , swiftModuleInterfacesPath,
842
+ " -experimental-explicit-module-build " ,
843
+ " -working-directory " , path. pathString,
844
+ " -disable-clang-target " ,
845
+ main. pathString] + sdkArgumentsForTesting,
846
+ env: ProcessEnv . vars)
847
+ let resolver = try ArgsResolver ( fileSystem: localFileSystem)
848
+ var scannerCommand = try driver. dependencyScannerInvocationCommand ( ) . 1 . map { try resolver. resolve ( $0) }
849
+ // We generate full swiftc -frontend -scan-dependencies invocations in order to also be
850
+ // able to launch them as standalone jobs. Frontend's argument parser won't recognize
851
+ // -frontend when passed directly via libSwiftScan.
852
+ if scannerCommand. first == " -frontend " {
853
+ scannerCommand. removeFirst ( )
854
+ }
840
855
841
856
let scanLibPath = try Driver . getScanLibPath ( of: toolchain,
842
857
hostTriple: hostTriple,
0 commit comments