void-linux / xbps

The X Binary Package System (XBPS)
https://voidlinux.org/xbps/
Other
808 stars 124 forks source link

Virtuals from provides are accepted in any version #473

Open Chocimier opened 2 years ago

Chocimier commented 2 years ago

There are two packages in repo: xf86-video-cirrus-1.5.3_8 and xf86-video-mach64-6.9.6_2, that depend on xserver-abi-video-24_1.

Xbps accepts xorg-server-21.1.3_3 which provides xserver-abi-video-25_1 as a valid dependency. That looks like a bug, where correct behaviour would be to

Chocimier commented 2 years ago

Here a testcase:

diff --git a/tests/xbps/libxbps/shell/incorrect_deps_test.sh b/tests/xbps/libxbps/shell/incorrect_deps_test.sh
index c6f2f13e..7c5d228d 100644
--- a/tests/xbps/libxbps/shell/incorrect_deps_test.sh
+++ b/tests/xbps/libxbps/shell/incorrect_deps_test.sh
@@ -43,6 +43,42 @@ incorrect_dep_vpkg_body() {
    atf_check_equal $? 0
 }

+atf_test_case incorrect_dep_vpkg_version
+
+incorrect_dep_vpkg_version_head() {
+   atf_set "descr" "pkg depends on virtual at version different than provided"
+}
+
+incorrect_dep_vpkg_version_body() {
+   mkdir some_repo
+   mkdir -p pkg_A/usr/bin pkg_B/usr/bin
+   echo "xf86-video-cirrus-1.5.3_8" > pkg_A/usr/bin/foo
+   echo "xorg-server-21.1.3_3" > pkg_B/usr/bin/bar
+   cd some_repo
+   xbps-create -A noarch -n xorg-server-21.1.3_3 -s "A pkg" --provides "xserver-abi-video-25_1" ../pkg_A
+   atf_check_equal $? 0
+   xbps-create -A noarch -n xf86-video-cirrus-1.5.3_8 -s "B pkg" --dependencies "xserver-abi-video-24_1" ../pkg_B
+   atf_check_equal $? 0
+   xbps-rindex -d -a $PWD/*.xbps
+   atf_check_equal $? 0
+   cd ..
+
+   xbps-install -C empty.conf -r root --repository=$PWD/some_repo -dy xorg-server
+   atf_check_equal $? 0
+   xbps-install -C empty.conf -r root --repository=$PWD/some_repo -dy xf86-video-cirrus
+   atf_check_equal $? 19 # ENODEV
+
+   cd some_repo
+   xbps-create -A noarch -n xf86-video-cirrus-1.5.3_9 -s "B pkg" --dependencies "xserver-abi-video-25_1" ../pkg_B
+   atf_check_equal $? 0
+   xbps-rindex -d -a $PWD/*.xbps
+   atf_check_equal $? 0
+   cd ..
+
+   xbps-install -C empty.conf -r root --repository=$PWD/some_repo -dy xf86-video-cirrus
+   atf_check_equal $? 0
+}
+
 atf_test_case incorrect_dep_issue45

 incorrect_dep_issue45_head() {
@@ -175,6 +211,7 @@ multiple_versions_body() {
 atf_init_test_cases() {
    atf_add_test_case incorrect_dep
    atf_add_test_case incorrect_dep_vpkg
+   atf_add_test_case incorrect_dep_vpkg_version
    atf_add_test_case incorrect_dep_issue45
    atf_add_test_case incorrect_dep_dups
    atf_add_test_case missing_deps