aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bdep/buildfile3
-rw-r--r--bdep/ci.cli10
-rw-r--r--bdep/ci.cxx85
-rwxr-xr-xbdep/odb.sh11
-rw-r--r--bdep/publish.cxx12
-rw-r--r--bdep/sync.cxx88
-rw-r--r--bdep/version.hxx.in8
-rw-r--r--manifest2
-rw-r--r--repositories.manifest12
-rw-r--r--tests/ci.testscript42
10 files changed, 181 insertions, 92 deletions
diff --git a/bdep/buildfile b/bdep/buildfile
index a71a85f..af911a0 100644
--- a/bdep/buildfile
+++ b/bdep/buildfile
@@ -10,8 +10,7 @@ xml{*}: extension = xml
import libs = libbpkg%lib{bpkg}
import libs += libbutl%lib{butl}
-import libs += libodb%lib{odb}
-import libs += libodb-sqlite%lib{odb-sqlite}
+import libs += libbutl%lib{butl-odb}
# @@ Why don't we generate these with wildcard patterns (and rules below with
# a for-loop)?
diff --git a/bdep/ci.cli b/bdep/ci.cli
index 65ae252..99b7834 100644
--- a/bdep/ci.cli
+++ b/bdep/ci.cli
@@ -237,10 +237,13 @@ namespace bdep
"<pc>/<tc>[/<tg>]",
"Shortcut for the following options sequence:
- \c{\b{--override\ }<pc>\b{-builds:all}}\n
+ [\c{\b{--override\ }<pc>\b{-builds:all}}]\n
\c{\b{--override\ }<pc>\b{-build-include:}<tc>[\b{/}<tg>]}\n
\c{\b{--override\ }<pc>\b{-build-exclude:**}}
+ The first override is omitted from the above sequence if the
+ \c{<pc>\b{-builds}} override is specified on the command line.
+
Repeat this option to specify multiple build configurations."
}
@@ -249,10 +252,13 @@ namespace bdep
"<tc>[/<tg>]",
"Shortcut for the following options sequence:
- \c{\b{--override\ builds:all}}\n
+ [\c{\b{--override\ builds:all}}]\n
\c{\b{--override\ build-include:}<tc>[\b{/}<tg>]}\n
\c{\b{--override\ build-exclude:**}}
+ The first override is omitted from the above sequence if the
+ \cb{builds} override is specified on the command line.
+
Repeat this option to specify multiple build target configurations."
}
diff --git a/bdep/ci.cxx b/bdep/ci.cxx
index cca2234..0b26b35 100644
--- a/bdep/ci.cxx
+++ b/bdep/ci.cxx
@@ -228,6 +228,30 @@ namespace bdep
bool build_email_ovr (false);
bool aux_ovr (false);
+ // Return true, if the [*-]builds override is specified.
+ //
+ auto builds_override = [&overrides] (const string& config = empty_string)
+ {
+ if (config.empty ())
+ {
+ return find_if (overrides.begin (), overrides.end (),
+ [] (const manifest_name_value& v)
+ {
+ return v.name == "builds";
+ }) != overrides.end ();
+ }
+ else
+ {
+ string n (config + "-builds");
+
+ return find_if (overrides.begin (), overrides.end (),
+ [&n] (const manifest_name_value& v)
+ {
+ return v.name == n;
+ }) != overrides.end ();
+ }
+ };
+
if (o.overrides_specified ())
{
const char* co (o.target_config_specified () ? "--target-config" :
@@ -240,11 +264,15 @@ namespace bdep
{
const string& n (nv.name);
+ // True if the name is *-builds.
+ //
+ bool cbso (
+ n.size () > 7 && n.compare (n.size () - 7, 7, "-builds") == 0);
+
// True if the name is one of {*-builds, *-build-{include,exclude}}
// and update the pkg_config_ovr flag accordingly if that's the case.
//
- bool cbo ((n.size () > 7 &&
- n.compare (n.size () - 7, 7, "-builds") == 0) ||
+ bool cbo (cbso ||
(n.size () > 14 &&
n.compare (n.size () - 14, 14, "-build-include") == 0) ||
(n.size () > 14 &&
@@ -253,9 +281,12 @@ namespace bdep
if (cbo)
pkg_config_ovr = true;
+ // Fail if --{target,build,package}-config or --interactive is
+ // combined with a [*-]build-{include,exclude} override (but not with
+ // [*-]builds).
+ //
if (co != nullptr &&
- (cbo ||
- n == "builds" ||
+ ((cbo && !cbso) ||
n == "build-include" ||
n == "build-exclude"))
{
@@ -339,7 +370,10 @@ namespace bdep
if (o.interactive_specified ())
fail << "--target-config specified together with --interactive|-i";
- override ("builds", "all", origin::target_config);
+ // Add "builds: all", unless the builds value is already overridden.
+ //
+ if (!builds_override ())
+ override ("builds", "all", origin::target_config);
for (const string& c: o.target_config ())
override ("build-include", c, origin::target_config);
@@ -404,8 +438,8 @@ namespace bdep
// Add a package to the list and suppressing duplicates.
//
auto add_package = [&pkgs] (package_name n,
- const dir_path& d,
- package_info&& pi)
+ const dir_path& d,
+ package_info&& pi)
{
auto i (find_if (pkgs.begin (),
pkgs.end (),
@@ -447,15 +481,17 @@ namespace bdep
}
else
{
- configurations cfgs;
+ pair<configurations, bool> cfgs;
{
// Don't keep the database open longer than necessary.
//
database db (open (prj, trace));
transaction t (db.begin ());
- cfgs = find_configurations (o, prj, t).first;
+ cfgs = find_configurations (o, prj, t);
t.commit ();
+
+ verify_project_packages (pp, cfgs);
}
// Add a package to the list, suppressing duplicates and verifying that
@@ -494,7 +530,7 @@ namespace bdep
if (pp.packages.empty ())
{
- for (const shared_ptr<configuration>& c: cfgs)
+ for (const shared_ptr<configuration>& c: cfgs.first)
{
for (const package_state& p: c->packages)
add_package (p.name, c);
@@ -506,7 +542,7 @@ namespace bdep
{
bool init (false);
- for (const shared_ptr<configuration>& c: cfgs)
+ for (const shared_ptr<configuration>& c: cfgs.first)
{
if (find_if (c->packages.begin (),
c->packages.end (),
@@ -523,9 +559,7 @@ namespace bdep
}
}
- if (!init)
- fail << "package " << p.name << " is not initialized in any "
- << "configuration";
+ assert (init); // Wouldn't be here otherwise.
}
}
}
@@ -594,7 +628,11 @@ namespace bdep
bool first (find (package_configs.begin (), package_configs.end (),
pc) == package_configs.end ());
- if (first)
+ // For the specific <pc> add "<pc>-builds: all" when the first
+ // --build-config <pc>/... option is encountered, unless the
+ // "<pc>-builds" value is already overridden.
+ //
+ if (first && !builds_override (pc))
override (pc + "-builds", "all", origin::build_config);
override (pc + "-build-include",
@@ -627,6 +665,14 @@ namespace bdep
fail << "package configuration " << pc << " is specified using "
<< "both --package-config and --build-config";
+ // If for the specific <pc> the "<pc>-builds" value is already
+ // overridden, then skip the --package-config <pc> option, assuming
+ // that the former override has already selected the <pc>
+ // configuration for the CI task.
+ //
+ if (builds_override (pc))
+ continue;
+
using bpkg::build_package_config;
using bpkg::build_class_expr;
using bpkg::build_constraint;
@@ -801,13 +847,20 @@ namespace bdep
fail << "invalid --interactive|-i option value '" << s
<< "': target configuration name is empty";
+ // For the specific <pc> add "<pc>-builds: all", unless the
+ // "<pc>-builds" value is already overridden.
+ //
+ bool bo (builds_override (pc));
+
if (!pc.empty ())
pc += '-';
if (!tg.empty ())
tg = '/' + tg;
- override (pc + "builds", "all", origin::interactive);
+ if (!bo)
+ override (pc + "builds", "all", origin::interactive);
+
override (pc + "build-include", tc + tg, origin::interactive);
override (pc + "build-exclude", "**", origin::interactive);
diff --git a/bdep/odb.sh b/bdep/odb.sh
index 0f71977..35be812 100755
--- a/bdep/odb.sh
+++ b/bdep/odb.sh
@@ -16,8 +16,9 @@ if test -d ../.bdep; then
sed -r -ne 's#^(@[^ ]+ )?([^ ]+)/ .*default.*$#\2#p')"
fi
- inc+=("-I$(echo "$cfg"/libodb-[1-9]*/)")
- inc+=("-I$(echo "$cfg"/libodb-sqlite-[1-9]*/)")
+ # Note: there is nothing generated in libbutl-odb.
+ #
+ inc+=("-I../../libbutl/libbutl-odb")
inc+=("-I$cfg/libbutl")
inc+=("-I../../libbutl")
@@ -30,11 +31,7 @@ sed -r -ne 's#^(@[^ ]+ )?([^ ]+)/ .*default.*$#\2#p')"
else
- inc+=("-I$HOME/work/odb/builds/default/libodb-sqlite-default")
- inc+=("-I$HOME/work/odb/libodb-sqlite")
-
- inc+=("-I$HOME/work/odb/builds/default/libodb-default")
- inc+=("-I$HOME/work/odb/libodb")
+ inc+=("-I../../libbutl/libbutl-odb")
inc+=(-I.. -I../../libbpkg -I../../libbutl)
diff --git a/bdep/publish.cxx b/bdep/publish.cxx
index c358add..3bdbf46 100644
--- a/bdep/publish.cxx
+++ b/bdep/publish.cxx
@@ -1053,15 +1053,17 @@ namespace bdep
}
else
{
- configurations cfgs;
+ pair<configurations, bool> cfgs;
{
// Don't keep the database open longer than necessary.
//
database db (open (prj, trace));
transaction t (db.begin ());
- cfgs = find_configurations (o, prj, t).first;
+ cfgs = find_configurations (o, prj, t);
t.commit ();
+
+ verify_project_packages (pp, cfgs);
}
// Configurations to sync.
@@ -1080,7 +1082,7 @@ namespace bdep
{
shared_ptr<configuration> pc;
- for (const shared_ptr<configuration>& c: cfgs)
+ for (const shared_ptr<configuration>& c: cfgs.first)
{
if (find_if (c->packages.begin (),
c->packages.end (),
@@ -1099,9 +1101,7 @@ namespace bdep
}
}
- if (pc == nullptr)
- fail << "package " << p.name << " is not initialized in any "
- << "configuration";
+ assert (pc != nullptr); // Wouldn't be here otherwise.
dist_dirs.push_back (dir_path (pc->path) /= p.name.string ());
diff --git a/bdep/sync.cxx b/bdep/sync.cxx
index 760b184..b7e71fb 100644
--- a/bdep/sync.cxx
+++ b/bdep/sync.cxx
@@ -842,6 +842,7 @@ namespace bdep
const strings& pkg_args,
bool implicit,
optional<bool> fetch,
+ uint16_t bpkg_fetch_verb,
bool yes,
bool name_cfg,
optional<bool> upgrade, // true - upgrade, false - patch
@@ -1631,10 +1632,24 @@ namespace bdep
if (cfg.reps.empty ())
continue;
- run_bpkg (3, co,
+ const path& p (cfg.path);
+
+ // If we are deep-fetching multiple configurations, print their names.
+ // Failed that it will be quite confusing since we may be re-fetching
+ // the same repositories over and over.
+ //
+ // Note: counter-intuitively, we may end up here even if fetch is
+ // nullopt; see load_implicit() for details.
+ //
+ bool deep_fetch (fetch && *fetch);
+
+ if (cfgs.size () != 1 && deep_fetch)
+ text << "fetching in configuration " << p.representation ();
+
+ run_bpkg (bpkg_fetch_verb, co,
"fetch",
- "-d", cfg.path.get (),
- (*fetch ? nullptr : "--shallow"),
+ "-d", p,
+ (deep_fetch ? nullptr : "--shallow"),
cfg.reps);
}
@@ -2201,14 +2216,15 @@ namespace bdep
pkg_args,
implicit,
fetch,
+ 3 /* bpkg_fetch_verb */,
yes,
name_cfg,
- nullopt /* upgrade */,
- nullopt /* recursive */,
- false /* disfigure */,
+ nullopt /* upgrade */,
+ nullopt /* recursive */,
+ false /* disfigure */,
prj_pkgs,
- strings () /* dep_pkgs */,
- strings () /* deinit_pkgs */,
+ strings () /* dep_pkgs */,
+ strings () /* deinit_pkgs */,
so,
create_host_config,
create_build2_config,
@@ -2280,14 +2296,15 @@ namespace bdep
pkg_args,
implicit,
fetch ? false /* shallow */ : optional<bool> (),
+ 3 /* bpkg_fetch_verb */,
yes,
name_cfg,
- nullopt /* upgrade */,
- nullopt /* recursive */,
- false /* disfigure */,
+ nullopt /* upgrade */,
+ nullopt /* recursive */,
+ false /* disfigure */,
prj_pkgs,
- strings () /* dep_pkgs */,
- strings () /* deinit_pkgs */,
+ strings () /* dep_pkgs */,
+ strings () /* deinit_pkgs */,
so,
create_host_config,
create_build2_config,
@@ -2325,17 +2342,18 @@ namespace bdep
dir_path () /* prj */,
{sync_config (cfg)},
move (lcfgs),
- strings () /* pkg_args */,
- true /* implicit */,
+ strings () /* pkg_args */,
+ true /* implicit */,
fetch ? false /* shallow */ : optional<bool> (),
+ 3 /* bpkg_fetch_verb */,
yes,
name_cfg,
- nullopt /* upgrade */,
- nullopt /* recursive */,
- false /* disfigure */,
- package_locations () /* prj_pkgs */,
- strings () /* dep_pkgs */,
- strings () /* deinit_pkgs */,
+ nullopt /* upgrade */,
+ nullopt /* recursive */,
+ false /* disfigure */,
+ package_locations () /* prj_pkgs */,
+ strings () /* dep_pkgs */,
+ strings () /* deinit_pkgs */,
so,
create_host_config,
create_build2_config);
@@ -2391,20 +2409,21 @@ namespace bdep
}
cmd_sync (co,
- dir_path () /* prj */,
+ dir_path () /* prj */,
move (ocfgs),
move (lcfgs),
- strings () /* pkg_args */,
- true /* implicit */,
+ strings () /* pkg_args */,
+ true /* implicit */,
fetch ? false /* shallow */ : optional<bool> (),
+ 3, /* bpkg_fetch_verb */
yes,
name_cfg,
- nullopt /* upgrade */,
- nullopt /* recursive */,
- false /* disfigure */,
- package_locations () /* prj_pkgs */,
- strings () /* dep_pkgs */,
- strings () /* deinit_pkgs */,
+ nullopt /* upgrade */,
+ nullopt /* recursive */,
+ false /* disfigure */,
+ package_locations () /* prj_pkgs */,
+ strings () /* dep_pkgs */,
+ strings () /* deinit_pkgs */,
so,
create_host_config,
create_build2_config);
@@ -2429,6 +2448,7 @@ namespace bdep
strings () /* pkg_args */,
true /* implicit */,
false /* shallow fetch */,
+ 3 /* bpkg_fetch_verb */,
true /* yes */,
false /* name_cfg */,
nullopt /* upgrade */,
@@ -2760,6 +2780,11 @@ namespace bdep
cmd_fetch (o, prj, c, o.fetch_full ());
}
+ // Increase verbosity for bpkg-fetch command in cmd_sync() if we perform
+ // explicit fetches as well.
+ //
+ uint16_t bpkg_fetch_verb (fetch && !ocfgs.empty () ? 2 : 3);
+
if (!dep_pkgs.empty ())
{
// We ignore the project packages if the dependencies are specified
@@ -2778,6 +2803,7 @@ namespace bdep
pkg_args,
false /* implicit */,
!fetch ? false /* shallow */ : optional<bool> (),
+ bpkg_fetch_verb,
o.recursive () || o.immediate () ? o.yes () : true,
false /* name_cfg */,
!o.patch (), // Upgrade by default unless patch requested.
@@ -2803,6 +2829,7 @@ namespace bdep
pkg_args,
false /* implicit */,
!fetch ? false /* shallow */ : optional<bool> (),
+ bpkg_fetch_verb,
o.yes (),
false /* name_cfg */,
o.upgrade (),
@@ -2829,6 +2856,7 @@ namespace bdep
pkg_args,
o.implicit (),
!fetch ? false /* shallow */ : optional<bool> (),
+ bpkg_fetch_verb,
true /* yes */,
o.implicit () /* name_cfg */,
nullopt /* upgrade */,
diff --git a/bdep/version.hxx.in b/bdep/version.hxx.in
index 7a0a666..cdf03db 100644
--- a/bdep/version.hxx.in
+++ b/bdep/version.hxx.in
@@ -43,14 +43,6 @@ $libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
$libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$
-#include <odb/version.hxx>
-
-$libodb.check(LIBODB_VERSION, LIBODB_SNAPSHOT)$
-
-#include <odb/sqlite/version.hxx>
-
-$libodb_sqlite.check(LIBODB_SQLITE_VERSION, LIBODB_SQLITE_SNAPSHOT)$
-
// User agent.
//
#if defined(_WIN32)
diff --git a/manifest b/manifest
index 523807e..7d2cc7c 100644
--- a/manifest
+++ b/manifest
@@ -18,7 +18,5 @@ depends: * build2 >= 0.16.0-
depends: * bpkg >= 0.16.0-
# @@ DEP Should probably become conditional dependency.
#requires: ? cli ; Only required if changing .cli files.
-depends: libodb [2.5.0-b.26.1 2.5.0-b.27)
-depends: libodb-sqlite [2.5.0-b.26.1 2.5.0-b.27)
depends: libbutl [0.17.0-a.0.1 0.17.0-a.1)
depends: libbpkg [0.17.0-a.0.1 0.17.0-a.1)
diff --git a/repositories.manifest b/repositories.manifest
index e3fa365..9837d08 100644
--- a/repositories.manifest
+++ b/repositories.manifest
@@ -3,16 +3,8 @@ summary: build2 project dependency manager repository
:
role: prerequisite
-location: ../libbutl.git##HEAD
+location: ../libbutl.git#HEAD
:
role: prerequisite
-location: ../libbpkg.git##HEAD
-
-:
-role: prerequisite
-location: https://git.codesynthesis.com/odb/libodb.git##HEAD
-
-:
-role: prerequisite
-location: https://git.codesynthesis.com/odb/libodb-sqlite.git##HEAD
+location: ../libbpkg.git#HEAD
diff --git a/tests/ci.testscript b/tests/ci.testscript
index ab3f33a..7f3e538 100644
--- a/tests/ci.testscript
+++ b/tests/ci.testscript
@@ -608,9 +608,21 @@ windows = ($cxx.target.class == 'windows')
{
$clone_prj;
- $* --target-config 'linux_debian_8-gcc_4.9' --builds '&gcc' 2>>EOE != 0
- error: invalid --builds option value: 'builds' override specified together with --target-config
- info: override: builds: &gcc
+ $* --target-config 'linux_debian_8-gcc_4.9' \
+ --override 'build-include: linux_debian_12-gcc_13' 2>>EOE != 0
+ error: invalid --override option value: 'build-include' override specified together with --target-config
+ info: override: build-include: linux_debian_12-gcc_13
+ EOE
+ }
+
+ : builds-overrides
+ :
+ {
+ $clone_prj;
+
+ $* --target-config 'linux_debian_8-gcc_4.9' --builds '&gcc' 2>>~%EOE%
+ %CI request is queued.*%
+ %reference: .+%
EOE
}
@@ -733,8 +745,8 @@ windows = ($cxx.target.class == 'windows')
$clone_prj;
$* --build-config 'default/linux_debian_8-gcc_4.9' --builds '&gcc' 2>>EOE != 0
- error: invalid --builds option value: 'builds' override specified together with --build-config
- info: override: builds: &gcc
+ error: invalid --build-config option value: 'default-builds' override specified together with 'builds' override
+ info: override: default-builds: all
EOE
}
@@ -856,9 +868,21 @@ windows = ($cxx.target.class == 'windows')
{
$clone_prj;
- $* --interactive 'linux_debian_8-gcc_4.9' --builds '&gcc' 2>>EOE != 0
- error: invalid --builds option value: 'builds' override specified together with --interactive|-i
- info: override: builds: &gcc
+ $* --interactive 'linux_debian_8-gcc_4.9' \
+ --override 'build-include: linux_debian_12-gcc_13' 2>>EOE != 0
+ error: invalid --override option value: 'build-include' override specified together with --interactive|-i
+ info: override: build-include: linux_debian_12-gcc_13
+ EOE
+ }
+
+ : overrides-builds
+ :
+ {
+ $clone_prj;
+
+ $* --interactive 'linux_debian_8-gcc_4.9' --builds '&gcc' 2>>~%EOE%
+ %CI request is queued.*%
+ %reference: .+%
EOE
}
}
@@ -939,7 +963,7 @@ windows = ($cxx.target.class == 'windows')
# While at it, test that we fail for uninitialized package.
#
$* -d prj/prj 2>>EOE != 0;
- error: package prj is not initialized in any configuration
+ error: package prj is not initialized in any default configuration(s)
EOE
$init -C @cfg2 --config-type host -d prj/prj &prj-cfg2/***;