From be49f444a90583f834b65934f032a6298a15033b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 22 Jul 2020 18:40:19 -0700 Subject: [PATCH] repair build after #32903 Repair the Windows build after #32903 --- test/ScanDependencies/can_import_with_map.swift | 4 ++-- .../explicit-module-map-forwarding-module.swift | 4 ++-- test/ScanDependencies/explicit-module-map.swift | 4 ++-- test/lit.cfg | 16 ++++++++++------ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/test/ScanDependencies/can_import_with_map.swift b/test/ScanDependencies/can_import_with_map.swift index 42bd4d1c38efc..80b28e97274f0 100644 --- a/test/ScanDependencies/can_import_with_map.swift +++ b/test/ScanDependencies/can_import_with_map.swift @@ -12,11 +12,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"," >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"," >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-frontend -typecheck %s -explicit-swift-module-map-file %t/inputs/map.json -disable-implicit-swift-modules diff --git a/test/ScanDependencies/explicit-module-map-forwarding-module.swift b/test/ScanDependencies/explicit-module-map-forwarding-module.swift index 1e2a7ec047661..58f439c70ef71 100644 --- a/test/ScanDependencies/explicit-module-map-forwarding-module.swift +++ b/test/ScanDependencies/explicit-module-map-forwarding-module.swift @@ -22,11 +22,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"," >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"," >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s diff --git a/test/ScanDependencies/explicit-module-map.swift b/test/ScanDependencies/explicit-module-map.swift index 401014da2d894..5043ac3cc50da 100644 --- a/test/ScanDependencies/explicit-module-map.swift +++ b/test/ScanDependencies/explicit-module-map.swift @@ -13,11 +13,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"," >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"," >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s diff --git a/test/lit.cfg b/test/lit.cfg index e6973ebf5ae1e..30aac4f745a81 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1441,23 +1441,27 @@ config.substitutions.append(('%target-sdk-name', config.target_sdk_name)) # Add 'stdlib_dir' as the path to the stdlib resource directory stdlib_dir = config.swift_lib_dir + "/swift/" -if platform.system() == 'Linux': - stdlib_dir += config.target_sdk_name + "/" + run_cpu -else: +if platform.system() == 'Darwin': stdlib_dir += config.target_sdk_name +else: + stdlib_dir += config.target_sdk_name + "/" + run_cpu config.substitutions.append(('%stdlib_dir', stdlib_dir)) # Add 'stdlib_module' as the path to the stdlib .swiftmodule file -stdlib_module = stdlib_dir + "/Swift.swiftmodule" +stdlib_module = os.path.join(stdlib_dir, "Swift.swiftmodule") if platform.system() == 'Darwin': stdlib_module += "/" + target_specific_module_triple + ".swiftmodule" config.substitutions.append(('%stdlib_module', stdlib_module)) +config.substitutions.append(('%/stdlib_module', + '/'.join(os.path.normpath(stdlib_module).split(os.sep)))) # Add 'ononesupport_module' as the path to the SwiftOnoneSupport .swiftmodule file -ononesupport_module = stdlib_dir + "/SwiftOnoneSupport.swiftmodule" +ononesupport_module = os.path.join(stdlib_dir, "SwiftOnoneSupport.swiftmodule") if platform.system() == 'Darwin': ononesupport_module += "/" + target_specific_module_triple + ".swiftmodule" -config.substitutions.append(('%ononesupport_module', ononesupport_module)) +config.substitutions.append(('%ononesupport_module', ononesupport_module)) +config.substitutions.append(('%/ononesupport_module', + '/'.join(os.path.normpath(ononesupport_module).split(os.sep)))) # Different OS's require different prefixes for the environment variables to be # propagated to the calling contexts.