Package Details: swift 5.1-1

Git Clone URL: https://aur.archlinux.org/swift-language.git (read-only)
Package Base: swift-language
Description: The Swift programming language compiler and tools
Upstream URL: http://swift.org/
Licenses: Apache
Conflicts: swift-bin, swift-git, swift-language-git
Provides: swift-language
Submitter: Zrax
Maintainer: Zrax
Last Packager: Zrax
Votes: 32
Popularity: 0.150128
First Submitted: 2016-01-08 23:39
Last Updated: 2019-09-22 19:31

Required by (10)

Sources (16)

Latest Comments

1 2 3 4 5 6 ... Next › Last »

cparrott73 commented on 2019-10-08 19:32

Just tried to build swift 5.1-1, and I ran into a different error:

--- bootstrap: note: building stage1
Compiling libc.c
Compiling Swift Module 'PackageDescription4' (10 sources)
clang-8: warning: argument unused during compilation: '-fmodules-cache-path=/home/pacman/aur/swift-language/src/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/.bootstrap/ModuleCache' [-Wunused-command-line-argument]
Linking clibc
Compiling Swift Module 'SPMLibc' (1 sources)
Linking SPMLibc
Compiling Swift Module 'Basic' (40 sources)
Linking PackageDescription4
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:328:59: error: value of optional type 'UnsafeMutablePointer<Int8>?' must be unwrapped to a value of type 'UnsafeMutablePointer<Int8>'
        posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0)
                                                          ^
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:328:59: note: coalesce using '??' to provide a default when the optional value contains 'nil'
        posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0)
                                                          ^
                                                                  ?? <#default value#>
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:328:59: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
        posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0)
                                                          ^
                                                                 !
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:351:54: error: value of optional type 'UnsafeMutablePointer<Int8>?' must be unwrapped to a value of type 'UnsafeMutablePointer<Int8>'
        let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray)
                                                     ^
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:351:54: note: coalesce using '??' to provide a default when the optional value contains 'nil'
        let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray)
                                                     ^
                                                         ?? <#default value#>
/home/pacman/aur/swift-language/src/swiftpm/Sources/Basic/Process.swift:351:54: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
        let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray)
                                                     ^
                                                        !
--- bootstrap: error: build failed with exit status 1
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
==> ERROR: A failure occurred in build().
    Aborting...

Any ideas?

EDIT: I seem to have fixed the compile error by modifying src/swiftpm/Sources/Basic/Process.swift:

--- Process.swift.orig  2019-10-08 13:36:31.053125481 -0700
+++ Process.swift       2019-10-08 13:26:17.278207101 -0700
@@ -325,7 +325,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]
@@ -348,7 +348,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)

Not sure if this is the correct/preferred solution, but it worked for me.

EDIT 2: similar fix for failing test in src/swift/test/stdlib/POSIX.swift:

--- POSIX.swift.orig    2019-10-08 13:45:28.987050875 -0700
+++ POSIX.swift 2019-10-08 13:39:31.728895278 -0700
@@ -69,7 +69,7 @@
   let sem = sem_open(semaphoreName, O_CREAT, 0o777, 1)
   expectNotEqual(SEM_FAILED, sem)

-  let res = sem_close(sem)
+  let res = sem_close(sem!)
   expectEqual(0, res)

   let res2 = sem_unlink(semaphoreName)
@@ -83,7 +83,7 @@
   let sem = sem_open(semaphoreName, O_CREAT | O_EXCL, 0o777, 1)
   expectNotEqual(SEM_FAILED, sem)

-  let res = sem_close(sem)
+  let res = sem_close(sem!)
   expectEqual(0, res)

   let res2 = sem_unlink(semaphoreName)
@@ -102,7 +102,7 @@
   // difficult.
   expectNotEqual(SEM_FAILED, sem2)

-  let res = sem_close(sem)
+  let res = sem_close(sem!)
   expectEqual(0, res)

   let res2 = sem_unlink(semaphoreName)
