feat: add built_against field for ABI-sensitive dependencies
- Introduced a new field `built_against` in the InstalledPackageRecord struct to track concrete package names for ABI-sensitive dependencies. - Updated database schema to include `built_against` column in the packages table. - Modified package registration and listing functions to handle the new `built_against` field. - Implemented helper functions to format and parse the `built_against` data. - Enhanced tests to verify the correct handling of the `built_against` metadata during package registration and retrieval. - Updated resolver logic to utilize `built_against` for dependency resolution.
This commit is contained in:
@@ -603,6 +603,19 @@ fn parse_dependency_list(metadata: &toml::Value, kind: &str) -> Vec<String> {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn parse_metadata_string_list(metadata: &toml::Value, key: &str) -> Vec<String> {
|
||||
metadata
|
||||
.get(key)
|
||||
.and_then(|v| v.as_array())
|
||||
.map(|arr| {
|
||||
arr.iter()
|
||||
.filter_map(|v| v.as_str())
|
||||
.map(String::from)
|
||||
.collect()
|
||||
})
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn parse_keep_list(metadata: &toml::Value) -> Vec<String> {
|
||||
if let Some(s) = metadata.get("keep").and_then(|v| v.as_str()) {
|
||||
return vec![s.to_string()];
|
||||
|
||||
Reference in New Issue
Block a user