rhx / SwiftGtk

A Swift wrapper around gtk-3.x and gtk-4.x that is largely auto-generated from gobject-introspection
https://rhx.github.io/SwiftGtk/
BSD 2-Clause "Simplified" License
318 stars 26 forks source link

Does not build on Arch Linux #43

Open melody-notpond opened 3 years ago

melody-notpond commented 3 years ago

On Arch Linux, trying to run ./build.sh yields the following error:

'CGLib' glib-2.0 gio-unix-2.0.pc: warning: couldn't find pc file
'CCairo' cairo glib-2.0 gio-unix-2.0.pc: warning: couldn't find pc file
fish: “./build.sh” terminated by signal SIGSEGV (Address boundary error)

I believe I have all required packages installed, but what's puzzling is the address boundary error. :thinking:

mikolasstuchlik commented 3 years ago

There is an issue in the current Package.swift files of the SwiftGtk project and it’s dependencies. It is explained in “ Building the project using swift build” section of https://github.com/rhx/SwiftGtk/issues/34.

It’s only guess but there might be an issue related to SPM.

The build.sh script forwards any following arguments to swift build command, appending -v flag might provide us with more information. ($ ./build.sh -v)

And/Or you can try following:

I have already implemented the pitch in my forks, so you can try, whether the changes I made to the build process solve the issue for you. I have created a demo project for purposes of the PRs I have opened, you can find it here: https://github.com/mikolasstuchlik/Matika.

melody-notpond commented 3 years ago

Here is the result of ./build.sh -v:

lsb_release -r
/usr/lib/swift/bin/swiftc -print-target-info
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/Package.swift -o /tmp/TemporaryDirectory.JcFInC/swiftgtk-manifest
/tmp/TemporaryDirectory.JcFInC/swiftgtk-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftAtk/Package.swift -o /tmp/TemporaryDirectory.TpNxqD/swiftatk-manifest
/tmp/TemporaryDirectory.TpNxqD/swiftatk-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGdk/Package.swift -o /tmp/TemporaryDirectory.vuDtRD/swiftgdk-manifest
/tmp/TemporaryDirectory.vuDtRD/swiftgdk-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGObject/Package.swift -o /tmp/TemporaryDirectory.cR3qnD/swiftgobject-manifest
/tmp/TemporaryDirectory.cR3qnD/swiftgobject-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGLib/Package.swift -o /tmp/TemporaryDirectory.1kKx5B/swiftglib-manifest
/tmp/TemporaryDirectory.1kKx5B/swiftglib-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGdkPixbuf/Package.swift -o /tmp/TemporaryDirectory.hIyScD/swiftgdkpixbuf-manifest
/tmp/TemporaryDirectory.hIyScD/swiftgdkpixbuf-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftPangoCairo/Package.swift -o /tmp/TemporaryDirectory.cuZNqC/swiftpangocairo-manifest
/tmp/TemporaryDirectory.cuZNqC/swiftpangocairo-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGIO/Package.swift -o /tmp/TemporaryDirectory.EoFtVB/swiftgio-manifest
/tmp/TemporaryDirectory.EoFtVB/swiftgio-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftGModule/Package.swift -o /tmp/TemporaryDirectory.Lr3jHD/swiftgmodule-manifest
/tmp/TemporaryDirectory.Lr3jHD/swiftgmodule-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftCairo/Package.swift -o /tmp/TemporaryDirectory.Jw0KgD/swiftcairo-manifest
/tmp/TemporaryDirectory.Jw0KgD/swiftcairo-manifest -fileno 9
/usr/lib/swift/bin/swiftc -L /usr/lib/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/lib/swift/lib/swift/pm/4_2 -swift-version5 -I /usr/lib/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/lauragallo/SwiftGtk/.build/checkouts/SwiftPango/Package.swift -o /tmp/TemporaryDirectory.zYNHAC/swiftpango-manifest
/tmp/TemporaryDirectory.zYNHAC/swiftpango-manifest -fileno 9
uname
pkg-config --variable pc_path pkg-config
'CGLib' glib-2.0 gio-unix-2.0.pc: warning: couldn't find pc file
'CAtk' atk glib-2.0 gio-unix-2.0.pc: warning: couldn't find pc file
fish: “./build.sh -v” terminated by signal SIGSEGV (Address boundary error)

I'm currently trying to build your fork; I'll let you know the results when it's done.

melody-notpond commented 3 years ago

