aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-06-24 14:05:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-06-24 16:19:23 +0300
commit5d815d5959fd4be096423772a8019f3dbdd536af (patch)
tree247960ed377cb9341c617053d5e99c0a848c2753
parent99aad70f19a21e3a38d9df539c77162fdef69b2b (diff)
Search for stubs in all configurations/repositories as a fallback when build system package to hold
-rw-r--r--bpkg/pkg-build.cxx10
-rw-r--r--tests/pkg-system.testscript42
2 files changed, 26 insertions, 26 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index eb836b3..f9882b6 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -3168,8 +3168,14 @@ namespace bpkg
? find_orphan_match (sp, root)
: find_available_one (pa.name, c, root));
- if (rp.first == nullptr && sys && c)
- rp = find_available_one (pa.name, nullopt, root);
+ if (rp.first == nullptr && sys)
+ {
+ available_packages aps (
+ find_available_all (repo_configs, pa.name));
+
+ if (!aps.empty ())
+ rp = move (aps.front ());
+ }
ap = move (rp.first);
af = move (rp.second);
diff --git a/tests/pkg-system.testscript b/tests/pkg-system.testscript
index fc4f707..0da2bc9 100644
--- a/tests/pkg-system.testscript
+++ b/tests/pkg-system.testscript
@@ -849,11 +849,6 @@ rep_remove += -d cfg 2>!
info: while satisfying foo/2
EOE
- $pkg_build 'sys:libbar' 2>>EOE != 0;
- error: unknown package sys:libbar
- info: consider specifying sys:libbar/*
- EOE
-
$pkg_build foo 'sys:libbar/1' 2>>EOE != 0;
error: dependency libbar >= 2 of package foo is not available in source
info: sys:libbar/1 does not satisfy the constrains
@@ -872,11 +867,26 @@ rep_remove += -d cfg 2>!
$pkg_status libbar >'libbar unknown'
}
+ : find-all
+ :
+ : Test that sys:libbar can be built to hold even if its stub package is not
+ : available from the configured repository but only from its prerequisite
+ : repository.
+ :
+ {
+ $clone_cfg;
+
+ $pkg_build 'sys:libbar' 2>>EOE;
+ configured sys:libbar/*
+ EOE
+
+ $pkg_status libbar >'!libbar configured,system !*'
+ }
+
: syslibbar1-foo-syslibbar-drop-foo
:
- : The overall plan is to build foo ?sys:libbar/2, fail to build sys:libbar
- : and foo 'sys:libbar', but succeed to build foo ?sys:libbar/3 and foo
- : ?sys:libbar.
+ : The overall plan is to build foo ?sys:libbar/2, then foo ?sys:libbar/3,
+ : and then foo ?sys:libbar.
:
{
$clone_cfg;
@@ -896,22 +906,6 @@ rep_remove += -d cfg 2>!
$pkg_status foo >'!foo configured 2';
$pkg_status libbar >'libbar configured,system !2';
- # Fail as libbar while being selected is still unknown (not present in t3
- # repo).
- #
- $pkg_build 'sys:libbar' 2>>EOE != 0;
- error: unknown package sys:libbar
- info: consider specifying sys:libbar/*
- EOE
-
- $pkg_build foo 'sys:libbar' 2>>EOE != 0;
- error: unknown package sys:libbar
- info: consider specifying sys:libbar/*
- EOE
-
- $pkg_status foo 1>'!foo configured 2';
- $pkg_status libbar 1>'libbar configured,system !2';
-
# Build foo and ?sys:libbar/3.
#
$pkg_build foo '?sys:libbar/3' 2>>~%EOE%;