From bee8c4afc182e20de9b7e7bd907bee72cfa55889 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 15 Nov 2023 22:11:03 +0300 Subject: Fix pkg-build by ignoring version replacement if it doesn't satisfy dependency constraints --- tests/common/satisfy/libbaz-1.2.0.tar.gz | Bin 0 -> 400 bytes tests/common/satisfy/libbaz-2.1.0.tar.gz | Bin 0 -> 386 bytes tests/common/satisfy/libfoo-3.0.0.tar.gz | Bin 0 -> 360 bytes tests/common/satisfy/libfox-3.0.0.tar.gz | Bin 0 -> 379 bytes tests/common/satisfy/t4j/libbar-0.1.0.tar.gz | 1 + tests/common/satisfy/t4j/libbar-1.2.0.tar.gz | 1 + tests/common/satisfy/t4j/libbaz-1.2.0.tar.gz | 1 + tests/common/satisfy/t4j/libbaz-2.1.0.tar.gz | 1 + tests/common/satisfy/t4j/libfoo-3.0.0.tar.gz | 1 + tests/common/satisfy/t4j/libfox-3.0.0.tar.gz | 1 + tests/common/satisfy/t4j/repositories.manifest | 1 + tests/pkg-build.testscript | 99 +++++++++++++++++++++++++ tests/pkg-build/t4j | 1 + 13 files changed, 107 insertions(+) create mode 100644 tests/common/satisfy/libbaz-1.2.0.tar.gz create mode 100644 tests/common/satisfy/libbaz-2.1.0.tar.gz create mode 100644 tests/common/satisfy/libfoo-3.0.0.tar.gz create mode 100644 tests/common/satisfy/libfox-3.0.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libbar-0.1.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libbar-1.2.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libbaz-1.2.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libbaz-2.1.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libfoo-3.0.0.tar.gz create mode 120000 tests/common/satisfy/t4j/libfox-3.0.0.tar.gz create mode 100644 tests/common/satisfy/t4j/repositories.manifest create mode 120000 tests/pkg-build/t4j (limited to 'tests') diff --git a/tests/common/satisfy/libbaz-1.2.0.tar.gz b/tests/common/satisfy/libbaz-1.2.0.tar.gz new file mode 100644 index 0000000..86b6e25 Binary files /dev/null and b/tests/common/satisfy/libbaz-1.2.0.tar.gz differ diff --git a/tests/common/satisfy/libbaz-2.1.0.tar.gz b/tests/common/satisfy/libbaz-2.1.0.tar.gz new file mode 100644 index 0000000..7567b65 Binary files /dev/null and b/tests/common/satisfy/libbaz-2.1.0.tar.gz differ diff --git a/tests/common/satisfy/libfoo-3.0.0.tar.gz b/tests/common/satisfy/libfoo-3.0.0.tar.gz new file mode 100644 index 0000000..55dc602 Binary files /dev/null and b/tests/common/satisfy/libfoo-3.0.0.tar.gz differ diff --git a/tests/common/satisfy/libfox-3.0.0.tar.gz b/tests/common/satisfy/libfox-3.0.0.tar.gz new file mode 100644 index 0000000..0bc246e Binary files /dev/null and b/tests/common/satisfy/libfox-3.0.0.tar.gz differ diff --git a/tests/common/satisfy/t4j/libbar-0.1.0.tar.gz b/tests/common/satisfy/t4j/libbar-0.1.0.tar.gz new file mode 120000 index 0000000..f622e36 --- /dev/null +++ b/tests/common/satisfy/t4j/libbar-0.1.0.tar.gz @@ -0,0 +1 @@ +../libbar-0.1.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4j/libbar-1.2.0.tar.gz b/tests/common/satisfy/t4j/libbar-1.2.0.tar.gz new file mode 120000 index 0000000..b4a7773 --- /dev/null +++ b/tests/common/satisfy/t4j/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/t4j/libbaz-1.2.0.tar.gz b/tests/common/satisfy/t4j/libbaz-1.2.0.tar.gz new file mode 120000 index 0000000..d43cdcd --- /dev/null +++ b/tests/common/satisfy/t4j/libbaz-1.2.0.tar.gz @@ -0,0 +1 @@ +../libbaz-1.2.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4j/libbaz-2.1.0.tar.gz b/tests/common/satisfy/t4j/libbaz-2.1.0.tar.gz new file mode 120000 index 0000000..11cd8c8 --- /dev/null +++ b/tests/common/satisfy/t4j/libbaz-2.1.0.tar.gz @@ -0,0 +1 @@ +../libbaz-2.1.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4j/libfoo-3.0.0.tar.gz b/tests/common/satisfy/t4j/libfoo-3.0.0.tar.gz new file mode 120000 index 0000000..7678898 --- /dev/null +++ b/tests/common/satisfy/t4j/libfoo-3.0.0.tar.gz @@ -0,0 +1 @@ +../libfoo-3.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4j/libfox-3.0.0.tar.gz b/tests/common/satisfy/t4j/libfox-3.0.0.tar.gz new file mode 120000 index 0000000..2aef930 --- /dev/null +++ b/tests/common/satisfy/t4j/libfox-3.0.0.tar.gz @@ -0,0 +1 @@ +../libfox-3.0.0.tar.gz \ No newline at end of file diff --git a/tests/common/satisfy/t4j/repositories.manifest b/tests/common/satisfy/t4j/repositories.manifest new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/common/satisfy/t4j/repositories.manifest @@ -0,0 +1 @@ +: 1 diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index fe01161..f4c79dc 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -127,6 +127,15 @@ # | |-- libbar-0.1.0.tar.gz # | `-- repositories.manifest # | +# |-- t4j +# | |-- libbar-0.1.0.tar.gz +# | |-- libbar-1.2.0.tar.gz +# | |-- libfoo-3.0.0.tar.gz -> libbar +# | |-- libfox-3.0.0.tar.gz -> libbar == 0.1.0, libbaz == 1.2.0 +# | |-- libbaz-1.2.0.tar.gz -> libbar == 1.2.0 +# | |-- libbaz-2.1.0.tar.gz +# | `-- repositories.manifest +# | # |-- t5 # | |-- libbar-1.2.0.tar.gz # | |-- libbox-1.2.0.tar.gz @@ -509,6 +518,7 @@ posix = ($cxx.target.class != 'windows') 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/t4i $out/t4i && $rep_create $out/t4i &$out/t4i/packages.manifest + cp -r $src/t4j $out/t4j && $rep_create $out/t4j &$out/t4j/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 @@ -4016,6 +4026,95 @@ test.arguments += --sys-no-query } } + : version-replacement + : + { + +$clone_root_cfg + +$rep_add $rep/t4j && $rep_fetch + + : denied + : + { + $clone_cfg; + + $* libbaz libfoo libfox --verbose 5 2>>~%EOE% != 0 + %.* + trace: pkg_build: refine package collection/plan execution from scratch + trace: collect_build: add libbaz/2.1.0 + trace: collect_build: add libfoo/3.0.0 + trace: collect_build: add libfox/3.0.0 + trace: collect_build_prerequisites: begin libbaz/2.1.0 + trace: collect_build_prerequisites: end libbaz/2.1.0 + trace: collect_build_prerequisites: begin libfoo/3.0.0 + trace: collect_build: add libbar/1.2.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/1.2.0 of dependent libfoo/3.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/3.0.0 + trace: collect_build_prerequisites: begin libfox/3.0.0 + trace: collect_build: pick libbar/0.1.0 over libbar/1.2.0 + trace: collect_build: libbar/1.2.0 package version needs to be replaced with libbar/0.1.0 + trace: pkg_build: collection failed due to package version replacement, retry from scratch + trace: pkg_build: refine package collection/plan execution from scratch + trace: collect_build: add libbaz/2.1.0 + trace: collect_build: add libfoo/3.0.0 + trace: collect_build: add libfox/3.0.0 + trace: collect_build_prerequisites: begin libbaz/2.1.0 + trace: collect_build_prerequisites: end libbaz/2.1.0 + trace: collect_build_prerequisites: begin libfoo/3.0.0 + trace: collect_build: apply version replacement for libbar/1.2.0 + trace: collect_build: replacement: libbar/0.1.0 + trace: collect_build: add libbar/0.1.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/0.1.0 of dependent libfoo/3.0.0 + trace: collect_build_prerequisites: begin libbar/0.1.0 + trace: collect_build_prerequisites: end libbar/0.1.0 + trace: collect_build_prerequisites: end libfoo/3.0.0 + trace: collect_build_prerequisites: begin libfox/3.0.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/0.1.0 of dependent libfox/3.0.0 + trace: collect_build: pick libbaz/1.2.0 over libbaz/2.1.0 + trace: collect_build: libbaz/2.1.0 package version needs to be replaced with libbaz/1.2.0 + trace: pkg_build: collection failed due to package version replacement, retry from scratch + trace: pkg_build: refine package collection/plan execution from scratch + trace: collect_build: apply version replacement for libbaz/2.1.0 + trace: collect_build: replacement: libbaz/1.2.0 + trace: collect_build: add libbaz/1.2.0 + trace: collect_build: add libfoo/3.0.0 + trace: collect_build: add libfox/3.0.0 + trace: collect_build_prerequisites: begin libbaz/1.2.0 + trace: collect_build: apply version replacement for libbar/1.2.0 + trace: collect_build: replacement to 0.1.0 is denied since libbaz/1.2.0 depends on (libbar == 1.2.0) + trace: collect_build: add libbar/1.2.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/1.2.0 of dependent libbaz/1.2.0 + trace: collect_build_prerequisites: begin libbar/1.2.0 + trace: collect_build_prerequisites: end libbar/1.2.0 + trace: collect_build_prerequisites: end libbaz/1.2.0 + trace: collect_build_prerequisites: begin libfoo/3.0.0 + trace: collect_build: apply version replacement for libbar/1.2.0 + trace: collect_build: replacement: libbar/0.1.0 + trace: collect_build: pick libbar/1.2.0 over libbar/0.1.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/1.2.0 of dependent libfoo/3.0.0 + trace: collect_build_prerequisites: end libfoo/3.0.0 + trace: collect_build_prerequisites: begin libfox/3.0.0 + trace: collect_build: postpone failure for dependent libfox unsatisfied with dependency libbar/1.2.0 (== 0.1.0) + trace: collect_build: pick libbar/1.2.0 over libbar/0.1.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbar/1.2.0 of dependent libfox/3.0.0 + trace: collect_build_prerequisites: no cfg-clause for dependency libbaz/1.2.0 of dependent libfox/3.0.0 + trace: collect_build_prerequisites: end libfox/3.0.0 + trace: execute_plan: simulate: yes + %.* + error: unable to satisfy constraints on package libbar + info: libbaz/1.2.0 depends on (libbar == 1.2.0) + libfox/3.0.0 requires (libbaz == 1.2.0) + info: libfox/3.0.0 depends on (libbar == 0.1.0) + info: available libbar/1.2.0 + info: available libbar/0.1.0 + info: while satisfying libfox/3.0.0 + info: explicitly specify libbar version to manually satisfy both constraints + %.* + EOE + } + } + : constraint-resolution : { diff --git a/tests/pkg-build/t4j b/tests/pkg-build/t4j new file mode 120000 index 0000000..3e18229 --- /dev/null +++ b/tests/pkg-build/t4j @@ -0,0 +1 @@ +../common/satisfy/t4j \ No newline at end of file -- cgit v1.1