aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-08-08 15:28:25 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-25 11:35:25 +0300
commitbbf4d75525f54a41ebf38608c193f5787128c590 (patch)
treef66707abaaf18d15b339615fcfd24a56278b079a /bpkg/package.hxx
parent6f40a051db7ef6c42c4856f0608ce1dad4fcf609 (diff)
Fix configuration negotiation in pkg-build to re-evaluate being reconfigured existing dependents
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r--bpkg/package.hxx60
1 files changed, 16 insertions, 44 deletions
diff --git a/bpkg/package.hxx b/bpkg/package.hxx
index 947393b..06278cd 100644
--- a/bpkg/package.hxx
+++ b/bpkg/package.hxx
@@ -32,7 +32,7 @@
//
#define DB_SCHEMA_VERSION_BASE 12
-#pragma db model version(DB_SCHEMA_VERSION_BASE, 24, closed)
+#pragma db model version(DB_SCHEMA_VERSION_BASE, 25, closed)
namespace bpkg
{
@@ -1086,37 +1086,9 @@ namespace bpkg
//
optional<version_constraint> constraint;
- // Position of the first dependency alternative with a configuration
- // clause, if any.
- //
- // Specifically, if there is such an alternative then this is a pair of
- // 1-based indexes of the respective depends value (first) and the
- // dependency alternative (second) in the dependent's manifest. Otherwise,
- // this is a pair of zeros.
- //
- // For example, for the following dependent the position for libfoo/1.2.0
- // prerequisite will be {2,2}:
- //
- // libbar: depends: libfoo >= 1.1.0
- // depends: libfox | libfoo >= 1.2.0 {require {...}}
- //
- pair<size_t, size_t> config_position;
-
// Database mapping.
//
#pragma db member(constraint) column("")
-
- #pragma db member(config_position) transient
-
- #pragma db member(config_dependency_index) \
- virtual(size_t) \
- access(config_position.first) \
- default(0)
-
- #pragma db member(config_alternative_index) \
- virtual(size_t) \
- access(config_position.second) \
- default(0)
};
// Note that the keys for this map need to be created with the database
@@ -1265,6 +1237,16 @@ namespace bpkg
package_prerequisites prerequisites;
+ // 1-based indexes of the selected dependency alternatives which the
+ // prerequisite packages are resolved from. Parallel to the dependencies
+ // member of the respective available package. Entries which don't
+ // correspond to a selected alternative (toolchain build-time dependency,
+ // not enabled alternatives, etc) are set to 0.
+ //
+ using indexes_type = vector<size_t>; // Make sure ODB maps it portably.
+ indexes_type dependency_alternatives;
+ odb::section dependency_alternatives_section;
+
// Project configuration variable names and their sources.
//
vector<config_variable> config_variables;
@@ -1363,6 +1345,11 @@ namespace bpkg
#pragma db member(prerequisites) id_column("package") \
key_column("") value_column("")
+ #pragma db member(dependency_alternatives) id_column("package") \
+ value_column("position") section(dependency_alternatives_section)
+
+ #pragma db member(dependency_alternatives_section) load(lazy) update(always)
+
#pragma db member(config_variables) id_column("package") value_column("")
// For the sake of simplicity let's not calculate the checksum during
@@ -1595,21 +1582,6 @@ namespace bpkg
#pragma db column("pp.package")
package_name name;
- #pragma db transient
- pair<size_t, size_t> config_position;
-
- #pragma db member(config_dependency_index) \
- column("pp.config_dependency_index") \
- virtual(size_t) \
- access(config_position.first) \
- default(0)
-
- #pragma db member(config_alternative_index) \
- column("pp.config_alternative_index") \
- virtual(size_t) \
- access(config_position.second) \
- default(0)
-
#pragma db column("pp.")
optional<version_constraint> constraint;
};