diff options
-rw-r--r-- | libbpkg/manifest.cxx | 61 | ||||
-rw-r--r-- | libbpkg/manifest.hxx | 26 | ||||
-rw-r--r-- | tests/manifest/testscript | 40 |
3 files changed, 106 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). // diff --git a/tests/manifest/testscript b/tests/manifest/testscript index dccc053..100f47d 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -3123,6 +3123,16 @@ build-include: linux* build-include: freebsd* build-exclude: *; Only supports Linux and FreeBSD. + bootstrap-build:\ + project = libfoo + + \ + root-build:\ + cxx.std = latest + + using cxx + + \ location: libfoo-1.2.3+2.tar.bz2 sha256sum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 : @@ -3138,6 +3148,10 @@ builds: default legacy; Default and legacy. builds: -windows; Not on Windows. build-exclude: *-msvc_14*/i?86-*; Linker crash. + bootstrap-build:\ + project = libbar + + \ location: bar/libbar-3.4A.5+6.tbz sha256sum: d4b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 : @@ -3149,6 +3163,10 @@ email: libbaz-users@example.org build-error-email: libbaz-issues@example.org; Email for libbaz issues. builds: default experimental + bootstrap-build:\ + project = libbaz + + \ location: libbaz/libbaz-+2-3.4A.5+3.tar.gz sha256sum: b5b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EOF @@ -3169,6 +3187,28 @@ depends: bar == $ EOI } + + : buildfiles + : + { + # @@ TMP Uncomment when the missing bootstrap-build value related + # workaround is removed (see manifest.cxx for details). + #\ + : no-bootstrap + : + $* <<EOI 2>"stdin:10:1: error: no package bootstrap build specified" != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + location: foo/foo-2.0.0.tar.gz + sha256sum: b5b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + EOI + #\ + } } : dir |