aboutsummaryrefslogtreecommitdiff
path: root/libbpkg
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-01-31 20:33:34 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-02-02 20:13:52 +0300
commit440ad866c75f9c24d49ea63df53d2f2ad0df38ca (patch)
tree5bafcafc559a076f4d6596ba748157428e8f9790 /libbpkg
parent384ee407d3b83333c6c9c9902dcd952e191e4ba1 (diff)
Add bootstrap-build and root-build package manifest values
Diffstat (limited to 'libbpkg')
-rw-r--r--libbpkg/manifest.cxx61
-rw-r--r--libbpkg/manifest.hxx26
2 files changed, 66 insertions, 21 deletions
diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx
index a71e1ab..bd5a93e 100644
--- a/libbpkg/manifest.cxx
+++ b/libbpkg/manifest.cxx
@@ -3607,6 +3607,20 @@ namespace bpkg
tests.push_back (move (nv));
}
+ else if (n == "bootstrap-build")
+ {
+ if (m.bootstrap_build)
+ bad_name ("package bootstrap-build redefinition");
+
+ m.bootstrap_build = move (v);
+ }
+ else if (n == "root-build")
+ {
+ if (m.root_build)
+ bad_name ("package root-build redefinition");
+
+ m.root_build = move (v);
+ }
else if (n == "location")
{
if (flag (package_manifest_flags::forbid_location))
@@ -3844,16 +3858,36 @@ namespace bpkg
}
}
- if (m.description &&
- !m.description_type &&
- flag (package_manifest_flags::require_description_type))
- bad_name ("no package description type specified");
-
if (!m.location && flag (package_manifest_flags::require_location))
bad_name ("no package location specified");
if (!m.sha256sum && flag (package_manifest_flags::require_sha256sum))
bad_name ("no package sha256sum specified");
+
+ if (m.description &&
+ !m.description_type &&
+ flag (package_manifest_flags::require_description_type))
+ bad_name ("no package description type specified");
+
+ if (!m.bootstrap_build &&
+ flag (package_manifest_flags::require_bootstrap_build))
+ {
+ // @@ TMP To support older repositories allow absent bootstrap build
+ // until toolchain 0.15.0 is released.
+ //
+ // Note that for such repositories the packages may not have any
+ // need for the bootstrap buildfile (may not have any dependency
+ // clauses, etc). Thus, we can safely set the bootstrap build
+ // value to an empty string if it is absent, so that the caller
+ // can always be sure that this value is always present for
+ // package manifest lists.
+ //
+ // Note: don't forget to uncomment no-bootstrap test in
+ // tests/manifest/testscript when removing this workaround.
+ //
+ // bad_name ("no package bootstrap build specified");
+ m.bootstrap_build = "";
+ }
}
static void
@@ -3895,11 +3929,12 @@ namespace bpkg
move (nv),
iu,
false /* complete_depends */,
- package_manifest_flags::forbid_file |
- package_manifest_flags::require_description_type |
- package_manifest_flags::require_location |
- package_manifest_flags::forbid_fragment |
- package_manifest_flags::forbid_incomplete_dependencies);
+ package_manifest_flags::forbid_file |
+ package_manifest_flags::forbid_fragment |
+ package_manifest_flags::forbid_incomplete_dependencies |
+ package_manifest_flags::require_location |
+ package_manifest_flags::require_description_type |
+ package_manifest_flags::require_bootstrap_build);
}
// package_manifest
@@ -4317,6 +4352,12 @@ namespace bpkg
: c.config + "/" + *c.target,
c.comment));
+ if (m.bootstrap_build)
+ s.next ("bootstrap-build", *m.bootstrap_build);
+
+ if (m.root_build)
+ s.next ("root-build", *m.root_build);
+
if (m.location)
s.next ("location", m.location->posix_string ());
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index 499d64d..364255b 100644
--- a/libbpkg/manifest.hxx
+++ b/libbpkg/manifest.hxx
@@ -783,17 +783,18 @@ namespace bpkg
//
enum class package_manifest_flags: std::uint16_t
{
- none = 0x00,
-
- forbid_file = 0x01, // Forbid *-file manifest values.
- forbid_location = 0x02,
- forbid_sha256sum = 0x04,
- forbid_fragment = 0x08,
- forbid_incomplete_dependencies = 0x10,
-
- require_location = 0x20,
- require_sha256sum = 0x40,
- require_description_type = 0x80
+ none = 0x000,
+
+ forbid_file = 0x001, // Forbid *-file manifest values.
+ forbid_location = 0x002,
+ forbid_sha256sum = 0x004,
+ forbid_fragment = 0x008,
+ forbid_incomplete_dependencies = 0x010,
+
+ require_location = 0x020,
+ require_sha256sum = 0x040,
+ require_description_type = 0x080,
+ require_bootstrap_build = 0x100
};
inline package_manifest_flags
@@ -1063,6 +1064,9 @@ namespace bpkg
butl::small_vector<build_class_expr, 1> builds;
std::vector<build_constraint> build_constraints;
+ butl::optional<std::string> bootstrap_build;
+ butl::optional<std::string> root_build;
+
// The following values are only valid in the manifest list (and only for
// certain repository types).
//