diff options
-rw-r--r-- | change-locations.patch | 39 | ||||
-rw-r--r-- | integration-tests.patch | 152 | ||||
-rw-r--r-- | swift-lang-4.2-change-lldb-location.patch | 23 | ||||
-rw-r--r-- | swift-lang.spec | 17 |
4 files changed, 203 insertions, 28 deletions
diff --git a/change-locations.patch b/change-locations.patch new file mode 100644 index 0000000..1d399f5 --- /dev/null +++ b/change-locations.patch @@ -0,0 +1,39 @@ +--- swift/lib/Driver/ToolChains.cpp.orig 2018-06-25 21:04:32.467377167 -0500 ++++ swift/lib/Driver/ToolChains.cpp 2018-06-25 21:04:57.553375531 -0500 +@@ -844,10 +844,8 @@ + useLLDB = false; + break; + case REPLJobAction::Mode::RequireLLDB: +- useLLDB = true; +- break; + case REPLJobAction::Mode::PreferLLDB: +- useLLDB = !findProgramRelativeToSwift("lldb").empty(); ++ useLLDB = true; + break; + } + +@@ -875,7 +873,7 @@ + ArgStringList Arguments; + Arguments.push_back(context.Args.MakeArgString(std::move(SingleArg))); + +- return {"lldb", Arguments}; ++ return {"/usr/libexec/swift-lldb/lldb", Arguments}; + } + + +@@ -1588,8 +1586,13 @@ + Clang = context.Args.MakeArgString(toolchainClang.get()); + } + if (Clang == nullptr) { +- if (auto pathClang = llvm::sys::findProgramByName("clang++", None)) +- Clang = context.Args.MakeArgString(pathClang.get()); ++ const char *isBuilding = getenv("SWIFT_BUILD_FOR_FEDORA"); ++ if (isBuilding == NULL) { ++ Clang = context.Args.MakeArgString("/usr/libexec/swift-clang/clang++"); ++ } else { ++ if (auto pathClang = llvm::sys::findProgramByName("clang++", None)) ++ Clang = context.Args.MakeArgString(pathClang.get()); ++ } + } + assert(Clang && + "clang++ was not found in the toolchain directory or system path."); diff --git a/integration-tests.patch b/integration-tests.patch new file mode 100644 index 0000000..f7ef732 --- /dev/null +++ b/integration-tests.patch @@ -0,0 +1,152 @@ +--- swift-integration-tests/test-foundation-package/test-foundation-package.txt.orig 2018-06-25 16:26:12.887466459 -0500 ++++ swift-integration-tests/test-foundation-package/test-foundation-package.txt 2018-06-25 16:26:12.887466459 -0500 +@@ -2,6 +2,7 @@ + // + // + // Make a sandbox dir. ++// RUN: export SWIFT_BUILD_FOR_FEDORA=1 + // RUN: rm -rf %t.dir + // RUN: mkdir -p %t.dir/tool + // RUN: cp %s %t.dir/tool/Package.swift +--- swift-integration-tests/test-import-glibc/test-import-glibc.py.orig 2018-06-25 16:26:12.888466459 -0500 ++++ swift-integration-tests/test-import-glibc/test-import-glibc.py 2018-06-25 16:26:12.888466459 -0500 +@@ -2,6 +2,7 @@ + # + # REQUIRES: platform=Linux + ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: rm -rf %t.dir + # RUN: mkdir %t.dir + # RUN: cp %S/import-glibc.swift %t.dir/import-glibc.swift +--- swift-integration-tests/test-multi-compile-glibc/swift-multi-compile-glibc.py.orig 2018-06-25 16:26:12.893466459 -0500 ++++ swift-integration-tests/test-multi-compile-glibc/swift-multi-compile-glibc.py 2018-06-25 16:26:12.893466459 -0500 +@@ -1,6 +1,7 @@ + # Tests that multiple files are compiled correctly + # + # REQUIRES: platform=Linux ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: rm -rf %t.dir + # RUN: mkdir %t.dir + # RUN: cp %S/hello.swift %t.dir/hello.swift +--- swift-integration-tests/test-multi-compile/swift-multi-compile.py.orig 2018-06-25 16:26:12.895466459 -0500 ++++ swift-integration-tests/test-multi-compile/swift-multi-compile.py 2018-06-25 16:26:12.896466459 -0500 +@@ -1,5 +1,6 @@ + # Tests that compiling multiple swift files works. + # ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: rm -rf %t.dir + # RUN: mkdir %t.dir + # RUN: cp %S/hello.swift %t.dir/hello.swift +--- swift-integration-tests/test-static-lib/test-static-lib.py.orig 2018-06-25 16:26:12.896466459 -0500 ++++ swift-integration-tests/test-static-lib/test-static-lib.py 2018-06-25 16:26:12.896466459 -0500 +@@ -1,5 +1,6 @@ + # Tests that creating a static lib and importing it into a file works + ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: rm -rf %t.dir + # RUN: mkdir %t.dir + # RUN: cp %S/staticLib.swift %t.dir/staticLib.swift +--- swift-integration-tests/test-xctest-package/test-xctest-package.txt.orig 2018-06-25 16:26:12.897466459 -0500 ++++ swift-integration-tests/test-xctest-package/test-xctest-package.txt 2018-06-25 16:26:12.897466459 -0500 +@@ -7,6 +7,7 @@ + // REQUIRES: platform=Linux + // + // Make a sandbox dir. ++// RUN: export SWIFT_BUILD_FOR_FEDORA=1 + // RUN: rm -rf %t.dir + // RUN: mkdir -p %t.dir/tool + // RUN: cp %s %t.dir/tool/Package.swift +--- swift-integration-tests/test-complex-xctest-package/test-xctest-package.txt.orig 2018-06-25 16:26:12.897466459 -0500 ++++ swift-integration-tests/test-complex-xctest-package/test-xctest-package.txt 2018-06-25 16:26:12.897466459 -0500 +@@ -1,6 +1,7 @@ + // Check if test modules can import Swift modules which depend on C module. + // + // Make a sandbox dir. ++// RUN: export SWIFT_BUILD_FOR_FEDORA=1 + // RUN: rm -rf %t.dir + // RUN: mkdir -p %t.dir + // RUN: cp -r %S/SwiftCMixed %t.dir/ +--- swift-integration-tests/basic.py.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/basic.py 2018-06-25 16:26:12.892466459 -0500 +@@ -1,5 +1,6 @@ + # Basic sanity check. + # ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: %{swiftc} --version > %t.out + # RUN: %{FileCheck} --input-file %t.out %s + # +--- swift-integration-tests/swift-package-init-lib.md.orig 2018-06-25 16:26:12.890466459 -0500 ++++ swift-integration-tests/swift-package-init-lib.md 2018-06-25 16:26:12.893466459 -0500 +@@ -6,6 +6,7 @@ + ``` + RUN: rm -rf %t.dir + RUN: mkdir -p %t.dir/Project ++RUN: export SWIFT_BUILD_FOR_FEDORA=1 + RUN: %{swift} package --package-path %t.dir/Project init --type library + RUN: %{swift} build --package-path %t.dir/Project 2>&1 | tee %t.build-log + RUN: %{swift} test --package-path %t.dir/Project 2>&1 | tee %t.test-log +--- swift-integration-tests/swift-build-self-host.py.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-build-self-host.py 2018-06-25 16:26:12.892466459 -0500 +@@ -12,6 +12,7 @@ + # RUN: cp -R %{swiftpm_srcdir} %t.dir/swiftpm + + # RUN: rm -rf %t.dir/swiftpm/.build ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: %{swift} build --package-path %t.dir/swiftpm 2>&1 | tee %t.build-log + + # Check the build log. +--- swift-integration-tests/swift-package-with-spaces.txt.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-package-with-spaces.txt 2018-06-25 16:26:12.892466459 -0500 +@@ -6,6 +6,7 @@ + // RUN: cp %s %t.dir/more\ spaces/special\ tool/Package.swift + // RUN: echo 'foo()' > %t.dir/more\ spaces/special\ tool/main.swift + // RUN: echo 'func foo() { print("HI") }' > %t.dir/more\ spaces/special\ tool/some\ file.swift ++// RUN: export SWIFT_BUILD_FOR_FEDORA=1 + // RUN: %{swift} build --package-path %t.dir/more\ spaces/special\ tool -v 2>&1 | tee %t.build-log + // + // Check the build log. +--- swift-integration-tests/swift-build.txt.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-build.txt 2018-06-25 16:26:12.892466459 -0500 +@@ -1,6 +1,7 @@ + // Trivial test for Swift build. + // + // Make a sandbox dir. ++// RUN: export SWIFT_BUILD_FOR_FEDORA=1 + // RUN: rm -rf %t.dir + // RUN: mkdir -p %t.dir/tool + // RUN: cp %s %t.dir/tool/Package.swift +--- swift-integration-tests/swift-run.md.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-run.md 2018-06-25 16:26:12.892466459 -0500 +@@ -3,6 +3,7 @@ + ## Create a new package with an echo executable. + + ``` ++RUN: export SWIFT_BUILD_FOR_FEDORA=1 + RUN: rm -rf %t.dir + RUN: mkdir -p %t.dir/secho + RUN: %{swift} package --package-path %t.dir/secho init --type executable +@@ -20,4 +21,4 @@ + CHECK-BUILD-LOG: Compile Swift Module 'secho' + CHECK-BUILD-LOG: Linking {{.*}}secho + CHECK-BUILD-LOG: 1 two +-``` +\ No newline at end of file ++``` +--- swift-integration-tests/swift-package-init-exec.md.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-package-init-exec.md 2018-06-25 16:26:12.892466459 -0500 +@@ -3,6 +3,7 @@ + ## Create a new package with an executable target. + + ``` ++RUN: export SWIFT_BUILD_FOR_FEDORA=1 + RUN: rm -rf %t.dir + RUN: mkdir -p %t.dir/Project + RUN: %{swift} package --package-path %t.dir/Project init --type executable +--- swift-integration-tests/swift-compiler.py.orig 2018-06-25 16:26:12.891466459 -0500 ++++ swift-integration-tests/swift-compiler.py 2018-06-25 16:26:12.892466459 -0500 +@@ -1,4 +1,5 @@ + # ++# RUN: export SWIFT_BUILD_FOR_FEDORA=1 + # RUN: rm -rf %t.dir + # RUN: mkdir -p %t.dir + # RUN: touch %t.dir/hello.swift diff --git a/swift-lang-4.2-change-lldb-location.patch b/swift-lang-4.2-change-lldb-location.patch deleted file mode 100644 index 7a13cb1..0000000 --- a/swift-lang-4.2-change-lldb-location.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- swift/lib/Driver/ToolChains.cpp.orig 2018-04-12 15:42:53.633440991 -0500 -+++ swift/lib/Driver/ToolChains.cpp 2018-04-12 15:44:37.578628169 -0500 -@@ -841,10 +841,8 @@ - useLLDB = false; - break; - case REPLJobAction::Mode::RequireLLDB: -- useLLDB = true; -- break; - case REPLJobAction::Mode::PreferLLDB: -- useLLDB = !findProgramRelativeToSwift("lldb").empty(); -+ useLLDB = true; - break; - } - -@@ -872,7 +870,7 @@ - ArgStringList Arguments; - Arguments.push_back(context.Args.MakeArgString(std::move(SingleArg))); - -- return {"lldb", Arguments}; -+ return {"/usr/libexec/swift-lldb/lldb", Arguments}; - } - - diff --git a/swift-lang.spec b/swift-lang.spec index 5ed57e5..0754f95 100644 --- a/swift-lang.spec +++ b/swift-lang.spec @@ -1,10 +1,10 @@ %global debug_package %{nil} -%global swifttag 4.2-DEVELOPMENT-SNAPSHOT-2018-06-12-a -%global swiftgithash bb9532c -%global swiftgitdate 20180612 +%global swifttag 4.2-DEVELOPMENT-SNAPSHOT-2018-06-23-a +%global swiftgithash 1e07724 +%global swiftgitdate 20180623 Name: swift-lang Version: 4.2 -Release: 0.19.%{swiftgitdate}git%{swiftgithash}%{?dist} +Release: 0.20.%{swiftgitdate}git%{swiftgithash}%{?dist} Summary: Apple's Swift programming language License: ASL 2.0 URL: https://swift.org @@ -24,10 +24,11 @@ Source12: https://github.com/apple/swift-xcode-playground-support/archive/ Source13: swift-lang.conf -Patch0: %{name}-%{version}-change-lldb-location.patch +Patch0: change-locations.patch Patch1: compiler-rt-no-ustat.patch Patch2: no-ninja-build.patch Patch3: time-struct-redefined.patch +Patch4: integration-tests.patch BuildRequires: which @@ -105,6 +106,10 @@ mv swift-xcode-playground-support-swift-%{swifttag} swift-xcode-playground-suppo # Fixes an error in compiler-rt where the timespec struct is redefined %patch3 -p0 +# Sets the environment variable SWIFT_BUILD_FOR_FEDORA to tell the tests to use +# the correct version of clang when testing +%patch4 -p0 + %build export VERBOSE=1 @@ -184,6 +189,8 @@ install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/m %postun -p /sbin/ldconfig %changelog +* Mon Jun 25 2018 Ron Olson <tachoknight@gmail.com> 4.2-0.20.20180623git1e07724 +- Updated to swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-23-a * Wed Jun 13 2018 Ron Olson <tachoknight@gmail.com> 4.2-0.19.20180612gitbb9532c - Updated to swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-12-a and removed gcc-c++ as a build requirement |