I attempted to build your fork and unfortunately it did not work. :( Here is the output of swift build -v:

lsb_release -r
/usr/lib/swift/bin/swiftc -print-target-info
uname
pkg-config --variable pc_path pkg-config
'CGLib' gio-unix-2.0.pc: warning: non whitelisted flag(s): -pthread
fish: “swift build -v” terminated by signal SIGSEGV (Address boundary error)
mikolasstuchlik commented 3 years ago

This looks like an issue with the Swift Package Manager to me, rather than an issue with the SwiftGtk itself (=> it might be an issue for the Swift Forum).

If there is an issue with the SPM, there is probably nothing I can do for you :(

If the problem is unrelated to the SwiftGtk, I think that attempt to compile only .systemLibrary module importing "gio-unix-2.0" should fail aswell. I have created such project when resolving an issue with LLDB. You can find it here https://github.com/mikolasstuchlik/LldbMinimalTest

It is quite a simple Swift package, it does nothing. There are three modules, CGLib which uses pkg-config to import "gio-unix-2.0", GLib which adds some settings important for the debugger and LldbMinimalTest which is an executable module. The package should build successfuly (I have just tired it on my Ubuntu 20.04). In case it does not, this might be indeed a SPM issue.

Edit: I get the "non-whitelisted" warning too.

mikolas@MIKI-U-NTBK:~/FI-Developer/apps/LldbMinimalTest$ swift package clean
mikolas@MIKI-U-NTBK:~/FI-Developer/apps/LldbMinimalTest$ swift build
'CGLib' gio-unix-2.0.pc: warning: non whitelisted flag(s): -pthread
[7/7] Linking LldbMinimalTest
mikolas@MIKI-U-NTBK:~/FI-Developer/apps/LldbMinimalTest$ 
melody-notpond commented 3 years ago

I can build LldbMinimalTest successfully. Strange. Does this mean it's not a problem with the Swift package manager?

mikolasstuchlik commented 3 years ago

Well, I would say that there is an issue with SPM, since build should not ever end by SIGSEGV.

The question what triggers the issue (and whether there is a workaround) remains. Would you tell me what version of Arch and Swift toolchain are you using, please? I might have some time to look at the issue myself in following days.

melody-notpond commented 3 years ago
~ ~> uname -a
Linux macbookarch 5.10.3-zen1-1-zen #1 ZEN SMP PREEMPT Sun, 27 Dec 2020 12:04:22 +0000 x86_64 GNU/Linux
~ ~> swift --version
Swift version 5.3.1 (swift-5.3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Dadoum commented 3 years ago

Build the latest SPM from https://github.com/apple/swift-package-manager and use it to build. This is a bug in SPM that I fixed in main

melody-notpond commented 3 years ago

Okay so i built the latest SPM from the github repo provided and I got the following error when building with the new SPM:

/home/jenra/SwiftGtk: error: manifest parse error(s):
/home/jenra/SwiftGtk/Package.swift:3:8: error: no such module 'PackageDescription'
import PackageDescription
       ^
Dadoum commented 3 years ago

Did you install SPM in the folder of your swift toolchain ? And can you try to build an example project using swift run ?

melody-notpond commented 3 years ago

I made an example project with swift-package init and got the same error:

~/test ~> swift-package init
Creating library package: test
Creating Package.swift
Creating README.md
Creating .gitignore
Creating Sources/
Creating Sources/test/test.swift
Creating Tests/
Creating Tests/testTests/
Creating Tests/testTests/testTests.swift
~/test ~> swift-run
/home/jenra/test: error: manifest parse error(s):
/home/jenra/test/Package.swift:4:8: error: no such module 'PackageDescription'
import PackageDescription
       ^
mikolasstuchlik commented 3 years ago

@Dadoum (@jenra-uwu)

Hello. First of all - I am not a "linux power user", so excuse my lack of linux proficiency. I have tried to look into the issue myself and I will probably need some guidance. I will desribe all steps I took.

[I'm using VBox 6.1 from Ubuntu 20.04]

I have:

Then I tried to build and "install" swiftPM where my lack of knowledge hit me so I was unable to "install SPM in the folder of my swift toolchain". I have made following steps:

Then I have started to think about the issue. My lack of understanding "how to install the SPM" lead me to consider, whether I have in fact replaced the SPM since build products also contain libSwiftPM.so and other libraries. I have found no such libraries in the toolchain, also the size of swift-build is around 60M so it migh contain more than just one line of code (as written in the target).

I have also searched Github for any PR opened by you on SPM (https://github.com/apple/swift-package-manager/pull/3080). I have checked again and there is no package with more than one package in pkgConfig since the version 12 (of the gir2swift) was released.

Since you mentioned in the PR, that the PR resolves the https://bugs.swift.org/browse/SR-13424, I think that the issue is on my side due to being unable to "install the SPM" correcly.

Would you please help me to do so? :) Thanks -stuchlej

Edit2: I need to go now, but I figured out it might be useful to post a stack trace (i needed to rebuild spm with searialize debugging option enabled). I'll look in to this soon but for now I need to go afk. I'll be in touch. trace.txt

Dadoum commented 3 years ago

The manual way is to get CentOS toolchain from trunk development on swift.org here and to patch it to replace every needed libraries with this command (to run in extracted toolchain folder):

find . -executable -type f -exec patchelf --replace-needed libncurses.so.6 libncursesw.so --replace-needed libpanel.so.6 libpanelw.so --replace-needed libform.so.6 libformw.so {} \;

The fast way is to clone swift-bin AUR package and replace in the PKGBUILD the source URL with the URL of trunk development and checksum with SKIP (I did not test, but should work)

use this PKGBUILD:

# Maintainer: Ryan Gonzalez <rymg19 at gmail dot com>
# Contributor: Frederic Bezies <fredbezies at gmail dot com>, youngunix <>

pkgname=swift-bin
pkgver=5.3.1
pkgrel=1
pkgdesc="Binary builds of the Swift programming language"
arch=('x86_64')
url="https://swift.org"
license=('apache')
depends=('libutil-linux' 'libxml2' 'python2')
makedepends=('patchelf' 'rpmextract')
options=('!strip')
provides=('swift-language')
replaces=('swift-language-bin')
source=("https://swift.org/builds/development/centos8/swift-DEVELOPMENT-SNAPSHOT-2021-01-15-a/swift-DEVELOPMENT-SNAPSHOT-2021-01-15-a-centos8.tar.gz")
sha256sums=('SKIP')

package() {
  find_elf_only() {
    find "${pkgdir}/usr/lib/swift" \
      -executable -type f \
      '(' -path '*/bin/*' -o -name '*.so*' ')' \
      -not -name '*.py' \
      "$@"
  }

  mkdir -p "${pkgdir}/usr/lib/swift"
  cp -Ppr "${srcdir}/swift-DEVELOPMENT-SNAPSHOT-2021-01-15-a-centos8"/usr/* "${pkgdir}/usr/lib/swift"

  # Symlink the desired binaries to /usr/bin
  mkdir -p "${pkgdir}/usr/bin"
  for bin in sourcekit-lsp swift swiftc; do
    ln -s "/usr/lib/swift/bin/$bin" "${pkgdir}/usr/bin/$bin"
  done

  # Patch the binaries to use the changed ncurses names
  patchelf=(patchelf)
  for lib in ncurses panel form; do
    patchelf+=(--replace-needed "lib${lib}.so.6" "lib${lib}w.so")
  done
  find_elf_only -exec "${patchelf[@]}" {} \;

  install -dm755 "${pkgdir}/etc/ld.so.conf.d"
  echo '/usr/lib/swift/lib/swift/linux' >> "${pkgdir}/etc/ld.so.conf.d/swift.conf"
}

PS: With "yay" AUR helper, the PKGBUILD is located in ~/.cache/yay/swift-bin/PKGBUILD, and install it then with makepkg -si in the folder

melody-notpond commented 3 years ago

I was able to successfully install this version of Swift, but the build process still terminates with a SIGSEGV. I built this using the modified PKGBUILD you provided to install Swift. Below is my output:

~/SwiftGtk (main|✔) ~> swift package --version
Swift Package Manager - Swift 5.4.0-dev
~/SwiftGtk (main|✔) ~> ./build.sh --verbose
lsb_release -r
/usr/lib/swift/bin/swiftc -print-target-info
/usr/lib/swift/bin/swiftc -print-target-info
uname
pkg-config --variable pc_path pkg-config
'CGLib' gio-unix-2.0.pc: warning: prohibited flag(s): -pthread
'CAtk' gio-unix-2.0.pc: warning: prohibited flag(s): -pthread
fish: “./build.sh --verbose” terminated by signal SIGSEGV (Address boundary error)
~/SwiftGtk (main|✔) 139 ~>
mikolasstuchlik commented 3 years ago

@Dadoum Thanks for your reply. I will describe all steps in the list below:

I have:

[m@mm SwiftHelloGtk]$ swift --version
Swift version 5.4-dev (LLVM a9b8270702a974a, Swift d121d7d55fbcce8)
Target: x86_64-unknown-linux-gnu
[m@mm SwiftHelloGtk]$ swift package --version
Swift Package Manager - Swift 5.4.0-dev
[m@mm SwiftHelloGtk]$ swift build
'CGLib' gio-unix-2.0.pc: warning: prohibited flag(s): -pthread
Neoprávněný přístup do paměti (SIGSEGV) (core dumped [obraz paměti uložen]) ### Localized description -> just a decorated SIGSEGV message
mikolasstuchlik commented 3 years ago

@Dadoum I have found out something that may be interesting.

At the previously mentioned package (https://github.com/mikolasstuchlik/LldbMinimalTest), the build succeeds when I use gio-unix-2.0 as the pkgConfig argument. However, it will fail when I replace it by pangocario. I have pushed it into master.

I came up with that idea by observing the stack trace I posted previously, there is sequence of 4 calls repeating resulting in ~ 8000 calls which is odd. -> See frame frame #8781

frame #4: 0x0000555556314e8c swift-build-new`PCFileFinder.locatePCFile(name="libpng", customSearchPaths=0 values, fileSystem=0x000055555732bed0, self=TSCUtility.PCFileFinder @ 0x00007fffff800ff8) at PkgConfig.swift:95:27
    frame #5: 0x000055555631570e swift-build-new`PkgConfig.init(name="libpng", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:151:45
    frame #6: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=3 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #7: 0x0000555556315b47 swift-build-new`PkgConfig.init(name="freetype2", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:183:42
    frame #8: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=3 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #9: 0x0000555556315b47 swift-build-new`PkgConfig.init(name="harfbuzz", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:183:42
    frame #10: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=3 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #11: 0x0000555556315b47 swift-build-new`PkgConfig.init(name="freetype2", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:183:42
    frame #12: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=3 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
##....
    frame #8775: 0x0000555556315b47 swift-build-new`PkgConfig.init(name="freetype2", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:183:42
    frame #8776: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=3 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #8777: 0x0000555556315b47 swift-build-new`PkgConfig.init(name="harfbuzz", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:183:42
    frame #8778: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=2 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #8779: 0x0000555556315a6c swift-build-new`PkgConfig.init(name="pango", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:182:35
    frame #8780: 0x000055555631806c swift-build-new`getFlags #1 (dependencies=2 values, additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) in PkgConfig.init(name:additionalSearchPaths:diagnostics:fileSystem:brewPrefix:) at PkgConfig.swift:167:31
    frame #8781: 0x0000555556315a6c swift-build-new`PkgConfig.init(name="pangocairo", additionalSearchPaths=0 values, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at PkgConfig.swift:182:35
    frame #8782: 0x0000555555df6921 swift-build-new`pkgConfigArgs(target=0x00005555573d22d0, diagnostics=0x000055555732ac90, fileSystem=0x000055555732bed0, brewPrefix=nil) at Target+PkgConfig.swift:71:33
    frame #8783: 0x0000555555774a16 swift-build-new`BuildPlan.pkgConfig(target=0x00005555573d22d0, self=0x0000555557332800) at BuildPlan.swift:1768:23

I suspect there is something wrong in the PkgConfig.swift file but I failed to find such file anywhere on Github. However I think that were getting closer!

Dadoum commented 3 years ago

On Arch Linux there is a problem between freetype and harfbuzz. They are circular dependent. With normal pkgconf command, it resolve the conflict. On SPM Pkg-config, it does not; the only workaround is to modify the pkg config file (/usr/lib/pkg-config) and to remove from either harfbuzz or freetype the reference to the other

Dadoum commented 3 years ago

I forgot that I modified that file while ago

mikolasstuchlik commented 3 years ago

Great!

I think that this might resolve the issue for you @jenra-uwu :)

On Arch Linux there is a problem between freetype and harfbuzz. They are circular dependent. With normal pkgconf command, it resolve the conflict. On SPM Pkg-config, it does not; the only workaround is to modify the pkg config file (/usr/lib/pkg-config) and to remove from either harfbuzz or freetype the reference to the other

As for the issue with circular dependencies. It is my opinion, that SPM should not SIGSEGV under any condition. I think that we should probably report this behavior as a bug. Either teach the SPM how to build such "corrupted" dependencies, assert the issue or report it and end gracefully.

I don't have enough time to learn SPM in order to solve the issue myself. Should I create bug report or will you (@Dadoum ) handle this :) ?

Dadoum commented 3 years ago

Create the bug issue I will try to fix this on my fork (and then try to PR)

mikolasstuchlik commented 3 years ago

OK! :)

Dadoum commented 3 years ago

./clean.sh then install swift version 5.3 development (just modify link and name of folder in PKGBUILD)

rhx commented 3 years ago

Also don't forget to ./run-gir2swift.sh -- these error messages look like you never created the Swift wrappers.

mikolasstuchlik commented 3 years ago

@Dadoum After reviewing https://bugs.swift.org/browse/SR-13424, I think that the issue is the same as described in this ticket. I will add our finsing into this ticket (and I won't create a new one) :)

I have edited the ticket.

Dadoum commented 3 years ago

Try to install https://github.com/Dadoum/swift-tools-support-core (you will need to clone swift-package-manager from Apple, change the url in Package.swift, and copy everything from ./.build/x86_64-unknown-linux-gnu/debug/ to /usr/lib/swift/bin/

mikolasstuchlik commented 3 years ago

@Dadoum Is it correct - It won't replace any existing file in /usr/lib/swift/bin? :thinking: Snímek obrazovky_2021-01-16_21-45-12

Dadoum commented 3 years ago

You need to build swift-package-manager with my fork swift-tools-support-core and use the binaries from swift-package-manager

Dadoum commented 3 years ago

the only files required are the one that are going to be replaced

mikolasstuchlik commented 3 years ago

OK. I suspect you have modified Package.swift for SPM (package swift-package-manager) already. If so, could you share it with me, please?

Edit: nwm - I have just replaced the swift-tools-support-core in the swift-package-manager .build/checkout directory.

Edit 2: When I installed the Manjaro today, I created non-resizable 15GB VM drive... well... now I struggle with lack of space :facepalm: ... I hate myself :rofl:

Dadoum commented 3 years ago
// swift-tools-version:5.1

/*
 This source file is part of the Swift.org open source project

 Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
 Licensed under Apache License v2.0 with Runtime Library Exception

 See http://swift.org/LICENSE.txt for license information
 See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import PackageDescription
import class Foundation.ProcessInfo

// We default to a 10.10 minimum deployment target for clients of libSwiftPM,
// but allow overriding it when building for a toolchain.

let macOSPlatform: SupportedPlatform
if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTPM_MACOS_DEPLOYMENT_TARGET"] {
    macOSPlatform = .macOS(deploymentTarget)
} else {
    macOSPlatform = .macOS(.v10_10)
}

let package = Package(
    name: "SwiftPM",
    platforms: [macOSPlatform],
    products: [
        // The `libSwiftPM` set of interfaces to programatically work with Swift
        // packages.  `libSwiftPM` includes all of the SwiftPM code except the
        // command line tools, while `libSwiftPMDataModel` includes only the data model.
        //
        // NOTE: This API is *unstable* and may change at any time.
        .library(
            name: "SwiftPM",
            type: .dynamic,
            targets: [
                "SourceControl",
                "SPMLLBuild",
                "PackageCollections",
                "LLBuildManifest",
                "PackageModel",
                "PackageLoading",
                "PackageGraph",
                "Build",
                "Xcodeproj",
                "Workspace"
            ]
        ),
        .library(
            name: "SwiftPM-auto",
            targets: [
                "SourceControl",
                "SPMLLBuild",
                "LLBuildManifest",
                "PackageCollections",
                "PackageModel",
                "PackageLoading",
                "PackageGraph",
                "Build",
                "Xcodeproj",
                "Workspace"
            ]
        ),
        .library(
            name: "SwiftPMDataModel",
            type: .dynamic,
            targets: [
                "SourceControl",
                "PackageCollections",
                "PackageModel",
                "PackageLoading",
                "PackageGraph",
                "Xcodeproj",
                "Workspace"
            ]
        ),

        .library(
            name: "XCBuildSupport",
            targets: ["XCBuildSupport"]
        ),

        .library(
            name: "PackageDescription",
            type: .dynamic,
            targets: ["PackageDescription"]
        ),
    ],
    targets: [
        // The `PackageDescription` targets define the API which is available to
        // the `Package.swift` manifest files. We build the latest API version
        // here which is used when building and running swiftpm without the
        // bootstrap script.
        .target(
            /** Package Definition API */
            name: "PackageDescription",
            swiftSettings: [
                .define("PACKAGE_DESCRIPTION_4_2"),
            ]),

        // MARK: SwiftPM specific support libraries

        .target(
            name: "Basics",
            dependencies: ["SwiftToolsSupport-auto"]),

        .target(
            /** The llbuild manifest model */
            name: "LLBuildManifest",
            dependencies: ["SwiftToolsSupport-auto", "Basics"]),

        .target(
            /** Source control operations */
            name: "SourceControl",
            dependencies: ["SwiftToolsSupport-auto", "Basics"]),
        .target(
            /** Shim for llbuild library */
            name: "SPMLLBuild",
            dependencies: ["SwiftToolsSupport-auto", "Basics"]),

        // MARK: Project Model

        .target(
            /** Primitive Package model objects */
            name: "PackageModel",
            dependencies: ["SwiftToolsSupport-auto", "Basics"]),
        .target(
            /** Package model conventions and loading support */
            name: "PackageLoading",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "PackageModel"]),

        // MARK: Package Dependency Resolution

        .target(
            /** Data structures and support for complete package graphs */
            name: "PackageGraph",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "PackageLoading", "PackageModel", "SourceControl"]),

        // MARK: Package Collections

        .target(
            /** Data structures and support for package collections */
            name: "PackageCollections",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "PackageModel", "SourceControl"]),

        // MARK: Package Manager Functionality

        .target(
            /** Builds Modules and Products */
            name: "SPMBuildCore",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "PackageGraph"]),
        .target(
            /** Builds Modules and Products */
            name: "Build",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "SPMBuildCore", "PackageGraph", "LLBuildManifest", "SwiftDriver", "SPMLLBuild"]),
        .target(
            /** Support for building using Xcode's build system */
            name: "XCBuildSupport",
            dependencies: ["SPMBuildCore", "PackageGraph"]),

        .target(
            /** Generates Xcode projects */
            name: "Xcodeproj",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "PackageGraph"]),
        .target(
            /** High level functionality */
            name: "Workspace",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "SPMBuildCore", "PackageGraph", "PackageModel", "SourceControl", "Xcodeproj"]),

        // MARK: Commands

        .target(
            /** High-level commands */
            name: "Commands",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "Build", "PackageGraph", "SourceControl", "Xcodeproj", "Workspace", "XCBuildSupport", "ArgumentParser", "PackageCollections"]),
        .target(
            /** The main executable provided by SwiftPM */
            name: "swift-package",
            dependencies: ["Commands"]),
        .target(
            /** Builds packages */
            name: "swift-build",
            dependencies: ["Commands"]),
        .target(
            /** Runs package tests */
            name: "swift-test",
            dependencies: ["Commands"]),
        .target(
            /** Runs an executable product */
            name: "swift-run",
            dependencies: ["Commands"]),
        .target(
            /** Interacts with package collections */
            name: "swift-package-collection",
            dependencies: ["Commands"]),
        .target(
            /** Shim tool to find test names on OS X */
            name: "swiftpm-xctest-helper",
            dependencies: [],
            linkerSettings: [
                .unsafeFlags(["-Xlinker", "-rpath", "-Xlinker", "@executable_path/../../../lib/swift/macosx"], .when(platforms: [.macOS])),
            ]),

        // MARK: Additional Test Dependencies

        .target(
            /** SwiftPM test support library */
            name: "SPMTestSupport",
            dependencies: ["SwiftToolsSupport-auto", "Basics", "TSCTestSupport", "PackageGraph", "PackageLoading", "SourceControl", "Workspace", "Xcodeproj", "XCBuildSupport"]),

        // MARK: SwiftPM tests

        .testTarget(
            name: "BasicsTests",
            dependencies: ["Basics", "SPMTestSupport"]),
        .testTarget(
            name: "BuildTests",
            dependencies: ["Build", "SPMTestSupport"]),
        .testTarget(
            name: "CommandsTests",
            dependencies: ["swift-build", "swift-package", "swift-test", "swift-run", "Commands", "Workspace", "SPMTestSupport"]),
        .testTarget(
            name: "WorkspaceTests",
            dependencies: ["Workspace", "SPMTestSupport"]),
        .testTarget(
            name: "FunctionalTests",
            dependencies: ["swift-build", "swift-package", "swift-test", "PackageModel", "SPMTestSupport"]),
        .testTarget(
            name: "FunctionalPerformanceTests",
            dependencies: ["swift-build", "swift-package", "swift-test", "SPMTestSupport"]),
        .testTarget(
            name: "PackageDescription4Tests",
            dependencies: ["PackageDescription"]),
        .testTarget(
            name: "PackageLoadingTests",
            dependencies: ["PackageLoading", "SPMTestSupport"],
            exclude: ["Inputs"]),
        .testTarget(
            name: "PackageLoadingPerformanceTests",
            dependencies: ["PackageLoading", "SPMTestSupport"]),
        .testTarget(
            name: "PackageModelTests",
            dependencies: ["PackageModel", "SPMTestSupport"]),
        .testTarget(
            name: "PackageGraphTests",
            dependencies: ["PackageGraph", "SPMTestSupport"]),
        .testTarget(
            name: "PackageGraphPerformanceTests",
            dependencies: ["PackageGraph", "SPMTestSupport"]),
        .testTarget(
            name: "PackageCollectionsTests",
            dependencies: ["SPMTestSupport", "PackageCollections"]),
        .testTarget(
            name: "SourceControlTests",
            dependencies: ["SourceControl", "SPMTestSupport"]),
        .testTarget(
            name: "XcodeprojTests",
            dependencies: ["Xcodeproj", "SPMTestSupport"]),
        .testTarget(
            name: "XCBuildSupportTests",
            dependencies: ["XCBuildSupport", "SPMTestSupport"]),

        // Examples (These are built to ensure they stay up to date with the API.)
        .target(
            name: "package-info",
            dependencies: ["PackageModel", "PackageLoading", "PackageGraph", "Workspace"],
            path: "Examples/package-info/Sources/package-info"
        )
    ],
    swiftLanguageVersions: [.v5]
)

