diff --git a/build-setup-s390x.patch b/build-setup-s390x.patch deleted file mode 100644 index c4ad610..0000000 --- a/build-setup-s390x.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- swift/utils/build-presets.ini.orig 2019-11-25 18:30:46.968790036 +0000 -+++ swift/utils/build-presets.ini 2019-11-25 18:31:56.158790036 +0000 -@@ -740,12 +740,10 @@ - llbuild - swiftpm - xctest --libicu - libcxx - - dash-dash - --build-ninja - install-swift - install-lldb - install-llbuild diff --git a/build-setup.patch b/build-setup.patch index 65101d0..0308c3f 100644 --- a/build-setup.patch +++ b/build-setup.patch @@ -1,6 +1,6 @@ ---- swift/utils/build-presets.ini.orig 2020-03-12 16:04:54.935355266 -0500 -+++ swift/utils/build-presets.ini 2020-03-12 16:05:14.714144269 -0500 -@@ -745,7 +745,6 @@ +--- swift/utils/build-presets.ini.orig 2020-01-30 19:54:07.528043218 -0600 ++++ swift/utils/build-presets.ini 2020-01-30 19:55:11.580461138 -0600 +@@ -741,7 +741,6 @@ dash-dash @@ -8,12 +8,15 @@ install-swift install-lldb install-llbuild -@@ -762,7 +761,7 @@ - # Executes the lit tests for the installable package that is created - # Assumes the swift-integration-tests repo is checked out +@@ -755,11 +754,6 @@ + build-swift-static-sdk-overlay + build-swift-stdlib-unittest-extra +-# Executes the lit tests for the installable package that is created +-# Assumes the swift-integration-tests repo is checked out +- -test-installable-package -+#test-installable-package +- + # Build the benchmarks against the toolchain. + toolchain-benchmarks - # Path to the root of the installation filesystem. - install-destdir=%(install_destdir)s diff --git a/change-lldb-location.patch b/change-lldb-location.patch deleted file mode 100644 index 3d324e7..0000000 --- a/change-lldb-location.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- swift/lib/Driver/ToolChains.cpp.orig 2018-11-16 09:22:38.058780122 -0600 -+++ swift/lib/Driver/ToolChains.cpp 2018-11-16 09:31:08.699326699 -0600 -@@ -881,7 +881,7 @@ - useLLDB = true; - break; - case REPLJobAction::Mode::PreferLLDB: -- useLLDB = !findProgramRelativeToSwift("lldb").empty(); -+ useLLDB = true; - break; - } - -@@ -909,7 +909,7 @@ - ArgStringList Arguments; - Arguments.push_back(context.Args.MakeArgString(std::move(SingleArg))); - -- return {"lldb", Arguments}; -+ return {"/usr/libexec/swift-lldb/lldb", Arguments}; - } - - ToolChain::InvocationInfo diff --git a/clangloc.patch b/clangloc.patch deleted file mode 100644 index c7012a4..0000000 --- a/clangloc.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp.orig 2019-06-25 14:34:32.837621023 -0500 -+++ lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp 2019-06-26 16:03:32.304254695 -0500 -@@ -54,11 +54,11 @@ - static const llvm::StringRef kResourceDirSuffixes[] = { - // LLVM.org's build of LLDB uses the clang resource directory placed - // in $install_dir/lib{,64}/clang/$clang_version. -- "lib" CLANG_LIBDIR_SUFFIX "/clang/" CLANG_VERSION_STRING, -+ "/swift" "/clang/" CLANG_VERSION_STRING, - // swift-lldb uses the clang resource directory copied from swift, which - // by default is placed in $install_dir/lib{,64}/lldb/clang. LLDB places - // it there, so we use LLDB_LIBDIR_SUFFIX. -- "lib" LLDB_LIBDIR_SUFFIX "/lldb/clang", -+ "/swift" "/clang", - }; - - for (const auto &Suffix : kResourceDirSuffixes) { diff --git a/compiler-rt-fuzzer.patch b/compiler-rt-fuzzer.patch index b0e779a..19575b7 100644 --- a/compiler-rt-fuzzer.patch +++ b/compiler-rt-fuzzer.patch @@ -1,5 +1,5 @@ ---- compiler-rt/lib/fuzzer/FuzzerDriver.cpp.orig 2019-02-13 14:24:24.239239031 -0600 -+++ compiler-rt/lib/fuzzer/FuzzerDriver.cpp 2019-02-13 14:28:18.525530281 -0600 +--- llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp.orig 2019-02-13 14:24:24.239239031 -0600 ++++ llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp 2019-02-13 14:28:18.525530281 -0600 @@ -248,13 +248,16 @@ Command Cmd(Args); Cmd.removeFlag("jobs"); diff --git a/compiler-rt-sanitizer.patch b/compiler-rt-sanitizer.patch deleted file mode 100644 index bf8df64..0000000 --- a/compiler-rt-sanitizer.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc.orig 2019-10-30 12:10:54.591060832 -0500 -+++ compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2019-10-30 12:11:56.483063580 -0500 -@@ -1131,7 +1131,7 @@ - CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); - #if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) - /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ --CHECK_SIZE_AND_OFFSET(ipc_perm, mode); -+/* CHECK_SIZE_AND_OFFSET(ipc_perm, mode); */ /* Error with clang 9.0.0 */ - #endif - - CHECK_TYPE_SIZE(shmid_ds); diff --git a/implicit_fallthru.patch b/implicit_fallthru.patch deleted file mode 100644 index abcec31..0000000 --- a/implicit_fallthru.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff -Naur swift-corelibs-libdispatch-orig/src/event/event_epoll.c swift-corelibs-libdispatch/src/event/event_epoll.c ---- swift-corelibs-libdispatch-orig/src/event/event_epoll.c 2019-07-31 17:58:26.000000000 -0500 -+++ swift-corelibs-libdispatch/src/event/event_epoll.c 2020-03-11 16:06:21.182865901 -0500 -@@ -174,6 +174,9 @@ - } - case EVFILT_WRITE: - filter = EVFILT_READ; -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case EVFILT_READ: - if (fstat(fd, &sb) < 0) { - return NULL; -diff -Naur swift-corelibs-libdispatch-orig/src/io.c swift-corelibs-libdispatch/src/io.c ---- swift-corelibs-libdispatch-orig/src/io.c 2019-07-31 17:58:26.000000000 -0500 -+++ swift-corelibs-libdispatch/src/io.c 2020-03-11 16:08:45.344481709 -0500 -@@ -2086,11 +2086,17 @@ - case DISPATCH_OP_DELIVER: - flags = DOP_DEFAULT; - // Fall through -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case DISPATCH_OP_DELIVER_AND_COMPLETE: - flags = (flags != DOP_DEFAULT) ? DOP_DELIVER | DOP_NO_EMPTY : - DOP_DEFAULT; - _dispatch_operation_deliver_data(op, flags); - // Fall through -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case DISPATCH_OP_COMPLETE: - if (flags != DOP_DEFAULT) { - _dispatch_stream_complete_operation(stream, op); -@@ -2103,6 +2109,9 @@ - case DISPATCH_OP_COMPLETE_RESUME: - _dispatch_stream_complete_operation(stream, op); - // Fall through -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case DISPATCH_OP_RESUME: - if (_dispatch_stream_operation_avail(stream)) { - stream->source_running = true; -diff -Naur swift-corelibs-libdispatch-orig/src/semaphore.c swift-corelibs-libdispatch/src/semaphore.c ---- swift-corelibs-libdispatch-orig/src/semaphore.c 2019-07-31 17:58:26.000000000 -0500 -+++ swift-corelibs-libdispatch/src/semaphore.c 2020-03-11 16:10:04.319558171 -0500 -@@ -118,6 +118,9 @@ - } - // Fall through and try to undo what the fast path did to - // dsema->dsema_value -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case DISPATCH_TIME_NOW: - orig = dsema->dsema_value; - while (orig < 0) { -@@ -128,6 +131,9 @@ - } - // Another thread called semaphore_signal(). - // Fall through and drain the wakeup. -+ #if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case DISPATCH_TIME_FOREVER: - _dispatch_sema4_wait(&dsema->dsema_sema); - break; -diff -Naur swift-corelibs-libdispatch-orig/src/shims/lock.c swift-corelibs-libdispatch/src/shims/lock.c ---- swift-corelibs-libdispatch-orig/src/shims/lock.c 2019-07-31 17:58:26.000000000 -0500 -+++ swift-corelibs-libdispatch/src/shims/lock.c 2020-03-11 16:10:55.045534383 -0500 -@@ -428,8 +428,17 @@ - continue; - } - /* FALLTHROUGH */ -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case ETIMEDOUT: -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case EFAULT: -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case EWOULDBLOCK: - return errno; - default: -diff -Naur swift-corelibs-libdispatch-orig/src/transform.c swift-corelibs-libdispatch/src/transform.c ---- swift-corelibs-libdispatch-orig/src/transform.c 2019-07-31 17:58:26.000000000 -0500 -+++ swift-corelibs-libdispatch/src/transform.c 2020-03-11 16:11:47.034560632 -0500 -@@ -781,11 +781,20 @@ - case 1: - *ptr++ = '='; // c - *ptr++ = '='; // d -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case 2: - *ptr++ = '='; // e -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case 3: - *ptr++ = '='; // f - *ptr++ = '='; // g -+#if __clang_major__ >= 10 -+ __attribute__((fallthrough)); -+ #endif - case 4: - *ptr++ = '='; // h - break; diff --git a/linux-tests-python-3-2.patch b/linux-tests-python-3-2.patch new file mode 100644 index 0000000..45a1bb6 --- /dev/null +++ b/linux-tests-python-3-2.patch @@ -0,0 +1,48 @@ +diff -Naur swift-integration-tests-orig/test-snapshot-binaries/linux_load_commands.py swift-integration-tests/test-snapshot-binaries/linux_load_commands.py +--- swift-integration-tests-orig/test-snapshot-binaries/linux_load_commands.py 2019-10-07 17:57:28.000000000 -0500 ++++ swift-integration-tests/test-snapshot-binaries/linux_load_commands.py 2020-01-29 14:05:33.991180706 -0600 +@@ -85,12 +85,12 @@ + numberOfLinesSeen = 0 + + print("Visiting lib: {}".format(lib)) +- lines = list(reversed(subprocess.check_output([args.read_elf, "-program-headers", lib]).split("\n")[:-1])) ++ lines = list(reversed(subprocess.check_output([args.read_elf, "-program-headers", lib]).split(b"\n")[:-1])) + p = ParseState() + + # Until we finish parsing or run out of lines to parse... + while len(lines) > 0: +- l = lines.pop() ++ l = lines.pop().decode("utf-8") + print("DUMP: '{}'".format(l)) + assert(p is not None) + curState = p +@@ -143,7 +143,7 @@ + "-iname", + "*.so" + ] +- return subprocess.check_output(cmd).split("\n")[:-1] ++ return subprocess.check_output(cmd).split(b"\n")[:-1] + + def main(): + parser = argparse.ArgumentParser() +@@ -154,7 +154,7 @@ + + libraries = get_libraries(args.package_path) + for l in libraries: +- process_library(args, l) ++ process_library(args, l.decode("utf-8")) + sys.exit(0) + + if __name__ == "__main__": +diff -Naur swift-integration-tests-orig/test-sourcekit-lsp/test-sourcekit-lsp.py swift-integration-tests/test-sourcekit-lsp/test-sourcekit-lsp.py +--- swift-integration-tests-orig/test-sourcekit-lsp/test-sourcekit-lsp.py 2019-10-07 17:57:28.000000000 -0500 ++++ swift-integration-tests/test-sourcekit-lsp/test-sourcekit-lsp.py 2020-01-29 18:35:26.953725332 -0600 +@@ -136,7 +136,7 @@ + + skargs = [args.sourcekit_lsp, '--sync', '-Xclangd', '-sync'] + p = subprocess.Popen(skargs, stdin=subprocess.PIPE, stdout=subprocess.PIPE) +- out, _ = p.communicate(lsp.script) ++ out, _ = p.communicate(lsp.script.encode()) + print(out) + print('') + diff --git a/linux-tests-python-3.patch b/linux-tests-python-3.patch deleted file mode 100644 index e64c644..0000000 --- a/linux-tests-python-3.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- swift-integration-tests/test-snapshot-binaries/linux_load_commands.py.orig 2019-07-22 18:29:09.865242157 -0500 -+++ swift-integration-tests/test-snapshot-binaries/linux_load_commands.py 2019-07-22 18:29:36.655204752 -0500 -@@ -85,12 +85,12 @@ - numberOfLinesSeen = 0 - - print("Visiting lib: {}".format(lib)) -- lines = list(reversed(subprocess.check_output([args.read_elf, "-program-headers", lib]).split("\n")[:-1])) -+ lines = list(reversed(subprocess.check_output([args.read_elf, "-program-headers", lib]).split(b"\n")[:-1])) - p = ParseState() - - # Until we finish parsing or run out of lines to parse... - while len(lines) > 0: -- l = lines.pop() -+ l = lines.pop().decode("utf-8") - print("DUMP: '{}'".format(l)) - assert(p is not None) - curState = p -@@ -143,7 +143,7 @@ - "-iname", - "*.so" - ] -- return subprocess.check_output(cmd).split("\n")[:-1] -+ return subprocess.check_output(cmd).split(b"\n")[:-1] - - def main(): - parser = argparse.ArgumentParser() -@@ -154,7 +154,7 @@ - - libraries = get_libraries(args.package_path) - for l in libraries: -- process_library(args, l) -+ process_library(args, l.decode("utf-8")) - sys.exit(0) - - if __name__ == "__main__": diff --git a/lldb_python38_platform.patch b/lldb_python38_platform.patch deleted file mode 100644 index 3408269..0000000 --- a/lldb_python38_platform.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- lldb/scripts/Python/finishSwigPythonLLDB.py.orig 2019-09-09 10:19:48.545053827 -0500 -+++ lldb/scripts/Python/finishSwigPythonLLDB.py 2019-09-09 10:28:59.121109016 -0500 -@@ -673,8 +673,16 @@ - - from distutils.sysconfig import get_python_lib - if platform.system() == 'Linux': -- if platform.linux_distribution()[0] == 'Fedora': -- dbg.dump_text("Platform is Fedora Linux") -+ linux_distro = '' -+ # platform.linux_distribution() is not available in -+ # Python >= 3.8 -+ if sys.version_info[0] >= 3 and sys.version_info[1] >= 8: -+ from distro import linux_distribution -+ linux_distro = linux_distribution()[0] -+ else: -+ linux_distro = platform.linux_distribution()[0] -+ if linux_distro == 'Fedora' or linux_distro == 'Red Hat Enterprise Linux' or linux_distro == 'CentOS Linux': -+ dbg.dump_text("Platform is Fedora Linux or Red Hat Enterprise Linux or CentOS Linux") - # On Fedora the installation gets split into lib and lib64, - # which prevents building lldb from completing successfully. - return get_python_lib(False, False, vstrPythonInstallDir) diff --git a/llvm.patch b/llvm.patch index 406e33c..b9f70d5 100644 --- a/llvm.patch +++ b/llvm.patch @@ -1,19 +1,11 @@ -diff -Naur llvm-project-orig/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h ---- llvm-project-orig/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h 2019-12-12 22:11:12.000000000 -0600 -+++ llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h 2020-01-23 11:01:29.173281217 -0600 -@@ -4,6 +4,8 @@ - #include "llvm/Demangle/Compiler.h" +--- llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h.orig 2020-01-29 10:02:44.222689214 -0600 ++++ llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h 2020-01-29 10:03:02.007354450 -0600 +@@ -16,6 +16,8 @@ + #include "llvm/Demangle/DemangleConfig.h" #include "llvm/Demangle/StringView.h" #include +#include +#include - class OutputStream; - -@@ -599,4 +601,4 @@ - } // namespace ms_demangle - } // namespace llvm - --#endif -\ No newline at end of file -+#endif + namespace llvm { + namespace itanium_demangle { diff --git a/python3-2.patch b/python3-2.patch new file mode 100644 index 0000000..1feab4f --- /dev/null +++ b/python3-2.patch @@ -0,0 +1,410 @@ +diff -Naur swift-orig/stdlib/public/core/IntegerTypes.swift.gyb swift/stdlib/public/core/IntegerTypes.swift.gyb +--- swift-orig/stdlib/public/core/IntegerTypes.swift.gyb 2020-01-24 01:22:05.000000000 -0600 ++++ swift/stdlib/public/core/IntegerTypes.swift.gyb 2020-01-29 13:23:24.851180231 -0600 +@@ -14,10 +14,9 @@ + # Utility code for later in this template + # + +-from SwiftIntTypes import all_integer_types, int_max_bits, should_define_truncating_bit_pattern_init +-from SwiftFloatingPointTypes import getFtoIBounds ++import SwiftIntTypes ++import SwiftFloatingPointTypes + +-from string import maketrans, capitalize + from itertools import chain + + # Number of bits in the Builtin.Word type +@@ -1064,7 +1063,7 @@ + //===--- Concrete FixedWidthIntegers --------------------------------------===// + //===----------------------------------------------------------------------===// + +-% for self_type in all_integer_types(word_bits): ++% for self_type in SwiftIntTypes.all_integer_types(word_bits): + % bits = self_type.bits + % signed = self_type.is_signed + % BuiltinName = self_type.builtin_name +@@ -1125,7 +1124,7 @@ + + % for (FloatType, FloatBits) in [ + % ('Float', 32), ('Double', 64), ('Float80', 80)]: +-% (lower, upper) = getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed) ++% (lower, upper) = SwiftFloatingPointTypes.getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed) + + % if FloatType == 'Float80': + #if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64)) +@@ -1648,7 +1647,7 @@ + return Hasher._hash( + seed: seed, + bytes: UInt64(truncatingIfNeeded: ${U}${Self}(_value)), +- count: ${bits / 8}) ++ count: ${bits // 8}) + % end + } + } +diff -Naur swift-orig/stdlib/public/core/Mirrors.swift.gyb swift/stdlib/public/core/Mirrors.swift.gyb +--- swift-orig/stdlib/public/core/Mirrors.swift.gyb 2020-01-24 01:22:05.000000000 -0600 ++++ swift/stdlib/public/core/Mirrors.swift.gyb 2020-01-29 13:27:07.425509032 -0600 +@@ -12,7 +12,7 @@ + + %{ + +-from SwiftIntTypes import all_integer_types ++import SwiftIntTypes + + # Number of bits in the Builtin.Word type + word_bits = int(CMAKE_SIZEOF_VOID_P) * 8 +@@ -26,7 +26,7 @@ + ('Unicode.Scalar', '.uInt', 'UInt64(self)'), + ] + +-for self_ty in all_integer_types(word_bits): ++for self_ty in SwiftIntTypes.all_integer_types(word_bits): + Self = self_ty.stdlib_name + if self_ty.is_signed: + Types.append( (Self, '.int', 'Int64(self)') ) +diff -Naur swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb swift/stdlib/public/core/SIMDVectorTypes.swift.gyb +--- swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb 2020-01-24 01:22:05.000000000 -0600 ++++ swift/stdlib/public/core/SIMDVectorTypes.swift.gyb 2020-01-29 13:30:52.170919077 -0600 +@@ -11,7 +11,7 @@ + //===----------------------------------------------------------------------===// + + %{ +-from SwiftIntTypes import all_integer_types ++import SwiftIntTypes + word_bits = int(CMAKE_SIZEOF_VOID_P) * 8 + storagescalarCounts = [2,4,8,16,32,64] + vectorscalarCounts = storagescalarCounts + [3] +@@ -90,17 +90,17 @@ + % if n >= 4: + /// Creates a new vector from two half-length vectors. + @_transparent +- public init(lowHalf: SIMD${n/2}, highHalf: SIMD${n/2}) { ++ public init(lowHalf: SIMD${n//2}, highHalf: SIMD${n//2}) { + self.init() + self.lowHalf = lowHalf + self.highHalf = highHalf + } + +-% for (half,indx) in [('low','i'), ('high',str(n/2)+'+i'), ('even','2*i'), ('odd','2*i+1')]: ++% for (half,indx) in [('low','i'), ('high',str(n//2)+'+i'), ('even','2*i'), ('odd','2*i+1')]: + /// A half-length vector made up of the ${half} elements of the vector. +- public var ${half}Half: SIMD${n/2} { ++ public var ${half}Half: SIMD${n//2} { + @inlinable get { +- var result = SIMD${n/2}() ++ var result = SIMD${n//2}() + for i in result.indices { result[i] = self[${indx}] } + return result + } +@@ -159,7 +159,7 @@ + public var debugDescription: String { + return "SIMD${n}<\(Scalar.self)>(${', '.join(map(lambda c: + '\\(self['+ str(c) + '])', +- xrange(n)))})" ++ range(n)))})" + } + } + +@@ -203,7 +203,7 @@ + } + } + +-%for self_type in all_integer_types(word_bits): ++%for self_type in SwiftIntTypes.all_integer_types(word_bits): + % Self = self_type.stdlib_name + % BuiltinName = self_type.builtin_name + % Mask = Self if self_type.is_signed else self_type.get_opposite_signedness().stdlib_name +@@ -212,7 +212,7 @@ + public typealias SIMDMaskScalar = ${Mask} + + % for n in storagescalarCounts: +-% bytes = n * self_type.bits / 8 ++% bytes = n * self_type.bits // 8 + /// Storage for a vector of ${spelledNumbers[n]} integers. + @frozen + @_alignment(${bytes if bytes <= 16 else 16}) +@@ -257,7 +257,7 @@ + public typealias SIMDMaskScalar = Int${bits} + + % for n in storagescalarCounts: +-% bytes = n * bits / 8 ++% bytes = n * bits // 8 + /// Storage for a vector of ${spelledNumbers[n]} floating-point values. + @frozen + @_alignment(${bytes if bytes <= 16 else 16}) +diff -Naur swift-orig/stdlib/public/core/Tuple.swift.gyb swift/stdlib/public/core/Tuple.swift.gyb +--- swift-orig/stdlib/public/core/Tuple.swift.gyb 2020-01-24 01:22:05.000000000 -0600 ++++ swift/stdlib/public/core/Tuple.swift.gyb 2020-01-29 13:32:22.287291260 -0600 +@@ -111,7 +111,7 @@ + % equatableTypeParams = ", ".join(["{}: Equatable".format(c) for c in typeParams]) + + % originalTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity)))) +-% greaterTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity - 1) + [arity]))) ++% greaterTuple = "(\"a\", {})".format(", ".join(map(str, list(range(1, arity - 1)) + [arity]))) + + /// Returns a Boolean value indicating whether the corresponding components of + /// two tuples are equal. +diff -Naur swift-orig/utils/gyb_sourcekit_support/__init__.py swift/utils/gyb_sourcekit_support/__init__.py +--- swift-orig/utils/gyb_sourcekit_support/__init__.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_sourcekit_support/__init__.py 2020-01-29 13:33:22.111521781 -0600 +@@ -14,9 +14,9 @@ + # utils/gyb_sourcekit_support/ directory as a module. + # + # ---------------------------------------------------------------------------- +-from UIDs import UID_KEYS +-from UIDs import UID_KINDS +-from UIDs import UID_REQUESTS ++from .UIDs import UID_KEYS ++from .UIDs import UID_KINDS ++from .UIDs import UID_REQUESTS + + + def check_uid_duplication(): +diff -Naur swift-orig/utils/gyb_syntax_support/AttributeNodes.py swift/utils/gyb_syntax_support/AttributeNodes.py +--- swift-orig/utils/gyb_syntax_support/AttributeNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/AttributeNodes.py 2020-01-29 13:34:03.265044624 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + ATTRIBUTE_NODES = [ + # token-list -> token? token-list? +diff -Naur swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py swift/utils/gyb_syntax_support/AvailabilityNodes.py +--- swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/AvailabilityNodes.py 2020-01-29 13:34:33.458161889 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + AVAILABILITY_NODES = [ + # availability-spec-list -> availability-entry availability-spec-list? +diff -Naur swift-orig/utils/gyb_syntax_support/Child.py swift/utils/gyb_syntax_support/Child.py +--- swift-orig/utils/gyb_syntax_support/Child.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/Child.py 2020-01-29 13:35:02.044219688 -0600 +@@ -1,7 +1,7 @@ + # flake8: noqa I201 +-from Classification import classification_by_name +-from Token import SYNTAX_TOKEN_MAP +-from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word ++from .Classification import classification_by_name ++from .Token import SYNTAX_TOKEN_MAP ++from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word + + + class Child(object): +diff -Naur swift-orig/utils/gyb_syntax_support/Classification.py swift/utils/gyb_syntax_support/Classification.py +--- swift-orig/utils/gyb_syntax_support/Classification.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/Classification.py 2020-01-29 13:46:45.334244147 -0600 +@@ -1,5 +1,5 @@ +-from Node import error +-from kinds import lowercase_first_word # noqa: I201 ++from .Node import error ++from .kinds import lowercase_first_word # noqa: I201 + + + class SyntaxClassification(object): +diff -Naur swift-orig/utils/gyb_syntax_support/CommonNodes.py swift/utils/gyb_syntax_support/CommonNodes.py +--- swift-orig/utils/gyb_syntax_support/CommonNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/CommonNodes.py 2020-01-29 13:47:02.390875308 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + COMMON_NODES = [ + Node('Decl', kind='Syntax'), +diff -Naur swift-orig/utils/gyb_syntax_support/DeclNodes.py swift/utils/gyb_syntax_support/DeclNodes.py +--- swift-orig/utils/gyb_syntax_support/DeclNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/DeclNodes.py 2020-01-29 13:47:30.486914972 -0600 +@@ -1,6 +1,6 @@ + # flake8: noqa I201 +-from Child import Child +-from Node import Node ++from .Child import Child ++from .Node import Node + + + DECL_NODES = [ +diff -Naur swift-orig/utils/gyb_syntax_support/ExprNodes.py swift/utils/gyb_syntax_support/ExprNodes.py +--- swift-orig/utils/gyb_syntax_support/ExprNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/ExprNodes.py 2020-01-29 13:47:47.095529555 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + EXPR_NODES = [ + # An inout expression. +diff -Naur swift-orig/utils/gyb_syntax_support/GenericNodes.py swift/utils/gyb_syntax_support/GenericNodes.py +--- swift-orig/utils/gyb_syntax_support/GenericNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/GenericNodes.py 2020-01-29 13:48:04.737182368 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + GENERIC_NODES = [ + # generic-where-clause -> 'where' requirement-list +diff -Naur swift-orig/utils/gyb_syntax_support/__init__.py swift/utils/gyb_syntax_support/__init__.py +--- swift-orig/utils/gyb_syntax_support/__init__.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/__init__.py 2020-01-29 13:52:03.762062110 -0600 +@@ -1,22 +1,22 @@ + import textwrap +-from AttributeNodes import ATTRIBUTE_NODES # noqa: I201 +-from AvailabilityNodes import AVAILABILITY_NODES # noqa: I201 +-import Classification # noqa: I201 +-from CommonNodes import COMMON_NODES # noqa: I201 +-from DeclNodes import DECL_NODES # noqa: I201 +-from ExprNodes import EXPR_NODES # noqa: I201 +-from GenericNodes import GENERIC_NODES # noqa: I201 ++from .AttributeNodes import ATTRIBUTE_NODES # noqa: I201 ++from .AvailabilityNodes import AVAILABILITY_NODES # noqa: I201 ++from . import Classification # noqa: I201 ++from .CommonNodes import COMMON_NODES # noqa: I201 ++from .DeclNodes import DECL_NODES # noqa: I201 ++from .ExprNodes import EXPR_NODES # noqa: I201 ++from .GenericNodes import GENERIC_NODES # noqa: I201 + +-from NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \ ++from .NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \ + get_serialization_code, \ + verify_syntax_node_serialization_codes + +-from PatternNodes import PATTERN_NODES # noqa: I201 +-from StmtNodes import STMT_NODES # noqa: I201 ++from .PatternNodes import PATTERN_NODES # noqa: I201 ++from .StmtNodes import STMT_NODES # noqa: I201 + +-import Token +-from Trivia import TRIVIAS # noqa: I201 +-from TypeNodes import TYPE_NODES # noqa: I201 ++from . import Token ++from .Trivia import TRIVIAS # noqa: I201 ++from .TypeNodes import TYPE_NODES # noqa: I201 + + + # Re-export global constants +diff -Naur swift-orig/utils/gyb_syntax_support/Node.py swift/utils/gyb_syntax_support/Node.py +--- swift-orig/utils/gyb_syntax_support/Node.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/Node.py 2020-01-29 13:52:32.755139868 -0600 +@@ -1,7 +1,7 @@ + from __future__ import print_function + import sys # noqa: I201 + +-from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word ++from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word + + + def error(msg): +diff -Naur swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py swift/utils/gyb_syntax_support/NodeSerializationCodes.py +--- swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/NodeSerializationCodes.py 2020-01-29 13:52:58.148083796 -0600 +@@ -1,4 +1,4 @@ +-from Node import error ++from .Node import error + + + SYNTAX_NODE_SERIALIZATION_CODES = { +diff -Naur swift-orig/utils/gyb_syntax_support/PatternNodes.py swift/utils/gyb_syntax_support/PatternNodes.py +--- swift-orig/utils/gyb_syntax_support/PatternNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/PatternNodes.py 2020-01-29 13:53:38.452582038 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + PATTERN_NODES = [ + +diff -Naur swift-orig/utils/gyb_syntax_support/StmtNodes.py swift/utils/gyb_syntax_support/StmtNodes.py +--- swift-orig/utils/gyb_syntax_support/StmtNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/StmtNodes.py 2020-01-29 13:53:55.056199243 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + STMT_NODES = [ + # continue-stmt -> 'continue' label? ';'? +diff -Naur swift-orig/utils/gyb_syntax_support/Token.py swift/utils/gyb_syntax_support/Token.py +--- swift-orig/utils/gyb_syntax_support/Token.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/Token.py 2020-01-29 13:54:12.720855888 -0600 +@@ -1,6 +1,6 @@ +-from Classification import classification_by_name +-from Node import error # noqa: I201 +-from kinds import lowercase_first_word # noqa: I201 ++from .Classification import classification_by_name ++from .Node import error # noqa: I201 ++from .kinds import lowercase_first_word # noqa: I201 + + + class Token(object): +diff -Naur swift-orig/utils/gyb_syntax_support/Trivia.py swift/utils/gyb_syntax_support/Trivia.py +--- swift-orig/utils/gyb_syntax_support/Trivia.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/Trivia.py 2020-01-29 13:54:41.647931191 -0600 +@@ -1,5 +1,5 @@ +-from Node import error +-from kinds import lowercase_first_word # noqa: I201 ++from .Node import error ++from .kinds import lowercase_first_word # noqa: I201 + + + class Trivia(object): +diff -Naur swift-orig/utils/gyb_syntax_support/TypeNodes.py swift/utils/gyb_syntax_support/TypeNodes.py +--- swift-orig/utils/gyb_syntax_support/TypeNodes.py 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/gyb_syntax_support/TypeNodes.py 2020-01-29 13:55:07.952909024 -0600 +@@ -1,5 +1,5 @@ +-from Child import Child +-from Node import Node # noqa: I201 ++from .Child import Child ++from .Node import Node # noqa: I201 + + TYPE_NODES = [ + # simple-type-identifier -> identifier generic-argument-clause? +diff -Naur swift-orig/utils/line-directive swift/utils/line-directive +--- swift-orig/utils/line-directive 2020-01-24 01:22:05.000000000 -0600 ++++ swift/utils/line-directive 2020-01-29 13:57:12.829551057 -0600 +@@ -61,7 +61,7 @@ + + def _make_line_map(target_filename, stream=None): + """ +- >>> from StringIO import StringIO ++ >>> from io import StringIO + >>> _make_line_map('box', + ... StringIO('''// ###sourceLocation(file: "foo.bar", line: 3) + ... line 2 +@@ -95,7 +95,7 @@ + + def map_line_to_source_file(target_filename, target_line_num): + """ +- >>> from tempfile import * ++ >>> from .tempfile import * + >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open + >>> # the file for a second time if delete=True. Therefore, we have to + >>> # manually handle closing and deleting this file to allow us to open +@@ -145,7 +145,7 @@ + def map_line_from_source_file(source_filename, source_line_num, + target_filename): + """ +- >>> from tempfile import * ++ >>> from .tempfile import * + >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open + >>> # the file for a second time if delete=True. Therefore, we have to + >>> # manually handle closing and deleting this file to allow us to open +@@ -231,7 +231,7 @@ + def run(): + """Simulate a couple of gyb-generated files + +- >>> from tempfile import * ++ >>> from .tempfile import * + >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open + >>> # the file for a second time if delete=True. Therefore, we have to + >>> # manually handle closing and deleting this file to allow us to open diff --git a/python3.patch b/python3.patch deleted file mode 100644 index a65c0f4..0000000 --- a/python3.patch +++ /dev/null @@ -1,437 +0,0 @@ -diff -Naur swift-orig/stdlib/public/core/FloatingPointTypes.swift.gyb swift/stdlib/public/core/FloatingPointTypes.swift.gyb ---- swift-orig/stdlib/public/core/FloatingPointTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500 -+++ swift/stdlib/public/core/FloatingPointTypes.swift.gyb 2019-07-22 11:22:17.049551459 -0500 -@@ -13,8 +13,8 @@ - import SwiftShims - - %{ --from SwiftIntTypes import all_integer_types --from SwiftFloatingPointTypes import all_floating_point_types -+import SwiftIntTypes -+import SwiftFloatingPointTypes - - # - # Utility code for later in this template -@@ -27,7 +27,7 @@ - builtinIntLiteralBits = 2048 - }% - --% for self_type in all_floating_point_types(): -+% for self_type in SwiftFloatingPointTypes.all_floating_point_types(): - %{ - Self = self_type.stdlib_name - bits = self_type.bits -@@ -1650,7 +1650,7 @@ - } - } - --% for src_type in all_floating_point_types(): -+% for src_type in SwiftFloatingPointTypes.all_floating_point_types(): - % srcBits = src_type.bits - % That = src_type.stdlib_name - -diff -Naur swift-orig/stdlib/public/core/IntegerTypes.swift.gyb swift/stdlib/public/core/IntegerTypes.swift.gyb ---- swift-orig/stdlib/public/core/IntegerTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500 -+++ swift/stdlib/public/core/IntegerTypes.swift.gyb 2019-07-22 15:30:40.491317722 -0500 -@@ -14,10 +14,9 @@ - # Utility code for later in this template - # - --from SwiftIntTypes import all_integer_types, int_max_bits, should_define_truncating_bit_pattern_init --from SwiftFloatingPointTypes import getFtoIBounds -+import SwiftIntTypes -+import SwiftFloatingPointTypes - --from string import maketrans, capitalize - from itertools import chain - - # Number of bits in the Builtin.Word type -@@ -1064,7 +1063,7 @@ - //===--- Concrete FixedWidthIntegers --------------------------------------===// - //===----------------------------------------------------------------------===// - --% for self_type in all_integer_types(word_bits): -+% for self_type in SwiftIntTypes.all_integer_types(word_bits): - % bits = self_type.bits - % signed = self_type.is_signed - % BuiltinName = self_type.builtin_name -@@ -1125,7 +1124,7 @@ - - % for (FloatType, FloatBits) in [ - % ('Float', 32), ('Double', 64), ('Float80', 80)]: --% (lower, upper) = getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed) -+% (lower, upper) = SwiftFloatingPointTypes.getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed) - - % if FloatType == 'Float80': - #if !os(Windows) && (arch(i386) || arch(x86_64)) -@@ -1651,7 +1650,7 @@ - return Hasher._hash( - seed: seed, - bytes: UInt64(truncatingIfNeeded: ${U}${Self}(_value)), -- count: ${bits / 8}) -+ count: ${bits // 8}) - % end - } - } -diff -Naur swift-orig/stdlib/public/core/Mirrors.swift.gyb swift/stdlib/public/core/Mirrors.swift.gyb ---- swift-orig/stdlib/public/core/Mirrors.swift.gyb 2019-07-14 15:16:38.000000000 -0500 -+++ swift/stdlib/public/core/Mirrors.swift.gyb 2019-07-23 09:20:38.269152361 -0500 -@@ -12,7 +12,7 @@ - - %{ - --from SwiftIntTypes import all_integer_types -+import SwiftIntTypes - - # Number of bits in the Builtin.Word type - word_bits = int(CMAKE_SIZEOF_VOID_P) * 8 -@@ -26,7 +26,7 @@ - ('Unicode.Scalar', '.uInt', 'UInt64(self)'), - ] - --for self_ty in all_integer_types(word_bits): -+for self_ty in SwiftIntTypes.all_integer_types(word_bits): - Self = self_ty.stdlib_name - if self_ty.is_signed: - Types.append( (Self, '.int', 'Int64(self)') ) -diff -Naur swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb swift/stdlib/public/core/SIMDVectorTypes.swift.gyb ---- swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500 -+++ swift/stdlib/public/core/SIMDVectorTypes.swift.gyb 2019-07-22 15:30:52.516752476 -0500 -@@ -11,7 +11,7 @@ - //===----------------------------------------------------------------------===// - - %{ --from SwiftIntTypes import all_integer_types -+import SwiftIntTypes - word_bits = int(CMAKE_SIZEOF_VOID_P) * 8 - storagescalarCounts = [2,4,8,16,32,64] - vectorscalarCounts = storagescalarCounts + [3] -@@ -90,17 +90,17 @@ - % if n >= 4: - /// Creates a new vector from two half-length vectors. - @_transparent -- public init(lowHalf: SIMD${n/2}, highHalf: SIMD${n/2}) { -+ public init(lowHalf: SIMD${n//2}, highHalf: SIMD${n//2}) { - self.init() - self.lowHalf = lowHalf - self.highHalf = highHalf - } - --% for (half,indx) in [('low','i'), ('high',str(n/2)+'+i'), ('even','2*i'), ('odd','2*i+1')]: -+% for (half,indx) in [('low','i'), ('high',str(n//2)+'+i'), ('even','2*i'), ('odd','2*i+1')]: - /// A half-length vector made up of the ${half} elements of the vector. -- public var ${half}Half: SIMD${n/2} { -+ public var ${half}Half: SIMD${n//2} { - @inlinable get { -- var result = SIMD${n/2}() -+ var result = SIMD${n//2}() - for i in result.indices { result[i] = self[${indx}] } - return result - } -@@ -159,7 +159,7 @@ - public var debugDescription: String { - return "SIMD${n}<\(Scalar.self)>(${', '.join(map(lambda c: - '\\(self['+ str(c) + '])', -- xrange(n)))})" -+ range(n)))})" - } - } - -@@ -203,7 +203,7 @@ - } - } - --%for self_type in all_integer_types(word_bits): -+%for self_type in SwiftIntTypes.all_integer_types(word_bits): - % Self = self_type.stdlib_name - % BuiltinName = self_type.builtin_name - % Mask = Self if self_type.is_signed else self_type.get_opposite_signedness().stdlib_name -@@ -212,7 +212,7 @@ - public typealias SIMDMaskScalar = ${Mask} - - % for n in storagescalarCounts: --% bytes = n * self_type.bits / 8 -+% bytes = n * self_type.bits // 8 - /// Storage for a vector of ${spelledNumbers[n]} integers. - @frozen - @_alignment(${bytes if bytes <= 16 else 16}) -@@ -257,7 +257,7 @@ - public typealias SIMDMaskScalar = Int${bits} - - % for n in storagescalarCounts: --% bytes = n * bits / 8 -+% bytes = n * bits // 8 - /// Storage for a vector of ${spelledNumbers[n]} floating-point values. - @frozen - @_alignment(${bytes if bytes <= 16 else 16}) -diff -Naur swift-orig/stdlib/public/core/Tuple.swift.gyb swift/stdlib/public/core/Tuple.swift.gyb ---- swift-orig/stdlib/public/core/Tuple.swift.gyb 2019-07-14 15:16:38.000000000 -0500 -+++ swift/stdlib/public/core/Tuple.swift.gyb 2019-07-17 20:54:45.400558556 -0500 -@@ -111,7 +111,7 @@ - % equatableTypeParams = ", ".join(["{} : Equatable".format(c) for c in typeParams]) - - % originalTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity)))) --% greaterTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity - 1) + [arity]))) -+% greaterTuple = "(\"a\", {})".format(", ".join(map(str, list(range(1, arity - 1)) + [arity]))) - - /// Returns a Boolean value indicating whether the corresponding components of - /// two tuples are equal. -diff -Naur swift-orig/utils/gyb_sourcekit_support/__init__.py swift/utils/gyb_sourcekit_support/__init__.py ---- swift-orig/utils/gyb_sourcekit_support/__init__.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_sourcekit_support/__init__.py 2019-07-18 14:19:45.668770778 -0500 -@@ -14,9 +14,9 @@ - # utils/gyb_sourcekit_support/ directory as a module. - # - # ---------------------------------------------------------------------------- --from UIDs import UID_KEYS --from UIDs import UID_KINDS --from UIDs import UID_REQUESTS -+from .UIDs import UID_KEYS -+from .UIDs import UID_KINDS -+from .UIDs import UID_REQUESTS - - - def check_uid_duplication(): -diff -Naur swift-orig/utils/gyb_syntax_support/AttributeNodes.py swift/utils/gyb_syntax_support/AttributeNodes.py ---- swift-orig/utils/gyb_syntax_support/AttributeNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/AttributeNodes.py 2019-07-18 12:34:20.708714660 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - ATTRIBUTE_NODES = [ - # token-list -> token? token-list? -diff -Naur swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py swift/utils/gyb_syntax_support/AvailabilityNodes.py ---- swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/AvailabilityNodes.py 2019-07-18 12:34:20.711714774 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - AVAILABILITY_NODES = [ - # availability-spec-list -> availability-entry availability-spec-list? -diff -Naur swift-orig/utils/gyb_syntax_support/Child.py swift/utils/gyb_syntax_support/Child.py ---- swift-orig/utils/gyb_syntax_support/Child.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/Child.py 2019-07-18 12:34:20.712714811 -0500 -@@ -1,7 +1,7 @@ - # flake8: noqa I201 --from Classification import classification_by_name --from Token import SYNTAX_TOKEN_MAP --from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word -+from .Classification import classification_by_name -+from .Token import SYNTAX_TOKEN_MAP -+from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word - - - class Child(object): -diff -Naur swift-orig/utils/gyb_syntax_support/Classification.py swift/utils/gyb_syntax_support/Classification.py ---- swift-orig/utils/gyb_syntax_support/Classification.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/Classification.py 2019-07-18 12:34:20.713714849 -0500 -@@ -1,5 +1,5 @@ --from Node import error --from kinds import lowercase_first_word # noqa: I201 -+from .Node import error -+from .kinds import lowercase_first_word # noqa: I201 - - - class SyntaxClassification(object): -diff -Naur swift-orig/utils/gyb_syntax_support/CommonNodes.py swift/utils/gyb_syntax_support/CommonNodes.py ---- swift-orig/utils/gyb_syntax_support/CommonNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/CommonNodes.py 2019-07-18 12:34:20.714714887 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - COMMON_NODES = [ - Node('Decl', kind='Syntax'), -diff -Naur swift-orig/utils/gyb_syntax_support/DeclNodes.py swift/utils/gyb_syntax_support/DeclNodes.py ---- swift-orig/utils/gyb_syntax_support/DeclNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/DeclNodes.py 2019-07-18 12:34:20.716714963 -0500 -@@ -1,6 +1,6 @@ - # flake8: noqa I201 --from Child import Child --from Node import Node -+from .Child import Child -+from .Node import Node - - - DECL_NODES = [ -diff -Naur swift-orig/utils/gyb_syntax_support/ExprNodes.py swift/utils/gyb_syntax_support/ExprNodes.py ---- swift-orig/utils/gyb_syntax_support/ExprNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/ExprNodes.py 2019-07-18 12:34:20.717715000 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - EXPR_NODES = [ - # An inout expression. -diff -Naur swift-orig/utils/gyb_syntax_support/GenericNodes.py swift/utils/gyb_syntax_support/GenericNodes.py ---- swift-orig/utils/gyb_syntax_support/GenericNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/GenericNodes.py 2019-07-18 12:34:20.718715038 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - GENERIC_NODES = [ - # generic-where-clause -> 'where' requirement-list -diff -Naur swift-orig/utils/gyb_syntax_support/__init__.py swift/utils/gyb_syntax_support/__init__.py ---- swift-orig/utils/gyb_syntax_support/__init__.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/__init__.py 2019-07-18 12:34:33.973215999 -0500 -@@ -1,19 +1,19 @@ - import textwrap --from AttributeNodes import ATTRIBUTE_NODES # noqa: I201 --from AvailabilityNodes import AVAILABILITY_NODES # noqa: I201 --import Classification # noqa: I201 --from CommonNodes import COMMON_NODES # noqa: I201 --from DeclNodes import DECL_NODES # noqa: I201 --from ExprNodes import EXPR_NODES # noqa: I201 --from GenericNodes import GENERIC_NODES # noqa: I201 --from NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \ -+from .AttributeNodes import ATTRIBUTE_NODES # noqa: I201 -+from .AvailabilityNodes import AVAILABILITY_NODES # noqa: I201 -+from . import Classification # noqa: I201 -+from .CommonNodes import COMMON_NODES # noqa: I201 -+from .DeclNodes import DECL_NODES # noqa: I201 -+from .ExprNodes import EXPR_NODES # noqa: I201 -+from .GenericNodes import GENERIC_NODES # noqa: I201 -+from .NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \ - get_serialization_code, \ - verify_syntax_node_serialization_codes - --from PatternNodes import PATTERN_NODES # noqa: I201 --from StmtNodes import STMT_NODES # noqa: I201 --import Token --from TypeNodes import TYPE_NODES # noqa: I201 -+from .PatternNodes import PATTERN_NODES # noqa: I201 -+from .StmtNodes import STMT_NODES # noqa: I201 -+from . import Token -+from .TypeNodes import TYPE_NODES # noqa: I201 - - - # Re-export global constants -diff -Naur swift-orig/utils/gyb_syntax_support/Node.py swift/utils/gyb_syntax_support/Node.py ---- swift-orig/utils/gyb_syntax_support/Node.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/Node.py 2019-07-18 12:34:20.722715189 -0500 -@@ -1,6 +1,6 @@ - from __future__ import print_function - import sys # noqa: I201 --from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word -+from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word - - - def error(msg): -diff -Naur swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py swift/utils/gyb_syntax_support/NodeSerializationCodes.py ---- swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/NodeSerializationCodes.py 2019-07-18 12:34:20.723715227 -0500 -@@ -1,4 +1,4 @@ --from Node import error -+from .Node import error - - - SYNTAX_NODE_SERIALIZATION_CODES = { -diff -Naur swift-orig/utils/gyb_syntax_support/PatternNodes.py swift/utils/gyb_syntax_support/PatternNodes.py ---- swift-orig/utils/gyb_syntax_support/PatternNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/PatternNodes.py 2019-07-18 12:34:20.724715265 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - PATTERN_NODES = [ - -diff -Naur swift-orig/utils/gyb_syntax_support/StmtNodes.py swift/utils/gyb_syntax_support/StmtNodes.py ---- swift-orig/utils/gyb_syntax_support/StmtNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/StmtNodes.py 2019-07-18 12:34:20.726715341 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - STMT_NODES = [ - # continue-stmt -> 'continue' label? ';'? -diff -Naur swift-orig/utils/gyb_syntax_support/Token.py swift/utils/gyb_syntax_support/Token.py ---- swift-orig/utils/gyb_syntax_support/Token.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/Token.py 2019-07-18 12:34:20.727715378 -0500 -@@ -1,6 +1,6 @@ --from Classification import classification_by_name --from Node import error # noqa: I201 --from kinds import lowercase_first_word # noqa: I201 -+from .Classification import classification_by_name -+from .Node import error # noqa: I201 -+from .kinds import lowercase_first_word # noqa: I201 - - - class Token(object): -diff -Naur swift-orig/utils/gyb_syntax_support/Trivia.py swift/utils/gyb_syntax_support/Trivia.py ---- swift-orig/utils/gyb_syntax_support/Trivia.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/Trivia.py 2019-07-18 14:22:04.074001913 -0500 -@@ -1,5 +1,5 @@ --from Node import error --from kinds import lowercase_first_word # noqa: I201 -+from .Node import error -+from .kinds import lowercase_first_word # noqa: I201 - - - class Trivia(object): -diff -Naur swift-orig/utils/gyb_syntax_support/TypeNodes.py swift/utils/gyb_syntax_support/TypeNodes.py ---- swift-orig/utils/gyb_syntax_support/TypeNodes.py 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/gyb_syntax_support/TypeNodes.py 2019-07-18 12:34:20.731715529 -0500 -@@ -1,5 +1,5 @@ --from Child import Child --from Node import Node # noqa: I201 -+from .Child import Child -+from .Node import Node # noqa: I201 - - TYPE_NODES = [ - # simple-type-identifier -> identifier generic-argument-clause? -diff -Naur swift-orig/utils/line-directive swift/utils/line-directive ---- swift-orig/utils/line-directive 2019-07-14 15:16:38.000000000 -0500 -+++ swift/utils/line-directive 2019-07-19 09:01:35.602482603 -0500 -@@ -60,7 +60,7 @@ - - def _make_line_map(target_filename, stream=None): - """ -- >>> from StringIO import StringIO -+ >>> from io import StringIO - >>> _make_line_map('box', - ... StringIO('''// ###sourceLocation(file: "foo.bar", line: 3) - ... line 2 -@@ -94,7 +94,7 @@ - - def map_line_to_source_file(target_filename, target_line_num): - """ -- >>> from tempfile import * -+ >>> from .tempfile import * - >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open - >>> # the file for a second time if delete=True. Therefore, we have to - >>> # manually handle closing and deleting this file to allow us to open -@@ -144,7 +144,7 @@ - def map_line_from_source_file(source_filename, source_line_num, - target_filename): - """ -- >>> from tempfile import * -+ >>> from .tempfile import * - >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open - >>> # the file for a second time if delete=True. Therefore, we have to - >>> # manually handle closing and deleting this file to allow us to open -@@ -230,7 +230,7 @@ - def run(): - """Simulate a couple of gyb-generated files - -- >>> from tempfile import * -+ >>> from .tempfile import * - >>> # On Windows, the name of a NamedTemporaryFile cannot be used to open - >>> # the file for a second time if delete=True. Therefore, we have to - >>> # manually handle closing and deleting this file to allow us to open diff --git a/sourcekit-loc.patch b/sourcekit-loc.patch deleted file mode 100644 index 06bf428..0000000 --- a/sourcekit-loc.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- sourcekit-lsp/Sources/SKCore/Toolchain.swift.orig 2019-12-07 13:28:15.316371656 -0600 -+++ sourcekit-lsp/Sources/SKCore/Toolchain.swift 2019-12-07 19:25:39.784513174 -0600 -@@ -127,12 +127,12 @@ - - var foundAny = false - -- let clangPath = binPath.appending(component: "clang") -+ let clangPath = AbsolutePath("/usr/libexec/swift-lldb/clang") - if fs.isExecutableFile(clangPath) { - self.clang = clangPath - foundAny = true - } -- let clangdPath = binPath.appending(component: "clangd") -+ let clangdPath = AbsolutePath("/usr/libexec/swift-lldb/clangd") - if fs.isExecutableFile(clangdPath) { - self.clangd = clangdPath - foundAny = true -@@ -152,14 +152,14 @@ - self.sourcekitd = sourcekitdPath - foundAny = true - } else { -- let sourcekitdPath = libPath.appending(component: "libsourcekitdInProc.\(dylibExt)") -+ let sourcekitdPath = AbsolutePath("/usr/lib/swift-lldb/libsourcekitdInProc.so") - if fs.isFile(sourcekitdPath) { - self.sourcekitd = sourcekitdPath - foundAny = true - } - } - -- let libIndexStore = libPath.appending(components: "libIndexStore.\(dylibExt)") -+ let libIndexStore = AbsolutePath("/usr/lib/swift-lldb/libIndexStore.so") - if fs.isFile(libIndexStore) { - self.libIndexStore = libIndexStore - foundAny = true diff --git a/sourcekit.patch b/sourcekit.patch deleted file mode 100644 index 96896f4..0000000 --- a/sourcekit.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- sourcekit-lsp/Utilities/build-script-helper.py.orig 2019-10-29 09:41:43.052157614 -0500 -+++ sourcekit-lsp/Utilities/build-script-helper.py 2019-10-30 21:23:18.538560646 -0500 -@@ -15,7 +15,7 @@ - subprocess.check_call(cmd, env=env) - - def swiftpm_bin_path(swift_exec, swiftpm_args, env=None): -- swiftpm_args = filter(lambda arg: arg != '-v' and arg != '--verbose', swiftpm_args) -+ swiftpm_args = list(filter(lambda arg: arg != '-v' and arg != '--verbose', swiftpm_args)) - cmd = [swift_exec, 'build', '--show-bin-path'] + swiftpm_args - print(' '.join(cmd)) - return subprocess.check_output(cmd, env=env).strip() -@@ -56,7 +56,7 @@ - install_binary(exe, swiftpm_bin_path, toolchain_bin, toolchain) - - def install_binary(exe, source_dir, install_dir, toolchain): -- cmd = ['rsync', '-a', os.path.join(source_dir, exe), install_dir] -+ cmd = ['rsync', '-a', os.path.join(source_dir.decode('UTF-8'), exe), install_dir] - print(' '.join(cmd)) - subprocess.check_call(cmd) - diff --git a/sources b/sources index 9c8d30a..3291aa9 100644 --- a/sources +++ b/sources @@ -1,15 +1,15 @@ SHA512 (cmake-3.16.5.tar.gz) = 204ce83501c8068ff660c30a68641a354764135e1600a9a95b39476d072876e400961377e19bbe03a7b18412b36dcf21a693946a2a81cff5985e637e9f193671 -SHA512 (cmark.tar.gz) = 279c96a0de7700c46d58482f500247445238bd3266f81dccef5ad785756cb82667f41dcf1f207a5e69064f8d4514011ca0eb5ba98565e120bba591a4e144d31b -SHA512 (corelibs-foundation.tar.gz) = 1801a624c19585bff8aebe3362ecc5d6f638331303e24ce592dc28418bf667a0e20dcd525e3ff1840258c9cc67c9254d5478436c18da24f7e5c60411fece149f -SHA512 (corelibs-libdispatch.tar.gz) = fab701b5e4b32b03decea1df4561b2ae65afbf7cd82d64768e77aa4907a179374fab4f5a4f81bda6bb490087eabdd2113988ec44424b14744ee0de2c94b96318 -SHA512 (corelibs-xctest.tar.gz) = 857fef0f6e681e563625a5f8f01072b5cd4c89af81ac7c919a5552b2a6f692fa06314d5d93289c6521273bfbbcfb1b619a1c79dffbb24f5a291e16d63cf3b0d9 -SHA512 (indexstore-db.tar.gz) = 7a260272ed309517b4c0878dcfb91db7826651934658632248e9719fe46811b8346b3c57c045f63cbedd15c5c0f5f829464c94f6d7c165b70ed0f418e4150e4a -SHA512 (llbuild.tar.gz) = 5f88dae0f1e76d7c27012b3237f4b7009a5da669dfc2569dc1bac8f9152279f6d2a5b9bf54ec5f844d64c841c0ab4c408835e3de8915f144ddacdcff2afa0575 -SHA512 (llvm-project.tar.gz) = ba88f86a57b6390e8a900620b0453dd61ca9c896cd2067e9415627087220b39a067801586e3e4fc0cfef21dca76e31c130ef9df05a2ddf0ada855fb79f66d228 -SHA512 (package-manager.tar.gz) = 1536f097960b3626060a3d07701d8dddb515862fa805285f9501a5cf3210b77276dac82525f9dc473532b97dd8e2e5287dec72ea4e6129b2cdc7f874d95915fe +SHA512 (cmark.tar.gz) = c1c31dadebb7e97ffbcf451e2964ab8593ab9048713b4aa102b87720a3f72b2b2bc7eedf4988cd7194dff930bfb27a0a3b34b4f5fd81e2d5d6f6cbd727d43282 +SHA512 (corelibs-foundation.tar.gz) = fca965045dcdb68c3038ddfab658cf2c26d84bcda8d29607538e583854858cf8b42c1bf55c2ca5d1d242c29666e23b0dba1f92da219b468112740681f26f0298 +SHA512 (corelibs-libdispatch.tar.gz) = 6180ee085e667e4990c1b93ec506eb623c871f95e3eca38e5545c84ff258a22f2deaa9b86e640ba668ad5a0f56e36ec06b06ea5f23f060b6c25b6e0fd929a03d +SHA512 (corelibs-xctest.tar.gz) = 840b56e7fa983af8207730590aeaf326c6264ffa1dff5366745498f6525bd9293e714dba96709b57a76fb52b094235d23f8eb46823c4ed97e7fb5e01120ede56 +SHA512 (indexstore-db.tar.gz) = 9c2a2e506e31d1531a45cd5c83e12510e1c48df0617360d6d721ae12c1c24a23ce4313d186766ee376ab4b8976521b9deb0a5adbefdc7f4e9cf9b57b68b2ac55 +SHA512 (llbuild.tar.gz) = 866526aa8c2a7b831b26aac067266cf579850508f3650a67042c84066283bcc6b8b8ad8021a0c1a1376f89a5407de5a3dccb264215a26afd91e19b35dbd4fd57 +SHA512 (llvm-project.tar.gz) = 137d004affab5239eaf89d06cd3b45fabe33ba0f7f930926204e15042e19f3ba9a77a394f71208521a7a6bced68f7ae1553bdff70676adfa81f5a0946d7eb2ca +SHA512 (package-manager.tar.gz) = 9bef9631ace2f09e7de40864316bb2440d0becc04ef7f5a03c58cb3f4189f60aedb72d870d84926b76fcfea9c3b53ae230ef2415138c07e5ae1f1bfe988a0f76 SHA512 (release-61-2.tar.gz) = 9c277f95694ef2b65da0c435ef580f85ec5ac425bca0d3cac82167d32ac6dbcd00a4411def7a7dd0c16786943b498486716b2ed5b353f19c4a499e8e1529fbf2 -SHA512 (sourcekit-lsp.tar.gz) = 9a1abe05795641519f68d58056933d3dd035cf6287652f08f29e632dd5c25966d7f92e64360715bd1f32ac29a7dd6137b0620b0e168dd33768b464b8baa08493 -SHA512 (swift-integration-tests.tar.gz) = 3e581c1d77d8eff71a8c51865cc425e6b6c28cd9c182f9f156d8d908b32c0f76163eac524f7c549c112cc068f945d15edd0be6d4f4b6899026272f03de96c887 -SHA512 (swift-syntax.tar.gz) = 05ee1e89aeb2db56e01cabb29bc6f53da29b9feb669ec0563f4ee9561afb61e40a5d2a24f121601b8afc7a9082864eec73d3fb72f00a570c000693d7db31e9ca -SHA512 (swift-xcode-playground-support.tar.gz) = ff5eb6c97ab7a1d0fabc08c01aebc876abbbc4a79fc437f8286deae7b9c248bd702fbb60217c1b53d5eecb18b096c68662e154d94c105400d6acc2ad72c176e6 -SHA512 (swift.tar.gz) = a5976a8edf2495168f0ba7c090af69ef0ef754ccfdf785a28b32c976eb4bc9e94d0c1022000ec50131b37b58ea8993aae8f095abf0d6b4028ea9fcabfd2e845a +SHA512 (sourcekit-lsp.tar.gz) = 8cc17cac6156f706d1e7a4daa0d8da4c10ddec36d268c94ec6ba82d9a6a1ba610308276dfb679cc1737ff684e634cf406e1b8636e50b2de96e12ee1a20a35bad +SHA512 (swift-integration-tests.tar.gz) = 1b641b0eb2ed219609716f689ec97d1982ac7b92b06ecc3b58cf5b4b703aa569387d9d2c035a6d09f2c6c17f8a897e0f6a711eac05d9f0c1071d9c8db46e248f +SHA512 (swift-syntax.tar.gz) = 937105f4f5483d6f049ad630192ab7dc9d3b01275d5fff9791b5994729b29edbface365335f5d2ec9aa7186bb728e3ec600015649b80e28ba02b114809c13913 +SHA512 (swift-xcode-playground-support.tar.gz) = acaeee1c578281f145a0a0e3abba2415e83de4628534aeae88f1d29c63fe71da59474cb427436cefa4664b75a2bd18aac868dcc7c62625749a94a1c0c1040a09 +SHA512 (swift.tar.gz) = fbf69731423f0e0c871d09c079dda4652114bc26b46fa31393c157c2c05568e7f972bdc951fd0f159745d3313bef5644a6eadf56a2403be41cb0d87dbeacb961 diff --git a/swift-lang-runtime.conf b/swift-lang-runtime.conf deleted file mode 100644 index d19930a..0000000 --- a/swift-lang-runtime.conf +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/swift/linux diff --git a/swift-lang.conf b/swift-lang.conf deleted file mode 100644 index ce1b5b2..0000000 --- a/swift-lang.conf +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/swift-lldb diff --git a/swift-lang.spec b/swift-lang.spec index 5806d43..aad418a 100644 --- a/swift-lang.spec +++ b/swift-lang.spec @@ -1,17 +1,16 @@ %global debug_package %{nil} -%global swifttag 5.1.5-RELEASE +%global swifttag 5.2.1-RELEASE # Swift syntax seems to only be updated on major releases -%global swiftsyntax 5.1.5-RELEASE -%global swiftgithash 30c042c -%global swiftgitdate 20200305 +%global swiftsyntax 5.2.1-RELEASE +%global swiftgithash 2e3b1b3 +%global swiftgitdate 20200331 %global swiftbuild swift-source -%global __provides_exclude ^/usr/lib/swift-lldb/.*\\.so.* %global cmake_version 3.16.5 Name: swift-lang -Version: 5.1.5 -Release: 0.3.%{swiftgitdate}git%{swiftgithash}%{?dist} +Version: 5.2.1 +Release: 1%{?dist} Summary: Apple's Swift programming language License: ASL 2.0 and Unicode URL: https://swift.org @@ -29,26 +28,16 @@ Source10: https://github.com/apple/indexstore-db/archive/swift-%{swifttag}.tar.g Source11: https://github.com/apple/llvm-project/archive/swift-%{swifttag}.tar.gz#/llvm-project.tar.gz Source12: https://github.com/unicode-org/icu/archive/release-61-2.tar.gz Source13: https://github.com/apple/swift-syntax/archive/swift-%{swiftsyntax}.zip#/swift-syntax.tar.gz -Source14: swift-lang.conf -Source15: swift-lang-runtime.conf -Source16: https://github.com/Kitware/CMake/releases/download/v%{cmake_version}/cmake-%{cmake_version}.tar.gz - -Patch0: change-lldb-location.patch -Patch1: build-setup.patch -Patch2: clangloc.patch -Patch3: compiler-rt-fuzzer.patch -Patch4: swift-unwrapped.patch -Patch5: python3.patch -Patch6: linux-tests-python-3.patch -Patch7: lldb_python38_platform.patch -Patch8: sourcekit.patch -Patch9: compiler-rt-sanitizer.patch -Patch10: build-setup-s390x.patch -Patch11: sourcekit-loc.patch -Patch12: glibcpthread.patch -Patch13: llvm.patch -Patch14: indexstore.patch -Patch15: implicit_fallthru.patch +Source16: https://github.com/Kitware/CMake/releases/download/v%{cmake_version}/cmake-%{cmake_version}.tar.gz + +Patch0: build-setup.patch +Patch1: compiler-rt-fuzzer.patch +Patch2: python3-2.patch +Patch3: linux-tests-python-3-2.patch +Patch4: glibcpthread.patch +Patch5: swift.patch +Patch6: llvm.patch +Patch7: indexstore.patch BuildRequires: clang BuildRequires: swig @@ -70,14 +59,17 @@ BuildRequires: libicu-devel BuildRequires: ninja-build BuildRequires: make BuildRequires: openssl-devel +BuildRequires: /usr/bin/pathfix.py Requires: glibc-devel -Requires: clang +Requires: binutils-gold +Requires: gcc Requires: ncurses-devel Requires: ncurses-compat-libs -Requires: %{name}-runtime = %{version}-%{release} Provides: %{name} = %{version}-%{release} +Obsoletes: %{name} < %{version}-%{release} +Obsoletes: %{name}-runtime < %{version}-%{release} ExclusiveArch: x86_64 aarch64 @@ -94,27 +86,16 @@ importantly, Swift is designed to make writing and maintaining correct programs easier for the developer. -%package runtime -Summary: Runtime files for Swift programs - -Provides: %{name}-runtime = %{version}-%{release} - - -%description runtime -Runtime libraries for Swift programs - - %prep -# First we handle our own CMake (sigh) +# Now we handle our own CMake (sigh) %setup -q -c -n cmake -a 16 mkdir cmake-build cd cmake-build ../cmake-%{cmake_version}/bootstrap && make -# Now continue on with Swift... -%setup -q -c -n %{swiftbuild} -a 0 -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 +%setup -q -c -n %{swiftbuild} -a 0 -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 # The Swift build script requires directories to be named # in a specific way so renaming the source directories is # necessary @@ -128,68 +109,39 @@ mv swift-package-manager-swift-%{swifttag} swiftpm mv swift-swift-%{swifttag} swift mv swift-xcode-playground-support-swift-%{swifttag} swift-xcode-playground-support mv sourcekit-lsp-swift-%{swifttag} sourcekit-lsp - mv indexstore-db-swift-%{swifttag} indexstore-db mv llvm-project-swift-%{swifttag} llvm-project -# Apple did some reorganization of the various components and what -# used to be separate subprojects are now symlinks into llvm-project -ln -s llvm-project/llvm llvm -ln -s llvm-project/lldb lldb -ln -s llvm-project/libcxx libcxx -ln -s llvm-project/compiler-rt compiler-rt -ln -s llvm-project/clang-tools-extra clang-tools-extra -ln -s llvm-project/clang clang + # ICU mv icu-release-61-2 icu # Swift Syntax on its own release (sigh) mv swift-syntax-swift-%{swiftsyntax} swift-syntax -# This patch tells the Swift executable to look for its Swift-specific -# lldb executable in /usr/libexec/swift-lldb, not in the same directory -# as the swift executable (i.e. /usr/bin). -%patch0 -p0 - # Since we require ninja for building, there's no sense to rebuild it just for Swift -%ifnarch s390x -%patch1 -p0 -%else -# Don't build ICU on s390x -%patch10 -p0 -%endif - -# This changes the location of where the headers and libs are to keep lldb happy -%patch2 -p0 +%patch0 -p0 # Fixes an issue with using std::thread in a vector in compiler-rt -%patch3 -p0 +%patch1 -p0 -# Patch for handling optional issue with pthreads functions in Swift file -# in the package mananger -%patch4 -p0 - # Python 3 is the new default so we need to make the python code work with it -%patch5 -p0 -%patch6 -p0 -%patch7 -p0 -%patch8 -p0 - -# New in Clang 9 is an assertion error of an array declared with a negative size -%patch9 -p0 - -# Changes locations where sourcekit-lsp looks for things -%patch11 -p0 +%patch2 -p0 +%patch3 -p0 # Fixes compiler issue with glibc and pthreads after 2.5.0.9000 -%patch12 -p0 +%patch4 -p0 -# Fixed STL no longer implicitly including -%patch13 -p0 -%patch14 -p0 +# +# 5.2 patches +# +%patch5 -p0 -# Implicit fallthrough warning treated as error in Clang 10 -%patch15 -p0 +# implicit include of cstdint +%patch6 -p0 +%patch7 -p0 +# Fix python to python3 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" swift/utils/api_checker/swift-api-checker.py %build export VERBOSE=1 @@ -206,118 +158,23 @@ swift/utils/build-script --preset=buildbot_linux,no_test install_destdir=%{_buil %install -mkdir -p %{buildroot}%{_libexecdir}/swift-lldb +mkdir -p %{buildroot}%{_libexecdir}/swift/ +cp -r %{_builddir}/usr/* %{buildroot}%{_libexecdir}/swift mkdir -p %{buildroot}%{_bindir} -mkdir -p %{buildroot}/usr/lib -install -m 0755 %{_builddir}/usr/bin/swift %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-build %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-build-tool %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-demangle %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-package %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-run %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-test %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/swift-api-digester %{buildroot}%{_bindir} -install -m 0644 %{_builddir}/usr/bin/swift-api-checker.py %{buildroot}%{_bindir} -ln -fs swift %{buildroot}/usr/bin/swift-autolink-extract -ln -fs swift %{buildroot}/usr/bin/swiftc -ln -fs swift %{buildroot}/usr/bin/swift-format - -install -m 0755 %{_builddir}/usr/bin/sourcekit-lsp %{buildroot}%{_bindir} -install -m 0755 %{_builddir}/usr/bin/plutil %{buildroot}%{_bindir} - -install -m 0755 %{_builddir}/usr/bin/lldb* %{buildroot}%{_libexecdir}/swift-lldb -install -m 0755 %{_builddir}/usr/bin/repl_swift %{buildroot}%{_libexecdir}/swift-lldb -install -m 0755 %{_builddir}/usr/bin/clangd %{buildroot}%{_libexecdir}/swift-lldb -install -m 0755 %{_builddir}/usr/bin/clang-7 %{buildroot}%{_libexecdir}/swift-lldb -# This is not a "real" clang, but an ersatz Swift version - placed here so it -# doesn't get in the way of the real one -ln -fs clang-7 %{buildroot}%{_libexecdir}/swift-lldb/clang -ln -fs clang-7 %{buildroot}%{_libexecdir}/swift-lldb/clang++ -ln -fs clang-7 %{buildroot}%{_libexecdir}/swift-lldb/clang-cl -ln -fs clang-7 %{buildroot}%{_libexecdir}/swift-lldb/clang-cpp - -# Why /usr/lib instead of %{_libdir}? -# The Swift toolchain is *extermely* sensitive to locations of its files -# (for example, the need for the patch above in the prep section) and -# has "lib" hardcoded in many, many places throughout all the projects that -# make up the Swift toolchain. Since we use subdirectories for the -# libraries, no actual .so files are dumped in /usr/lib. -mkdir -p %{buildroot}/usr/lib/swift-lldb -cp %{_builddir}/usr/lib/libIndexStore.so.7svn %{buildroot}/usr/lib/swift-lldb -ln -fs libIndexStore.so.7svn %{buildroot}/usr/lib/swift-lldb/libIndexStore.so -cp %{_builddir}/usr/lib/liblldb.so.992.8.1svn %{buildroot}/usr/lib/swift-lldb -ln -fs liblldb.so.992.8.1svn %{buildroot}/usr/lib/swift-lldb/liblldb.so.7svn -ln -fs liblldb.so.7svn %{buildroot}/usr/lib/swift-lldb/liblldb.so -cp %{_builddir}/usr/lib/libsourcekitdInProc.so %{buildroot}/usr/lib/swift-lldb -cp %{_builddir}/usr/lib/libswiftDemangle.so %{buildroot}/usr/lib/swift-lldb -cp %{_builddir}/usr/lib/liblldbIntelFeatures.so.7svn %{buildroot}/usr/lib/swift-lldb -ln -fs liblldbIntelFeatures.so.7svn %{buildroot}/usr/lib/swift-lldb/liblldbIntelFeatures.so -ln -fs %{_bindir}/swift %{buildroot}%{_libexecdir}/swift-lldb/swift -cp %{_builddir}/usr/lib/libBlocksRuntime.so %{buildroot}/usr/lib/swift-lldb -cp %{_builddir}/usr/lib/libdispatch.so %{buildroot}/usr/lib/swift-lldb - -mkdir -p %{buildroot}/usr/lib/swift -cp -r %{_builddir}/usr/lib/swift/* %{buildroot}/usr/lib/swift -rm %{buildroot}/usr/lib/swift/clang -cp -r %{_builddir}/usr/lib/clang %{buildroot}/usr/lib/swift -ln -fs /usr/lib/swift/clang/7.0.0/include %{buildroot}/usr/lib/swift/clang/include -ln -fs /usr/lib/swift/clang/7.0.0/lib %{buildroot}/usr/lib/swift/clang/lib -ln -fs /usr/lib/swift/clang/7.0.0/share %{buildroot}/usr/lib/swift/clang/share -ln -fs /usr/lib/swift %{buildroot}/usr/lib/swift-lldb/swift -chmod 0755 %{buildroot}/usr/lib/swift/linux/libswiftDispatch.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libFoundation.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libFoundationXML.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libXCTest.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libFoundationNetworking.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so -chmod 0755 %{buildroot}/usr/lib/swift/linux/libswiftRemoteMirror.so -chmod 0755 %{buildroot}/usr/lib/swift/pm/llbuild/libllbuild.so -chmod 0755 %{buildroot}/usr/lib/swift/pm/llbuild/libllbuildSwift.so - -mkdir -p %{buildroot}/usr/lib/swift_static -cp -r %{_builddir}/usr/lib/swift_static/* %{buildroot}/usr/lib/swift_static - -mkdir -p %{buildroot}/%{_sysconfdir}/ld.so.conf.d/ -install -m 0644 %{SOURCE14} %{buildroot}/%{_sysconfdir}/ld.so.conf.d/swift-lang.conf -install -m 0644 %{SOURCE15} %{buildroot}/%{_sysconfdir}/ld.so.conf.d/swift-lang-runtime.conf - +ln -fs %{_libexecdir}/swift/bin/swift %{buildroot}%{_bindir}/swift +ln -fs %{_libexecdir}/swift/bin/swiftc %{buildroot}%{_bindir}/swiftc +ln -fs %{_libexecdir}/swift/bin/sourcekit-lsp %{buildroot}%{_bindir}/sourcekit-lsp mkdir -p %{buildroot}%{_mandir}/man1 -install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1 +cp %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/swift.1 %files %license swift/LICENSE.txt -%{_bindir}/swift* -%{_mandir}/man1/* -/usr/lib/swift-lldb/ -/usr/lib/swift/Block/ -/usr/lib/swift/CoreFoundation/ -/usr/lib/swift/_InternalSwiftSyntaxParser/ -/usr/lib/swift/clang/ -/usr/lib/swift/dispatch/ -/usr/lib/swift/migrator/ -/usr/lib/swift/os/ -/usr/lib/swift/pm/ -/usr/lib/swift/shims/ -/usr/lib/swift_static/ -/usr/lib/swift/CFURLSessionInterface/ -/usr/lib/swift/CFXMLInterface/ -/usr/lib/swift/FrameworkABIBaseline/ -%{_libexecdir}/swift-lldb/ -%{_sysconfdir}/ld.so.conf.d/swift-lang.conf -%{_bindir}/plutil +%{_bindir}/swift +%{_bindir}/swiftc %{_bindir}/sourcekit-lsp - - -%files runtime -%dir /usr/lib/swift -/usr/lib/swift/linux/ -%ifarch aarch64 -/usr/lib/swift/linux/aarch64/ -%else -/usr/lib/swift/linux/x86_64/ -%endif -%{_sysconfdir}/ld.so.conf.d/swift-lang-runtime.conf +%{_mandir}/man1/swift.1.gz +%{_libexecdir}/swift/ %post -p /sbin/ldconfig @@ -325,36 +182,33 @@ install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/m %changelog -* Tue Mar 10 2020 Ron Olson 5.1.5-0.1.20200305git30c042c -- Updated to swift-5.1.5-RELEASE and added building the 3.16 version of CMake - to work around issues with 3.17 -* Mon Feb 17 2020 Ron Olson 5.1.4-0.2.20200131git2194dc2 -- Added patch to handle warning-as-error using Clang 10 -* Fri Jan 31 2020 Ron Olson 5.1.4-0.1.20200131git2194dc2 -- Updated to swift-5.1.4-RELEASE -* Wed Jan 29 2020 Ron Olson 5.1-0.17.20200128gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-28-a -* Tue Jan 28 2020 Ron Olson 5.1-0.16.20200127gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-27-a -* Sat Jan 25 2020 Ron Olson 5.1-0.15.20200124gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-24-a and added patches to - handle the cstdint header not being implicitly included -* Fri Jan 24 2020 Ron Olson 5.1-0.14.20200123gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-23-a -* Wed Jan 22 2020 Ron Olson 5.1-0.13.20200121gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-21-a -* Mon Jan 20 2020 Ron Olson 5.1-0.12.20200119gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-19-a -* Sat Jan 18 2020 Ron Olson 5.1-0.11.20200117gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-17-a -* Sun Jan 12 2020 Ron Olson 5.1-0.10.20200111gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-11-a -* Sat Jan 11 2020 Ron Olson 5.1-0.9.20200110gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-10-a -* Fri Jan 10 2020 Ron Olson 5.1-0.8.20200109gite45437e -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-09-a -* Wed Jan 08 2020 Ron Olson 5.1-0.7.20200107git04833a6 -- Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-07-a +* Mon Apr 06 2020 Ron Olson 5.2.1-1 +- Reorganized the package to place everything in a single location, + changed the versioning scheme, and removed a number of obsolete patches +* Wed Apr 01 2020 Ron Olson 5.2.1-0.1.20200331git2e3b1b3 +- Updated to swift-5.2.1-RELEASE +* Wed Mar 25 2020 Ron Olson 5.2-0.10.20200324git443e9a4 +- Updated to swift-5.2-RELEASE +* Thu Mar 12 2020 Ron Olson 5.2-0.9.20200311git33150e3 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-03-11-a and switched to + using patched version of cmake to get around issues building 5.2 with + 3.17 +* Fri Feb 28 2020 Ron Olson 5.2-0.8.20200227git33150e3 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-27-a +* Sun Feb 02 2020 Ron Olson 5.2-0.7.20200201git66c06ab +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-01-a +* Sat Feb 01 2020 Ron Olson 5.2-0.6.20200131gitfab20c6 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-31-a +* Thu Jan 30 2020 Ron Olson 5.2-0.5.20200129gita0c1677 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-29-a +* Tue Jan 28 2020 Ron Olson 5.2-0.4.20200127git7c02102 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-27-a +* Mon Jan 20 2020 Ron Olson 5.2-0.3.20200117git3194881 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-17-a +* Fri Jan 10 2020 Ron Olson 5.2-0.2.20200109git880e9e6 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-09-a +* Tue Jan 07 2020 Ron Olson 5.2-0.1.20200106git74df113 +- Updated to swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-06-a * Sat Dec 21 2019 Ron Olson 5.1-0.6.20191220git04833a6 - Updated to swift-5.1-DEVELOPMENT-SNAPSHOT-2019-12-20-a * Fri Dec 20 2019 Ron Olson 5.1-0.5.20191219git04833a6 diff --git a/swift-unwrapped.patch b/swift-unwrapped.patch deleted file mode 100644 index 0f88eb0..0000000 --- a/swift-unwrapped.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- swiftpm/Sources/Basic/Process.swift.orig 2019-03-13 14:27:25.426760197 -0500 -+++ swiftpm/Sources/Basic/Process.swift 2019-03-13 14:28:45.656837626 -0500 -@@ -327,7 +327,7 @@ - let devNull = strdup("/dev/null") - defer { free(devNull) } - // Open /dev/null as stdin. -- posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0) -+ posix_spawn_file_actions_addopen(&fileActions, 0, devNull!, O_RDONLY, 0) - - var outputPipe: [Int32] = [0, 0] - var stderrPipe: [Int32] = [0, 0] -@@ -350,7 +350,7 @@ - - let argv = CStringArray(arguments) - let env = CStringArray(environment.map({ "\($0.0)=\($0.1)" })) -- let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray) -+ let rv = posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray) - - guard rv == 0 else { - throw SystemError.posix_spawn(rv, arguments) diff --git a/swift.patch b/swift.patch new file mode 100644 index 0000000..80cc2c8 --- /dev/null +++ b/swift.patch @@ -0,0 +1,23 @@ +diff -Naur swift-orig/utils/build-presets.ini swift/utils/build-presets.ini +--- swift-orig/utils/build-presets.ini 2020-02-10 23:48:46.000000000 -0600 ++++ swift/utils/build-presets.ini 2020-02-13 20:40:30.123310629 -0600 +@@ -527,7 +527,6 @@ + release + assertions + +-build-swift-stdlib-unittest-extra + + # We run the OS X tests and validation tests. + test +diff -Naur swift-orig/utils/swift_build_support/swift_build_support/host_specific_configuration.py swift/utils/swift_build_support/swift_build_support/host_specific_configuration.py +--- swift-orig/utils/swift_build_support/swift_build_support/host_specific_configuration.py 2020-02-10 23:48:46.000000000 -0600 ++++ swift/utils/swift_build_support/swift_build_support/host_specific_configuration.py 2020-02-13 20:22:27.615497246 -0600 +@@ -12,7 +12,7 @@ + + from argparse import ArgumentError + +-import diagnostics ++from . import diagnostics + + from .targets import StdlibDeploymentTarget +