termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.39k stars 3.08k forks source link

[Bug]: swift could not be installed #21903

Open afrhan-repo opened 1 month ago

afrhan-repo commented 1 month ago

Problem description

I tried to install swift on my system but unsatisfied dependency error occurred

`pkg install swift Checking availability of current mirror: [*] https://ftp.agdsn.de/termux/termux-main: ok Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

Unsatisfied dependencies: libobjc2 : Conflicts: libblocksruntime but 1:5.10 is to be installed Error: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.`

What steps will reproduce the bug?

pkg install swift

What is the expected behavior?

I should install without any broken dependency.

System information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PACKAGE_VARIANT=apt-android-7
TERMUX_APP_PID=4573
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_VERSION=0.119.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://ftp.agdsn.de/termux/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://ftp.agdsn.de/termux/termux-x11 x11 main
# sources.list.d/termux-adb.list
deb https://nohajc.github.io termux extras
# root-repo (sources.list.d/root.list)
deb https://ftp.agdsn.de/termux/termux-root root stable
Updatable packages:
audacity-ffmpeg/x11 3.6.4-1 aarch64 [upgradable from: 3.6.4]
audacity/x11 3.6.4-1 aarch64 [upgradable from: 3.6.4]
command-not-found/stable 2.4.0-47 aarch64 [upgradable from: 2.4.0-46]
gnupg/stable 2.4.5-3 aarch64 [upgradable from: 2.4.5-2]
gpgme/stable 1.23.2-3 aarch64 [upgradable from: 1.23.2-2]
gpgv/stable 2.4.5-3 aarch64 [upgradable from: 2.4.5-2]
libassuan/stable 3.0.1 aarch64 [upgradable from: 2.5.7-1]
libuv/stable 1.49.2 aarch64 [upgradable from: 1.49.1]
pinentry/stable 1.3.1-1 aarch64 [upgradable from: 1.3.1]
termux-tools version:
1.44.1
Android version:
9
Kernel build information:
Linux localhost 4.4.153-perf+ #1 SMP PREEMPT Thu Sep 17 11:35:50 WIB 2020 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
Redmi Note 5 Pro
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.x11 versionCode:15
com.termux.styling versionCode:1000
twaik commented 1 month ago

Ping @fornwall @Grimler91 @finagolfin because you commited to swift build recipes.

fingolfin commented 1 month ago

Nope I never did that (I only contributed to the package for the computer algebra system "gap", other than that I don't even use termux myself, nor swift)

twaik commented 1 month ago

Sorry, wrong ping.

finagolfin commented 1 month ago

It looks like libobjc2 ships with its own blocks runtime which conflicts with the one from Swift, as detailed in the linked issue from our build script. It appears you have to choose one or the other, they conflict for a reason.

Of course, you could always submit a patch to make them play nice, if you need both.

afrhan-repo commented 1 month ago

My problem is solved by doing apt reinstall libblocksruntime,then I successfully installed swift

twaik commented 1 month ago

@finagolfin It seems like the problem in referenced issue is gone or not reproducible in termux anymore.

twaik@twaikpc:~/termux-packages$ for i in libdispatch libobjc2; do termux apt-file show $i | grep -v "/usr/share/"; done
apt-file show libdispatch
libdispatch: /data/data/com.termux/files/usr/include/dispatch/base.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/block.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/data.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/dispatch.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/group.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/introspection.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/io.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/object.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/once.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/queue.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/semaphore.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/source.h
libdispatch: /data/data/com.termux/files/usr/include/dispatch/time.h
libdispatch: /data/data/com.termux/files/usr/include/os/generic_base.h
libdispatch: /data/data/com.termux/files/usr/include/os/generic_unix_base.h
libdispatch: /data/data/com.termux/files/usr/include/os/generic_win_base.h
libdispatch: /data/data/com.termux/files/usr/include/os/object.h
libdispatch: /data/data/com.termux/files/usr/lib/libdispatch.so
apt-file show libobjc2
libobjc2: /data/data/com.termux/files/usr/include/Block.h
libobjc2: /data/data/com.termux/files/usr/include/Block_private.h
libobjc2: /data/data/com.termux/files/usr/include/objc/Availability.h
libobjc2: /data/data/com.termux/files/usr/include/objc/Object.h
libobjc2: /data/data/com.termux/files/usr/include/objc/Protocol.h
libobjc2: /data/data/com.termux/files/usr/include/objc/blocks_private.h
libobjc2: /data/data/com.termux/files/usr/include/objc/blocks_runtime.h
libobjc2: /data/data/com.termux/files/usr/include/objc/capabilities.h
libobjc2: /data/data/com.termux/files/usr/include/objc/developer.h
libobjc2: /data/data/com.termux/files/usr/include/objc/encoding.h
libobjc2: /data/data/com.termux/files/usr/include/objc/hooks.h
libobjc2: /data/data/com.termux/files/usr/include/objc/message.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-api.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-arc.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-auto.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-class.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-runtime.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc-visibility.h
libobjc2: /data/data/com.termux/files/usr/include/objc/objc.h
libobjc2: /data/data/com.termux/files/usr/include/objc/runtime-deprecated.h
libobjc2: /data/data/com.termux/files/usr/include/objc/runtime.h
libobjc2: /data/data/com.termux/files/usr/include/objc/slot.h
libobjc2: /data/data/com.termux/files/usr/lib/libobjc.so
libobjc2: /data/data/com.termux/files/usr/lib/pkgconfig/libobjc.pc

libdispatch does not ship Block.h or Block_private.h so there is no interference. Should we remove the TERMUX_PKG_CONFLICTS?

twaik commented 1 month ago

Probably fixed by this. https://github.com/gnustep/libobjc2/pull/293

finagolfin commented 1 month ago

libdispatch does not ship Block.h or Block_private.h so there is no interference.

The issue is not libdispatch but libblocksruntime:

> dpkg -L libblocksruntime | ag usr/include/
/data/data/com.termux/files/usr/include/Block.h
twaik commented 1 month ago

Oh, right. Sorry.

finagolfin commented 1 month ago

Probably fixed by this. gnustep/libobjc2#293

We could probably use that in the next libobjc2 release to remove this conflict, or backport that patch to the current release.

afrhan-repo commented 4 weeks ago

Having no problem anymore.So I am closing this issue.

finagolfin commented 4 weeks ago

Keep it open, we'll probably fix this with the next libobjc2 release.