// Add package dependency on llbuild when not bootstrapping.
//
// When bootstrapping SwiftPM, we can't use llbuild as a package dependency it
// will provided by whatever build system (SwiftCI, bootstrap script) is driving
// the build process. So, we only add these dependencies if SwiftPM is being
// built directly using SwiftPM. It is a bit unfortunate that we've add the
// package dependency like this but there is no other good way of expressing
// this right now.

/// When not using local dependencies, the branch to use for llbuild and TSC repositories.
let relatedDependenciesBranch = "main"

if ProcessInfo.processInfo.environment["SWIFTPM_LLBUILD_FWK"] == nil {
    if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
        package.dependencies += [
            .package(url: "https://github.com/apple/swift-llbuild.git", .branch(relatedDependenciesBranch)),
        ]
    } else {
        // In Swift CI, use a local path to llbuild to interoperate with tools
        // like `update-checkout`, which control the sources externally.
        package.dependencies += [
            .package(path: "../llbuild"),
        ]
    }
    package.targets.first(where: { $0.name == "SPMLLBuild" })!.dependencies += ["llbuildSwift"]
}

if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
    package.dependencies += [
        .package(url: "https://github.com/Dadoum/swift-tools-support-core.git", .branch(relatedDependenciesBranch)),
        // The 'swift-argument-parser' version declared here must match that
        // used by 'swift-driver' and 'sourcekit-lsp'. Please coordinate
        // dependency version changes here with those projects.
        .package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.1")),
        .package(url: "https://github.com/apple/swift-driver.git", .branch(relatedDependenciesBranch)),
    ]
} else {
    package.dependencies += [
        .package(path: "../swift-tools-support-core"),
        .package(path: "../swift-argument-parser"),
        .package(path: "../swift-driver"),
    ]
}
mikolasstuchlik commented 3 years ago

