aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-11-09 19:23:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-11-14 16:16:51 +0300
commit76632ec8816369f5b7cf503a37e75fe814bb12bf (patch)
tree9dcb79d30e046145bfbb42f4d11b79e617758547 /tests
parent82667c36bfbeebdf56fb9573ea28d3cf87cbae42 (diff)
Fix unexpected 'unable to satisfy dependency' error in pkg_configure() by turning collect_order_dependent() into collect_dependent()
Diffstat (limited to 'tests')
-rw-r--r--tests/common/satisfy/libbar-2.1.0.tar.gzbin0 -> 414 bytes
-rw-r--r--tests/common/satisfy/libbax-1.0.0.tar.gzbin0 -> 347 bytes
-rw-r--r--tests/common/satisfy/libbax-2.0.0.tar.gzbin0 -> 350 bytes
-rw-r--r--tests/common/satisfy/libbox-1.0.0.tar.gzbin0 -> 361 bytes
-rw-r--r--tests/common/satisfy/libbox-2.0.0.tar.gzbin0 -> 367 bytes
-rw-r--r--tests/common/satisfy/libfoo-2.0.0.tar.gzbin0 -> 368 bytes
l---------tests/common/satisfy/t4f/libbar-1.2.0.tar.gz1
l---------tests/common/satisfy/t4f/libbar-2.1.0.tar.gz1
l---------tests/common/satisfy/t4f/libbax-1.0.0.tar.gz1
l---------tests/common/satisfy/t4f/libbax-2.0.0.tar.gz1
l---------tests/common/satisfy/t4f/libbox-1.0.0.tar.gz1
l---------tests/common/satisfy/t4f/libbox-2.0.0.tar.gz1
l---------tests/common/satisfy/t4f/libfoo-2.0.0.tar.gz1
-rw-r--r--tests/common/satisfy/t4f/repositories.manifest4
-rw-r--r--tests/pkg-build.testscript138
l---------tests/pkg-build/t4f1
16 files changed, 146 insertions, 4 deletions
diff --git a/tests/common/satisfy/libbar-2.1.0.tar.gz b/tests/common/satisfy/libbar-2.1.0.tar.gz
new file mode 100644
index 0000000..0ff50c5
--- /dev/null
+++ b/tests/common/satisfy/libbar-2.1.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/libbax-1.0.0.tar.gz b/tests/common/satisfy/libbax-1.0.0.tar.gz
new file mode 100644
index 0000000..7f4dfd0
--- /dev/null
+++ b/tests/common/satisfy/libbax-1.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/libbax-2.0.0.tar.gz b/tests/common/satisfy/libbax-2.0.0.tar.gz
new file mode 100644
index 0000000..f130da0
--- /dev/null
+++ b/tests/common/satisfy/libbax-2.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/libbox-1.0.0.tar.gz b/tests/common/satisfy/libbox-1.0.0.tar.gz
new file mode 100644
index 0000000..90227f7
--- /dev/null
+++ b/tests/common/satisfy/libbox-1.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/libbox-2.0.0.tar.gz b/tests/common/satisfy/libbox-2.0.0.tar.gz
new file mode 100644
index 0000000..15d457f
--- /dev/null
+++ b/tests/common/satisfy/libbox-2.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/libfoo-2.0.0.tar.gz b/tests/common/satisfy/libfoo-2.0.0.tar.gz
new file mode 100644
index 0000000..fd8eeb3
--- /dev/null
+++ b/tests/common/satisfy/libfoo-2.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/t4f/libbar-1.2.0.tar.gz b/tests/common/satisfy/t4f/libbar-1.2.0.tar.gz
new file mode 120000
index 0000000..b4a7773
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbar-1.2.0.tar.gz
@@ -0,0 +1 @@
+../libbar-1.2.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libbar-2.1.0.tar.gz b/tests/common/satisfy/t4f/libbar-2.1.0.tar.gz
new file mode 120000
index 0000000..0df079a
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbar-2.1.0.tar.gz
@@ -0,0 +1 @@
+../libbar-2.1.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libbax-1.0.0.tar.gz b/tests/common/satisfy/t4f/libbax-1.0.0.tar.gz
new file mode 120000
index 0000000..137b938
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbax-1.0.0.tar.gz
@@ -0,0 +1 @@
+../libbax-1.0.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libbax-2.0.0.tar.gz b/tests/common/satisfy/t4f/libbax-2.0.0.tar.gz
new file mode 120000
index 0000000..465832f
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbax-2.0.0.tar.gz
@@ -0,0 +1 @@
+../libbax-2.0.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libbox-1.0.0.tar.gz b/tests/common/satisfy/t4f/libbox-1.0.0.tar.gz
new file mode 120000
index 0000000..3bc2a0c
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbox-1.0.0.tar.gz
@@ -0,0 +1 @@
+../libbox-1.0.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libbox-2.0.0.tar.gz b/tests/common/satisfy/t4f/libbox-2.0.0.tar.gz
new file mode 120000
index 0000000..1ec50e6
--- /dev/null
+++ b/tests/common/satisfy/t4f/libbox-2.0.0.tar.gz
@@ -0,0 +1 @@
+../libbox-2.0.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/libfoo-2.0.0.tar.gz b/tests/common/satisfy/t4f/libfoo-2.0.0.tar.gz
new file mode 120000
index 0000000..406696d
--- /dev/null
+++ b/tests/common/satisfy/t4f/libfoo-2.0.0.tar.gz
@@ -0,0 +1 @@
+../libfoo-2.0.0.tar.gz \ No newline at end of file
diff --git a/tests/common/satisfy/t4f/repositories.manifest b/tests/common/satisfy/t4f/repositories.manifest
new file mode 100644
index 0000000..4cc7c0a
--- /dev/null
+++ b/tests/common/satisfy/t4f/repositories.manifest
@@ -0,0 +1,4 @@
+: 1
+:
+location: ../t4a
+role: complement
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript
index 3cb3f03..4766e2a 100644
--- a/tests/pkg-build.testscript
+++ b/tests/pkg-build.testscript
@@ -106,6 +106,16 @@
# | |-- libfoo-1.1.0+1.tar.gz
# | `-- repositories.manifest
# |
+# |-- t4f
+# | |-- libfoo-2.0.0.tar.gz -> libbar == 1.2.0
+# | |-- libbar-1.2.0.tar.gz
+# | |-- libbar-2.1.0.tar.gz -> libbox
+# | |-- libbox-1.0.0.tar.gz -> libbax
+# | |-- libbox-2.0.0.tar.gz -> libbax == 1.0.0
+# | |-- libbax-1.0.0.tar.gz
+# | |-- libbax-2.0.0.tar.gz
+# | `-- repositories.manifest
+# |
# |-- t5
# | |-- libbar-1.2.0.tar.gz
# | |-- libbox-1.2.0.tar.gz
@@ -486,6 +496,7 @@ posix = ($cxx.target.class != 'windows')
cp -r $src/t4c $out/t4c && $rep_create $out/t4c &$out/t4c/packages.manifest
cp -r $src/t4d $out/t4d && $rep_create $out/t4d &$out/t4d/packages.manifest
cp -r $src/t4e $out/t4e && $rep_create $out/t4e &$out/t4e/packages.manifest
+ cp -r $src/t4f $out/t4f && $rep_create $out/t4f &$out/t4f/packages.manifest
cp -r $src/t5 $out/t5 && $rep_create $out/t5 &$out/t5/packages.manifest
cp -r $src/t6 $out/t6 && $rep_create $out/t6 &$out/t6/packages.manifest
cp -r $src/t7a $out/t7a && $rep_create $out/t7a &$out/t7a/packages.manifest
@@ -3849,10 +3860,9 @@ test.arguments += --sys-no-query
: adjust-merge-build
:
- : Test that the registered in the map but not ordered package build
- : (libfoo) is properly merged into the reconfigure adjustment as a
- : dependent of the reconfigured dependency (see collect_order_dependents()
- : for more details).
+ : Test that the registered in the map package build (libfoo) is properly
+ : merged into the reconfigure adjustment as a dependent of the
+ : reconfigured dependency (see collect_dependents() for more details).
:
{
$clone_root_cfg;
@@ -3886,6 +3896,113 @@ test.arguments += --sys-no-query
$pkg_drop libbaz libbar libfoo
}
+
+ : reconfiguration
+ :
+ {
+ +$clone_root_cfg
+ +$rep_add $rep/t4f && $rep_fetch
+
+ : re-order
+ :
+ : This test reproduced a failure of the collect_order_dependents()
+ : function (now turned into collect_dependents()) to properly order
+ : dependents of a being upgraded package, if the current version of this
+ : package is a dependent of a being reconfigured dependency. The now
+ : fixed bug ended up with the 'unable to satisfy dependency' failure of
+ : the subsequent pkg_configure() function call for the described case.
+ :
+ {
+ $clone_cfg;
+
+ $* libbar libbox/1.0.0 ?libbax/1.0.0 2>!;
+
+ $pkg_status -ar >>EOO;
+ libbax configured !1.0.0 available 2.0.0
+ !libbox configured !1.0.0 available 2.0.0
+ libbax configured !1.0.0 available 2.0.0
+ !libbar configured 2.1.0
+ !libbox configured !1.0.0 available 2.0.0
+ libbax configured !1.0.0 available 2.0.0
+ EOO
+
+ $* libfoo libbax 2>>EOE;
+ warning: package libfoo dependency on (libbar == 1.2.0) is forcing downgrade of libbar/2.1.0 to 1.2.0
+ disfigured libbar/2.1.0
+ disfigured libbox/1.0.0
+ disfigured libbax/1.0.0
+ fetched libbax/2.0.0
+ unpacked libbax/2.0.0
+ fetched libbar/1.2.0
+ unpacked libbar/1.2.0
+ fetched libfoo/2.0.0
+ unpacked libfoo/2.0.0
+ configured libbax/2.0.0
+ configured libbox/1.0.0
+ configured libbar/1.2.0
+ configured libfoo/2.0.0
+ EOE
+
+ $pkg_status -ar >>EOO;
+ !libbax configured 2.0.0
+ !libbox configured !1.0.0 available 2.0.0
+ !libbax configured 2.0.0
+ !libbar configured 1.2.0 available 2.1.0
+ !libfoo configured 2.0.0
+ !libbar configured 1.2.0 available 2.1.0
+ EOO
+
+ $pkg_drop libbax libbox libbar libfoo
+ }
+
+ : re-order-unsatisfied
+ :
+ : Similar to the above but the dependent of the mentioned package is
+ : unsatisfied with its dependencies.
+ :
+ {
+ $clone_cfg;
+
+ $* libbar libbox ?libbax/1.0.0 2>!;
+
+ $pkg_status -ar >>EOO;
+ libbax configured !1.0.0 available 2.0.0
+ !libbox configured 2.0.0
+ libbax configured !1.0.0 available 2.0.0
+ !libbar configured 2.1.0
+ !libbox configured 2.0.0
+ libbax configured !1.0.0 available 2.0.0
+ EOO
+
+ $* libfoo libbax/2.0.0 --verbose 5 2>>~%EOE% != 0;
+ %.*
+ trace: pkg_build: refine package collection/plan execution from scratch
+ trace: collect_build: add libfoo/2.0.0
+ trace: collect_build: add libbax/2.0.0
+ trace: collect_build_prerequisites: begin libfoo/2.0.0
+ trace: collect_build: add libbar/1.2.0
+ warning: package libfoo dependency on (libbar == 1.2.0) is forcing downgrade of libbar/2.1.0 to 1.2.0
+ trace: collect_build_prerequisites: no cfg-clause for dependency libbar/1.2.0 of dependent libfoo/2.0.0
+ trace: collect_build_prerequisites: begin libbar/1.2.0
+ trace: collect_build_prerequisites: end libbar/1.2.0
+ trace: collect_build_prerequisites: end libfoo/2.0.0
+ trace: collect_build_prerequisites: skip unsatisfied existing dependent libbox of dependency libbax/2.0.0 due to constraint (libbax == 1.0.0)
+ trace: collect_build_prerequisites: begin libbax/2.0.0
+ trace: collect_build_prerequisites: end libbax/2.0.0
+ trace: collect_dependents: postpone failure for existing dependent libbox unsatisfied with dependency libbax/2.0.0 (== 1.0.0)
+ trace: execute_plan: simulate: yes
+ %.*
+ error: unable to upgrade package libbax/1.0.0 to 2.0.0
+ info: because configured package libbox/2.0.0 depends on (libbax == 1.0.0)
+ info: consider re-trying with --upgrade|-u potentially combined with --recursive|-r
+ info: or explicitly request up/downgrade of package libbox
+ info: or explicitly specify package libbax version to manually satisfy these constraints
+ %.*
+ EOE
+
+ $pkg_drop libbox libbar
+ }
+ }
}
: upgrade
@@ -3913,6 +4030,19 @@ test.arguments += --sys-no-query
configured libbar/0.0.2
EOE
+ +$pkg_status -ar >>EOO
+ libfix configured 0.0.1 available 0.0.3
+ !libfoo configured !0.0.1 available 1.0.0
+ libfix configured 0.0.1 available 0.0.3
+ !libbaz configured !0.0.2 available 0.1.0 0.0.4 0.0.3
+ !libfoo configured !0.0.1 available 1.0.0
+ libfix configured 0.0.1 available 0.0.3
+ !libbar configured !0.0.2 available 1.0.0 0.0.3
+ !libbaz configured !0.0.2 available 0.1.0 0.0.4 0.0.3
+ !libfoo configured !0.0.1 available 1.0.0
+ libfix configured 0.0.1 available 0.0.3
+ EOO
+
clone_cfg = [cmdline] cp --no-cleanup -r ../cfg ./ &cfg/***
: immediate
diff --git a/tests/pkg-build/t4f b/tests/pkg-build/t4f
new file mode 120000
index 0000000..00f2c86
--- /dev/null
+++ b/tests/pkg-build/t4f
@@ -0,0 +1 @@
+../common/satisfy/t4f \ No newline at end of file