Indexes 3: Adds flatbuffers schema and SolverPackageSpec for indexes to spk#1338
Indexes 3: Adds flatbuffers schema and SolverPackageSpec for indexes to spk#1338dcookspi wants to merge 14 commits intoindex-2-new-unchecked-additionsfrom
Conversation
| @@ -0,0 +1,327 @@ | |||
| // Copyright (c) Contributors to the SPK project. | |||
There was a problem hiding this comment.
This flatbuffer schema does not match the rust spk schema objects one-to-one. The focus is on in making an index that is useful for spk solvers. There is not enough data in the index schema to build or run tests on any of the packages. There is only enough to run solves on them.
Some of the tables have the same name as their rust counterparts, others do not. Some are flatbuffer specific. Some do not store all the fields of their rust counter part. The ones not stored are noted as 'ignored' in comments. Some of the objects have been flattened down to include pieces of intermediate or more deeply nested rust objects. Those should also be noted in comments.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
47ea722 to
af8dcc2
Compare
d83388a to
a59523b
Compare
af8dcc2 to
53f24d1
Compare
5c8e4db to
33938c3
Compare
53f24d1 to
cb733cd
Compare
crates/spk-schema/src/spec.rs
Outdated
| #[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd, Serialize)] | ||
| #[serde(tag = "api")] | ||
| #[enum_dispatch(Deprecate, DeprecateMut)] | ||
| #[allow(clippy::large_enum_variant)] |
There was a problem hiding this comment.
Maybe I missed this before, but we don't want to allow this. You can avoid it by Boxing the IndexedPackage.
There was a problem hiding this comment.
I've done this. I had to box both of the entries because of the size differences between them and the Boxed object itself.
…kage data. Adds v0 SolverPackageSpec as a package implementation backed by a flatbuffer. Adds fb_converter functions for converting spk schema objects into and out of flatbuffer objects. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
schema. Moves flatc-rust to workspace Cargo.toml for spk and spfs. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
package list to the index. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
…kage Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
…cated check during index generation. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
differences, removes some unnecessary unsafe keywords. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
acf608d to
d47df82
Compare
Note: for info on benefits of indexing for spk solves see #1340 (5 of 5). Maybe start there and work back down to this PR if you prefer to review PRs top down.
This adds a new
spk-protocrate to spk, and a new v0 package implementation:SolverPackageSpec.spk-protocontains a flatbuffers schema for index package, version, build, options, and global variables data. The flatbuffers schema is designed for solver use. It only stores data needed for solving with the packages. It is not a complete replacement for all package operations. It does not have enough data to build or test packages.SolverPackageSpecis a package implementation backed by a flatbuffer. Those packages will be produced from an index by changes added in a subsequent PR (#1339, 4 of 5). The functions for converting spk schema objects into and out of flatbuffer objects are contained infb_converter.rs.This is one of the changes that supports adding indexes and index based packages to Spk repositories.
This is 3 of 5 chained PRs for adding indexes to spk solves:
new_unchecked()constructors to spk schema objects #1337spk repo indexsubcommand for index generation and updates #1340version_filterfield in index schema #1344