Works fine in the official Swift Docker image, but not on my Gentoo system Reproducible: Always Steps to Reproduce: 1. Create a project that uses SQLite.swift to open a database 2. `swift run` Actual Results: Prints error at runtime: ``` sst: /var/tmp/portage/dev-lang/swift-5.10.1/work/swift/stdlib/public/runtime/Metadata.cpp:1577: (anonymous namespace)::FunctionCacheEntry::FunctionCacheEntry(const Key &): Assertion `false && "objc block without objc interop?"' failed. fish: Job 1, 'swift run' terminated by signal SIGABRT (Abort) ``` Expected Results: It should successfully open the database
Created attachment 904223 [details] Sample project demonstrating the issue
It's possible that the Docker image doesn't build Swift with assertions.
Sorry about this! Indeed, I believe the Swift Docker images build without assertions, and we should be doing the same here too. I can confirm the crash trivially, but I haven't had the time yet to rebuild Swift 5.10.1 without assertions to confirm the fix (I'm still trying to get Swift 6.0.1 built and I have limited compute resources) — hoping to get to this soon!
Confirmed that compiling Swift without assertions resolves the issue. Fix incoming in swift-5.10.1-r1.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2a36ac399b06cd73f2be2c7d0df56dc82eb31fb4 commit 2a36ac399b06cd73f2be2c7d0df56dc82eb31fb4 Author: Itai Ferber <itai@itaiferber.net> AuthorDate: 2024-10-13 01:27:34 +0000 Commit: Itai Ferber <itai@itaiferber.net> CommitDate: 2024-10-13 01:31:25 +0000 dev-lang/swift: build without compiler assertions Closes: https://bugs.gentoo.org/940500 Signed-off-by: Itai Ferber <itai@itaiferber.net> dev-lang/swift/swift-5.10.1-r1.ebuild | 6 ++++++ 1 file changed, 6 insertions(+)
This needs a new revision as it changes the installed binary (the bug itself involves runtime behaviour).
Indeed, the change was introduced in a new revision (-r1)
Ah, the commit didn't make it obvious, you're right of course: https://gitweb.gentoo.org/repo/proj/guru.git/log/dev-lang/swift/swift-5.10.1-r1.ebuild.
Yeah, sorry — I had a few reasons to introduce -r1 and I didn't want the individual changes to get lost; agreed that it was unclear! (And thanks for checking!)