diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index 76c2da0a656af..38c40106388b7 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -98,6 +98,7 @@ let "autolink-driver" "compiler" # "clang-builtin-headers" + "libexec" "stdlib" "sdk-overlay" "static-mirror-lib" @@ -142,9 +143,9 @@ let # Create a tool used during the build to create a custom swift wrapper for # each of the swift executables produced by the build. # - # The build produces several `swift-frontend` executables during - # bootstrapping. Each of these has numerous aliases via symlinks, and the - # executable uses $0 to detect what tool is called. + # The build produces a `swift-frontend` executable per bootstrap stage. Each + # of these has one or more aliases via symlinks, and the executable uses $0 + # to detect what tool is called. wrapperParams = { inherit bintools; default_cc_wrapper = clang; # Instead of `@out@` in the original. @@ -153,7 +154,7 @@ let suffixSalt = lib.replaceStrings ["-" "."] ["_" "_"] targetPlatform.config; use_response_file_by_default = 1; swiftDriver = ""; - # NOTE: @prog@ needs to be filled elsewhere. + # NOTE: @prog@ and @progName@ need to be filled elsewhere. }; swiftWrapper = runCommand "swift-wrapper.sh" wrapperParams '' substituteAll '${../wrapper/wrapper.sh}' "$out" @@ -167,7 +168,7 @@ let mv "$targetFile" "$unwrappedSwift" sed < '${swiftWrapper}' > "$targetFile" \ -e "s|@prog@|'$unwrappedSwift'|g" \ - -e 's|exec "$prog"|exec -a "$0" "$prog"|g' + -e 's|@progName@|"$0"|g' chmod a+x "$targetFile" ''; @@ -254,7 +255,7 @@ in stdenv.mkDerivation { mkdir src cd src - ${copySource "swift-cmark"} + ${copySource "cmark"} ${copySource "llvm-project"} ${copySource "swift"} ${copySource "swift-experimental-string-processing"} @@ -278,7 +279,6 @@ in stdenv.mkDerivation { -e 's|/bin/cp|${coreutils}/bin/cp|g' \ -e 's|/usr/bin/file|${file}/bin/file|g' - patch -p1 -d swift -i ${./patches/swift-cmake-3.25-compat.patch} patch -p1 -d swift -i ${./patches/swift-wrap.patch} patch -p1 -d swift -i ${./patches/swift-nix-resource-root.patch} patch -p1 -d swift -i ${./patches/swift-linux-fix-libc-paths.patch} @@ -300,23 +300,13 @@ in stdenv.mkDerivation { substituteAll ${./patches/swift-separate-lib.patch} $TMPDIR/swift-separate-lib.patch patch -p1 -d swift -i $TMPDIR/swift-separate-lib.patch + patch -p1 -d llvm-project -i ${./patches/lldb-build-fix.patch} + patch -p1 -d llvm-project/llvm -i ${./patches/llvm-module-cache.patch} patch -p1 -d llvm-project/clang -i ${./patches/clang-toolchain-dir.patch} patch -p1 -d llvm-project/clang -i ${./patches/clang-wrap.patch} - patch -p1 -d llvm-project/clang -i ${../../llvm/14/clang/purity.patch} - patch -p2 -d llvm-project/clang -i ${fetchpatch { - name = "clang-cmake-fix-interpreter.patch"; - url = "https://github.com/llvm/llvm-project/commit/b5eaf500f2441eff2277ea2973878fb1f171fd0a.patch"; - sha256 = "1rma1al0rbm3s3ql6bnvbcighp74lri1lcrwbyacgdqp80fgw1b6"; - }} - - # gcc-13 build fixes - patch -p2 -d llvm-project/llvm -i ${fetchpatch { - name = "gcc-13.patch"; - url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; - hash = "sha256-nkRPWx8gNvYr7mlvEUiOAb1rTrf+skCZjAydJVUHrcI="; - }} + patch -p1 -d llvm-project/clang -i ${../../llvm/15/clang/purity.patch} ${lib.optionalString stdenv.isLinux '' substituteInPlace llvm-project/clang/lib/Driver/ToolChains/Linux.cpp \ @@ -406,7 +396,7 @@ in stdenv.mkDerivation { } cmakeFlags="-GNinja" - buildProject swift-cmark + buildProject cmark # Some notes: # - The Swift build just needs Clang. @@ -425,8 +415,7 @@ in stdenv.mkDerivation { # Add appleSwiftCore to the search paths. We can't simply add it to # buildInputs, because it is potentially an older stdlib than the one we're # building. We have to remove it again after the main Swift build, or later - # build steps may fail. (Specific case: Concurrency backdeploy uses the - # Sendable protocol, which appears to not be present in the macOS 11 SDK.) + # build steps may fail. OLD_NIX_SWIFTFLAGS_COMPILE="$NIX_SWIFTFLAGS_COMPILE" OLD_NIX_LDFLAGS="$NIX_LDFLAGS" export NIX_SWIFTFLAGS_COMPILE+=" -I ${appleSwiftCore}/lib/swift" @@ -450,12 +439,16 @@ in stdenv.mkDerivation { -DBOOTSTRAPPING_MODE=BOOTSTRAPPING${lib.optionalString stdenv.isDarwin "-WITH-HOSTLIBS"} -DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=ON -DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=ON + -DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=ON -DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=ON -DSWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=ON + -DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=ON + -DSWIFT_ENABLE_BACKTRACING=ON + -DSWIFT_BUILD_LIBEXEC=${if stdenv.isDarwin then "ON" else "OFF"} -DLLVM_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/llvm -DClang_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/clang - -DSWIFT_PATH_TO_CMARK_SOURCE=$SWIFT_SOURCE_ROOT/swift-cmark - -DSWIFT_PATH_TO_CMARK_BUILD=$SWIFT_BUILD_ROOT/swift-cmark + -DSWIFT_PATH_TO_CMARK_SOURCE=$SWIFT_SOURCE_ROOT/cmark + -DSWIFT_PATH_TO_CMARK_BUILD=$SWIFT_BUILD_ROOT/cmark -DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=$SWIFT_SOURCE_ROOT/swift-corelibs-libdispatch -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=$SWIFT_SOURCE_ROOT/swift-syntax -DSWIFT_PATH_TO_STRING_PROCESSING_SOURCE=$SWIFT_SOURCE_ROOT/swift-experimental-string-processing @@ -506,75 +499,6 @@ in stdenv.mkDerivation { -DPANEL_LIBRARIES=${ncurses}/lib/libpanel${stdenv.hostPlatform.extensions.sharedLibrary} "; buildProject lldb llvm-project/lldb - - ${lib.optionalString stdenv.isDarwin '' - # Need to do a standalone build of concurrency for Darwin back deployment. - # Based on: utils/swift_build_support/swift_build_support/products/backdeployconcurrency.py - cmakeFlags=" - -GNinja - -DCMAKE_Swift_COMPILER=$SWIFT_BUILD_ROOT/swift/bin/swiftc - -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE=$SWIFT_SOURCE_ROOT/swift-syntax - - -DTOOLCHAIN_DIR=/var/empty - -DSWIFT_NATIVE_LLVM_TOOLS_PATH=${stdenv.cc}/bin - -DSWIFT_NATIVE_CLANG_TOOLS_PATH=${stdenv.cc}/bin - -DSWIFT_NATIVE_SWIFT_TOOLS_PATH=$SWIFT_BUILD_ROOT/swift/bin - - -DCMAKE_CROSSCOMPILING=ON - - -DBUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES=ON - -DSWIFT_INCLUDE_TOOLS=OFF - -DSWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT=OFF - -DSWIFT_BUILD_TEST_SUPPORT_MODULES=OFF - -DSWIFT_BUILD_STDLIB=OFF - -DSWIFT_BUILD_DYNAMIC_STDLIB=OFF - -DSWIFT_BUILD_STATIC_STDLIB=OFF - -DSWIFT_BUILD_REMOTE_MIRROR=OFF - -DSWIFT_BUILD_SDK_OVERLAY=OFF - -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=OFF - -DSWIFT_BUILD_STATIC_SDK_OVERLAY=OFF - -DSWIFT_INCLUDE_TESTS=OFF - -DSWIFT_BUILD_PERF_TESTSUITE=OFF - - -DSWIFT_HOST_VARIANT_ARCH=${swiftArch} - -DBUILD_STANDALONE=ON - - -DSWIFT_INSTALL_COMPONENTS=back-deployment - - -DSWIFT_SDKS=${{ - "macos" = "OSX"; - "ios" = "IOS"; - #IOS_SIMULATOR - #TVOS - #TVOS_SIMULATOR - #WATCHOS - #WATCHOS_SIMULATOR - }.${targetPlatform.darwinPlatform}} - - -DLLVM_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/llvm - - -DSWIFT_DEST_ROOT=$out - -DSWIFT_HOST_VARIANT_SDK=OSX - - -DSWIFT_DARWIN_DEPLOYMENT_VERSION_OSX=10.15 - -DSWIFT_DARWIN_DEPLOYMENT_VERSION_IOS=13.0 - -DSWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST=13.0 - -DSWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS=13.0 - -DSWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS=6.0 - " - - # This depends on the special Clang build specific to the Swift branch. - # We also need to call a specific Ninja target. - export CC=$SWIFT_BUILD_ROOT/llvm/bin/clang - export CXX=$SWIFT_BUILD_ROOT/llvm/bin/clang++ - ninjaFlags="back-deployment" - - buildProject swift-concurrency-backdeploy swift - - export CC=$NIX_CC/bin/clang - export CXX=$NIX_CC/bin/clang++ - unset ninjaFlags - ''} ''; # TODO: ~50 failing tests on x86_64-linux. Other platforms not checked. @@ -592,7 +516,7 @@ in stdenv.mkDerivation { # Undo the clang and swift wrapping we did for the build. # (This happened via patches to cmake files.) cd $SWIFT_BUILD_ROOT - mv llvm/bin/clang-15{-unwrapped,} + mv llvm/bin/clang-16{-unwrapped,} mv swift/bin/swift-frontend{-unwrapped,} mkdir $out $lib @@ -611,13 +535,6 @@ in stdenv.mkDerivation { cd $SWIFT_BUILD_ROOT/swift ninjaInstallPhase - ${lib.optionalString stdenv.isDarwin '' - cd $SWIFT_BUILD_ROOT/swift-concurrency-backdeploy - installTargets=install-back-deployment - ninjaInstallPhase - unset installTargets - ''} - # Separate $lib output here, because specific logic follows. # Only move the dynamic run-time parts, to keep $lib small. Every Swift # build will depend on it. diff --git a/pkgs/development/compilers/swift/compiler/patches/lldb-build-fix.patch b/pkgs/development/compilers/swift/compiler/patches/lldb-build-fix.patch new file mode 100644 index 0000000000000..ca6add4fd51c3 --- /dev/null +++ b/pkgs/development/compilers/swift/compiler/patches/lldb-build-fix.patch @@ -0,0 +1,10 @@ +--- a/cmake/Modules/FindLibEdit.cmake ++++ b/cmake/Modules/FindLibEdit.cmake +@@ -19,6 +19,7 @@ pkg_check_modules(PC_LIBEDIT QUIET libedit) + find_path(LibEdit_INCLUDE_DIRS NAMES histedit.h HINTS ${PC_LIBEDIT_INCLUDE_DIRS}) + find_library(LibEdit_LIBRARIES NAMES edit HINTS ${PC_LIBEDIT_LIBRARY_DIRS}) + ++include(CMakePushCheckState) + include(CheckIncludeFile) + if(LibEdit_INCLUDE_DIRS AND EXISTS "${LibEdit_INCLUDE_DIRS}/histedit.h") + cmake_push_check_state() diff --git a/pkgs/development/compilers/swift/compiler/patches/swift-cmake-3.25-compat.patch b/pkgs/development/compilers/swift/compiler/patches/swift-cmake-3.25-compat.patch deleted file mode 100644 index 83c8d95984ffc..0000000000000 --- a/pkgs/development/compilers/swift/compiler/patches/swift-cmake-3.25-compat.patch +++ /dev/null @@ -1,1509 +0,0 @@ -Upstream PR: https://github.com/apple/swift/pull/65534 - -commit 112681f7f5927588569b225d926ca9f5f9ec98b3 -Author: Stéphan Kochen -Date: Sat Apr 29 20:34:40 2023 +0200 - - build: fix accidental cmake expansions - - As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`, - etc. These conflict with expressions that used these names as unquoted - strings in positions where CMake accepts 'variable|string', for example: - - - `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and - expands to 1, where it would previously coerce to a string. - - - `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the - left-hand side expands twice. - - In this patch, I looked for a number of patterns to fix up, sometimes a - little defensively: - - - Quoted right-hand side of `STREQUAL` where I was confident it was - intended to be a string literal. - - - Removed manual variable expansion on left-hand side of `STREQUAL`, - `MATCHES` and `IN_LIST` where I was confident it was unintended. - - Fixes #65028. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index eaab71fbaf0..45aa5d65dd3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -119,7 +119,7 @@ else() - if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64") - set(SWIFT_HOST_VARIANT_ARCH_default "x86_64") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64") -- if(SWIFT_HOST_VARIANT_SDK_default STREQUAL OSX) -+ if(SWIFT_HOST_VARIANT_SDK_default STREQUAL "OSX") - set(SWIFT_HOST_VARIANT_ARCH_default "arm64") - else() - set(SWIFT_HOST_VARIANT_ARCH_default "aarch64") -@@ -336,7 +336,7 @@ set(SWIFT_STDLIB_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING - # - MultiThreadedDebug (/MTd) - # - MultiThreadedDLL (/MD) - # - MultiThreadedDebugDLL (/MDd) --if(CMAKE_BUILD_TYPE STREQUAL Debug) -+if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY_default MultiThreadedDebugDLL) - else() - set(SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY_default MultiThreadedDLL) -@@ -598,7 +598,7 @@ if(SWIFT_BUILT_STANDALONE) - project(Swift C CXX ASM) - endif() - --if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL MSVC) -+if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL "MSVC") - include(ClangClCompileRules) - elseif(UNIX) - include(UnixCompileRules) -@@ -627,7 +627,7 @@ if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY AND "${SWIFT_CONCURRENCY_GLOBAL_EXECUTO - endif() - - set(SWIFT_BUILD_HOST_DISPATCH FALSE) --if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # Only build libdispatch for the host if the host tools are being built and - # specifically if these two libraries that depend on it are built. - if(SWIFT_INCLUDE_TOOLS AND SWIFT_BUILD_SOURCEKIT) -@@ -801,11 +801,11 @@ endif() - # build environment. - if(LLVM_USE_LINKER) - set(SWIFT_USE_LINKER_default "${LLVM_USE_LINKER}") --elseif(${SWIFT_HOST_VARIANT_SDK} STREQUAL ANDROID) -+elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") - set(SWIFT_USE_LINKER_default "lld") --elseif(CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) -+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(SWIFT_USE_LINKER_default "lld") --elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(SWIFT_USE_LINKER_default "") - else() - set(SWIFT_USE_LINKER_default "gold") -diff --git a/SwiftCompilerSources/CMakeLists.txt b/SwiftCompilerSources/CMakeLists.txt -index 225e72663a1..d14e0ccecac 100644 ---- a/SwiftCompilerSources/CMakeLists.txt -+++ b/SwiftCompilerSources/CMakeLists.txt -@@ -80,7 +80,7 @@ function(add_swift_compiler_modules_library name) - list(APPEND swift_compile_options "-Xfrontend" "-disable-implicit-string-processing-module-import") - endif() - -- if(CMAKE_BUILD_TYPE STREQUAL Debug) -+ if(CMAKE_BUILD_TYPE STREQUAL "Debug") - list(APPEND swift_compile_options "-g") - else() - list(APPEND swift_compile_options "-O" "-cross-module-optimization") -@@ -98,7 +98,7 @@ function(add_swift_compiler_modules_library name) - set(deployment_version "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}") - set(sdk_path "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}") - set(sdk_option "-sdk" "${sdk_path}") -- if(${BOOTSTRAPPING_MODE} STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS") -+ if(BOOTSTRAPPING_MODE STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS") - # Let the cross-compiled compile don't pick up the compiled stdlib by providing - # an (almost) empty resource dir. - # The compiler will instead pick up the stdlib from the SDK. -@@ -117,7 +117,7 @@ function(add_swift_compiler_modules_library name) - message(ERROR "libc++ not found in the toolchain.") - endif() - endif() -- elseif(${BOOTSTRAPPING_MODE} STREQUAL "CROSSCOMPILE") -+ elseif(BOOTSTRAPPING_MODE STREQUAL "CROSSCOMPILE") - set(sdk_option "-sdk" "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}") - get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY) - set(sdk_option ${sdk_option} "-resource-dir" "${swift_exec_bin_dir}/../lib/swift") -@@ -253,13 +253,13 @@ else() - add_dependencies(importedHeaderDependencies swift-ast-generated-headers) - target_include_directories(importedHeaderDependencies PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../include/swift") - -- if(${BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE") -+ if(BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|CROSSCOMPILE") - - if (NOT SWIFT_EXEC_FOR_SWIFT_MODULES) - message(FATAL_ERROR "Need a swift toolchain building swift compiler sources") - endif() - -- if(${BOOTSTRAPPING_MODE} STREQUAL "HOSTTOOLS") -+ if(BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS") - if(NOT SWIFT_EXEC_FOR_SWIFT_MODULES STREQUAL CMAKE_Swift_COMPILER) - message(FATAL_ERROR "The Swift compiler (${CMAKE_Swift_COMPILER}) differs from the Swift compiler in SWIFT_NATIVE_SWIFT_TOOLS_PATH (${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc).") - endif() -@@ -275,11 +275,11 @@ else() - add_swift_compiler_modules_library(swiftCompilerModules - SWIFT_EXEC "${SWIFT_EXEC_FOR_SWIFT_MODULES}") - -- elseif(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") -+ elseif(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - - set(b0_deps swift-frontend-bootstrapping0 symlink-headers-bootstrapping0) - set(b1_deps swift-frontend-bootstrapping1 symlink-headers-bootstrapping1) -- if(${BOOTSTRAPPING_MODE} STREQUAL "BOOTSTRAPPING") -+ if(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING") - list(APPEND b0_deps swiftCore-bootstrapping0) - list(APPEND b1_deps swiftCore-bootstrapping1) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") -@@ -290,7 +290,7 @@ else() - list(APPEND b0_deps swiftDarwin-bootstrapping0) - list(APPEND b1_deps swiftDarwin-bootstrapping1) - endif() -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_LIBSTDCXX_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_LIBSTDCXX_PLATFORMS) - list(APPEND b0_deps copy-libstdcxx-modulemap-bootstrapping0 copy-libstdcxx-header-bootstrapping0) - list(APPEND b1_deps copy-libstdcxx-modulemap-bootstrapping1 copy-libstdcxx-header-bootstrapping1) - endif() -diff --git a/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake b/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake -index dd989efe618..3ed37754214 100644 ---- a/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake -+++ b/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake -@@ -21,7 +21,7 @@ macro(configure_build) - # thus allowing the --host-cc build-script argument to work here. - get_filename_component(c_compiler ${CMAKE_C_COMPILER} NAME) - -- if(${c_compiler} STREQUAL "clang") -+ if(c_compiler STREQUAL "clang") - set(CLANG_EXEC ${CMAKE_C_COMPILER}) - else() - if(NOT SWIFT_DARWIN_XCRUN_TOOLCHAIN) -@@ -713,7 +713,7 @@ function(swift_benchmark_compile) - - if(NOT SWIFT_BENCHMARK_BUILT_STANDALONE) - set(stdlib_dependencies "swift-frontend" "swiftCore-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}") -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - list(APPEND stdlib_dependencies "swiftDarwin-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}") - endif() - foreach(stdlib_dependency ${UNIVERSAL_LIBRARY_NAMES_${SWIFT_BENCHMARK_COMPILE_PLATFORM}}) -diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake -index 58c7eb1bd4f..96c4fe804f9 100644 ---- a/cmake/modules/AddSwift.cmake -+++ b/cmake/modules/AddSwift.cmake -@@ -63,16 +63,16 @@ function(_set_target_prefix_and_suffix target kind sdk) - precondition(kind MESSAGE "kind is required") - precondition(sdk MESSAGE "sdk is required") - -- if(${sdk} STREQUAL ANDROID) -- if(${kind} STREQUAL STATIC) -+ if(sdk STREQUAL "ANDROID") -+ if(kind STREQUAL "STATIC") - set_target_properties(${target} PROPERTIES PREFIX "lib" SUFFIX ".a") -- elseif(${kind} STREQUAL SHARED) -+ elseif(kind STREQUAL "SHARED") - set_target_properties(${target} PROPERTIES PREFIX "lib" SUFFIX ".so") - endif() -- elseif(${sdk} STREQUAL WINDOWS) -- if(${kind} STREQUAL STATIC) -+ elseif(sdk STREQUAL "WINDOWS") -+ if(kind STREQUAL "STATIC") - set_target_properties(${target} PROPERTIES PREFIX "" SUFFIX ".lib") -- elseif(${kind} STREQUAL SHARED) -+ elseif(kind STREQUAL "SHARED") - set_target_properties(${target} PROPERTIES PREFIX "" SUFFIX ".dll") - endif() - endif() -@@ -115,7 +115,7 @@ function(_add_host_variant_c_compile_link_flags name) - set(DEPLOYMENT_VERSION "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}") - endif() - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") - set(DEPLOYMENT_VERSION ${SWIFT_ANDROID_API_LEVEL}) - endif() - -@@ -151,7 +151,7 @@ function(_add_host_variant_c_compile_link_flags name) - target_compile_options(${name} PRIVATE $<$:--sysroot=${_sysroot}>) - endif() - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") - # Make sure the Android NDK lld is used. - swift_android_tools_path(${SWIFT_HOST_VARIANT_ARCH} tools_path) - target_compile_options(${name} PRIVATE $<$:-B${tools_path}>) -@@ -223,7 +223,7 @@ function(_add_host_variant_c_compile_flags target) - endif() - endif() - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - # MSVC/clang-cl don't support -fno-pic or -fms-compatibility-version. - if(NOT SWIFT_COMPILER_IS_MSVC_LIKE) - target_compile_options(${target} PRIVATE -@@ -276,14 +276,14 @@ function(_add_host_variant_c_compile_flags target) - # NOTE(compnerd) workaround LLVM invoking `add_definitions(-D_DEBUG)` which - # causes failures for the runtime library when cross-compiling due to - # undefined symbols from the standard library. -- if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) -+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - target_compile_options(${target} PRIVATE - $<$:-U_DEBUG>) - endif() - endif() - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID) -- if(SWIFT_HOST_VARIANT_ARCH STREQUAL x86_64) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") -+ if(SWIFT_HOST_VARIANT_ARCH STREQUAL "x86_64") - # NOTE(compnerd) Android NDK 21 or lower will generate library calls to - # `__sync_val_compare_and_swap_16` rather than lowering to the CPU's - # `cmpxchg16b` instruction as the `cx16` feature is disabled due to a bug -@@ -317,15 +317,15 @@ function(_add_host_variant_c_compile_flags target) - $<$:-fprofile-instr-generate -fcoverage-mapping>) - endif() - -- if((SWIFT_HOST_VARIANT_ARCH STREQUAL armv7 OR -- SWIFT_HOST_VARIANT_ARCH STREQUAL aarch64) AND -- (SWIFT_HOST_VARIANT_SDK STREQUAL LINUX OR -- SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID)) -+ if((SWIFT_HOST_VARIANT_ARCH STREQUAL "armv7" OR -+ SWIFT_HOST_VARIANT_ARCH STREQUAL "aarch64") AND -+ (SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX" OR -+ SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID")) - target_compile_options(${target} PRIVATE $<$:-funwind-tables>) - endif() - - if(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX") -- if(SWIFT_HOST_VARIANT_ARCH STREQUAL x86_64) -+ if(SWIFT_HOST_VARIANT_ARCH STREQUAL "x86_64") - # this is the minimum architecture that supports 16 byte CAS, which is - # necessary to avoid a dependency to libatomic - target_compile_options(${target} PRIVATE $<$:-march=core2>) -@@ -336,7 +336,7 @@ function(_add_host_variant_c_compile_flags target) - # llvm/llvm-project@66395c9, which can cause incompatibilities with the Swift - # frontend if not built the same way. - if("${SWIFT_HOST_VARIANT_ARCH}" MATCHES "armv6|armv7|i686" AND -- NOT (SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID AND SWIFT_ANDROID_API_LEVEL LESS 24)) -+ NOT (SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID" AND SWIFT_ANDROID_API_LEVEL LESS 24)) - target_compile_definitions(${target} PRIVATE - $<$:_LARGEFILE_SOURCE _FILE_OFFSET_BITS=64>) - endif() -@@ -345,19 +345,19 @@ endfunction() - function(_add_host_variant_link_flags target) - _add_host_variant_c_compile_link_flags(${target}) - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL LINUX) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX") - target_link_libraries(${target} PRIVATE - pthread - dl) - if("${SWIFT_HOST_VARIANT_ARCH}" MATCHES "armv5|armv6|armv7|i686") - target_link_libraries(${target} PRIVATE atomic) - endif() -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL FREEBSD) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "FREEBSD") - target_link_libraries(${target} PRIVATE - pthread) -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL CYGWIN) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "CYGWIN") - # No extra libraries required. -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - # We don't need to add -nostdlib using MSVC or clang-cl, as MSVC and - # clang-cl rely on auto-linking entirely. - if(NOT SWIFT_COMPILER_IS_MSVC_LIKE) -@@ -375,12 +375,12 @@ function(_add_host_variant_link_flags target) - # the Windows SDK on case sensitive file systems. - target_link_directories(${target} PRIVATE - ${CMAKE_BINARY_DIR}/winsdk_lib_${SWIFT_HOST_VARIANT_ARCH}_symlinks) -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL HAIKU) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "HAIKU") - target_link_libraries(${target} PRIVATE - bsd) - target_link_options(${target} PRIVATE - "SHELL:-Xlinker -Bsymbolic") -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") - target_link_libraries(${target} PRIVATE - dl - log -@@ -422,7 +422,7 @@ function(_add_host_variant_link_flags target) - # - # TODO: Evaluate/enable -f{function,data}-sections --gc-sections for bfd, - # gold, and lld. -- if(NOT CMAKE_BUILD_TYPE STREQUAL Debug AND CMAKE_SYSTEM_NAME MATCHES Darwin) -+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_SYSTEM_NAME MATCHES Darwin) - if (NOT SWIFT_DISABLE_DEAD_STRIPPING) - # See rdar://48283130: This gives 6MB+ size reductions for swift and - # SourceKitService, and much larger size reductions for sil-opt etc. -@@ -446,7 +446,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping) - # RPATH where Swift runtime can be found. - set(swift_runtime_rpath) - -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - - set(sdk_dir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift") - -@@ -529,7 +529,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping) - - elseif(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD") - set(swiftrt "swiftImageRegistrationObject${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}") -- if(${ASRLF_BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE") -+ if(ASRLF_BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|CROSSCOMPILE") - # At build time and run time, link against the swift libraries in the - # installed host toolchain. - get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY) -@@ -575,7 +575,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping) - # able to fall back to the SDK directory for libswiftCore et al. - if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - if (NOT "${bootstrapping}" STREQUAL "1") -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - target_link_directories(${target} PRIVATE "${sdk_dir}") - - # Include the abi stable system stdlib in our rpath. -@@ -706,10 +706,10 @@ function(add_swift_host_library name) - if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - set_target_properties(${name} PROPERTIES - INSTALL_NAME_DIR "@rpath") -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL LINUX) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX") - set_target_properties(${name} PROPERTIES - INSTALL_RPATH "$ORIGIN") -- elseif(SWIFT_HOST_VARIANT_SDK STREQUAL CYGWIN) -+ elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "CYGWIN") - set_target_properties(${name} PROPERTIES - INSTALL_RPATH "$ORIGIN:/usr/lib/swift/cygwin") - elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") -@@ -731,18 +731,18 @@ function(add_swift_host_library name) - endif() - - # Set compilation and link flags. -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH} - ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE) - target_include_directories(${name} SYSTEM PRIVATE - ${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE}) - -- if(libkind STREQUAL SHARED) -+ if(libkind STREQUAL "SHARED") - target_compile_definitions(${name} PRIVATE - _WINDLL) - endif() - -- if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL MSVC) -+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") - swift_windows_get_sdk_vfs_overlay(ASHL_VFS_OVERLAY) - # Both clang and clang-cl on Windows set CMAKE_C_SIMULATE_ID to MSVC. - # We are using CMAKE_C_COMPILER_FRONTEND_VARIANT to detect the correct -@@ -770,7 +770,7 @@ function(add_swift_host_library name) - - set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) - -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - target_link_options(${name} PRIVATE - "LINKER:-compatibility_version,1") - if(SWIFT_COMPILER_VERSION) -@@ -856,7 +856,7 @@ function(add_swift_host_tool executable) - add_dependencies(${executable} ${LLVM_COMMON_DEPENDS}) - endif() - -- if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "") -+ if(NOT "${ASHT_BOOTSTRAPPING}" STREQUAL "") - # Strip the "-bootstrapping" suffix from the target name to get the base - # executable name. - string(REGEX REPLACE "-bootstrapping.*" "" executable_filename ${executable}) -@@ -891,7 +891,7 @@ function(add_swift_host_tool executable) - BINARY_DIR ${out_bin_dir} - LIBRARY_DIR ${out_lib_dir}) - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH} - ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE) - target_include_directories(${executable} SYSTEM PRIVATE -@@ -913,8 +913,8 @@ function(add_swift_host_tool executable) - - if(SWIFT_SWIFT_PARSER) - set(extra_relative_rpath "") -- if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "") -- if (${executable} MATCHES "-bootstrapping") -+ if(NOT "${ASHT_BOOTSTRAPPING}" STREQUAL "") -+ if(executable MATCHES "-bootstrapping") - set(extra_relative_rpath "../") - endif() - endif() -@@ -938,7 +938,7 @@ function(add_swift_host_tool executable) - target_link_options(${executable} PRIVATE "${lto_codegen_only_link_options}") - endif() - -- if(NOT ${ASHT_SWIFT_COMPONENT} STREQUAL "no_component") -+ if(NOT ASHT_SWIFT_COMPONENT STREQUAL "no_component") - add_dependencies(${ASHT_SWIFT_COMPONENT} ${executable}) - swift_install_in_component(TARGETS ${executable} - RUNTIME -diff --git a/cmake/modules/Libdispatch.cmake b/cmake/modules/Libdispatch.cmake -index f0ea3577a2b..3fb0ecdce89 100644 ---- a/cmake/modules/Libdispatch.cmake -+++ b/cmake/modules/Libdispatch.cmake -@@ -1,13 +1,13 @@ - include(ExternalProject) - --if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -- if(CMAKE_C_COMPILER_ID STREQUAL Clang AND -+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") -+ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND - CMAKE_C_COMPILER_VERSION VERSION_GREATER 3.8 - OR LLVM_USE_SANITIZER) - set(SWIFT_LIBDISPATCH_C_COMPILER ${CMAKE_C_COMPILER}) - set(SWIFT_LIBDISPATCH_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -- elseif(${CMAKE_SYSTEM_NAME} STREQUAL ${CMAKE_HOST_SYSTEM_NAME}) -- if(CMAKE_SYSTEM_NAME STREQUAL Windows) -+ elseif(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME) -+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - if(CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR AND - TARGET clang) - set(SWIFT_LIBDISPATCH_C_COMPILER -@@ -29,7 +29,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) - message(SEND_ERROR "libdispatch requires a newer clang compiler (${CMAKE_C_COMPILER_VERSION} < 3.9)") - endif() - -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - set(LIBDISPATCH_RUNTIME_DIR bin) - else() - set(LIBDISPATCH_RUNTIME_DIR lib) -@@ -40,7 +40,7 @@ set(DISPATCH_SDKS) - - # Build the host libdispatch if needed. - if(SWIFT_BUILD_HOST_DISPATCH) -- if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - if(NOT "${SWIFT_HOST_VARIANT_SDK}" IN_LIST SWIFT_SDKS) - list(APPEND DISPATCH_SDKS "${SWIFT_HOST_VARIANT_SDK}") - endif() -@@ -52,20 +52,20 @@ foreach(sdk ${SWIFT_SDKS}) - # Darwin targets have libdispatch available, do not build it. - # Wasm/WASI doesn't support libdispatch yet. - # See https://github.com/apple/swift/issues/54533 for more details. -- if(NOT "${sdk}" IN_LIST SWIFT_DARWIN_PLATFORMS AND NOT "${sdk}" STREQUAL WASI) -+ if(NOT "${sdk}" IN_LIST SWIFT_DARWIN_PLATFORMS AND NOT "${sdk}" STREQUAL "WASI") - list(APPEND DISPATCH_SDKS "${sdk}") - endif() - endforeach() - - foreach(sdk ${DISPATCH_SDKS}) - set(ARCHS ${SWIFT_SDK_${sdk}_ARCHITECTURES}) -- if(${sdk} STREQUAL "${SWIFT_HOST_VARIANT_SDK}") -+ if(sdk STREQUAL "${SWIFT_HOST_VARIANT_SDK}") - if(NOT "${SWIFT_HOST_VARIANT_ARCH}" IN_LIST ARCHS) - list(APPEND ARCHS "${SWIFT_HOST_VARIANT_ARCH}") - endif() - endif() - -- if(sdk STREQUAL ANDROID) -+ if(sdk STREQUAL "ANDROID") - set(SWIFT_LIBDISPATCH_COMPILER_CMAKE_ARGS) - else() - set(SWIFT_LIBDISPATCH_COMPILER_CMAKE_ARGS -DCMAKE_C_COMPILER=${SWIFT_LIBDISPATCH_C_COMPILER};-DCMAKE_CXX_COMPILER=${SWIFT_LIBDISPATCH_CXX_COMPILER}) -diff --git a/cmake/modules/SwiftComponents.cmake b/cmake/modules/SwiftComponents.cmake -index 6816b75e8a4..2ec225140dc 100644 ---- a/cmake/modules/SwiftComponents.cmake -+++ b/cmake/modules/SwiftComponents.cmake -@@ -82,7 +82,7 @@ list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "clang-builtin-headers-in-clang-resou - # This conflicts with LLVM itself when doing unified builds. - list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "llvm-toolchain-dev-tools") - # The sourcekit install variants are currently mutually exclusive. --if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -+if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "sourcekit-inproc") - else() - list(REMOVE_ITEM _SWIFT_DEFAULT_COMPONENTS "sourcekit-xpc-service") -diff --git a/cmake/modules/SwiftConfigureSDK.cmake b/cmake/modules/SwiftConfigureSDK.cmake -index d4cb352d658..5dd258cdd24 100644 ---- a/cmake/modules/SwiftConfigureSDK.cmake -+++ b/cmake/modules/SwiftConfigureSDK.cmake -@@ -232,7 +232,7 @@ macro(configure_sdk_darwin - SWIFT_SDK_${prefix}_MODULE_ARCHITECTURES) # result - - # Determine whether this is a simulator SDK. -- if ( ${xcrun_name} MATCHES "simulator" ) -+ if(xcrun_name MATCHES "simulator") - set(SWIFT_SDK_${prefix}_IS_SIMULATOR TRUE) - else() - set(SWIFT_SDK_${prefix}_IS_SIMULATOR FALSE) -@@ -378,11 +378,11 @@ macro(configure_sdk_unix name architectures) - message(FATAL_ERROR "unknown arch for ${prefix}: ${arch}") - endif() - elseif("${prefix}" STREQUAL "FREEBSD") -- if(NOT arch STREQUAL x86_64) -+ if(NOT arch STREQUAL "x86_64") - message(FATAL_ERROR "unsupported arch for FreeBSD: ${arch}") - endif() - -- if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL FreeBSD) -+ if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") - message(WARNING "CMAKE_SYSTEM_VERSION will not match target") - endif() - -@@ -391,7 +391,7 @@ macro(configure_sdk_unix name architectures) - - set(SWIFT_SDK_FREEBSD_ARCH_x86_64_TRIPLE "x86_64-unknown-freebsd${freebsd_system_version}") - elseif("${prefix}" STREQUAL "OPENBSD") -- if(NOT arch STREQUAL amd64) -+ if(NOT arch STREQUAL "amd64") - message(FATAL_ERROR "unsupported arch for OpenBSD: ${arch}") - endif() - -@@ -404,17 +404,17 @@ macro(configure_sdk_unix name architectures) - set(SWIFT_SDK_OPENBSD_ARCH_${arch}_PATH "${CMAKE_SYSROOT}${SWIFT_SDK_OPENBSD_ARCH_${arch}_PATH}" CACHE INTERNAL "sysroot path" FORCE) - endif() - elseif("${prefix}" STREQUAL "CYGWIN") -- if(NOT arch STREQUAL x86_64) -+ if(NOT arch STREQUAL "x86_64") - message(FATAL_ERROR "unsupported arch for cygwin: ${arch}") - endif() - set(SWIFT_SDK_CYGWIN_ARCH_x86_64_TRIPLE "x86_64-unknown-windows-cygnus") - elseif("${prefix}" STREQUAL "HAIKU") -- if(NOT arch STREQUAL x86_64) -+ if(NOT arch STREQUAL "x86_64") - message(FATAL_ERROR "unsupported arch for Haiku: ${arch}") - endif() - set(SWIFT_SDK_HAIKU_ARCH_x86_64_TRIPLE "x86_64-unknown-haiku") - elseif("${prefix}" STREQUAL "WASI") -- if(NOT arch STREQUAL wasm32) -+ if(NOT arch STREQUAL "wasm32") - message(FATAL_ERROR "unsupported arch for WebAssembly: ${arch}") - endif() - set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}") -@@ -459,7 +459,7 @@ macro(configure_sdk_windows name environment architectures) - get_threading_package(${prefix} "win32" SWIFT_SDK_${prefix}_THREADING_PACKAGE) - - foreach(arch ${architectures}) -- if(arch STREQUAL armv7) -+ if(arch STREQUAL "armv7") - set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE - "thumbv7-unknown-windows-${environment}") - else() -diff --git a/cmake/modules/SwiftWindowsSupport.cmake b/cmake/modules/SwiftWindowsSupport.cmake -index 6216b82c12b..a3432476658 100644 ---- a/cmake/modules/SwiftWindowsSupport.cmake -+++ b/cmake/modules/SwiftWindowsSupport.cmake -@@ -2,13 +2,13 @@ - include(SwiftUtils) - - function(swift_windows_arch_spelling arch var) -- if(${arch} STREQUAL i686) -+ if(arch STREQUAL "i686") - set(${var} x86 PARENT_SCOPE) -- elseif(${arch} STREQUAL x86_64) -+ elseif(arch STREQUAL "x86_64") - set(${var} x64 PARENT_SCOPE) -- elseif(${arch} STREQUAL armv7) -+ elseif(arch STREQUAL "armv7") - set(${var} arm PARENT_SCOPE) -- elseif(${arch} STREQUAL aarch64) -+ elseif(arch STREQUAL "aarch64") - set(${var} arm64 PARENT_SCOPE) - else() - message(FATAL_ERROR "do not know MSVC spelling for ARCH: `${arch}`") -@@ -33,7 +33,7 @@ function(swift_windows_lib_for_arch arch var) - # a directory called "Lib" rather than VS2017 which normalizes the layout and - # places them in a directory named "lib". - if(IS_DIRECTORY "${VCToolsInstallDir}/Lib") -- if(${ARCH} STREQUAL x86) -+ if(ARCH STREQUAL "x86") - list(APPEND paths "${VCToolsInstallDir}/Lib/") - else() - list(APPEND paths "${VCToolsInstallDir}/Lib/${ARCH}") -diff --git a/include/swift/AST/CMakeLists.txt b/include/swift/AST/CMakeLists.txt -index 869d96ba13b..050695f65c6 100644 ---- a/include/swift/AST/CMakeLists.txt -+++ b/include/swift/AST/CMakeLists.txt -@@ -1,4 +1,4 @@ --if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) -+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"") - else() - set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'") -diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt -index a0011d8a68c..13363dea4aa 100644 ---- a/lib/AST/CMakeLists.txt -+++ b/lib/AST/CMakeLists.txt -@@ -125,7 +125,7 @@ add_swift_host_library(swiftAST STATIC - ) - - if(SWIFT_FORCE_OPTIMIZED_TYPECHECKER) -- if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) -+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") - target_compile_options(swiftAST PRIVATE /O2 /Ob2) - else() - target_compile_options(swiftAST PRIVATE -O3) -diff --git a/lib/Migrator/CMakeLists.txt b/lib/Migrator/CMakeLists.txt -index 1dfd089d21a..228baa470ed 100644 ---- a/lib/Migrator/CMakeLists.txt -+++ b/lib/Migrator/CMakeLists.txt -@@ -23,7 +23,7 @@ set(outputs) - foreach(input ${datafiles}) - set(source "${CMAKE_CURRENT_SOURCE_DIR}/${input}") - set(dest "${output_dir}/${input}") -- if(CMAKE_SYSTEM_NAME STREQUAL Windows) -+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(CMAKE_SYMLINK_COMMAND copy) - else() - set(CMAKE_SYMLINK_COMMAND create_symlink) -diff --git a/lib/Parse/CMakeLists.txt b/lib/Parse/CMakeLists.txt -index b46a4b217c3..b8550c96b2a 100644 ---- a/lib/Parse/CMakeLists.txt -+++ b/lib/Parse/CMakeLists.txt -@@ -1,6 +1,6 @@ - - --if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) -+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"") - else() - set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'") -diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt -index c0e3608d07a..bf70a33782d 100644 ---- a/lib/Sema/CMakeLists.txt -+++ b/lib/Sema/CMakeLists.txt -@@ -74,7 +74,7 @@ add_swift_host_library(swiftSema STATIC - TypeChecker.cpp - IDETypeCheckingRequests.cpp) - if(SWIFT_FORCE_OPTIMIZED_TYPECHECKER) -- if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) -+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") - target_compile_options(swiftSema PRIVATE /O2 /Ob2) - else() - target_compile_options(swiftSema PRIVATE -O3) -diff --git a/lib/SwiftRemoteMirror/CMakeLists.txt b/lib/SwiftRemoteMirror/CMakeLists.txt -index f774297e51c..da2248de9f7 100644 ---- a/lib/SwiftRemoteMirror/CMakeLists.txt -+++ b/lib/SwiftRemoteMirror/CMakeLists.txt -@@ -3,6 +3,6 @@ add_swift_host_library(swiftRemoteMirror STATIC - target_link_libraries(swiftRemoteMirror PRIVATE - swiftDemangling) - --if(CMAKE_SYSTEM_NAME STREQUAL Windows) -+if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - target_compile_definitions(swiftRemoteMirror PRIVATE _LIB) - endif() -diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake -index 25a79d145fb..781d6fd33cf 100644 ---- a/stdlib/cmake/modules/AddSwiftStdlib.cmake -+++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake -@@ -249,7 +249,7 @@ function(_add_target_variant_c_compile_flags) - # NOTE(compnerd) workaround LLVM invoking `add_definitions(-D_DEBUG)` which - # causes failures for the runtime library when cross-compiling due to - # undefined symbols from the standard library. -- if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) -+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - list(APPEND result "-U_DEBUG") - endif() - endif() -@@ -258,7 +258,7 @@ function(_add_target_variant_c_compile_flags) - # uses a spin lock for this, so to get reasonable behavior we have to - # implement it ourselves using _InterlockedCompareExchange128. - # clang-cl requires us to enable the `cx16` feature to use this intrinsic. -- if(CFLAGS_ARCH STREQUAL x86_64) -+ if(CFLAGS_ARCH STREQUAL "x86_64") - if(SWIFT_COMPILER_IS_MSVC_LIKE) - list(APPEND result /clang:-mcx16) - else() -@@ -287,7 +287,7 @@ function(_add_target_variant_c_compile_flags) - endif() - - if("${CFLAGS_SDK}" STREQUAL "LINUX") -- if(${CFLAGS_ARCH} STREQUAL x86_64) -+ if("${CFLAGS_ARCH}" STREQUAL "x86_64") - # this is the minimum architecture that supports 16 byte CAS, which is necessary to avoid a dependency to libatomic - list(APPEND result "-march=core2") - endif() -@@ -493,7 +493,7 @@ function(_add_target_variant_link_flags) - else() - set(linker "${SWIFT_USE_LINKER}") - endif() -- if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) -+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - list(APPEND result "-fuse-ld=${linker}.exe") - else() - list(APPEND result "-fuse-ld=${linker}") -@@ -506,8 +506,8 @@ function(_add_target_variant_link_flags) - # - # TODO: Evaluate/enable -f{function,data}-sections --gc-sections for bfd, - # gold, and lld. -- if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) -- if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") -+ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - # See rdar://48283130: This gives 6MB+ size reductions for swift and - # SourceKitService, and much larger size reductions for sil-opt etc. - list(APPEND result "-Wl,-dead_strip") -@@ -969,7 +969,7 @@ function(add_swift_target_library_single target name) - endif() - - set(INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS}) -- if(${libkind} STREQUAL "SHARED") -+ if(libkind STREQUAL "SHARED") - list(APPEND INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS - ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY}) - endif() -@@ -991,7 +991,7 @@ function(add_swift_target_library_single target name) - # target_sources(${target} - # PRIVATE - # $) -- if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS) -+ if(SWIFTLIB_SINGLE_SDK STREQUAL "WINDOWS") - set(extension .obj) - else() - set(extension .o) -@@ -1059,8 +1059,8 @@ function(add_swift_target_library_single target name) - set_target_properties("${target}" PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${swiftlib_prefix}/${output_sub_dir} - ARCHIVE_OUTPUT_DIRECTORY ${swiftlib_prefix}/${output_sub_dir}) -- if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE -- AND libkind STREQUAL SHARED) -+ if(SWIFTLIB_SINGLE_SDK STREQUAL "WINDOWS" AND SWIFTLIB_SINGLE_IS_STDLIB_CORE -+ AND libkind STREQUAL "SHARED") - add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${swiftlib_prefix}/${output_sub_dir}) - endif() -@@ -1264,8 +1264,8 @@ function(add_swift_target_library_single target name) - MACCATALYST_BUILD_FLAVOR "${SWIFTLIB_SINGLE_MACCATALYST_BUILD_FLAVOR}" - ) - -- if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS) -- if(libkind STREQUAL SHARED) -+ if(SWIFTLIB_SINGLE_SDK STREQUAL "WINDOWS") -+ if(libkind STREQUAL "SHARED") - list(APPEND c_compile_flags -D_WINDLL) - endif() - endif() -@@ -1324,13 +1324,13 @@ function(add_swift_target_library_single target name) - endif() - - # Set compilation and link flags. -- if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS) -+ if(SWIFTLIB_SINGLE_SDK STREQUAL "WINDOWS") - swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} - ${SWIFTLIB_SINGLE_ARCHITECTURE}_INCLUDE) - target_include_directories(${target} SYSTEM PRIVATE - ${${SWIFTLIB_SINGLE_ARCHITECTURE}_INCLUDE}) - -- if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL MSVC) -+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") - swift_windows_get_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY) - target_compile_options(${target} PRIVATE - "SHELL:-Xclang -ivfsoverlay -Xclang ${SWIFTLIB_SINGLE_VFS_OVERLAY}") -@@ -1347,7 +1347,7 @@ function(add_swift_target_library_single target name) - ${c_compile_flags}) - target_link_options(${target} PRIVATE - ${link_flags}) -- if(${SWIFTLIB_SINGLE_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - target_link_options(${target} PRIVATE - "LINKER:-compatibility_version,1") - if(SWIFT_COMPILER_VERSION) -@@ -1380,7 +1380,7 @@ function(add_swift_target_library_single target name) - list(APPEND swiftlib_link_flags_all "-Xlinker -no_warn_inits") - endif() - -- if(${SWIFTLIB_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS) -+ if(SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_APPLE_PLATFORMS) - # In the past, we relied on unsetting globally - # CMAKE_OSX_ARCHITECTURES to ensure that CMake - # would not add the -arch flag. This is no longer -@@ -1403,7 +1403,7 @@ function(add_swift_target_library_single target name) - # doing so will result in incorrect symbol resolution and linkage. We created - # import library targets when the library was added. Use that to adjust the - # link libraries. -- if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) -+ if(SWIFTLIB_SINGLE_SDK STREQUAL "WINDOWS" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") - foreach(library_list LINK_LIBRARIES PRIVATE_LINK_LIBRARIES) - set(import_libraries) - foreach(library ${SWIFTLIB_SINGLE_${library_list}}) -@@ -1415,7 +1415,7 @@ function(add_swift_target_library_single target name) - set(import_library ${library}) - if(TARGET ${library}) - get_target_property(type ${library} TYPE) -- if(${type} STREQUAL "SHARED_LIBRARY") -+ if(type STREQUAL "SHARED_LIBRARY") - set(import_library ${library}_IMPLIB) - endif() - endif() -@@ -1744,7 +1744,7 @@ function(add_swift_target_library name) - list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS Core) - - # swiftSwiftOnoneSupport does not depend on itself, obviously. -- if(NOT ${name} STREQUAL swiftSwiftOnoneSupport) -+ if(NOT name STREQUAL "swiftSwiftOnoneSupport") - # All Swift code depends on the SwiftOnoneSupport in non-optimized mode, - # except for the standard library itself. - is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" optimized) -@@ -1851,7 +1851,7 @@ function(add_swift_target_library name) - - # Collect architecture agnostic SDK module dependencies - set(swiftlib_module_depends_flattened ${SWIFTLIB_SWIFT_MODULE_DEPENDS}) -- if(${sdk} STREQUAL OSX) -+ if(sdk STREQUAL "OSX") - if(DEFINED maccatalyst_build_flavor AND NOT maccatalyst_build_flavor STREQUAL "macos-like") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_MACCATALYST}) -@@ -1863,70 +1863,70 @@ function(add_swift_target_library name) - endif() - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_OSX}) -- elseif(${sdk} STREQUAL IOS OR ${sdk} STREQUAL IOS_SIMULATOR) -+ elseif(sdk STREQUAL "IOS" OR sdk STREQUAL "IOS_SIMULATOR") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_IOS}) -- elseif(${sdk} STREQUAL TVOS OR ${sdk} STREQUAL TVOS_SIMULATOR) -+ elseif(sdk STREQUAL "TVOS" OR sdk STREQUAL "TVOS_SIMULATOR") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_TVOS}) -- elseif(${sdk} STREQUAL WATCHOS OR ${sdk} STREQUAL WATCHOS_SIMULATOR) -+ elseif(sdk STREQUAL "WATCHOS" OR sdk STREQUAL "WATCHOS_SIMULATOR") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WATCHOS}) -- elseif(${sdk} STREQUAL FREESTANDING) -+ elseif(sdk STREQUAL "FREESTANDING") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_FREESTANDING}) -- elseif(${sdk} STREQUAL FREEBSD) -+ elseif(sdk STREQUAL "FREEBSD") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_FREEBSD}) -- elseif(${sdk} STREQUAL OPENBSD) -+ elseif(sdk STREQUAL "OPENBSD") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_OPENBSD}) -- elseif(${sdk} STREQUAL LINUX OR ${sdk} STREQUAL ANDROID) -+ elseif(sdk STREQUAL "LINUX" OR sdk STREQUAL "ANDROID") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_LINUX}) -- elseif(${sdk} STREQUAL CYGWIN) -+ elseif(sdk STREQUAL "CYGWIN") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_CYGWIN}) -- elseif(${sdk} STREQUAL HAIKU) -+ elseif(sdk STREQUAL "HAIKU") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_HAIKU}) -- elseif(${sdk} STREQUAL WASI) -+ elseif(sdk STREQUAL "WASI") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WASI}) -- elseif(${sdk} STREQUAL WINDOWS) -+ elseif(sdk STREQUAL "WINDOWS") - list(APPEND swiftlib_module_depends_flattened - ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WINDOWS}) - endif() - - # Collect architecture agnostic SDK framework dependencies - set(swiftlib_framework_depends_flattened ${SWIFTLIB_FRAMEWORK_DEPENDS}) -- if(${sdk} STREQUAL OSX) -+ if(sdk STREQUAL "OSX") - list(APPEND swiftlib_framework_depends_flattened - ${SWIFTLIB_FRAMEWORK_DEPENDS_OSX}) -- elseif(${sdk} STREQUAL IOS OR ${sdk} STREQUAL IOS_SIMULATOR OR -- ${sdk} STREQUAL TVOS OR ${sdk} STREQUAL TVOS_SIMULATOR) -+ elseif(sdk STREQUAL "IOS" OR sdk STREQUAL "IOS_SIMULATOR" OR -+ sdk STREQUAL "TVOS" OR sdk STREQUAL "TVOS_SIMULATOR") - list(APPEND swiftlib_framework_depends_flattened - ${SWIFTLIB_FRAMEWORK_DEPENDS_IOS_TVOS}) - endif() - - # Collect architecture agnostic swift compiler flags - set(swiftlib_swift_compile_flags_all ${SWIFTLIB_SWIFT_COMPILE_FLAGS}) -- if(${sdk} STREQUAL OSX) -+ if(sdk STREQUAL "OSX") - list(APPEND swiftlib_swift_compile_flags_all - ${SWIFTLIB_SWIFT_COMPILE_FLAGS_OSX}) -- elseif(${sdk} STREQUAL IOS OR ${sdk} STREQUAL IOS_SIMULATOR) -+ elseif(sdk STREQUAL "IOS" OR sdk STREQUAL "IOS_SIMULATOR") - list(APPEND swiftlib_swift_compile_flags_all - ${SWIFTLIB_SWIFT_COMPILE_FLAGS_IOS}) -- elseif(${sdk} STREQUAL TVOS OR ${sdk} STREQUAL TVOS_SIMULATOR) -+ elseif(sdk STREQUAL "TVOS" OR sdk STREQUAL "TVOS_SIMULATOR") - list(APPEND swiftlib_swift_compile_flags_all - ${SWIFTLIB_SWIFT_COMPILE_FLAGS_TVOS}) -- elseif(${sdk} STREQUAL WATCHOS OR ${sdk} STREQUAL WATCHOS_SIMULATOR) -+ elseif(sdk STREQUAL "WATCHOS" OR sdk STREQUAL "WATCHOS_SIMULATOR") - list(APPEND swiftlib_swift_compile_flags_all - ${SWIFTLIB_SWIFT_COMPILE_FLAGS_WATCHOS}) -- elseif(${sdk} STREQUAL LINUX) -+ elseif(sdk STREQUAL "LINUX") - list(APPEND swiftlib_swift_compile_flags_all - ${SWIFTLIB_SWIFT_COMPILE_FLAGS_LINUX}) -- elseif(${sdk} STREQUAL WINDOWS) -+ elseif(sdk STREQUAL "WINDOWS") - # FIXME: https://github.com/apple/swift/issues/44614 - # static and shared are not mutually exclusive; however since we do a - # single build of the sources, this doesn't work for building both -@@ -1945,7 +1945,7 @@ function(add_swift_target_library name) - - # Collect architecture agnostic SDK linker flags - set(swiftlib_link_flags_all ${SWIFTLIB_LINK_FLAGS}) -- if(${sdk} STREQUAL IOS_SIMULATOR AND ${name} STREQUAL swiftMediaPlayer) -+ if(sdk STREQUAL "IOS_SIMULATOR" AND name STREQUAL "swiftMediaPlayer") - # message("DISABLING AUTOLINK FOR swiftMediaPlayer") - list(APPEND swiftlib_link_flags_all "-Xlinker" "-ignore_auto_link") - endif() -@@ -1959,8 +1959,8 @@ function(add_swift_target_library name) - # back to supported targets and libraries only. This is needed for ELF - # targets only; however, RemoteMirror needs to build with undefined - # symbols. -- if(${SWIFT_SDK_${sdk}_OBJECT_FORMAT} STREQUAL ELF AND -- NOT ${name} STREQUAL swiftRemoteMirror) -+ if(SWIFT_SDK_${sdk}_OBJECT_FORMAT STREQUAL "ELF" AND -+ NOT name STREQUAL "swiftRemoteMirror") - list(APPEND swiftlib_link_flags_all "-Wl,-z,defs") - endif() - # Setting back linker flags which are not supported when making Android build on macOS cross-compile host. -@@ -2067,22 +2067,22 @@ function(add_swift_target_library name) - set(swiftlib_link_flags_all ${SWIFTLIB_LINK_FLAGS}) - - # Collect architecture agnostic c compiler flags -- if(${sdk} STREQUAL OSX) -+ if(sdk STREQUAL "OSX") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_OSX}) -- elseif(${sdk} STREQUAL IOS OR ${sdk} STREQUAL IOS_SIMULATOR) -+ elseif(sdk STREQUAL "IOS" OR sdk STREQUAL "IOS_SIMULATOR") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_IOS}) -- elseif(${sdk} STREQUAL TVOS OR ${sdk} STREQUAL TVOS_SIMULATOR) -+ elseif(sdk STREQUAL "TVOS" OR sdk STREQUAL "TVOS_SIMULATOR") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_TVOS}) -- elseif(${sdk} STREQUAL WATCHOS OR ${sdk} STREQUAL WATCHOS_SIMULATOR) -+ elseif(sdk STREQUAL "WATCHOS" OR sdk STREQUAL "WATCHOS_SIMULATOR") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_WATCHOS}) -- elseif(${sdk} STREQUAL LINUX) -+ elseif(sdk STREQUAL "LINUX") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_LINUX}) -- elseif(${sdk} STREQUAL WINDOWS) -+ elseif(sdk STREQUAL "WINDOWS") - list(APPEND swiftlib_c_compile_flags_all - ${SWIFTLIB_C_COMPILE_FLAGS_WINDOWS}) - endif() -@@ -2124,7 +2124,7 @@ function(add_swift_target_library name) - endif() - - # Setting back linker flags which are not supported when making Android build on macOS cross-compile host. -- if(SWIFTLIB_SHARED AND ${sdk} STREQUAL ANDROID) -+ if(SWIFTLIB_SHARED AND sdk STREQUAL "ANDROID") - list(APPEND swiftlib_link_flags_all "-shared") - # TODO: Instead of `lib${name}.so` find variable or target property which already have this value. - list(APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name}.so") -@@ -2181,7 +2181,7 @@ function(add_swift_target_library name) - add_dependencies(${VARIANT_NAME} clang) - endif() - -- if(sdk STREQUAL WINDOWS) -+ if(sdk STREQUAL "WINDOWS") - if(SWIFT_COMPILER_IS_MSVC_LIKE) - if (SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY MATCHES MultiThreadedDebugDLL) - target_compile_options(${VARIANT_NAME} PRIVATE /MDd /D_DLL /D_DEBUG) -@@ -2326,7 +2326,7 @@ function(add_swift_target_library name) - set(optional_arg "OPTIONAL") - endif() - -- if(sdk STREQUAL WINDOWS AND CMAKE_SYSTEM_NAME STREQUAL Windows) -+ if(sdk STREQUAL "WINDOWS" AND CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_dependencies(${SWIFTLIB_INSTALL_IN_COMPONENT} ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH}) - swift_install_in_component(TARGETS ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH} - RUNTIME -@@ -2357,7 +2357,7 @@ function(add_swift_target_library name) - PERMISSIONS ${file_permissions} - "${optional_arg}") - endif() -- if(sdk STREQUAL WINDOWS) -+ if(sdk STREQUAL "WINDOWS") - foreach(arch ${SWIFT_SDK_WINDOWS_ARCHITECTURES}) - if(TARGET ${name}-windows-${arch}_IMPLIB) - get_target_property(import_library ${name}-windows-${arch}_IMPLIB IMPORTED_LOCATION) -@@ -2558,13 +2558,13 @@ function(_add_swift_target_executable_single name) - ${SWIFTEXE_SINGLE_DEPENDS}) - llvm_update_compile_flags("${name}") - -- if(SWIFTEXE_SINGLE_SDK STREQUAL WINDOWS) -+ if(SWIFTEXE_SINGLE_SDK STREQUAL "WINDOWS") - swift_windows_include_for_arch(${SWIFTEXE_SINGLE_ARCHITECTURE} - ${SWIFTEXE_SINGLE_ARCHITECTURE}_INCLUDE) - target_include_directories(${name} SYSTEM PRIVATE - ${${SWIFTEXE_SINGLE_ARCHITECTURE}_INCLUDE}) - -- if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL MSVC) -+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") - # MSVC doesn't support -Xclang. We don't need to manually specify - # the dependent libraries as `cl` does so. - target_compile_options(${name} PRIVATE -@@ -2584,7 +2584,7 @@ function(_add_swift_target_executable_single name) - if (SWIFT_PARALLEL_LINK_JOBS) - set_property(TARGET ${name} PROPERTY JOB_POOL_LINK swift_link_job_pool) - endif() -- if(${SWIFTEXE_SINGLE_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFTEXE_SINGLE_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - set_target_properties(${name} PROPERTIES - BUILD_WITH_INSTALL_RPATH YES - INSTALL_RPATH "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}") -@@ -2596,7 +2596,7 @@ function(_add_swift_target_executable_single name) - # NOTE(compnerd) use the C linker language to invoke `clang` rather than - # `clang++` as we explicitly link against the C++ runtime. We were previously - # actually passing `-nostdlib++` to avoid the C++ runtime linkage. -- if(${SWIFTEXE_SINGLE_SDK} STREQUAL ANDROID) -+ if(SWIFTEXE_SINGLE_SDK STREQUAL "ANDROID") - set_property(TARGET "${name}" PROPERTY - LINKER_LANGUAGE "C") - else() -@@ -2666,7 +2666,7 @@ function(add_swift_target_executable name) - EXCLUDE_FROM_ALL TRUE) - endif() - -- if(${sdk} IN_LIST SWIFT_APPLE_PLATFORMS) -+ if(sdk IN_LIST SWIFT_APPLE_PLATFORMS) - # In the past, we relied on unsetting globally - # CMAKE_OSX_ARCHITECTURES to ensure that CMake would - # not add the -arch flag -diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake -index d5d57dfd18a..39c2e07860f 100644 ---- a/stdlib/cmake/modules/SwiftSource.cmake -+++ b/stdlib/cmake/modules/SwiftSource.cmake -@@ -730,7 +730,7 @@ function(_compile_swift_files - - set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive") - -- if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) -+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(HOST_EXECUTABLE_SUFFIX .exe) - endif() - if(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER) -@@ -748,7 +748,7 @@ function(_compile_swift_files - "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc${HOST_EXECUTABLE_SUFFIX}" - "${SWIFTFILE_BOOTSTRAPPING}") - -- if(NOT ${SWIFTFILE_BOOTSTRAPPING} STREQUAL "") -+ if(NOT "${SWIFTFILE_BOOTSTRAPPING}" STREQUAL "") - set(target_suffix "-bootstrapping${SWIFTFILE_BOOTSTRAPPING}") - endif() - -@@ -786,7 +786,7 @@ function(_compile_swift_files - # When building the stdlib with bootstrapping, the compiler needs - # to pick up the stdlib from the previous bootstrapping stage, because the - # stdlib in the current stage is not built yet. -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_APPLE_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_APPLE_PLATFORMS) - set(set_environment_args "${CMAKE_COMMAND}" "-E" "env" "DYLD_LIBRARY_PATH=${bs_lib_dir}") - elseif(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD") - set(set_environment_args "${CMAKE_COMMAND}" "-E" "env" "LD_LIBRARY_PATH=${bs_lib_dir}") -diff --git a/stdlib/public/Concurrency/CMakeLists.txt b/stdlib/public/Concurrency/CMakeLists.txt -index ff614adce76..76e0694a731 100644 ---- a/stdlib/public/Concurrency/CMakeLists.txt -+++ b/stdlib/public/Concurrency/CMakeLists.txt -@@ -26,14 +26,14 @@ set(SWIFT_RUNTIME_CONCURRENCY_C_FLAGS) - set(SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS) - - set(swift_concurrency_private_link_libraries) --if(CMAKE_SYSTEM_NAME STREQUAL Windows) -+if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - list(APPEND swift_concurrency_private_link_libraries Synchronization) - endif() - - set(swift_concurrency_incorporate_object_libraries_so swiftThreading) - - if("${SWIFT_CONCURRENCY_GLOBAL_EXECUTOR}" STREQUAL "dispatch") -- if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - include_directories(AFTER - ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}) - -@@ -61,7 +61,7 @@ endif() - - # Don't emit extended frame info on platforms other than darwin, system - # backtracer and system debugger are unlikely to support it. --if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - list(APPEND SWIFT_RUNTIME_CONCURRENCY_C_FLAGS - "-fswift-async-fp=${swift_concurrency_async_fp_mode}") - list(APPEND SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS -diff --git a/stdlib/public/Cxx/std/CMakeLists.txt b/stdlib/public/Cxx/std/CMakeLists.txt -index f24d08b6b62..b805b2ed6cb 100644 ---- a/stdlib/public/Cxx/std/CMakeLists.txt -+++ b/stdlib/public/Cxx/std/CMakeLists.txt -@@ -1,6 +1,6 @@ - set(libstdcxx_modulemap_target_list) - foreach(sdk ${SWIFT_SDKS}) -- if(NOT ${sdk} IN_LIST SWIFT_LIBSTDCXX_PLATFORMS) -+ if(NOT sdk IN_LIST SWIFT_LIBSTDCXX_PLATFORMS) - continue() - endif() - -@@ -86,7 +86,7 @@ foreach(sdk ${SWIFT_SDKS}) - COMPONENT sdk-overlay) - endif() - -- if(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") -+ if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - foreach(bootstrapping "0" "1") - get_bootstrapping_path(bootstrapping_dir ${module_dir} ${bootstrapping}) - set(libstdcxx_modulemap_out_bootstrapping "${bootstrapping_dir}/libstdcxx.modulemap") -diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt -index 9063931bd20..757a89eb760 100644 ---- a/stdlib/public/Platform/CMakeLists.txt -+++ b/stdlib/public/Platform/CMakeLists.txt -@@ -42,8 +42,8 @@ set(swiftDarwin_common_options - DEPENDS ${darwin_depends}) - - --if(${BOOTSTRAPPING_MODE} STREQUAL "BOOTSTRAPPING" AND -- ${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+if(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING" AND -+ SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - - set(swiftDarwin_common_bootstrapping_options - ${swiftDarwin_common_options} -@@ -179,7 +179,7 @@ foreach(sdk ${SWIFT_SDKS}) - # with its own native sysroot, create a native modulemap without a sysroot - # prefix. This is the one we'll install instead. - if(NOT "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${arch}_PATH}" STREQUAL "/" AND -- NOT (${sdk} STREQUAL ANDROID AND NOT "${SWIFT_ANDROID_NATIVE_SYSROOT}" STREQUAL "")) -+ NOT (sdk STREQUAL "ANDROID" AND NOT "${SWIFT_ANDROID_NATIVE_SYSROOT}" STREQUAL "")) - set(glibc_sysroot_relative_modulemap_out "${module_dir}/sysroot-relative-modulemaps/glibc.modulemap") - - handle_gyb_source_single(glibc_modulemap_native_target -diff --git a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt -index 50efa52b7e1..cf6f09bcf69 100644 ---- a/stdlib/public/SwiftOnoneSupport/CMakeLists.txt -+++ b/stdlib/public/SwiftOnoneSupport/CMakeLists.txt -@@ -10,7 +10,7 @@ set(swiftOnoneSupport_common_options - SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "-Xfrontend" "-check-onone-completeness" "-Xfrontend" "-disable-access-control" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}" - LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}") - --if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${BOOTSTRAPPING_MODE} STREQUAL "BOOTSTRAPPING") -+if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING") - - set(swiftOnoneSupport_common_bootstrapping_options - SHARED -diff --git a/stdlib/public/SwiftShims/swift/shims/CMakeLists.txt b/stdlib/public/SwiftShims/swift/shims/CMakeLists.txt -index c54b2cf84b2..f925940d8a2 100644 ---- a/stdlib/public/SwiftShims/swift/shims/CMakeLists.txt -+++ b/stdlib/public/SwiftShims/swift/shims/CMakeLists.txt -@@ -152,7 +152,7 @@ if(NOT SWIFT_BUILT_STANDALONE) - endforeach() - endif() - --if(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") -+if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - foreach(bootstrapping "0" "1") - get_bootstrapping_path(outdir ${SWIFTLIB_DIR} ${bootstrapping}) - set(target_name "symlink-headers-bootstrapping${bootstrapping}") -diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt -index c2217c9f294..be0d826b29d 100644 ---- a/stdlib/public/core/CMakeLists.txt -+++ b/stdlib/public/core/CMakeLists.txt -@@ -251,18 +251,18 @@ set(swift_core_framework_depends) - set(swift_core_private_link_libraries) - set(swift_stdlib_compile_flags "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}") - --if(SWIFT_PRIMARY_VARIANT_SDK STREQUAL CYGWIN) -+if(SWIFT_PRIMARY_VARIANT_SDK STREQUAL "CYGWIN") - # TODO(compnerd) cache this variable to permit re-configuration - execute_process(COMMAND "cygpath" "-u" "$ENV{SYSTEMROOT}" OUTPUT_VARIABLE ENV_SYSTEMROOT) - list(APPEND swift_core_private_link_libraries "${ENV_SYSTEMROOT}/system32/psapi.dll") --elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL FREEBSD) -+elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL "FREEBSD") - find_library(EXECINFO_LIBRARY execinfo) - list(APPEND swift_core_private_link_libraries ${EXECINFO_LIBRARY}) --elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL LINUX) -+elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL "LINUX") - if(SWIFT_BUILD_STATIC_STDLIB) - list(APPEND swift_core_private_link_libraries) - endif() --elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL WINDOWS) -+elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL "WINDOWS") - list(APPEND swift_core_private_link_libraries shell32;DbgHelp;Synchronization) - endif() - -@@ -331,7 +331,7 @@ set(swiftCore_common_options - set(swiftCore_common_dependencies - copy_shim_headers "${SWIFTLIB_DIR}/shims" ${GROUP_INFO_JSON_FILE}) - --if(${BOOTSTRAPPING_MODE} STREQUAL "BOOTSTRAPPING") -+if(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING") - - set(b0_deps symlink-headers-bootstrapping0) - set(b1_deps symlink-headers-bootstrapping1) -diff --git a/stdlib/public/runtime/CMakeLists.txt b/stdlib/public/runtime/CMakeLists.txt -index e46c37d626b..db503543b6b 100644 ---- a/stdlib/public/runtime/CMakeLists.txt -+++ b/stdlib/public/runtime/CMakeLists.txt -@@ -163,7 +163,7 @@ foreach(sdk ${SWIFT_SDKS}) - # set(swiftrtObject "$") - set(swiftrtObject ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/swiftImageRegistrationObject${SWIFT_SDK_${sdk}_OBJECT_FORMAT}-${arch_suffix}.dir/SwiftRT-${SWIFT_SDK_${sdk}_OBJECT_FORMAT}.cpp${CMAKE_C_OUTPUT_EXTENSION}) - -- if(sdk STREQUAL WINDOWS) -+ if(sdk STREQUAL "WINDOWS") - set(extension .obj) - else() - set(extension .o) -@@ -209,12 +209,12 @@ foreach(sdk ${SWIFT_SDKS}) - - # Generate the static-stdlib-args.lnk file used by -static-stdlib option for - # 'GenericUnix' (eg linux) -- if(${SWIFT_SDK_${sdk}_OBJECT_FORMAT} STREQUAL ELF) -+ if(SWIFT_SDK_${sdk}_OBJECT_FORMAT STREQUAL "ELF") - string(TOLOWER "${sdk}" lowercase_sdk) - set(libpthread -lpthread) - set(concurrency_libs) - set(android_libraries) -- if(${sdk} STREQUAL ANDROID) -+ if(sdk STREQUAL "ANDROID") - set(android_libraries -llog) - set(libpthread) - elseif(SWIFT_CONCURRENCY_USES_DISPATCH) -diff --git a/stdlib/toolchain/legacy_layouts/CMakeLists.txt b/stdlib/toolchain/legacy_layouts/CMakeLists.txt -index ad18c6b1b32..96da3906821 100644 ---- a/stdlib/toolchain/legacy_layouts/CMakeLists.txt -+++ b/stdlib/toolchain/legacy_layouts/CMakeLists.txt -@@ -55,7 +55,7 @@ foreach(sdk ${SWIFT_SDKS}) - endforeach() - endforeach() - --if(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") -+if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - # The resource dir for bootstrapping0 may be used explicitly - # to cross compile for other architectures, so we would need - # to have all the legacy layouts in there -diff --git a/tools/SourceKit/CMakeLists.txt b/tools/SourceKit/CMakeLists.txt -index f87720f9c80..6c0c0800bc4 100644 ---- a/tools/SourceKit/CMakeLists.txt -+++ b/tools/SourceKit/CMakeLists.txt -@@ -82,7 +82,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - # Add deployment target to C/C++ compiler and linker flags. - # FIXME: CMAKE_OSX_DEPLOYMENT_TARGET falls over when used for iOS versions. - if (XCODE) -- if (${SOURCEKIT_DEPLOYMENT_OS} MATCHES "^macosx") -+ if (SOURCEKIT_DEPLOYMENT_OS MATCHES "^macosx") - set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET}) - else() - set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${SOURCEKIT_DEPLOYMENT_TARGET}) -@@ -101,7 +101,7 @@ if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - endif() - - if(SWIFT_BUILD_HOST_DISPATCH) -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - set(SOURCEKIT_RUNTIME_DIR bin) - else() - set(SOURCEKIT_RUNTIME_DIR lib) -@@ -114,7 +114,7 @@ if(SWIFT_BUILD_HOST_DISPATCH) - DESTINATION ${SOURCEKIT_RUNTIME_DIR} - COMPONENT sourcekit-inproc) - endif() -- if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - swift_install_in_component(FILES - $ - $ -diff --git a/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake b/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake -index 14d9a99a13a..bc26b263848 100644 ---- a/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake -+++ b/tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake -@@ -8,7 +8,7 @@ function(add_sourcekit_default_compiler_flags target) - _add_host_variant_link_flags(${target}) - - # Set compilation and link flags. -- if(${SWIFT_HOST_VARIANT_SDK} STREQUAL WINDOWS) -+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "WINDOWS") - swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH} - ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE) - target_include_directories(${target} SYSTEM PRIVATE -@@ -30,7 +30,7 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES) - endif() - endif() - -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - - # Lists of rpaths that we are going to add to our executables. - # -@@ -118,7 +118,7 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES) - - elseif(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD" AND HAS_SWIFT_MODULES AND ASKD_BOOTSTRAPPING_MODE) - set(swiftrt "swiftImageRegistrationObject${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}") -- if(${ASKD_BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE") -+ if(ASKD_BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|CROSSCOMPILE") - # At build time and run time, link against the swift libraries in the - # installed host toolchain. - get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY) -@@ -163,7 +163,7 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES) - # able to fall back to the SDK directory for libswiftCore et al. - if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - if (NOT "${bootstrapping}" STREQUAL "1") -- if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+ if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - target_link_directories(${target} PRIVATE "${sdk_dir}") - - # Include the abi stable system stdlib in our rpath. -diff --git a/tools/SourceKit/lib/Support/CMakeLists.txt b/tools/SourceKit/lib/Support/CMakeLists.txt -index c4e2cbcd31e..a47b2347a12 100644 ---- a/tools/SourceKit/lib/Support/CMakeLists.txt -+++ b/tools/SourceKit/lib/Support/CMakeLists.txt -@@ -9,7 +9,7 @@ target_link_libraries(SourceKitSupport PRIVATE - swiftBasic - clangBasic - clangRewrite) --if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_libraries(SourceKitSupport INTERFACE - dispatch - BlocksRuntime) -diff --git a/tools/SourceKit/tools/complete-test/CMakeLists.txt b/tools/SourceKit/tools/complete-test/CMakeLists.txt -index ec3437650a0..d1b3fe3b36a 100644 ---- a/tools/SourceKit/tools/complete-test/CMakeLists.txt -+++ b/tools/SourceKit/tools/complete-test/CMakeLists.txt -@@ -7,13 +7,13 @@ if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY) - else() - target_link_libraries(complete-test PRIVATE sourcekitd) - endif() --if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_libraries(complete-test PRIVATE - dispatch - BlocksRuntime) - endif() - --if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set_target_properties(complete-test PROPERTIES - INSTALL_RPATH "@executable_path/../lib") - target_link_options(complete-test PRIVATE -diff --git a/tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt b/tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt -index d4a3a77df2a..f537ad74544 100644 ---- a/tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt -+++ b/tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt -@@ -7,7 +7,7 @@ if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY) - else() - target_link_libraries(sourcekitd-repl PRIVATE sourcekitd) - endif() --if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_libraries(sourcekitd-repl PRIVATE - dispatch - BlocksRuntime) -@@ -15,7 +15,7 @@ endif() - target_link_libraries(sourcekitd-repl PRIVATE - libedit) - --if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set_target_properties(sourcekitd-repl PROPERTIES - INSTALL_RPATH "@executable_path/../lib") - target_link_options(sourcekitd-repl PRIVATE -diff --git a/tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt b/tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt -index 91c28f371c4..e5f7aa5c9fb 100644 ---- a/tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt -+++ b/tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt -@@ -17,7 +17,7 @@ if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY) - else() - target_link_libraries(sourcekitd-test PRIVATE sourcekitd) - endif() --if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_libraries(sourcekitd-test PRIVATE - dispatch - BlocksRuntime) -@@ -25,7 +25,7 @@ endif() - - add_dependencies(sourcekitd-test sourcekitdTestOptionsTableGen) - --if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set_target_properties(sourcekitd-test PROPERTIES - INSTALL_RPATH "@executable_path/../lib") - target_link_options(sourcekitd-test PRIVATE -diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt -index 4521356ffc6..ab6dad7b273 100644 ---- a/tools/driver/CMakeLists.txt -+++ b/tools/driver/CMakeLists.txt -@@ -10,7 +10,7 @@ function(add_swift_parser_link_libraries target) - endif() - endfunction() - --if(${BOOTSTRAPPING_MODE} MATCHES "BOOTSTRAPPING.*") -+if(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") - - # Bootstrapping - level 0 - # For more information on how bootstrapping works, see docs/SwiftInTheCompiler.md -diff --git a/tools/libSwiftScan/CMakeLists.txt b/tools/libSwiftScan/CMakeLists.txt -index f11c2a99758..93beb4629b0 100644 ---- a/tools/libSwiftScan/CMakeLists.txt -+++ b/tools/libSwiftScan/CMakeLists.txt -@@ -8,7 +8,7 @@ add_swift_host_library(libSwiftScan SHARED - libSwiftScan.cpp - c-include-check.c) - --if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS) -+if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) - # Workaround for a linker crash related to autolinking: rdar://77839981 - set_property(TARGET libSwiftScan APPEND_STRING PROPERTY - LINK_FLAGS " -lobjc ") -diff --git a/unittests/Basic/CMakeLists.txt b/unittests/Basic/CMakeLists.txt -index 547751e6cac..10b413ce732 100644 ---- a/unittests/Basic/CMakeLists.txt -+++ b/unittests/Basic/CMakeLists.txt -@@ -49,6 +49,6 @@ target_link_libraries(SwiftBasicTests - LLVMTestingSupport - ) - --if(SWIFT_HOST_VARIANT STREQUAL windows) -+if(SWIFT_HOST_VARIANT STREQUAL "windows") - target_link_libraries(SwiftBasicTests PRIVATE Synchronization) - endif() -diff --git a/unittests/Threading/CMakeLists.txt b/unittests/Threading/CMakeLists.txt -index 5e0f27c089d..239630d038c 100644 ---- a/unittests/Threading/CMakeLists.txt -+++ b/unittests/Threading/CMakeLists.txt -@@ -14,7 +14,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND - swiftCore${SWIFT_PRIMARY_VARIANT_SUFFIX} - ) - -- if(SWIFT_HOST_VARIANT STREQUAL windows) -+ if(SWIFT_HOST_VARIANT STREQUAL "windows") - target_link_libraries(SwiftThreadingTests PRIVATE Synchronization) - endif() - endif() -diff --git a/unittests/runtime/CMakeLists.txt b/unittests/runtime/CMakeLists.txt -index 79df463c0ed..cef40263785 100644 ---- a/unittests/runtime/CMakeLists.txt -+++ b/unittests/runtime/CMakeLists.txt -@@ -63,7 +63,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND - list(APPEND PLATFORM_TARGET_LINK_LIBRARIES - ${EXECINFO_LIBRARY} - ) -- elseif(SWIFT_HOST_VARIANT STREQUAL windows) -+ elseif(SWIFT_HOST_VARIANT STREQUAL "windows") - list(APPEND PLATFORM_TARGET_LINK_LIBRARIES DbgHelp;Synchronization) - endif() - -diff --git a/unittests/runtime/LongTests/CMakeLists.txt b/unittests/runtime/LongTests/CMakeLists.txt -index 592e532f8cf..37b5e00714e 100644 ---- a/unittests/runtime/LongTests/CMakeLists.txt -+++ b/unittests/runtime/LongTests/CMakeLists.txt -@@ -30,7 +30,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND - list(APPEND PLATFORM_TARGET_LINK_LIBRARIES - ${EXECINFO_LIBRARY} - ) -- elseif(SWIFT_HOST_VARIANT STREQUAL windows) -+ elseif(SWIFT_HOST_VARIANT STREQUAL "windows") - list(APPEND PLATFORM_TARGET_LINK_LIBRARIES DbgHelp;Synchronization) - endif() - -diff --git a/utils/api_checker/CMakeLists.txt b/utils/api_checker/CMakeLists.txt -index e664a73ddd9..fea720f6095 100644 ---- a/utils/api_checker/CMakeLists.txt -+++ b/utils/api_checker/CMakeLists.txt -@@ -16,7 +16,7 @@ set(SWIFTLIB_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/swift") - set(dest "${SWIFTLIB_DIR}/${framework}") - set(source "${CMAKE_CURRENT_SOURCE_DIR}/${framework}") - --if(CMAKE_SYSTEM_NAME STREQUAL Windows) -+if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(CMAKE_SYMLINK_COMMAND copy) - else() - set(CMAKE_SYMLINK_COMMAND create_symlink) diff --git a/pkgs/development/compilers/swift/compiler/patches/swift-darwin-libcxx-flags.patch b/pkgs/development/compilers/swift/compiler/patches/swift-darwin-libcxx-flags.patch index c2b5adafa592f..3f74ffc58757e 100644 --- a/pkgs/development/compilers/swift/compiler/patches/swift-darwin-libcxx-flags.patch +++ b/pkgs/development/compilers/swift/compiler/patches/swift-darwin-libcxx-flags.patch @@ -4,7 +4,7 @@ interop succeed. The required flags can be read from cc-wrapper support files. --- a/SwiftCompilerSources/CMakeLists.txt +++ b/SwiftCompilerSources/CMakeLists.txt -@@ -105,18 +105,11 @@ function(add_swift_compiler_modules_library name) +@@ -110,18 +110,11 @@ function(add_swift_compiler_modules_library name) get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY) set(sdk_option ${sdk_option} "-resource-dir" "${swift_exec_bin_dir}/../bootstrapping0/lib/swift") endif() @@ -51,7 +51,7 @@ interop succeed. The required flags can be read from cc-wrapper support files. --- a/stdlib/public/Cxx/std/CMakeLists.txt +++ b/stdlib/public/Cxx/std/CMakeLists.txt -@@ -145,6 +145,9 @@ add_swift_target_library(swiftstd STATIC NO_LINK_NAME IS_STDLIB +@@ -14,6 +14,9 @@ add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_O SWIFT_COMPILE_FLAGS_LINUX ${SWIFT_SDK_LINUX_CXX_OVERLAY_SWIFT_COMPILE_FLAGS} @@ -59,5 +59,5 @@ interop succeed. The required flags can be read from cc-wrapper support files. + ${SWIFT_SDK_OSX_CXX_OVERLAY_SWIFT_COMPILE_FLAGS} + LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" - TARGET_SDKS ALL_APPLE_PLATFORMS LINUX + TARGET_SDKS ALL_APPLE_PLATFORMS LINUX WINDOWS INSTALL_IN_COMPONENT compiler diff --git a/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch b/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch index 02cdeb368bb7a..eba39d59ef370 100644 --- a/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch +++ b/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch @@ -5,15 +5,15 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper. --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp -@@ -120,6 +120,7 @@ static clang::driver::Driver createClangDriver(const ASTContext &ctx) { +@@ -142,6 +142,7 @@ createClangDriver(const ASTContext &ctx, /// \return a path without dots (`../`, './'). - static llvm::Optional - findFirstIncludeDir(const llvm::opt::InputArgList &args, -+ const llvm::opt::ArgList &DriverArgs, - const ArrayRef expectedFileNames) { + static llvm::Optional findFirstIncludeDir( + const llvm::opt::InputArgList &args, ++ const llvm::opt::ArgList &DriverArgs, + const ArrayRef expectedFileNames, + const llvm::IntrusiveRefCntPtr &vfs) { // C++ stdlib paths are added as `-internal-isystem`. - std::vector includeDirs = -@@ -128,6 +129,14 @@ findFirstIncludeDir(const llvm::opt::InputArgList &args, +@@ -151,6 +152,14 @@ static llvm::Optional findFirstIncludeDir( llvm::append_range(includeDirs, args.getAllArgValues( clang::driver::options::OPT_internal_externc_isystem)); @@ -28,21 +28,21 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper. for (const auto &includeDir : includeDirs) { Path dir(includeDir); -@@ -193,7 +202,7 @@ getGlibcFileMapping(ASTContext &ctx) { - // Ideally we would check that all of the headers referenced from the +@@ -218,7 +227,7 @@ static SmallVector, 2> getGlibcFileMapping( // modulemap are present. Path glibcDir; -- if (auto dir = findFirstIncludeDir(parsedIncludeArgs, -+ if (auto dir = findFirstIncludeDir(parsedIncludeArgs, clangDriverArgs, - {"inttypes.h", "unistd.h", "stdint.h"})) { + if (auto dir = findFirstIncludeDir( +- parsedIncludeArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) { ++ parsedIncludeArgs, clangDriverArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) { glibcDir = dir.value(); } else { -@@ -251,7 +260,7 @@ getLibStdCxxFileMapping(ASTContext &ctx) { + ctx.Diags.diagnose(SourceLoc(), diag::glibc_not_found, triple.str()); +@@ -276,7 +285,7 @@ static void getLibStdCxxFileMapping( auto parsedStdlibArgs = parseClangDriverArgs(clangDriver, stdlibArgStrings); Path cxxStdlibDir; - if (auto dir = findFirstIncludeDir(parsedStdlibArgs, + if (auto dir = findFirstIncludeDir(parsedStdlibArgs, clangDriverArgs, - {"cstdlib", "string", "vector"})) { + {"cstdlib", "string", "vector"}, vfs)) { cxxStdlibDir = dir.value(); } else { diff --git a/pkgs/development/compilers/swift/sourcekit-lsp/generated/default.nix b/pkgs/development/compilers/swift/sourcekit-lsp/generated/default.nix index d753f378946ab..0e5cf36288ba3 100644 --- a/pkgs/development/compilers/swift/sourcekit-lsp/generated/default.nix +++ b/pkgs/development/compilers/swift/sourcekit-lsp/generated/default.nix @@ -2,16 +2,18 @@ { workspaceStateFile = ./workspace-state.json; hashes = { - "indexstore-db" = "0lf96m82s8f6lv67wbcnm9ii01fgw4bsr4vn2xp07ydfj1iqy8il"; - "swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; - "swift-collections" = "1k6sjx5rqmp3gklny77b480hyzy6gkhpi23r0s8ljfbrcwawgnan"; - "swift-crypto" = "0kllp7j0hd8k67l9b9zr2c3ddc5bvshldchzivhcz3q31qvq9ag8"; - "swift-driver" = "0cbvddj54k3sbw0vzlmzhccs7h43hi5kq6i3n2i0mysz3bf0c6zg"; - "swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; - "swift-package-manager" = "1d1ngh7da42dm0rwkw7jzxa63a1rpc88wimm85w2j59cm446pk9k"; - "swift-syntax" = "05394mzznmcrw246lyzsjsn1fmilj98jgkjyyxr2ynhnbgzp2jl2"; + "indexstore-db" = "02al5rk807685ian3xckpdl00yplm8v92b7gq1prw7abll8k6hnq"; + "swift-argument-parser" = "1463yiahwa8qwgzbbxfzj3srcr9yx8z71lniqqaj8hvav3dpfhm8"; + "swift-asn1" = "0hlz76c2m3ifrxhqvch2h2zysnc6rn80s1y2scdwpkhdxh8kyi4d"; + "swift-certificates" = "0fixqxb51vpipw081x92wznlrrdi0cpswbhwbjlfc9hgr2wbw77j"; + "swift-collections" = "0i19czvb1j0xjbg238k802g72dpsa9mvxn9wf16jc3bgckvgbn2q"; + "swift-crypto" = "1i9sshrkckq8kx8j9nap93xrnzmv1q9zwjjlmg6735x7vigf645w"; + "swift-driver" = "1m02089427i3ln2663r270vzkcbydy24gy5pc2wd9j1sh7yp153d"; + "swift-llbuild" = "03czswc2vwz2711qid7jc0l9119fcrqgq585j084v9a9x9i2j4n3"; + "swift-package-manager" = "01d7d1az6xps1ini13sqhj1n3ddasvksnra0d9lak94im8zkz7mv"; + "swift-syntax" = "1vggy5yv8sxdp1g0kcaiq2kr3g93rh526xw2jjym0x2mf0zfkkn9"; "swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; - "swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; - "Yams" = "0b4lprxl4f6yqq0djnp394mxgmsxm2pljr7fh4f6ihdhnpwfsfvl"; + "swift-tools-support-core" = "0xh84x25ar5vfvjy58yzamphxm19g713nda5jqx9kjfssdpfv9rk"; + "Yams" = "1jf3k2lm5b9i8m9bpnzhqa8mnc3qzj91icv5ykjplk3vy0idz3q1"; }; } diff --git a/pkgs/development/compilers/swift/sourcekit-lsp/generated/workspace-state.json b/pkgs/development/compilers/swift/sourcekit-lsp/generated/workspace-state.json index b2659770cc7a7..efb7c1ebc12d7 100644 --- a/pkgs/development/compilers/swift/sourcekit-lsp/generated/workspace-state.json +++ b/pkgs/development/compilers/swift/sourcekit-lsp/generated/workspace-state.json @@ -12,8 +12,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "6caa12ab3bb6245eee4e09dce7677e64720c6545" + "branch": "release/5.9", + "revision": "89ec16c2ac1bb271614e734a2ee792224809eb20" }, "name": "sourceControlCheckout" }, @@ -29,13 +29,47 @@ }, "state": { "checkoutState": { - "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", - "version": "1.0.3" + "revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version": "1.2.3" }, "name": "sourceControlCheckout" }, "subpath": "swift-argument-parser" }, + { + "basedOn": null, + "packageRef": { + "identity": "swift-asn1", + "kind": "remoteSourceControl", + "location": "https://github.com/apple/swift-asn1.git", + "name": "swift-asn1" + }, + "state": { + "checkoutState": { + "revision": "805deae27a7506dcad043604c00a9dc52d465dcb", + "version": "0.7.0" + }, + "name": "sourceControlCheckout" + }, + "subpath": "swift-asn1" + }, + { + "basedOn": null, + "packageRef": { + "identity": "swift-certificates", + "kind": "remoteSourceControl", + "location": "https://github.com/apple/swift-certificates.git", + "name": "swift-certificates" + }, + "state": { + "checkoutState": { + "revision": "35a7df2d9d71c401a47de9be2e3de629a01370c2", + "version": "0.4.1" + }, + "name": "sourceControlCheckout" + }, + "subpath": "swift-certificates" + }, { "basedOn": null, "packageRef": { @@ -46,8 +80,8 @@ }, "state": { "checkoutState": { - "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version": "1.0.4" + "revision": "d029d9d39c87bed85b1c50adee7c41795261a192", + "version": "1.0.6" }, "name": "sourceControlCheckout" }, @@ -63,8 +97,8 @@ }, "state": { "checkoutState": { - "revision": "75ec60b8b4cc0f085c3ac414f3dca5625fa3588e", - "version": "2.2.4" + "revision": "33a20e650c33f6d72d822d558333f2085effa3dc", + "version": "2.5.0" }, "name": "sourceControlCheckout" }, @@ -80,8 +114,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "7cfe0c0b6e6297efe88a3ce34e6138ee7eda969e" + "branch": "release/5.9", + "revision": "1b2b851ae4718caffa5f18fd1861bc0ddd1791a3" }, "name": "sourceControlCheckout" }, @@ -97,8 +131,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" + "branch": "release/5.9", + "revision": "d73a305d6e5a82e4bf3bf1727da3d1376e87efab" }, "name": "sourceControlCheckout" }, @@ -114,8 +148,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "6651d98a4ce3c6faa82768256ca286412bf4a04d" + "branch": "release/5.9", + "revision": "2b7ebe65a258faf26e7bf57c3b7a36d727017518" }, "name": "sourceControlCheckout" }, @@ -127,12 +161,12 @@ "identity": "swift-syntax", "kind": "remoteSourceControl", "location": "https://github.com/apple/swift-syntax.git", - "name": "SwiftSyntax" + "name": "swift-syntax" }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "cd793adf5680e138bf2bcbaacc292490175d0dcd" + "branch": "release/5.9", + "revision": "9a101b70eee2a9dec04f92d2d47b22ebe57a1aae" }, "name": "sourceControlCheckout" }, @@ -165,8 +199,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" + "branch": "release/5.9", + "revision": "5665fc7641ce1a971ad06faaa476862b222ef44b" }, "name": "sourceControlCheckout" }, @@ -182,8 +216,8 @@ }, "state": { "checkoutState": { - "revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", - "version": "5.0.5" + "revision": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", + "version": "5.0.6" }, "name": "sourceControlCheckout" }, diff --git a/pkgs/development/compilers/swift/sources.nix b/pkgs/development/compilers/swift/sources.nix index 11240f767d08e..788c676d74207 100644 --- a/pkgs/development/compilers/swift/sources.nix +++ b/pkgs/development/compilers/swift/sources.nix @@ -1,35 +1,286 @@ -{ lib, fetchFromGitHub }: - -let - - # These packages are all part of the Swift toolchain, and have a single - # upstream version that should match. We also list the hashes here so a basic - # version upgrade touches only this file. - version = "5.8"; - hashes = { - llvm-project = "sha256-0xwSAwwkzFgYO3mY1rHqV8TCeH2NpM7m3VUkCDqjcdE="; - sourcekit-lsp = "sha256-XDGq64LbpgBrRy3IvZNgsoLUePXECK5p10vQ8cUKeGE="; - swift = "sha256-EY2IImBCVLiUutvDQjNUiInwCNxZsCu1mZzYSjNd4+A="; - swift-cmark = "sha256-6xkO9kN6eXMAigjk+KyIgVhTyC50BxmkZmD4+9z6nz8="; - swift-corelibs-foundation = "sha256-yRjjxJRy1eTM9VG7/Fn60UMghPavsaoueH0V8cjaIyM="; - swift-corelibs-libdispatch = "sha256-XOAWuaGqWJtxhGIPXYT3PIvk5OK0rkY4g1IOybJUlm4="; - swift-corelibs-xctest = "sha256-uwxQhKUQ1xp5ao6kfkdlYOvMr6yAb5IaBIdOfoyf+n8="; - swift-docc = "sha256-k1ygYDZwF4Jo7iOkHxc/3NzfgN+8XNCks5aizxBgPjM="; - swift-docc-render-artifact = "sha256-vdSyICXOjlNSjZXzPRxa/5305pg6PG4xww9GYEV9m10="; - swift-driver = "sha256-7xsG3Bpf+wqisCMaPEuEg8CjGYO/0r8BX3pMUmRrezE="; - swift-experimental-string-processing = "sha256-ioXG6pQKjlAc2oF38Z7TGighyZN8w2ZAAtFUq83Ow6Q="; - swift-format = "sha256-uKhIcbJb0DDHKACfVrhQ4fSyXVUkAj090eUZsOrtEqw="; - swift-package-manager = "sha256-xd6ZpeXfMoHyVrJxz6XcDLPKBvc2nl1lgWXuLrJdq+E="; - swift-syntax = "sha256-gkpx/1sWWi9y917OJ1GSNFYXrJb6e2qI4JlV+38laRQ="; - }; - - # Create fetch derivations. - sources = lib.mapAttrs (repo: hash: fetchFromGitHub { - owner = "apple"; - inherit repo; - rev = "swift-${version}-RELEASE"; - name = "${repo}-${version}-src"; - hash = hashes.${repo}; - }) hashes; - -in sources // { inherit version; } +# DO NOT EDIT. This file is generated by update.sh +{ fetchFromGitHub }: { + + version = "5.9.2"; + + cmake = fetchFromGitHub { + owner = "KitWare"; + repo = "CMake"; + rev = "0ecd9de6ddcaf951968d053ae491949d68d6175f"; + hash = "sha256-jaPm1KcK/80ahoIyDP5txEQ3Fihqmwr5DnCz8frzWyk="; + }; + + cmark = fetchFromGitHub { + owner = "apple"; + repo = "swift-cmark"; + rev = "f218e5d7691f78b55bfa39b367763f4612486c35"; + hash = "sha256-qJpDdwGFf4AwSBsSGJ5yTMh8pr+Xvf0HftWS0NPxQB8="; + }; + + icu = fetchFromGitHub { + owner = "unicode-org"; + repo = "icu"; + rev = "fd123bf023882f07bfacf51c39111be2f946d8f8"; + hash = "sha256-RKJVoKv40nJqDLqUCtEOaP19OxVk9xjfg8mGfRS1a1k="; + }; + + indexstore-db = fetchFromGitHub { + owner = "apple"; + repo = "indexstore-db"; + rev = "89ec16c2ac1bb271614e734a2ee792224809eb20"; + hash = "sha256-2EIzEaVLHZ5vwO8skTaq9HoAaLuT9WFVLMgcgGYuVAk="; + }; + + llbuild = fetchFromGitHub { + owner = "apple"; + repo = "swift-llbuild"; + rev = "d73a305d6e5a82e4bf3bf1727da3d1376e87efab"; + hash = "sha256-wxIpYupJpU0QkAUV/HBmLoWQKGDytIhDOOLzLRjXnw0="; + }; + + llvm-project = fetchFromGitHub { + owner = "apple"; + repo = "llvm-project"; + rev = "2b42c5ce063a374fb22676e27505a22fe411ea8c"; + hash = "sha256-tup4VEbehYhALECe9LFYz4lC3LGOg7WQ7Fl5JWbYIdk="; + }; + + ninja = fetchFromGitHub { + owner = "ninja-build"; + repo = "ninja"; + rev = "448ae1ccacd17025457ace965d78a45a113c70c6"; + hash = "sha256-SDCF3yzgb3XV3kCi8vbAlas+5UyfXjVvNdR9SDbGQPM="; + }; + + sourcekit-lsp = fetchFromGitHub { + owner = "apple"; + repo = "sourcekit-lsp"; + rev = "cb4fb91f772bc40923e30eea38a31206b1a6f912"; + hash = "sha256-YG8TMLLvb5UwgV3wiwgomjk267TEHQV0PNw2OuVugbg="; + }; + + swift = fetchFromGitHub { + owner = "apple"; + repo = "swift"; + rev = "9142833603ab2e876bd766c08194d76741e09a27"; + hash = "sha256-qm7Z2qlOVRqP7W8LWzlymUx4y8OY4jmnHmv3LqKqsbY="; + }; + + swift-argument-parser = fetchFromGitHub { + owner = "apple"; + repo = "swift-argument-parser"; + rev = "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a"; + hash = "sha256-G4Tz/AdL5WbRq93aJnQhMjHLH7dEuhmXL3PPn+0H6vM="; + }; + + swift-asn1 = fetchFromGitHub { + owner = "apple"; + repo = "swift-asn1"; + rev = "805deae27a7506dcad043604c00a9dc52d465dcb"; + hash = "sha256-jUQ/EewNzssb08IHDZDNhlntv4ACso1hzy6OKpg5n0I="; + }; + + swift-atomics = fetchFromGitHub { + owner = "apple"; + repo = "swift-atomics"; + rev = "919eb1d83e02121cdb434c7bfc1f0c66ef17febe"; + hash = "sha256-6fMm8q57/KUS+1xRKzCWO+a45tAxK6SKrhXwOuxhZas="; + }; + + swift-certificates = fetchFromGitHub { + owner = "apple"; + repo = "swift-certificates"; + rev = "35a7df2d9d71c401a47de9be2e3de629a01370c2"; + hash = "sha256-8hy+uMgPJuaoXBwuri8DseVM7eci9YAAv/HuUFbHPTo="; + }; + + swift-cmark-gfm = fetchFromGitHub { + owner = "apple"; + repo = "swift-cmark"; + rev = "f218e5d7691f78b55bfa39b367763f4612486c35"; + hash = "sha256-qJpDdwGFf4AwSBsSGJ5yTMh8pr+Xvf0HftWS0NPxQB8="; + }; + + swift-collections = fetchFromGitHub { + owner = "apple"; + repo = "swift-collections"; + rev = "2d33a0ea89c961dcb2b3da2157963d9c0370347e"; + hash = "sha256-vd3yaYKG0xIeH1sCSlNuQUB38NNFzr6C1lme+MUg70w="; + }; + + swift-corelibs-foundation = fetchFromGitHub { + owner = "apple"; + repo = "swift-corelibs-foundation"; + rev = "5aff3b2861224459fe1f4ba1979d9ca5c4cbb4d3"; + hash = "sha256-9EBBzX4DpjfJHaRp6QWBuMIOFKASrgrt3ILD6aRPzHM="; + }; + + swift-corelibs-libdispatch = fetchFromGitHub { + owner = "apple"; + repo = "swift-corelibs-libdispatch"; + rev = "2053307c15ce83a68fa50e1c97012c4b6961d6d2"; + hash = "sha256-pta3wJj2LJ/lsYAWQpw0wSGLDMO41mN8Zbl78LUCaQo="; + }; + + swift-corelibs-xctest = fetchFromGitHub { + owner = "apple"; + repo = "swift-corelibs-xctest"; + rev = "17df9675d90246edd0b5e747d7923c577717b6e1"; + hash = "sha256-5khqzW4YwZHESiV1lmxlPe6kO4GhYsY6LLxvvcbDOEA="; + }; + + swift-crypto = fetchFromGitHub { + owner = "apple"; + repo = "swift-crypto"; + rev = "33a20e650c33f6d72d822d558333f2085effa3dc"; + hash = "sha256-vBDjXtynl3HMq1RK/hMOu36b+0hX2SRRnwhPNjPUOsU="; + }; + + swift-docc = fetchFromGitHub { + owner = "apple"; + repo = "swift-docc"; + rev = "a0644adfbe854573d2a2a180be396d9a835460c8"; + hash = "sha256-EXkVgI1hxwa1iu6cBcnHDAhT+oTF4U9cgJ3lKlPSR8c="; + }; + + swift-docc-render-artifact = fetchFromGitHub { + owner = "apple"; + repo = "swift-docc-render-artifact"; + rev = "71b756c8944e531c88ad0642762e7f2337d1a191"; + hash = "sha256-zmeUjawNzhNB0psR85EKaRIhW++NAgrBifhm3TeMYy0="; + }; + + swift-docc-symbolkit = fetchFromGitHub { + owner = "apple"; + repo = "swift-docc-symbolkit"; + rev = "d42e3db1c0f97f4a3be9a4552f7003c2959268d5"; + hash = "sha256-wZEcUSjjX79K1v4kzaGWNyXvKTtoWhVtAmLLBA2BtJs="; + }; + + swift-driver = fetchFromGitHub { + owner = "apple"; + repo = "swift-driver"; + rev = "1b2b851ae4718caffa5f18fd1861bc0ddd1791a3"; + hash = "sha256-bZRw/YE6yNS4YLf4R4RvfrH5NzgiD2OEpSMeQRICAtQ="; + }; + + swift-experimental-string-processing = fetchFromGitHub { + owner = "apple"; + repo = "swift-experimental-string-processing"; + rev = "e659e86188d88dd4639acb7607e5f4d7f6eab1fd"; + hash = "sha256-SlP2NHidHJ0ABQ/hRqdUkqJgBPvy1DHZCGEEgxz4Nrw="; + }; + + swift-format = fetchFromGitHub { + owner = "apple"; + repo = "swift-format"; + rev = "1323e87eced56bdcfed1bb78af1f16f39274d032"; + hash = "sha256-TnDZUexCkVxGwcpgsCR2E4fS7kNecP7Sl4wfWk6Ghnw="; + }; + + swift-installer-scripts = fetchFromGitHub { + owner = "apple"; + repo = "swift-installer-scripts"; + rev = "4d5a3519ca1ed98f556c74e1d99e44bf661ae42b"; + hash = "sha256-s57ABZ1GJkJ7bfOfeyIY1H+fbnCF9MnhndoGf4pr5tw="; + }; + + swift-integration-tests = fetchFromGitHub { + owner = "apple"; + repo = "swift-integration-tests"; + rev = "dfb0a0a3f3aade3a928c1fc91418727b1044f9cc"; + hash = "sha256-nx1emv1Y02zN6SVXFnxhBa7WavbnC5Rw6bwo5qQc1Ww="; + }; + + swift-llvm-bindings = fetchFromGitHub { + owner = "apple"; + repo = "swift-llvm-bindings"; + rev = "46c67a9c1018980b92a869ad58a5ac290e64b9e0"; + hash = "sha256-87taAyf52FdH0ERCbvZFqNvCHzeLdCS1rSXBh+mrfkI="; + }; + + swift-lmdb = fetchFromGitHub { + owner = "apple"; + repo = "swift-lmdb"; + rev = "584941b1236b15bad74d8163785d389c028b1ad8"; + hash = "sha256-dZDN2pBOE0ZPtneQvEjF+AE4PDwbcaTausR2W4lg9Ss="; + }; + + swift-markdown = fetchFromGitHub { + owner = "apple"; + repo = "swift-markdown"; + rev = "15bbd521f3efd161995ed55179e9984a7d734c61"; + hash = "sha256-VvGNZWr3G302ue4CGJMmj28v7mJnmIn7hDhc9hbAmVY="; + }; + + swift-nio = fetchFromGitHub { + owner = "apple"; + repo = "swift-nio"; + rev = "1d425b0851ffa2695d488cce1d68df2539f42500"; + hash = "sha256-FscOA/S7on31QCR/MZFjg4ZB3FGJ+rdptZ6MRZJXexE="; + }; + + swift-nio-ssl = fetchFromGitHub { + owner = "apple"; + repo = "swift-nio-ssl"; + rev = "2e74773972bd6254c41ceeda827f229bccbf1c0f"; + hash = "sha256-5QGkmkCOXhG3uOdf0bd3Fo1MFekB8/WcveBXGhtVZKo="; + }; + + swift-numerics = fetchFromGitHub { + owner = "apple"; + repo = "swift-numerics"; + rev = "0a23770641f65a4de61daf5425a37ae32a3fd00d"; + hash = "sha256-wGIJ4hMxIBHy8mqmUGFWPR56wPFlI5qS4N7+nsFqLbs="; + }; + + swift-stress-tester = fetchFromGitHub { + owner = "apple"; + repo = "swift-stress-tester"; + rev = "b74ce5772e40178c464dd2357bccd4c710aacbf0"; + hash = "sha256-m/1gnOoZusgSpC0mrNe3iVBPhgKofGlg51AVQXH+LXo="; + }; + + swift-syntax = fetchFromGitHub { + owner = "apple"; + repo = "swift-syntax"; + rev = "9a101b70eee2a9dec04f92d2d47b22ebe57a1aae"; + hash = "sha256-yc7pPnBVdFC9lIJ3IwrMI72Rp8BRsQleuK1rtH3x7+0="; + }; + + swift-system = fetchFromGitHub { + owner = "apple"; + repo = "swift-system"; + rev = "836bc4557b74fe6d2660218d56e3ce96aff76574"; + hash = "sha256-p18QHzO+NtoY/WQzOD+PfD+bjqrIWsbeEbsJLPqEAhA="; + }; + + swift-tools-support-core = fetchFromGitHub { + owner = "apple"; + repo = "swift-tools-support-core"; + rev = "5665fc7641ce1a971ad06faaa476862b222ef44b"; + hash = "sha256-M6ftbtPayZk6lkU1O8J5KdQOb1Xfo+LldrtkVUQnCHY="; + }; + + swift-xcode-playground-support = fetchFromGitHub { + owner = "apple"; + repo = "swift-xcode-playground-support"; + rev = "bbba1ba704c37d1d0131bb7d6986a80ad8cb6d6c"; + hash = "sha256-esv5h1SLs/oy7hr4CwhnHufwlBxu2Q+gfbTYU/LlkyE="; + }; + + swiftpm = fetchFromGitHub { + owner = "apple"; + repo = "swift-package-manager"; + rev = "2b7ebe65a258faf26e7bf57c3b7a36d727017518"; + hash = "sha256-u54/P6qRpKloakBlq+fWqrVhg4RYjxBtDPp281VopwU="; + }; + + yams = fetchFromGitHub { + owner = "jpsim"; + repo = "Yams"; + rev = "01835dc202670b5bb90d07f3eae41867e9ed29f6"; + hash = "sha256-5qxuCkmopm3uFcoYJKQA8ofW98f53H1gZaPiOh2DS4U="; + }; + +} diff --git a/pkgs/development/compilers/swift/swift-docc/generated/default.nix b/pkgs/development/compilers/swift/swift-docc/generated/default.nix index 47822ca40bb48..f797d91ba67be 100644 --- a/pkgs/development/compilers/swift/swift-docc/generated/default.nix +++ b/pkgs/development/compilers/swift/swift-docc/generated/default.nix @@ -3,12 +3,12 @@ workspaceStateFile = ./workspace-state.json; hashes = { "swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; - "swift-cmark" = "1qswlh6j9mlfq8qj7xfqspla7w7rrzvplgcs4mgllgi012yfgwnp"; + "swift-cmark" = "02n7y24pwg52zv6ikcfb8zdkw4x6svs3qmw6ypd1c884zdkgmgj0"; "swift-crypto" = "020b8q4ss2k7a65r5dgh59z40i6sn7ij1allxkh8c8a9d0jzn313"; "swift-docc-plugin" = "11d6nhi139yzk1lxxrixsbgyj1bnvmh40wj30y725q83nqq49ljh"; - "swift-docc-symbolkit" = "14w37wzbx1mygfwm4iv0ypj120n1axhk627rg5a7v8j0ln511r7s"; + "swift-docc-symbolkit" = "16xlh46h9jv209niank87clyy99pjshws97ysr5bypz3518ir4f1"; "swift-lmdb" = "0azmc24mnxn4pbda8w8v7hy3h0gqqm4br43pnr7lc4sfj3dcv43m"; - "swift-markdown" = "1l4ydc0xyv88gnyc33p61qavdh8cv98c548n1icphrfd6i78yygw"; + "swift-markdown" = "1b1y2ic2sshhja1vsjsiic8s3s4ldy5x2c0wdkdhk92d6pm3vij1"; "swift-nio" = "04bvay94b34ynmlvgyl9a7f431l3cf8k2zr483spv8mvyh1hxiqn"; }; } diff --git a/pkgs/development/compilers/swift/swift-docc/generated/workspace-state.json b/pkgs/development/compilers/swift/swift-docc/generated/workspace-state.json index 699de93f79079..77b98e5358854 100644 --- a/pkgs/development/compilers/swift/swift-docc/generated/workspace-state.json +++ b/pkgs/development/compilers/swift/swift-docc/generated/workspace-state.json @@ -29,8 +29,8 @@ }, "state": { "checkoutState": { - "branch": "gfm", - "revision": "eb9a6a357b6816c68f4b194eaa5b67f3cd1fa5c3" + "branch": "release/5.9", + "revision": "86aeb491675de6f077a3a6df6cbcac1a25dcbee1" }, "name": "sourceControlCheckout" }, @@ -80,8 +80,8 @@ }, "state": { "checkoutState": { - "branch": "main", - "revision": "b45d1f2ed151d057b54504d653e0da5552844e34" + "branch": "release/5.9", + "revision": "d42e3db1c0f97f4a3be9a4552f7003c2959268d5" }, "name": "sourceControlCheckout" }, @@ -97,7 +97,7 @@ }, "state": { "checkoutState": { - "branch": "main", + "branch": "release/5.9", "revision": "584941b1236b15bad74d8163785d389c028b1ad8" }, "name": "sourceControlCheckout" @@ -114,8 +114,8 @@ }, "state": { "checkoutState": { - "branch": "main", - "revision": "d491147940587dbadfb3472354f4d0c6e063e061" + "branch": "release/5.9", + "revision": "bbeb362919d903eb722c913ad49a1b23d27bdc00" }, "name": "sourceControlCheckout" }, diff --git a/pkgs/development/compilers/swift/swift-driver/default.nix b/pkgs/development/compilers/swift/swift-driver/default.nix index d69a4da0eb3e1..0a60af66736bc 100644 --- a/pkgs/development/compilers/swift/swift-driver/default.nix +++ b/pkgs/development/compilers/swift/swift-driver/default.nix @@ -39,12 +39,6 @@ stdenv.mkDerivation { ./patches/nix-resource-root.patch ./patches/disable-catalyst.patch ./patches/linux-fix-linking.patch - # TODO: Replace with branch patch once merged: - # https://github.com/apple/swift-driver/pull/1197 - (fetchpatch { - url = "https://github.com/apple/swift-driver/commit/d3ef9cdf4871a58eddec7ff0e28fe611130da3f9.patch"; - hash = "sha256-eVBaKN6uzj48ZnHtwGV0k5ChKjak1tDCyE+wTdyGq2c="; - }) # Prevent a warning about SDK directories we don't have. (substituteAll { src = ./patches/prevent-sdk-dirs-warnings.patch; diff --git a/pkgs/development/compilers/swift/swift-driver/generated/default.nix b/pkgs/development/compilers/swift/swift-driver/generated/default.nix index cb6f3cca078e0..d4c4b2214999c 100644 --- a/pkgs/development/compilers/swift/swift-driver/generated/default.nix +++ b/pkgs/development/compilers/swift/swift-driver/generated/default.nix @@ -2,10 +2,10 @@ { workspaceStateFile = ./workspace-state.json; hashes = { - "swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; - "swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; + "swift-argument-parser" = "1wza0znrzkvk5ybikfj4nwgwnc9j45s2dnnxmg8ndrab0zyg710v"; + "swift-llbuild" = "111bsckdybwm6j0pssfx741s9yv3abqxy7scnvjfl29wqv196qc4"; "swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; - "swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; + "swift-tools-support-core" = "0pg8yg87x1zzn4kz426c4vb28khx3vb8j0672bf40k6i6p7msya3"; "Yams" = "11abhcfkmqm3cmh7vp7rqzvxd1zj02j2866a2pp6v9m89456xb76"; }; } diff --git a/pkgs/development/compilers/swift/swift-driver/generated/workspace-state.json b/pkgs/development/compilers/swift/swift-driver/generated/workspace-state.json index 09f0b7398d979..1e19ea57697b8 100644 --- a/pkgs/development/compilers/swift/swift-driver/generated/workspace-state.json +++ b/pkgs/development/compilers/swift/swift-driver/generated/workspace-state.json @@ -12,8 +12,8 @@ }, "state": { "checkoutState": { - "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", - "version": "1.0.3" + "revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", + "version": "1.2.2" }, "name": "sourceControlCheckout" }, @@ -29,8 +29,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" + "branch": "release/5.9", + "revision": "0d6e4f2db7fb3b8c9a48afb6a9a435736212cae0" }, "name": "sourceControlCheckout" }, @@ -63,8 +63,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" + "branch": "release/5.9", + "revision": "cab96f6bcce855feec8b85286205a7d15a275b6a" }, "name": "sourceControlCheckout" }, diff --git a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch b/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch index 8f91b3a234b50..e90cfdd476c5a 100644 --- a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch +++ b/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch @@ -1,3 +1,4 @@ +ndex 518c6e95..6061047b 100644 --- a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift +++ b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift @@ -10,6 +10,7 @@ @@ -8,10 +9,10 @@ import SwiftOptions import func TSCBasic.lookupExecutablePath -@@ -120,7 +121,20 @@ extension GenericUnixToolchain { - // just using `clang` and avoid a dependency on the C++ runtime. - let clangTool: Tool = - parsedOptions.hasArgument(.enableExperimentalCxxInterop) ? .clangxx : .clang +@@ -126,7 +127,20 @@ extension GenericUnixToolchain { + } + + let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang - var clangPath = try getToolPath(clangTool) + + // For Nix, prefer linking using the wrapped system clang, instead of using @@ -21,7 +22,7 @@ + let env = ProcessInfo.processInfo.environment + if let nixCC = env["NIX_CC"], + let binPath = try? AbsolutePath(validating: "\(nixCC)/bin"), -+ let tool = lookupExecutablePath(filename: parsedOptions.hasArgument(.enableExperimentalCxxInterop) ++ let tool = lookupExecutablePath(filename: cxxCompatEnabled + ? "clang++" : "clang", + searchPaths: [binPath]) { + clangPath = tool @@ -30,7 +31,7 @@ if let toolsDirPath = parsedOptions.getLastArgument(.toolsDirectory) { // FIXME: What if this isn't an absolute path? let toolsDir = try AbsolutePath(validating: toolsDirPath.asSingle) -@@ -136,6 +150,7 @@ extension GenericUnixToolchain { +@@ -142,6 +156,7 @@ extension GenericUnixToolchain { commandLine.appendFlag("-B") commandLine.appendPath(toolsDir) } diff --git a/pkgs/development/compilers/swift/swift-format/default.nix b/pkgs/development/compilers/swift/swift-format/default.nix index 2f7e630e68045..d68801aac6e2d 100644 --- a/pkgs/development/compilers/swift/swift-format/default.nix +++ b/pkgs/development/compilers/swift/swift-format/default.nix @@ -19,10 +19,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ swift swiftpm ]; buildInputs = [ Foundation ]; - configurePhase = generated.configure + '' - swiftpmMakeMutable swift-tools-support-core - patch -p1 -d .build/checkouts/swift-tools-support-core -i ${./patches/force-unwrap-file-handles.patch} - ''; + configurePhase = generated.configure; # We only install the swift-format binary, so don't need the other products. swiftpmFlags = [ "--product swift-format" ]; diff --git a/pkgs/development/compilers/swift/swift-format/generated/default.nix b/pkgs/development/compilers/swift/swift-format/generated/default.nix index ec4969bc60b50..4bf855cc4c3ef 100644 --- a/pkgs/development/compilers/swift/swift-format/generated/default.nix +++ b/pkgs/development/compilers/swift/swift-format/generated/default.nix @@ -2,9 +2,7 @@ { workspaceStateFile = ./workspace-state.json; hashes = { - "swift-argument-parser" = "01p814snzlfpby2qj67a3dcnsa6038fbk8411npi28440w1hzpzx"; - "swift-syntax" = "05394mzznmcrw246lyzsjsn1fmilj98jgkjyyxr2ynhnbgzp2jl2"; - "swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; - "swift-tools-support-core" = "16kp0y1akr99v319j46x0zwc8kzh5klnqcvjhsb57ah5xr0l29bk"; + "swift-argument-parser" = "1463yiahwa8qwgzbbxfzj3srcr9yx8z71lniqqaj8hvav3dpfhm8"; + "swift-syntax" = "1vggy5yv8sxdp1g0kcaiq2kr3g93rh526xw2jjym0x2mf0zfkkn9"; }; } diff --git a/pkgs/development/compilers/swift/swift-format/generated/workspace-state.json b/pkgs/development/compilers/swift/swift-format/generated/workspace-state.json index b726eefc56ee5..bdf42e92c49b3 100644 --- a/pkgs/development/compilers/swift/swift-format/generated/workspace-state.json +++ b/pkgs/development/compilers/swift/swift-format/generated/workspace-state.json @@ -12,8 +12,8 @@ }, "state": { "checkoutState": { - "branch": "main", - "revision": "c5050aa63ed5bb23209e7120b7ff6618ee06e0ee" + "revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version": "1.2.3" }, "name": "sourceControlCheckout" }, @@ -25,50 +25,16 @@ "identity": "swift-syntax", "kind": "remoteSourceControl", "location": "https://github.com/apple/swift-syntax.git", - "name": "SwiftSyntax" + "name": "swift-syntax" }, "state": { "checkoutState": { - "branch": "main", - "revision": "cd793adf5680e138bf2bcbaacc292490175d0dcd" + "branch": "release/5.9", + "revision": "9a101b70eee2a9dec04f92d2d47b22ebe57a1aae" }, "name": "sourceControlCheckout" }, "subpath": "swift-syntax" - }, - { - "basedOn": null, - "packageRef": { - "identity": "swift-system", - "kind": "remoteSourceControl", - "location": "https://github.com/apple/swift-system.git", - "name": "swift-system" - }, - "state": { - "checkoutState": { - "revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", - "version": "1.1.1" - }, - "name": "sourceControlCheckout" - }, - "subpath": "swift-system" - }, - { - "basedOn": null, - "packageRef": { - "identity": "swift-tools-support-core", - "kind": "remoteSourceControl", - "location": "https://github.com/apple/swift-tools-support-core.git", - "name": "swift-tools-support-core" - }, - "state": { - "checkoutState": { - "branch": "main", - "revision": "1296d2f11b0226c4b83540010936c7238d21c12b" - }, - "name": "sourceControlCheckout" - }, - "subpath": "swift-tools-support-core" } ] }, diff --git a/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch b/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch deleted file mode 100644 index a2f2d38c37c81..0000000000000 --- a/pkgs/development/compilers/swift/swift-format/patches/force-unwrap-file-handles.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8d9ab4b6ed24a97e8af0cc338a52aacdcf438b8c Mon Sep 17 00:00:00 2001 -From: Pavel Sobolev -Date: Tue, 21 Nov 2023 20:53:33 +0300 -Subject: [PATCH] Force-unwrap file handles. - ---- - Sources/TSCBasic/FileSystem.swift | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Sources/TSCBasic/FileSystem.swift b/Sources/TSCBasic/FileSystem.swift -index 3a63bdf..a1f3d9d 100644 ---- a/Sources/TSCBasic/FileSystem.swift -+++ b/Sources/TSCBasic/FileSystem.swift -@@ -425,7 +425,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Read the data one block at a time. - let data = BufferedOutputByteStream() -@@ -455,7 +455,7 @@ private class LocalFileSystem: FileSystem { - if fp == nil { - throw FileSystemError(errno: errno, path) - } -- defer { fclose(fp) } -+ defer { fclose(fp!) } - - // Write the data in one chunk. - var contents = bytes.contents --- -2.42.0 diff --git a/pkgs/development/compilers/swift/swiftpm/cmake-glue.nix b/pkgs/development/compilers/swift/swiftpm/cmake-glue.nix index 252040dd3ec01..34c552ae5ede5 100644 --- a/pkgs/development/compilers/swift/swiftpm/cmake-glue.nix +++ b/pkgs/development/compilers/swift/swiftpm/cmake-glue.nix @@ -21,6 +21,16 @@ let ''; in lib.mapAttrs mkInstallScript { + SwiftASN1 = '' + add_library(SwiftASN1 SHARED IMPORTED) + set_property(TARGET SwiftASN1 PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libSwiftASN1@sharedLibExt@") + ''; + + SwiftCertificates = '' + add_library(SwiftCertificates SHARED IMPORTED) + set_property(TARGET SwiftCertificates PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libSwiftCertificates@sharedLibExt@") + ''; + SwiftSystem = '' add_library(SwiftSystem::SystemPackage STATIC IMPORTED) set_property(TARGET SwiftSystem::SystemPackage PROPERTY IMPORTED_LOCATION "@out@/lib/swift_static/@swiftOs@/libSystemPackage@staticLibExt@") @@ -83,5 +93,8 @@ in lib.mapAttrs mkInstallScript { SwiftCrypto = '' add_library(Crypto SHARED IMPORTED) set_property(TARGET Crypto PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCrypto@sharedLibExt@") + + add_library(_CryptoExtras SHARED IMPORTED) + set_property(TARGET _CryptoExtras PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/lib_CryptoExtras@sharedLibExt@") ''; } diff --git a/pkgs/development/compilers/swift/swiftpm/default.nix b/pkgs/development/compilers/swift/swiftpm/default.nix index 4a7a4ab63cced..3231fceb02fcd 100644 --- a/pkgs/development/compilers/swift/swiftpm/default.nix +++ b/pkgs/development/compilers/swift/swiftpm/default.nix @@ -23,7 +23,7 @@ let - inherit (swift) swiftOs swiftModuleSubdir swiftStaticModuleSubdir; + inherit (swift) swiftOs swiftLibSubdir swiftModuleSubdir swiftStaticModuleSubdir; sharedLibraryExt = stdenv.hostPlatform.extensions.sharedLibrary; sources = callPackage ../sources.nix { }; @@ -33,13 +33,12 @@ let # Common attributes for the bootstrap swiftpm and the final swiftpm. commonAttrs = { inherit (sources) version; - src = sources.swift-package-manager; + src = sources.swiftpm; nativeBuildInputs = [ makeWrapper ]; # Required at run-time for the host platform to build package manifests. propagatedBuildInputs = [ Foundation ]; patches = [ ./patches/cmake-disable-rpath.patch - ./patches/cmake-fix-quoting.patch ./patches/disable-index-store.patch ./patches/disable-sandbox.patch ./patches/disable-xctest.patch @@ -60,21 +59,6 @@ let --replace \ 'librariesPath = applicationPath.parentDirectory' \ "librariesPath = AbsolutePath(\"$out\")" - - # Fix case-sensitivity issues. - # Upstream PR: https://github.com/apple/swift-package-manager/pull/6500 - substituteInPlace Sources/CMakeLists.txt \ - --replace \ - 'packageCollectionsSigning' \ - 'PackageCollectionsSigning' - substituteInPlace Sources/PackageCollectionsSigning/CMakeLists.txt \ - --replace \ - 'SubjectPublickeyInfo' \ - 'SubjectPublicKeyInfo' - substituteInPlace Sources/PackageCollections/CMakeLists.txt \ - --replace \ - 'FilepackageCollectionsSourcesStorage' \ - 'FilePackageCollectionsSourcesStorage' ''; }; @@ -162,6 +146,25 @@ let # In the end, we don't expose these derivations, and they only exist during # the bootstrap phase. The final swiftpm derivation does not depend on them. + swift-asn1 = mkBootstrapDerivation { + name = "swift-asn1"; + src = generated.sources.swift-asn1; + + postInstall = cmakeGlue.SwiftASN1; + }; + + swift-certificates = mkBootstrapDerivation { + name = "swift-certificates"; + src = generated.sources.swift-certificates; + + buildInputs = [ + swift-asn1 + swift-crypto + ]; + + postInstall = cmakeGlue.SwiftCertificates; + }; + swift-system = mkBootstrapDerivation { name = "swift-system"; src = generated.sources.swift-system; @@ -321,6 +324,10 @@ let name = "swift-crypto"; src = generated.sources.swift-crypto; + patches = [ + ./patches/swift-crypto-cmake-install-extras.patch + ]; + postPatch = '' # Fix use of hardcoded tool paths on Darwin. substituteInPlace CMakeLists.txt \ @@ -345,7 +352,9 @@ let buildInputs = [ llbuild sqlite + swift-asn1 swift-argument-parser + swift-certificates swift-collections swift-crypto swift-driver diff --git a/pkgs/development/compilers/swift/swiftpm/generated/default.nix b/pkgs/development/compilers/swift/swiftpm/generated/default.nix index dbcd0f18e71fc..bfcb4d094dece 100644 --- a/pkgs/development/compilers/swift/swiftpm/generated/default.nix +++ b/pkgs/development/compilers/swift/swiftpm/generated/default.nix @@ -2,13 +2,15 @@ { workspaceStateFile = ./workspace-state.json; hashes = { - "swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; - "swift-collections" = "1k6sjx5rqmp3gklny77b480hyzy6gkhpi23r0s8ljfbrcwawgnan"; - "swift-crypto" = "0kllp7j0hd8k67l9b9zr2c3ddc5bvshldchzivhcz3q31qvq9ag8"; - "swift-driver" = "0cbvddj54k3sbw0vzlmzhccs7h43hi5kq6i3n2i0mysz3bf0c6zg"; - "swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; + "swift-argument-parser" = "1463yiahwa8qwgzbbxfzj3srcr9yx8z71lniqqaj8hvav3dpfhm8"; + "swift-asn1" = "0hlz76c2m3ifrxhqvch2h2zysnc6rn80s1y2scdwpkhdxh8kyi4d"; + "swift-certificates" = "0fixqxb51vpipw081x92wznlrrdi0cpswbhwbjlfc9hgr2wbw77j"; + "swift-collections" = "0i19czvb1j0xjbg238k802g72dpsa9mvxn9wf16jc3bgckvgbn2q"; + "swift-crypto" = "1i9sshrkckq8kx8j9nap93xrnzmv1q9zwjjlmg6735x7vigf645w"; + "swift-driver" = "1m02089427i3ln2663r270vzkcbydy24gy5pc2wd9j1sh7yp153d"; + "swift-llbuild" = "03czswc2vwz2711qid7jc0l9119fcrqgq585j084v9a9x9i2j4n3"; "swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; - "swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; - "Yams" = "0b4lprxl4f6yqq0djnp394mxgmsxm2pljr7fh4f6ihdhnpwfsfvl"; + "swift-tools-support-core" = "0xh84x25ar5vfvjy58yzamphxm19g713nda5jqx9kjfssdpfv9rk"; + "Yams" = "1jf3k2lm5b9i8m9bpnzhqa8mnc3qzj91icv5ykjplk3vy0idz3q1"; }; } diff --git a/pkgs/development/compilers/swift/swiftpm/generated/workspace-state.json b/pkgs/development/compilers/swift/swiftpm/generated/workspace-state.json index 187df519fb7b3..1d2dc721083e9 100644 --- a/pkgs/development/compilers/swift/swiftpm/generated/workspace-state.json +++ b/pkgs/development/compilers/swift/swiftpm/generated/workspace-state.json @@ -12,13 +12,47 @@ }, "state": { "checkoutState": { - "revision": "e394bf350e38cb100b6bc4172834770ede1b7232", - "version": "1.0.3" + "revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version": "1.2.3" }, "name": "sourceControlCheckout" }, "subpath": "swift-argument-parser" }, + { + "basedOn": null, + "packageRef": { + "identity": "swift-asn1", + "kind": "remoteSourceControl", + "location": "https://github.com/apple/swift-asn1.git", + "name": "swift-asn1" + }, + "state": { + "checkoutState": { + "revision": "805deae27a7506dcad043604c00a9dc52d465dcb", + "version": "0.7.0" + }, + "name": "sourceControlCheckout" + }, + "subpath": "swift-asn1" + }, + { + "basedOn": null, + "packageRef": { + "identity": "swift-certificates", + "kind": "remoteSourceControl", + "location": "https://github.com/apple/swift-certificates.git", + "name": "swift-certificates" + }, + "state": { + "checkoutState": { + "revision": "35a7df2d9d71c401a47de9be2e3de629a01370c2", + "version": "0.4.1" + }, + "name": "sourceControlCheckout" + }, + "subpath": "swift-certificates" + }, { "basedOn": null, "packageRef": { @@ -29,8 +63,8 @@ }, "state": { "checkoutState": { - "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version": "1.0.4" + "revision": "d029d9d39c87bed85b1c50adee7c41795261a192", + "version": "1.0.6" }, "name": "sourceControlCheckout" }, @@ -46,8 +80,8 @@ }, "state": { "checkoutState": { - "revision": "75ec60b8b4cc0f085c3ac414f3dca5625fa3588e", - "version": "2.2.4" + "revision": "33a20e650c33f6d72d822d558333f2085effa3dc", + "version": "2.5.0" }, "name": "sourceControlCheckout" }, @@ -63,8 +97,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "7cfe0c0b6e6297efe88a3ce34e6138ee7eda969e" + "branch": "release/5.9", + "revision": "1b2b851ae4718caffa5f18fd1861bc0ddd1791a3" }, "name": "sourceControlCheckout" }, @@ -80,8 +114,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" + "branch": "release/5.9", + "revision": "d73a305d6e5a82e4bf3bf1727da3d1376e87efab" }, "name": "sourceControlCheckout" }, @@ -114,8 +148,8 @@ }, "state": { "checkoutState": { - "branch": "release/5.8", - "revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" + "branch": "release/5.9", + "revision": "5665fc7641ce1a971ad06faaa476862b222ef44b" }, "name": "sourceControlCheckout" }, @@ -131,8 +165,8 @@ }, "state": { "checkoutState": { - "revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", - "version": "5.0.5" + "revision": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", + "version": "5.0.6" }, "name": "sourceControlCheckout" }, diff --git a/pkgs/development/compilers/swift/swiftpm/patches/cmake-disable-rpath.patch b/pkgs/development/compilers/swift/swiftpm/patches/cmake-disable-rpath.patch index 9aeba452f9e80..7a1da6fad80d7 100644 --- a/pkgs/development/compilers/swift/swiftpm/patches/cmake-disable-rpath.patch +++ b/pkgs/development/compilers/swift/swiftpm/patches/cmake-disable-rpath.patch @@ -2,14 +2,15 @@ Disable rpath for the bootstrap build with CMake. --- a/Sources/PackageDescription/CMakeLists.txt +++ b/Sources/PackageDescription/CMakeLists.txt -@@ -31,14 +31,11 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/ManifestAPI/PackageDescription.swiftinterface) - target_compile_options(PackageDescription PUBLIC - $<$:-emit-module-interface-path$${SWIFT_INTERFACE_PATH}>) +@@ -26,15 +26,9 @@ add_library(PackageDescription + target_compile_options(PackageDescription PUBLIC + $<$:-package-description-version$999.0>) + +-if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - target_link_options(PackageDescription PRIVATE - "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackageDescription.dylib") - endif() - +-endif() +- set_target_properties(PackageDescription PROPERTIES Swift_MODULE_NAME PackageDescription Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI @@ -19,7 +20,7 @@ Disable rpath for the bootstrap build with CMake. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI --- a/Sources/PackagePlugin/CMakeLists.txt +++ b/Sources/PackagePlugin/CMakeLists.txt -@@ -29,14 +29,11 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) +@@ -30,14 +30,11 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftinterface) target_compile_options(PackagePlugin PUBLIC $<$:-emit-module-interface-path$${SWIFT_INTERFACE_PATH}>) diff --git a/pkgs/development/compilers/swift/swiftpm/patches/cmake-fix-quoting.patch b/pkgs/development/compilers/swift/swiftpm/patches/cmake-fix-quoting.patch deleted file mode 100644 index 04f51e9ec8351..0000000000000 --- a/pkgs/development/compilers/swift/swiftpm/patches/cmake-fix-quoting.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/Sources/PackageCollectionsSigning/CMakeLists.txt -+++ b/Sources/PackageCollectionsSigning/CMakeLists.txt -@@ -43,6 +43,7 @@ target_link_libraries(PackageCollectionsSigning PUBLIC - PackageCollectionsModel - TSCBasic) - target_link_libraries(PackageCollectionsSigning PRIVATE -- PackageCollectionsSigningLibc -- $<$:SHELL:-Xlinker -framework -Xlinker Security>) -+ PackageCollectionsSigningLibc) -+target_link_options(PackageCollectionsSigning PRIVATE -+ "$<$:SHELL:-Xlinker -framework -Xlinker Security>") - diff --git a/pkgs/development/compilers/swift/swiftpm/patches/disable-sandbox.patch b/pkgs/development/compilers/swift/swiftpm/patches/disable-sandbox.patch index 0c76d59f9dfb1..425e77a1ef7c1 100644 --- a/pkgs/development/compilers/swift/swiftpm/patches/disable-sandbox.patch +++ b/pkgs/development/compilers/swift/swiftpm/patches/disable-sandbox.patch @@ -2,13 +2,18 @@ Nix may already sandbox the build, in which case sandbox_apply will fail. --- a/Sources/Basics/Sandbox.swift +++ b/Sources/Basics/Sandbox.swift -@@ -33,12 +33,14 @@ public enum Sandbox { - readOnlyDirectories: [AbsolutePath] = [] +@@ -57,6 +57,8 @@ public enum Sandbox { + allowNetworkConnections: [SandboxNetworkPermission] = [] ) throws -> [String] { #if os(macOS) + let env = ProcessInfo.processInfo.environment + if env["NIX_BUILD_TOP"] == nil || env["IN_NIX_SHELL"] != nil { - let profile = try macOSSandboxProfile(strictness: strictness, writableDirectories: writableDirectories, readOnlyDirectories: readOnlyDirectories) + let profile = try macOSSandboxProfile( + fileSystem: fileSystem, + strictness: strictness, +@@ -65,10 +67,10 @@ public enum Sandbox { + allowNetworkConnections: allowNetworkConnections + ) return ["/usr/bin/sandbox-exec", "-p", profile] + command - #else + } diff --git a/pkgs/development/compilers/swift/swiftpm/patches/disable-xctest.patch b/pkgs/development/compilers/swift/swiftpm/patches/disable-xctest.patch index b587393dc2a21..cdfdb58078a44 100644 --- a/pkgs/development/compilers/swift/swiftpm/patches/disable-xctest.patch +++ b/pkgs/development/compilers/swift/swiftpm/patches/disable-xctest.patch @@ -12,26 +12,3 @@ command-line runner available, so disable support. let data: String = try withTemporaryFile { tempFile in let args = [try Self.xctestHelperPath(swiftTool: swiftTool).pathString, path.pathString, tempFile.path.pathString] var env = try Self.constructTestEnvironment( ---- a/Sources/swiftpm-xctest-helper/main.swift -+++ b/Sources/swiftpm-xctest-helper/main.swift -@@ -11,8 +11,11 @@ - //===----------------------------------------------------------------------===// - - #if os(macOS) --import XCTest - import func Darwin.C.exit -+print("Not supported in Nix.") -+exit(1) -+#if false -+import XCTest - - /// A helper tool to get list of tests from a XCTest Bundle on macOS. - /// -@@ -134,6 +137,7 @@ do { - exit(1) - } - -+#endif // nix - #else - - #if os(Windows) diff --git a/pkgs/development/compilers/swift/swiftpm/patches/fix-clang-cxx.patch b/pkgs/development/compilers/swift/swiftpm/patches/fix-clang-cxx.patch index 93c43c664ed36..b9abe70d3a2a2 100644 --- a/pkgs/development/compilers/swift/swiftpm/patches/fix-clang-cxx.patch +++ b/pkgs/development/compilers/swift/swiftpm/patches/fix-clang-cxx.patch @@ -4,18 +4,18 @@ swiftpm to properly invoke clang++. --- a/Sources/Build/BuildPlan.swift +++ b/Sources/Build/BuildPlan.swift -@@ -2089,7 +2089,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan { +@@ -638,7 +638,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan { for target in dependencies.staticTargets { if case let target as ClangTarget = target.underlyingTarget, target.isCXX { - if buildParameters.hostTriple.isDarwin() { + if buildParameters.triple.isDarwin() { - buildProduct.additionalFlags += ["-lc++"] + buildProduct.additionalFlags += ["-lc++", "-lc++abi"] - } else if buildParameters.hostTriple.isWindows() { + } else if buildParameters.triple.isWindows() { // Don't link any C++ library. } else { --- a/Sources/Build/LLBuildManifestBuilder.swift +++ b/Sources/Build/LLBuildManifestBuilder.swift -@@ -786,7 +786,7 @@ extension LLBuildManifestBuilder { +@@ -871,7 +871,7 @@ extension LLBuildManifestBuilder { args += ["-c", path.source.pathString, "-o", path.object.pathString] @@ -26,8 +26,8 @@ swiftpm to properly invoke clang++. let objectFileNode: Node = .file(path.object) --- a/Sources/PackageModel/Toolchain.swift +++ b/Sources/PackageModel/Toolchain.swift -@@ -23,7 +23,7 @@ public protocol Toolchain { - var macosSwiftStdlib: AbsolutePath { get throws } +@@ -35,7 +35,7 @@ public protocol Toolchain { + var librarySearchPaths: [AbsolutePath] { get } /// Path of the `clang` compiler. - func getClangCompiler() throws -> AbsolutePath @@ -37,7 +37,7 @@ swiftpm to properly invoke clang++. // the OSS clang compiler. This API should not used for any other purpose. --- a/Sources/PackageModel/UserToolchain.swift +++ b/Sources/PackageModel/UserToolchain.swift -@@ -57,7 +57,7 @@ public final class UserToolchain: Toolchain { +@@ -62,7 +62,7 @@ public final class UserToolchain: Toolchain { /// Only use search paths, do not fall back to `xcrun`. let useXcrun: Bool @@ -46,7 +46,7 @@ swiftpm to properly invoke clang++. private let environment: EnvironmentVariables -@@ -196,29 +196,31 @@ public final class UserToolchain: Toolchain { +@@ -233,33 +233,35 @@ public final class UserToolchain: Toolchain { } /// Returns the path to clang compiler tool. @@ -59,10 +59,14 @@ swiftpm to properly invoke clang++. } // Check in the environment variable first. -- if let toolPath = UserToolchain.lookup(variable: "CC", searchPaths: self.envSearchPaths, environment: environment) { -- self._clangCompiler = toolPath + let envVar = isCXX ? "CXX" : "CC"; -+ if let toolPath = UserToolchain.lookup(variable: envVar, searchPaths: self.envSearchPaths, environment: environment) { + if let toolPath = UserToolchain.lookup( +- variable: "CC", ++ variable: envVar, + searchPaths: self.envSearchPaths, + environment: environment + ) { +- self._clangCompiler = toolPath + self._clangCompiler[isCXX] = toolPath return toolPath } @@ -70,9 +74,9 @@ swiftpm to properly invoke clang++. // Then, check the toolchain. + let tool = isCXX ? "clang++" : "clang"; do { -- if let toolPath = try? UserToolchain.getTool("clang", binDir: self.destination.toolchainBinDir) { +- if let toolPath = try? UserToolchain.getTool("clang", binDirectories: self.destination.toolset.rootPaths) { - self._clangCompiler = toolPath -+ if let toolPath = try? UserToolchain.getTool(tool, binDir: self.destination.binDir) { ++ if let toolPath = try? UserToolchain.getTool(tool, binDirectories: self.destination.toolset.rootPaths) { + self._clangCompiler[isCXX] = toolPath return toolPath } @@ -88,7 +92,7 @@ swiftpm to properly invoke clang++. --- a/Sources/SPMBuildCore/BuildParameters.swift +++ b/Sources/SPMBuildCore/BuildParameters.swift -@@ -394,7 +394,7 @@ private struct _Toolchain: Encodable { +@@ -446,7 +446,7 @@ private struct _Toolchain: Encodable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(toolchain.swiftCompilerPath, forKey: .swiftCompiler) @@ -99,7 +103,7 @@ swiftpm to properly invoke clang++. // Maintaining `extraCPPFlags` key for compatibility with older encoding. --- a/Sources/XCBuildSupport/XcodeBuildSystem.swift +++ b/Sources/XCBuildSupport/XcodeBuildSystem.swift -@@ -182,7 +182,7 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem { +@@ -189,7 +189,7 @@ public final class XcodeBuildSystem: SPMBuildCore.BuildSystem { // Generate a table of any overriding build settings. var settings: [String: String] = [:] // An error with determining the override should not be fatal here. @@ -110,10 +114,10 @@ swiftpm to properly invoke clang++. settings["LIBRARY_SEARCH_PATHS"] = "$(inherited) \(try buildParameters.toolchain.toolchainLibDir.pathString)" --- a/Tests/BuildTests/MockBuildTestHelper.swift +++ b/Tests/BuildTests/MockBuildTestHelper.swift -@@ -23,7 +23,7 @@ struct MockToolchain: PackageModel.Toolchain { - #else - let extraFlags = BuildFlags(cxxCompilerFlags: ["-lstdc++"]) - #endif +@@ -36,7 +36,7 @@ struct MockToolchain: PackageModel.Toolchain { + + let extraFlags = PackageModel.BuildFlags() + - func getClangCompiler() throws -> AbsolutePath { + func getClangCompiler(isCXX: Bool) throws -> AbsolutePath { return AbsolutePath(path: "/fake/path/to/clang") diff --git a/pkgs/development/compilers/swift/swiftpm/patches/swift-crypto-cmake-install-extras.patch b/pkgs/development/compilers/swift/swiftpm/patches/swift-crypto-cmake-install-extras.patch new file mode 100644 index 0000000000000..ca3b281844c4f --- /dev/null +++ b/pkgs/development/compilers/swift/swiftpm/patches/swift-crypto-cmake-install-extras.patch @@ -0,0 +1,10 @@ +CMake doesn't install this, but dependants use it. + +--- a/Sources/_CryptoExtras/CMakeLists.txt ++++ b/Sources/_CryptoExtras/CMakeLists.txt +@@ -42,4 +42,5 @@ target_link_options(_CryptoExtras PRIVATE + set_target_properties(_CryptoExtras PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) + ++_install_target(_CryptoExtras) + set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS _CryptoExtras) diff --git a/pkgs/development/compilers/swift/update.sh b/pkgs/development/compilers/swift/update.sh new file mode 100755 index 0000000000000..073b7d16e1481 --- /dev/null +++ b/pkgs/development/compilers/swift/update.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -E "with import {}; runCommandWith { name = \"shell\"; inherit (swiftPackages) stdenv; derivationArgs = { buildInputs = [ gawk gnused nix-prefetch-github jq swift swiftpm swiftpm2nix ]; }; } \"\"" + +set -euo pipefail + +cd "$(dirname "$0")" + +currentVersion="$(gawk -F'"' '/version = ".*"/ { print $2 }' ./sources.nix)" +if [[ -z "$currentVersion" ]]; then + echo >&2 "Could not determine current Swift version from sources.nix" + exit 1 +fi + +latestTag="$(curl -fsSL https://api.github.com/repos/apple/swift/releases/latest | jq -r '.tag_name')" +latestVersion="$(expr $latestTag : 'swift-\(.*\)-RELEASE')" +if [[ -z "$latestVersion" ]]; then + echo >&2 "Could not determine latest Swift version from GitHub releases" + exit 1 +fi + +if [[ "$currentVersion" == "$latestVersion" ]]; then + echo >&2 "Swift is up-to-date: ${currentVersion}" + exit 0 +fi + +echo >&2 "Updating Swift: $currentVersion -> $latestVersion" + +# Update sources.nix + +releaseBranch="release/$(cut -d. -f 1-2 <<< "$latestVersion")" +checkoutConfig="$(curl -fsSL "https://raw.githubusercontent.com/apple/swift/$latestTag/utils/update_checkout/update-checkout-config.json")" +repos="$(jq '.repos | map_values(.remote.id | split("/"))' <<< "$checkoutConfig")" +alternateRevs="$( + jq --arg branch "$releaseBranch" \ + '.["branch-schemes"][$branch] | .aliases as $aliases | .repos | map_values(select(IN($aliases[]) | not))' \ + <<< "$checkoutConfig" +)" + +newSourcesNix="$(mktemp)" +cat >> "$newSourcesNix" << EOF +# DO NOT EDIT. This file is generated by update.sh +{ fetchFromGitHub }: { + + version = "$latestVersion"; + +EOF + +for name in $(jq -r 'keys | .[]' <<< "$repos"); do + echo >&2 "Prefetching $name..." + + mapfile -t repo < <(jq -r --arg name "$name" '.[$name][]' <<< "$repos") + rev="$(jq -r --arg name "$name" --arg latestTag "$latestTag" '.[$name] // $latestTag' <<< "$alternateRevs")" + + nix-prefetch-github --nix --rev "$rev" "${repo[0]}" "${repo[1]}" \ + | tail -n +4 \ + | sed -e "s/^ pkgs.fetch/ $name = fetch/" -e 's/}/};/g' \ + >> "$newSourcesNix" +done + +echo "}" >> "$newSourcesNix" +mv "$newSourcesNix" ./sources.nix + +# Update swiftpm2nix generated expressions + +work="$(mktemp -d)" +clean_up() { + rm -rf "$work" +} +trap clean_up EXIT + +for generated in */generated; do + package="$(dirname "$generated")" + src="$(nix build --no-link --print-out-paths -f ../../../.. "swiftPackages.$package.src")" + + cp -R "$src" "$work/$package" + chmod -R u+w "$work" + pushd "$work/$package" > /dev/null + + echo >&2 "Running swiftpm on $package" + swift package resolve + + echo >&2 "Running swiftpm2nix on $package" + swiftpm2nix + + popd > /dev/null + rm -fr "$generated" + cp -R "$work/$package/nix" "$generated" +done diff --git a/pkgs/development/compilers/swift/wrapper/default.nix b/pkgs/development/compilers/swift/wrapper/default.nix index 0c7e0f8cbcf87..3de598ba1a165 100644 --- a/pkgs/development/compilers/swift/wrapper/default.nix +++ b/pkgs/development/compilers/swift/wrapper/default.nix @@ -28,11 +28,12 @@ stdenv.mkDerivation (swift._wrapperParams // { ln -s -t $out/bin/ $swift/bin/swift* # Replace specific binaries with wrappers. - for executable in swift swiftc swift-frontend; do - export prog=$swift/bin/$executable - rm $out/bin/$executable - substituteAll '${./wrapper.sh}' $out/bin/$executable - chmod a+x $out/bin/$executable + for progName in swift swiftc swift-frontend; do + prog=$swift/bin/$progName + export prog progName + rm $out/bin/$progName + substituteAll '${./wrapper.sh}' $out/bin/$progName + chmod a+x $out/bin/$progName done ${lib.optionalString useSwiftDriver '' diff --git a/pkgs/development/compilers/swift/wrapper/wrapper.sh b/pkgs/development/compilers/swift/wrapper/wrapper.sh index 0ac066d340d6f..7f9a5cb62443b 100644 --- a/pkgs/development/compilers/swift/wrapper/wrapper.sh +++ b/pkgs/development/compilers/swift/wrapper/wrapper.sh @@ -19,7 +19,7 @@ expandResponseParams "$@" # and doesn't understand linker flags. This follows logic in # `lib/DriverTool/driver.cpp`. prog=@prog@ -progName="$(basename "$prog")" +progName=@progName@ firstArg="${params[0]:-}" isFrontend=0 isRepl=0 @@ -35,6 +35,9 @@ if [[ "$progName" == swift ]]; then esac fi +extraAfter=() +extraBefore=() + # These checks follow the first part of `run_driver`. # # NOTE: The original function short-circuits, but we can't here, because both @@ -48,7 +51,7 @@ case "$firstArg" in ;; -modulewrap) # Don't wrap this integrated tool. - exec "$prog" "${params[@]}" + exec -a "$progName" "$prog" "${params[@]}" ;; repl) isRepl=1 @@ -208,8 +211,8 @@ done for i in ${NIX_SWIFTFLAGS_COMPILE_BEFORE:-}; do extraBefore+=("$i") done -addCFlagsToList extraAfter $NIX_CFLAGS_COMPILE_@suffixSalt@ -addCFlagsToList extraBefore ${hardeningCFlags[@]+"${hardeningCFlags[@]}"} $NIX_CFLAGS_COMPILE_BEFORE_@suffixSalt@ +addCFlagsToList extraAfter ${hardeningCFlagsAfter[@]+"${hardeningCFlagsAfter[@]}"} $NIX_CFLAGS_COMPILE_@suffixSalt@ +addCFlagsToList extraBefore ${hardeningCFlagsBefore[@]+"${hardeningCFlagsBefore[@]}"} $NIX_CFLAGS_COMPILE_BEFORE_@suffixSalt@ if [ "$dontLink" != 1 ]; then @@ -279,12 +282,15 @@ PATH="$path_backup" # Old bash workaround, see above. if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then - exec "$prog" @<(printf "%q\n" \ + responseFile=$(mktemp --tmpdir swift-params.XXXXXX) + trap 'rm -f -- "$responseFile"' EXIT + printf "%q\n" \ ${extraBefore+"${extraBefore[@]}"} \ ${params+"${params[@]}"} \ - ${extraAfter+"${extraAfter[@]}"}) + ${extraAfter+"${extraAfter[@]}"} > "$responseFile" + (exec -a "$progName" "$prog" "@$responseFile") else - exec "$prog" \ + exec -a "$progName" "$prog" \ ${extraBefore+"${extraBefore[@]}"} \ ${params+"${params[@]}"} \ ${extraAfter+"${extraAfter[@]}"}