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:
2026-06-16 06:35:08 -05:00
parent ffe6e4868f
commit 65e48ed280
28 changed files with 568 additions and 40 deletions
+32
View File
@@ -40,6 +40,37 @@ type = "custom"
assert_eq!(spec.spec_dir, tmp.path());
}
#[test]
fn parse_package_built_against_metadata() {
let tmp = tempfile::tempdir().unwrap();
let path = tmp.path().join("pkg.toml");
std::fs::write(
&path,
r#"
[package]
name = "foo"
version = "1.0"
description = "d"
homepage = "h"
license = "MIT"
built-against = ["icu78"]
[source]
url = "https://example.com/foo.tar.gz"
sha256 = "skip"
extract_dir = "foo"
[build]
type = "custom"
"#,
)
.unwrap();
let spec = PackageSpec::from_file(&path).unwrap();
assert_eq!(spec.package.built_against, vec!["icu78".to_string()]);
}
#[test]
fn parse_source_array() {
let tmp = tempfile::tempdir().unwrap();
@@ -2358,6 +2389,7 @@ fn mk_spec(name: &str, version: &str) -> PackageSpec {
description: "d".into(),
homepage: "h".into(),
abi_breaking: false,
built_against: Vec::new(),
license: vec!["MIT".into()],
},
packages: Vec::new(),