@Dadoum

It gave me this message :slightly_smiling_face: :+1:

[m@mm LldbMinimalTest]$ /usr/lib/swift/bin/swift-run-new
warning: circular dependency detected while parsing pangocairo: harfbuzz -> freetype2 -> harfbuzz
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: harfbuzz -> freetype2 -> harfbuzz
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: harfbuzz -> freetype2 -> harfbuzz
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: harfbuzz -> freetype2 -> harfbuzz
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
warning: circular dependency detected while parsing pangocairo: freetype2 -> harfbuzz -> freetype2
'CGLib' pangocairo.pc: warning: prohibited flag(s): -pthread, -pthread, -pthread, -pthread
[7/7] Linking LldbMinimalTest

* Build Completed!
Hello, world!
[m@mm LldbMinimalTest]$
mikolasstuchlik commented 3 years ago

(Also please check out my post in https://github.com/apple/swift-package-manager/pull/3080#issuecomment-761629403) :)

Dadoum commented 3 years ago

The PR is not in the actual swift stable version yet; so I think it can be added later (and I don't know where to edit this) nvm

mikolasstuchlik commented 3 years ago

@jenra-uwu just to make sure, are you now able to build the project? :)

Kiwijane3 commented 3 years ago

I'm having an issue that seems to be the same on an install of Fedora 34, using both 5.3.3 and 5.4.1 builds

Dadoum commented 3 years ago

Can you upload the logs ? I can surely help about this

Kiwijane3 commented 3 years ago

Sure. There's a page on fedora's error manager, I'll link it and see what I can do on the logs.

Kiwijane3 commented 3 years ago

https://retrace.fedoraproject.org/faf/reports/118516/

Kiwijane3 commented 3 years ago

[janefraser@fedora GtkKit]$ swift build -v lsb_release -r /usr/libexec/swift/bin/swiftc -print-target-info /usr/libexec/swift/bin/swiftc -print-target-info Planning build /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.3.0 /home/janefraser/Documents/GtkKit/Package.swift -o /tmp/TemporaryDirectory.78i9ba/gtkkit-manifest /tmp/TemporaryDirectory.78i9ba/gtkkit-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.0.0 /home/janefraser/Documents/GtkKit/.build/checkouts/DeepDiff/Package.swift -o /tmp/TemporaryDirectory.x0wdRc/deepdiff-manifest /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGtk/Package.swift -o /tmp/TemporaryDirectory.rNoKfw/swiftgtk-manifest /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/gir2swift/Package.swift -o /tmp/TemporaryDirectory.kz3U2s/gir2swift-manifest /tmp/TemporaryDirectory.x0wdRc/deepdiff-manifest -fileno 15 /tmp/TemporaryDirectory.kz3U2s/gir2swift-manifest -fileno 23 /tmp/TemporaryDirectory.rNoKfw/swiftgtk-manifest -fileno 20 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftLibXML/Package.swift -o /tmp/TemporaryDirectory.ljB8gp/swiftlibxml-manifest /tmp/TemporaryDirectory.ljB8gp/swiftlibxml-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftAtk/Package.swift -o /tmp/TemporaryDirectory.h9b7ll/swiftatk-manifest /tmp/TemporaryDirectory.h9b7ll/swiftatk-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGdk/Package.swift -o /tmp/TemporaryDirectory.z5I77x/swiftgdk-manifest /tmp/TemporaryDirectory.z5I77x/swiftgdk-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGObject/Package.swift -o /tmp/TemporaryDirectory.7VO3dj/swiftgobject-manifest /tmp/TemporaryDirectory.7VO3dj/swiftgobject-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGLib/Package.swift -o /tmp/TemporaryDirectory.WE1K9t/swiftglib-manifest /tmp/TemporaryDirectory.WE1K9t/swiftglib-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGdkPixbuf/Package.swift -o /tmp/TemporaryDirectory.pnsrwb/swiftgdkpixbuf-manifest /tmp/TemporaryDirectory.pnsrwb/swiftgdkpixbuf-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftPangoCairo/Package.swift -o /tmp/TemporaryDirectory.EBsS2s/swiftpangocairo-manifest /tmp/TemporaryDirectory.EBsS2s/swiftpangocairo-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGIO/Package.swift -o /tmp/TemporaryDirectory.FjF3St/swiftgio-manifest /tmp/TemporaryDirectory.FjF3St/swiftgio-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftGModule/Package.swift -o /tmp/TemporaryDirectory.aYnxUc/swiftgmodule-manifest /tmp/TemporaryDirectory.aYnxUc/swiftgmodule-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftCairo/Package.swift -o /tmp/TemporaryDirectory.4D92Nn/swiftcairo-manifest /tmp/TemporaryDirectory.4D92Nn/swiftcairo-manifest -fileno 15 /usr/libexec/swift/bin/swiftc -L /usr/libexec/swift/lib/swift/pm/4_2 -lPackageDescription -Xlinker -rpath -Xlinker /usr/libexec/swift/lib/swift/pm/4_2 -swift-version 5 -I /usr/libexec/swift/lib/swift/pm/4_2 -package-description-version 5.2.0 /home/janefraser/Documents/GtkKit/.build/checkouts/SwiftPango/Package.swift -o /tmp/TemporaryDirectory.9rH6Rx/swiftpango-manifest /tmp/TemporaryDirectory.9rH6Rx/swiftpango-manifest -fileno 15 'GtkKit' /home/janefraser/Documents/GtkKit: warning: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target /home/janefraser/Documents/GtkKit/Sources/TestApp/ui.glade~

uname pkg-config --variable pc_path pkg-config 'CGLib' gio-unix-2.0.pc: warning: prohibited flag(s): -pthread, -pthread, -pthread, -pthread, -pthread, -pthread 'CAtk' atk.pc: warning: prohibited flag(s): -pthread, -pthread Segmentation fault (core dumped)

Dadoum commented 3 years ago

The problem seems to be always the same, there is to many pkgconfig files to load that lead to a stack overflow. Can surely help by caching result. Will upload fork soon

Dadoum commented 3 years ago

Please try to recompile swift-packaeg-manager but change swift-tools-support-core url in package.swift by this one: https://github.com/Dadoum/swift-tools-support-core

Kiwijane3 commented 3 years ago

Based on the above comments regarding a circular dependency between freetype and harfbuzz, I edited harfbuzz to not depend on freetype and the issue no longer occurs, so this is the same issue. I'll test the forked spm variant.

Dadoum commented 3 years ago

I think even the upstream SPM should fix the issue (even if it is very very unefficient)