@@ -120,7 +120,7 @@
   expectEqual(SEM_FAILED, sem2)
   expectEqual(EEXIST, errno)

-  let res = sem_close(sem)
+  let res = sem_close(sem!)
   expectEqual(0, res)

   let res2 = sem_unlink(semaphoreName)

n00b3 commented on 2019-09-29 18:39

any suggestions how to trace back this error. Issued command in swift-language dir: makepkg -si

Warning, treated as error: /home/adones/tarballs/swift-language/src/swift/docs/ABI/Mangling.rst:708:Unknown target name: "0". [934/979][ 95%][1835.321s] Compiling /home/adones/tarballs/swift-language/src/build/Ninja-ReleaseAssert/swift-linux-x86_64/stdlib/public/core/LINUX/x86_64/Swift.o ninja: build stopped: subcommand failed. ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting ==> ERROR: A failure occurred in build(). Aborting...

calin commented on 2019-09-29 10:29

I get a compilation failure:

/home/user/.cache/yay/swift-language/src/swift/docs/ABI/Mangling.rst:708:Unknown target name: "0". [296/992][ 29%][58.189s] Building CXX object lib/AST/CMakeFiles/swiftAST.dir/Decl.cpp.o ninja: build stopped: subcommand failed. ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting ==> ERROR: A failure occurred in build(). Aborting... Error making: swift-language (swift)

Tabsc commented on 2019-08-14 07:52

Many thanks for the feedback. But there are so many packages depending on python-sphinx that it is difficult for me to remove it. Maybe we should post an issue somewhere else if this is not directly related to Arch. In your opinion where is the problem lying ? In the swift build, in python-sphinx incompatibility or in the Arch packages incompatibility ?

joekiller commented on 2019-08-09 23:41

@Tabsc sphinx version 2.X+ is actually the python-sphinx version (the python 3 version). So if you want this to work, you need to remove python-sphinx. Yes it is confusing that sphinx 2.X+ is for python 3 and version sphinx <2.X ie version 1.X is for python 2.

Tabsc commented on 2019-08-06 08:22

Comfirm @joekiller error occurs for me as well.

I was not able to remove python2-sphinx since it is installed as a dependency of the package (it thus reinstall itself at each pkgbuild). I tried to put python 3 sphinx as a dep in the PKGBUILD instead of python2-sphinx but it did not work.

joekiller commented on 2019-07-29 20:59

So I kept getting

Warning, treated as error:
/home/jlawson/.cache/yay/swift-language/src/swift/docs/ARCOptimization.rst:100:Pygments lexer name 'sil' is not known
[907/950] Compiling /home/jlawson/.cache/yay/swift-...inux-x86_64/stdlib/public/core/linux/x86_64/Swift.o
ninja: build stopped: subcommand failed.
./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
==> ERROR: A failure occurred in build().
    Aborting...

Again and finally traced it down to having both python-sphinx and python2-sphinx installed. Once I got rid of sphinx 2+ it went fine.

I had to move into my cache directory (~/.cache/yay/swift-language/src/build/Ninja-ReleaseAssert/swift-linux-x86_64) and run ninja -d explain to see what the heck was going on. Frustrating but finally it is working again.

Zrax commented on 2019-06-05 22:12

It looks like lldb hasn't been updated to work with swig 4 yet, so I created a swig3 AUR package which can be installed side-by-side with swig, and updated swift to use it for now until a better fix can be made.

I've also re-enabled the sourcekit (libsourcekitdInProc.so) build.

torpesco commented on 2019-06-04 16:56

I ran strace on the command that fails. Python can't find swig_runtime_data4. It tries various suffixes on it of .so, module.so, .py, .pyc in the library path. Has anyone reported this (or found an existing report for this) at bugs.swift.org? I can't find one, myself.

MarcinWieczorek commented on 2019-06-03 13:33

I confirm.