| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
Dependency resolution major rework epkg install --assume-no now uses 'world + resolvo' to work out install plan, the new code is well tested for major distros. Bump version to 0.2.1 Major Features ============== Constraint-Aware Dependency Resolution - **Introduced Alpine 'world' concenpt for top level package specs with version constraints** (e.g., pkgname=version, pkgname>=version, pkgname~=version) - **Implemented resolvo-based dependency solver** that works across all package formats Local Package and URL Support - **Support for local package files** (.rpm, .deb, .apk, .epkg, .conda, .pkg.tar.xz, .pkg.tar.zst, .tar.bz2) - **Support for remote package URLs** (http://, https://, file://) with automatic downloading Testing Infrastructure - **Data-driven test framework** for dependency solver using YAML/JSON test definitions (cargo test solver_tests::tests -- --nocapture) - **Batch package dependency testing script** (test_depends.py) with random package selection and configurable --os/--batch - **Added --assume-no option** for automatic negative prompts in testing scenarios Dependency Parsing Improvements =============================== Operator Parsing Fixes - **Fixed operator parsing order** in parse_operator_from_start() - now checks multi-character operators (>=, <=, ==) before single-character ones (>, <, =) - **Fixed ">>" and "==" parsing** - now correctly parsed instead of being split into ">" and "=" RPM "with" Operator Support - **Added support for RPM "with" operator** to combine multiple constraints on the same package - **Support for parenthesized and unparenthesized "with" clauses** - **Support for OR expressions in "with" clause left side** with De Morgan's law expansion - **Refactored parse_rpm_requires()** into smaller, focused helper functions Conditional Dependencies - **Fixed "if" operator parsing** in conditional dependencies with proper parentheses handling - **Fixed "and" operator handling** in conditional dependencies by normalizing to commas - **Improved conditional dependency resolution** - only checks installed/selected packages, not repository availability Architecture and Capability Parsing - **Support for RPM architecture specifications** in capability names (e.g., wine-cms(x86-32), wine-cms(x86-64)) - **Arch Linux library alias parsing** - distinguishes between version constraints and library aliases (e.g., libfoo=1.0.0 vs libstk-5.0.0.so=libstk-5.0.0.so-64) - **Support for capability tags** (pkgconfig, crate, python3.13dist, etc.) with proper parsing Version Comparison Fixes ======================== Debian Version Comparison - **Fixed Debian revision comparison** for strings with letters (e.g., "0ubuntu8.6" vs "0") - **Fixed parsing of versions with dashes in revision** (e.g., "1.48.0-2-3") - **Fixed alphabetic revision parsing** (e.g., "2.14.14-z" correctly parsed with revision "z") - **Fixed version comparison when string ends with ~** (tilde has lowest precedence) - **Fixed pre-release detection** - only recognized markers (rc, beta, alpha, pre, dev, snapshot) treated as pre-releases - **Strip local version suffixes** for VersionEqual constraints (everything after last '+') - **Strip trailing ~ suffix** for >= and > constraints in Debian format - **Improved trailing ~ handling** for versions with revisions RPM Version Comparison - **Fixed RPM version comparison** for numeric vs alphabetic segments (numbers > letters in RPM) - **Fixed semantic version comparison** - now compares segment-by-segment instead of concatenating - **Fixed revision comparison** - versions with release > versions without release (e.g., "12.0.0-bp160.1.2" > "12.0.0") - **Fixed version matching** for packages with letter-prefixed build numbers (e.g., "9.8.3-bp160.1.34") - **Compare upstream-only when operand has no release/revision** for RPM/Pacman/Apk formats - **Fixed explicit revision "0" handling** - distinguishes between no revision and explicit "0" APK/Alpine Version Comparison - **Fixed APK explicit revision comparison** (e.g., "6.0-r0" < "6.0") - **Fixed VersionCompatible operator** for APK format to ignore revision suffixes - **Fixed dot-separated pre-release version comparison** (e.g., "48.4" > "48.alpha") Wildcard and Pattern Matching - **Implemented VersionEqualStar and VersionNotEqualStar** wildcard matching (e.g., "6.9.*") - **Support for conda version patterns** (e.g., "3.13" matches "3.13.*" in conda format) - **Support for conda 3-part version matching** and underscore handling Dependency Resolution Improvements ================================== Provider Resolution - **Fixed provider constraint checking** - now checks what providers provide, not provider package version - **Filter provider packages by constraints** before version selection - **Try all providers when constraints fail** - fixed to always check mmio providers - **Fixed provider resolution for version-constrained capabilities** (e.g., "php-composer(doctrine/cache) >= 1.6") - **Split Pacman format provides fields** by whitespace for proper SONAME matching - **Split Alpine pkgconfig provides** by whitespace for multiple provides in single string - **Centralized provides parsing** with format-aware version stripping Version Constraint Checking - **Fixed OR condition handling** in version constraint checking - detects mutually exclusive constraints - **Improved OR group detection** for constraints with different operands - **Fixed VersionGreaterThan constraint with ~~ suffix** for versions with revisions - **Implemented VersionCompatible operator** constraint checking - **Refactored constraint checking logic** to shared functions in version.rs - **Ignore RPM constraints with unexpanded macros** (pattern %{xxx}) Conditional Dependencies - **Fixed conditional dependency resolution** - only checks installed/selected packages, not repository - **Proper handling of skipped conditional dependencies** - marks OR groups as satisfied when all are conditional and none satisfied Direct Package Lookup - **Fixed direct package lookup with version constraints** - filters packages before selecting highest version - **Support for package specs with version constraints** in install command Package Format Support ====================== Conda Support - **Added conda repository support** with noarch repos - **Fixed noarch handling** - set arch to "all" at creation time - **Custom deserializer for noarch field** (handles string and boolean values) - **Improved error logging** throughout conda processing pipeline Arch Linux/Pacman - **Added more repositories** for Arch Linux - **Added zstd decoder support** for .tar.zst files - **Skip usr/lib64 symlink** during package installation to prevent overwriting environment symlink - **Fixed library alias parsing** in requires and provides Alpine/APK - **Parse conflicts from requires field** - conflicts with '!' prefix now properly separated - **Fixed pkgconfig dependency resolution** with version constraints for multiple provides Debian/Ubuntu - **Fixed Debian provide version parsing** with parentheses format (e.g., "libgcc1 (= 1:14.2.0-19)") - **Handle ~~ suffix in version constraints** for Debian Rust packages - **Support for python3:any** capability resolution RPM/OpenSUSE/Fedora/OpenEuler - **Fixed RPM provides parsing** with spaces (e.g., ">= 1.0" format) - **Support for RPM files provides** and font provides - **Support for ksym(default:__SCT__cond_resched) provides** - **Fixed openeuler provides parsing** Error Handling and Logging ========================== Logging Improvements - **Improved error logging** in conda processing with full error chains - **Added debug logging** for provider lookup and constraint checking Bug Fixes ========= Dependency Resolution - **Fixed panic when package obsoleted during dependency resolution** - check if package exists before updating dependencies - **Improved version selection** - prefer packages that don't obsolete existing packages - **Fixed self-obsoletes handling** - flip to VersionNotEqual for self-obsoletes - **De-duplicate provides** to avoid redundant entries - **Remove duplicate pkgkeys** from same package in dependency collection Package Indexing - **Fixed last package not saved to index** in RPM repository processing - call on_new_paragraph() in finalize() - **Filter out trivial entries** from provide2pkgnames.yaml (where key == value) - **Fixed cache path collision** for URLs with same filename - include host and path in cache path Package Installation - **Fixed checksum file path resolution** for downloaded files - use resolve_mirror_path() consistently - **Fixed "Text file busy" errors** during package installation Miscellaneous - **Support for pkgkeys like __glibc__2.41__x86_64** - treat leading __ as part of pkgname - **Fixed epkg info command** - support pkgkey format (pkgname__version__arch) for exact package lookup - **Fixed test framework** - ensure constraints test runs even if simple test fails - **Added path-based filtering** to solver tests Documentation and Tests ======================= - **Added comprehensive test cases** for all major features - **Port initial tests** from apk-tools/test/solver/ - **Added test whitelist** for known working packages - **Improved test organization** with data-driven test framework Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 8 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
Dependency resolution major rework epkg install --assume-no now uses 'world + resolvo' to work out install plan, the new code is well tested for major distros. Bump version to 0.2.1 Major Features ============== Constraint-Aware Dependency Resolution - **Introduced Alpine 'world' concenpt for top level package specs with version constraints** (e.g., pkgname=version, pkgname>=version, pkgname~=version) - **Implemented resolvo-based dependency solver** that works across all package formats Local Package and URL Support - **Support for local package files** (.rpm, .deb, .apk, .epkg, .conda, .pkg.tar.xz, .pkg.tar.zst, .tar.bz2) - **Support for remote package URLs** (http://, https://, file://) with automatic downloading Testing Infrastructure - **Data-driven test framework** for dependency solver using YAML/JSON test definitions (cargo test solver_tests::tests -- --nocapture) - **Batch package dependency testing script** (test_depends.py) with random package selection and configurable --os/--batch - **Added --assume-no option** for automatic negative prompts in testing scenarios Dependency Parsing Improvements =============================== Operator Parsing Fixes - **Fixed operator parsing order** in parse_operator_from_start() - now checks multi-character operators (>=, <=, ==) before single-character ones (>, <, =) - **Fixed ">>" and "==" parsing** - now correctly parsed instead of being split into ">" and "=" RPM "with" Operator Support - **Added support for RPM "with" operator** to combine multiple constraints on the same package - **Support for parenthesized and unparenthesized "with" clauses** - **Support for OR expressions in "with" clause left side** with De Morgan's law expansion - **Refactored parse_rpm_requires()** into smaller, focused helper functions Conditional Dependencies - **Fixed "if" operator parsing** in conditional dependencies with proper parentheses handling - **Fixed "and" operator handling** in conditional dependencies by normalizing to commas - **Improved conditional dependency resolution** - only checks installed/selected packages, not repository availability Architecture and Capability Parsing - **Support for RPM architecture specifications** in capability names (e.g., wine-cms(x86-32), wine-cms(x86-64)) - **Arch Linux library alias parsing** - distinguishes between version constraints and library aliases (e.g., libfoo=1.0.0 vs libstk-5.0.0.so=libstk-5.0.0.so-64) - **Support for capability tags** (pkgconfig, crate, python3.13dist, etc.) with proper parsing Version Comparison Fixes ======================== Debian Version Comparison - **Fixed Debian revision comparison** for strings with letters (e.g., "0ubuntu8.6" vs "0") - **Fixed parsing of versions with dashes in revision** (e.g., "1.48.0-2-3") - **Fixed alphabetic revision parsing** (e.g., "2.14.14-z" correctly parsed with revision "z") - **Fixed version comparison when string ends with ~** (tilde has lowest precedence) - **Fixed pre-release detection** - only recognized markers (rc, beta, alpha, pre, dev, snapshot) treated as pre-releases - **Strip local version suffixes** for VersionEqual constraints (everything after last '+') - **Strip trailing ~ suffix** for >= and > constraints in Debian format - **Improved trailing ~ handling** for versions with revisions RPM Version Comparison - **Fixed RPM version comparison** for numeric vs alphabetic segments (numbers > letters in RPM) - **Fixed semantic version comparison** - now compares segment-by-segment instead of concatenating - **Fixed revision comparison** - versions with release > versions without release (e.g., "12.0.0-bp160.1.2" > "12.0.0") - **Fixed version matching** for packages with letter-prefixed build numbers (e.g., "9.8.3-bp160.1.34") - **Compare upstream-only when operand has no release/revision** for RPM/Pacman/Apk formats - **Fixed explicit revision "0" handling** - distinguishes between no revision and explicit "0" APK/Alpine Version Comparison - **Fixed APK explicit revision comparison** (e.g., "6.0-r0" < "6.0") - **Fixed VersionCompatible operator** for APK format to ignore revision suffixes - **Fixed dot-separated pre-release version comparison** (e.g., "48.4" > "48.alpha") Wildcard and Pattern Matching - **Implemented VersionEqualStar and VersionNotEqualStar** wildcard matching (e.g., "6.9.*") - **Support for conda version patterns** (e.g., "3.13" matches "3.13.*" in conda format) - **Support for conda 3-part version matching** and underscore handling Dependency Resolution Improvements ================================== Provider Resolution - **Fixed provider constraint checking** - now checks what providers provide, not provider package version - **Filter provider packages by constraints** before version selection - **Try all providers when constraints fail** - fixed to always check mmio providers - **Fixed provider resolution for version-constrained capabilities** (e.g., "php-composer(doctrine/cache) >= 1.6") - **Split Pacman format provides fields** by whitespace for proper SONAME matching - **Split Alpine pkgconfig provides** by whitespace for multiple provides in single string - **Centralized provides parsing** with format-aware version stripping Version Constraint Checking - **Fixed OR condition handling** in version constraint checking - detects mutually exclusive constraints - **Improved OR group detection** for constraints with different operands - **Fixed VersionGreaterThan constraint with ~~ suffix** for versions with revisions - **Implemented VersionCompatible operator** constraint checking - **Refactored constraint checking logic** to shared functions in version.rs - **Ignore RPM constraints with unexpanded macros** (pattern %{xxx}) Conditional Dependencies - **Fixed conditional dependency resolution** - only checks installed/selected packages, not repository - **Proper handling of skipped conditional dependencies** - marks OR groups as satisfied when all are conditional and none satisfied Direct Package Lookup - **Fixed direct package lookup with version constraints** - filters packages before selecting highest version - **Support for package specs with version constraints** in install command Package Format Support ====================== Conda Support - **Added conda repository support** with noarch repos - **Fixed noarch handling** - set arch to "all" at creation time - **Custom deserializer for noarch field** (handles string and boolean values) - **Improved error logging** throughout conda processing pipeline Arch Linux/Pacman - **Added more repositories** for Arch Linux - **Added zstd decoder support** for .tar.zst files - **Skip usr/lib64 symlink** during package installation to prevent overwriting environment symlink - **Fixed library alias parsing** in requires and provides Alpine/APK - **Parse conflicts from requires field** - conflicts with '!' prefix now properly separated - **Fixed pkgconfig dependency resolution** with version constraints for multiple provides Debian/Ubuntu - **Fixed Debian provide version parsing** with parentheses format (e.g., "libgcc1 (= 1:14.2.0-19)") - **Handle ~~ suffix in version constraints** for Debian Rust packages - **Support for python3:any** capability resolution RPM/OpenSUSE/Fedora/OpenEuler - **Fixed RPM provides parsing** with spaces (e.g., ">= 1.0" format) - **Support for RPM files provides** and font provides - **Support for ksym(default:__SCT__cond_resched) provides** - **Fixed openeuler provides parsing** Error Handling and Logging ========================== Logging Improvements - **Improved error logging** in conda processing with full error chains - **Added debug logging** for provider lookup and constraint checking Bug Fixes ========= Dependency Resolution - **Fixed panic when package obsoleted during dependency resolution** - check if package exists before updating dependencies - **Improved version selection** - prefer packages that don't obsolete existing packages - **Fixed self-obsoletes handling** - flip to VersionNotEqual for self-obsoletes - **De-duplicate provides** to avoid redundant entries - **Remove duplicate pkgkeys** from same package in dependency collection Package Indexing - **Fixed last package not saved to index** in RPM repository processing - call on_new_paragraph() in finalize() - **Filter out trivial entries** from provide2pkgnames.yaml (where key == value) - **Fixed cache path collision** for URLs with same filename - include host and path in cache path Package Installation - **Fixed checksum file path resolution** for downloaded files - use resolve_mirror_path() consistently - **Fixed "Text file busy" errors** during package installation Miscellaneous - **Support for pkgkeys like __glibc__2.41__x86_64** - treat leading __ as part of pkgname - **Fixed epkg info command** - support pkgkey format (pkgname__version__arch) for exact package lookup - **Fixed test framework** - ensure constraints test runs even if simple test fails - **Added path-based filtering** to solver tests Documentation and Tests ======================= - **Added comprehensive test cases** for all major features - **Port initial tests** from apk-tools/test/solver/ - **Added test whitelist** for known working packages - **Improved test organization** with data-driven test framework Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 8 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
Dependency resolution major rework epkg install --assume-no now uses 'world + resolvo' to work out install plan, the new code is well tested for major distros. Bump version to 0.2.1 Major Features ============== Constraint-Aware Dependency Resolution - **Introduced Alpine 'world' concenpt for top level package specs with version constraints** (e.g., pkgname=version, pkgname>=version, pkgname~=version) - **Implemented resolvo-based dependency solver** that works across all package formats Local Package and URL Support - **Support for local package files** (.rpm, .deb, .apk, .epkg, .conda, .pkg.tar.xz, .pkg.tar.zst, .tar.bz2) - **Support for remote package URLs** (http://, https://, file://) with automatic downloading Testing Infrastructure - **Data-driven test framework** for dependency solver using YAML/JSON test definitions (cargo test solver_tests::tests -- --nocapture) - **Batch package dependency testing script** (test_depends.py) with random package selection and configurable --os/--batch - **Added --assume-no option** for automatic negative prompts in testing scenarios Dependency Parsing Improvements =============================== Operator Parsing Fixes - **Fixed operator parsing order** in parse_operator_from_start() - now checks multi-character operators (>=, <=, ==) before single-character ones (>, <, =) - **Fixed ">>" and "==" parsing** - now correctly parsed instead of being split into ">" and "=" RPM "with" Operator Support - **Added support for RPM "with" operator** to combine multiple constraints on the same package - **Support for parenthesized and unparenthesized "with" clauses** - **Support for OR expressions in "with" clause left side** with De Morgan's law expansion - **Refactored parse_rpm_requires()** into smaller, focused helper functions Conditional Dependencies - **Fixed "if" operator parsing** in conditional dependencies with proper parentheses handling - **Fixed "and" operator handling** in conditional dependencies by normalizing to commas - **Improved conditional dependency resolution** - only checks installed/selected packages, not repository availability Architecture and Capability Parsing - **Support for RPM architecture specifications** in capability names (e.g., wine-cms(x86-32), wine-cms(x86-64)) - **Arch Linux library alias parsing** - distinguishes between version constraints and library aliases (e.g., libfoo=1.0.0 vs libstk-5.0.0.so=libstk-5.0.0.so-64) - **Support for capability tags** (pkgconfig, crate, python3.13dist, etc.) with proper parsing Version Comparison Fixes ======================== Debian Version Comparison - **Fixed Debian revision comparison** for strings with letters (e.g., "0ubuntu8.6" vs "0") - **Fixed parsing of versions with dashes in revision** (e.g., "1.48.0-2-3") - **Fixed alphabetic revision parsing** (e.g., "2.14.14-z" correctly parsed with revision "z") - **Fixed version comparison when string ends with ~** (tilde has lowest precedence) - **Fixed pre-release detection** - only recognized markers (rc, beta, alpha, pre, dev, snapshot) treated as pre-releases - **Strip local version suffixes** for VersionEqual constraints (everything after last '+') - **Strip trailing ~ suffix** for >= and > constraints in Debian format - **Improved trailing ~ handling** for versions with revisions RPM Version Comparison - **Fixed RPM version comparison** for numeric vs alphabetic segments (numbers > letters in RPM) - **Fixed semantic version comparison** - now compares segment-by-segment instead of concatenating - **Fixed revision comparison** - versions with release > versions without release (e.g., "12.0.0-bp160.1.2" > "12.0.0") - **Fixed version matching** for packages with letter-prefixed build numbers (e.g., "9.8.3-bp160.1.34") - **Compare upstream-only when operand has no release/revision** for RPM/Pacman/Apk formats - **Fixed explicit revision "0" handling** - distinguishes between no revision and explicit "0" APK/Alpine Version Comparison - **Fixed APK explicit revision comparison** (e.g., "6.0-r0" < "6.0") - **Fixed VersionCompatible operator** for APK format to ignore revision suffixes - **Fixed dot-separated pre-release version comparison** (e.g., "48.4" > "48.alpha") Wildcard and Pattern Matching - **Implemented VersionEqualStar and VersionNotEqualStar** wildcard matching (e.g., "6.9.*") - **Support for conda version patterns** (e.g., "3.13" matches "3.13.*" in conda format) - **Support for conda 3-part version matching** and underscore handling Dependency Resolution Improvements ================================== Provider Resolution - **Fixed provider constraint checking** - now checks what providers provide, not provider package version - **Filter provider packages by constraints** before version selection - **Try all providers when constraints fail** - fixed to always check mmio providers - **Fixed provider resolution for version-constrained capabilities** (e.g., "php-composer(doctrine/cache) >= 1.6") - **Split Pacman format provides fields** by whitespace for proper SONAME matching - **Split Alpine pkgconfig provides** by whitespace for multiple provides in single string - **Centralized provides parsing** with format-aware version stripping Version Constraint Checking - **Fixed OR condition handling** in version constraint checking - detects mutually exclusive constraints - **Improved OR group detection** for constraints with different operands - **Fixed VersionGreaterThan constraint with ~~ suffix** for versions with revisions - **Implemented VersionCompatible operator** constraint checking - **Refactored constraint checking logic** to shared functions in version.rs - **Ignore RPM constraints with unexpanded macros** (pattern %{xxx}) Conditional Dependencies - **Fixed conditional dependency resolution** - only checks installed/selected packages, not repository - **Proper handling of skipped conditional dependencies** - marks OR groups as satisfied when all are conditional and none satisfied Direct Package Lookup - **Fixed direct package lookup with version constraints** - filters packages before selecting highest version - **Support for package specs with version constraints** in install command Package Format Support ====================== Conda Support - **Added conda repository support** with noarch repos - **Fixed noarch handling** - set arch to "all" at creation time - **Custom deserializer for noarch field** (handles string and boolean values) - **Improved error logging** throughout conda processing pipeline Arch Linux/Pacman - **Added more repositories** for Arch Linux - **Added zstd decoder support** for .tar.zst files - **Skip usr/lib64 symlink** during package installation to prevent overwriting environment symlink - **Fixed library alias parsing** in requires and provides Alpine/APK - **Parse conflicts from requires field** - conflicts with '!' prefix now properly separated - **Fixed pkgconfig dependency resolution** with version constraints for multiple provides Debian/Ubuntu - **Fixed Debian provide version parsing** with parentheses format (e.g., "libgcc1 (= 1:14.2.0-19)") - **Handle ~~ suffix in version constraints** for Debian Rust packages - **Support for python3:any** capability resolution RPM/OpenSUSE/Fedora/OpenEuler - **Fixed RPM provides parsing** with spaces (e.g., ">= 1.0" format) - **Support for RPM files provides** and font provides - **Support for ksym(default:__SCT__cond_resched) provides** - **Fixed openeuler provides parsing** Error Handling and Logging ========================== Logging Improvements - **Improved error logging** in conda processing with full error chains - **Added debug logging** for provider lookup and constraint checking Bug Fixes ========= Dependency Resolution - **Fixed panic when package obsoleted during dependency resolution** - check if package exists before updating dependencies - **Improved version selection** - prefer packages that don't obsolete existing packages - **Fixed self-obsoletes handling** - flip to VersionNotEqual for self-obsoletes - **De-duplicate provides** to avoid redundant entries - **Remove duplicate pkgkeys** from same package in dependency collection Package Indexing - **Fixed last package not saved to index** in RPM repository processing - call on_new_paragraph() in finalize() - **Filter out trivial entries** from provide2pkgnames.yaml (where key == value) - **Fixed cache path collision** for URLs with same filename - include host and path in cache path Package Installation - **Fixed checksum file path resolution** for downloaded files - use resolve_mirror_path() consistently - **Fixed "Text file busy" errors** during package installation Miscellaneous - **Support for pkgkeys like __glibc__2.41__x86_64** - treat leading __ as part of pkgname - **Fixed epkg info command** - support pkgkey format (pkgname__version__arch) for exact package lookup - **Fixed test framework** - ensure constraints test runs even if simple test fails - **Added path-based filtering** to solver tests Documentation and Tests ======================= - **Added comprehensive test cases** for all major features - **Port initial tests** from apk-tools/test/solver/ - **Added test whitelist** for known working packages - **Improved test organization** with data-driven test framework Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 8 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
tests: refactor to use GenerationCommand instead of InstallationPlan Refactored solver test system to use GenerationCommand for test expectations instead of InstallationPlan. This simplifies test file format and removes the need for custom deserialization logic. Changes: - Added plan_to_generation_command() helper function in plan.rs to extract package lists and expose operations from InstallationPlan - Updated TestCaseMetadata to use GenerationCommand instead of InstallationPlan - Removed custom Deserialize implementation for InstallationPlan (no longer needed since tests deserialize GenerationCommand directly) - Removed Serialize derive and serde attributes from InstallationPlan struct - Refactored record_history() to use plan_to_generation_command() helper - Updated validate_plan() to use helper and compare directly with GenerationCommand Vec fields - Converted all test YAML files from map format (pkgkey: null) to Vec format (pkgkey list), making test files cleaner and easier to read - Added serde(default) attributes to GenerationCommand metadata fields for proper deserialization Test file format change: Before: fresh_installs: {pkgkey: null} After: fresh_installs: [pkgkey] This provides better separation of concerns: InstallationPlan is the internal runtime structure, while GenerationCommand is the serialized representation used for history and tests. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 6 个月前 | |
Dependency resolution major rework epkg install --assume-no now uses 'world + resolvo' to work out install plan, the new code is well tested for major distros. Bump version to 0.2.1 Major Features ============== Constraint-Aware Dependency Resolution - **Introduced Alpine 'world' concenpt for top level package specs with version constraints** (e.g., pkgname=version, pkgname>=version, pkgname~=version) - **Implemented resolvo-based dependency solver** that works across all package formats Local Package and URL Support - **Support for local package files** (.rpm, .deb, .apk, .epkg, .conda, .pkg.tar.xz, .pkg.tar.zst, .tar.bz2) - **Support for remote package URLs** (http://, https://, file://) with automatic downloading Testing Infrastructure - **Data-driven test framework** for dependency solver using YAML/JSON test definitions (cargo test solver_tests::tests -- --nocapture) - **Batch package dependency testing script** (test_depends.py) with random package selection and configurable --os/--batch - **Added --assume-no option** for automatic negative prompts in testing scenarios Dependency Parsing Improvements =============================== Operator Parsing Fixes - **Fixed operator parsing order** in parse_operator_from_start() - now checks multi-character operators (>=, <=, ==) before single-character ones (>, <, =) - **Fixed ">>" and "==" parsing** - now correctly parsed instead of being split into ">" and "=" RPM "with" Operator Support - **Added support for RPM "with" operator** to combine multiple constraints on the same package - **Support for parenthesized and unparenthesized "with" clauses** - **Support for OR expressions in "with" clause left side** with De Morgan's law expansion - **Refactored parse_rpm_requires()** into smaller, focused helper functions Conditional Dependencies - **Fixed "if" operator parsing** in conditional dependencies with proper parentheses handling - **Fixed "and" operator handling** in conditional dependencies by normalizing to commas - **Improved conditional dependency resolution** - only checks installed/selected packages, not repository availability Architecture and Capability Parsing - **Support for RPM architecture specifications** in capability names (e.g., wine-cms(x86-32), wine-cms(x86-64)) - **Arch Linux library alias parsing** - distinguishes between version constraints and library aliases (e.g., libfoo=1.0.0 vs libstk-5.0.0.so=libstk-5.0.0.so-64) - **Support for capability tags** (pkgconfig, crate, python3.13dist, etc.) with proper parsing Version Comparison Fixes ======================== Debian Version Comparison - **Fixed Debian revision comparison** for strings with letters (e.g., "0ubuntu8.6" vs "0") - **Fixed parsing of versions with dashes in revision** (e.g., "1.48.0-2-3") - **Fixed alphabetic revision parsing** (e.g., "2.14.14-z" correctly parsed with revision "z") - **Fixed version comparison when string ends with ~** (tilde has lowest precedence) - **Fixed pre-release detection** - only recognized markers (rc, beta, alpha, pre, dev, snapshot) treated as pre-releases - **Strip local version suffixes** for VersionEqual constraints (everything after last '+') - **Strip trailing ~ suffix** for >= and > constraints in Debian format - **Improved trailing ~ handling** for versions with revisions RPM Version Comparison - **Fixed RPM version comparison** for numeric vs alphabetic segments (numbers > letters in RPM) - **Fixed semantic version comparison** - now compares segment-by-segment instead of concatenating - **Fixed revision comparison** - versions with release > versions without release (e.g., "12.0.0-bp160.1.2" > "12.0.0") - **Fixed version matching** for packages with letter-prefixed build numbers (e.g., "9.8.3-bp160.1.34") - **Compare upstream-only when operand has no release/revision** for RPM/Pacman/Apk formats - **Fixed explicit revision "0" handling** - distinguishes between no revision and explicit "0" APK/Alpine Version Comparison - **Fixed APK explicit revision comparison** (e.g., "6.0-r0" < "6.0") - **Fixed VersionCompatible operator** for APK format to ignore revision suffixes - **Fixed dot-separated pre-release version comparison** (e.g., "48.4" > "48.alpha") Wildcard and Pattern Matching - **Implemented VersionEqualStar and VersionNotEqualStar** wildcard matching (e.g., "6.9.*") - **Support for conda version patterns** (e.g., "3.13" matches "3.13.*" in conda format) - **Support for conda 3-part version matching** and underscore handling Dependency Resolution Improvements ================================== Provider Resolution - **Fixed provider constraint checking** - now checks what providers provide, not provider package version - **Filter provider packages by constraints** before version selection - **Try all providers when constraints fail** - fixed to always check mmio providers - **Fixed provider resolution for version-constrained capabilities** (e.g., "php-composer(doctrine/cache) >= 1.6") - **Split Pacman format provides fields** by whitespace for proper SONAME matching - **Split Alpine pkgconfig provides** by whitespace for multiple provides in single string - **Centralized provides parsing** with format-aware version stripping Version Constraint Checking - **Fixed OR condition handling** in version constraint checking - detects mutually exclusive constraints - **Improved OR group detection** for constraints with different operands - **Fixed VersionGreaterThan constraint with ~~ suffix** for versions with revisions - **Implemented VersionCompatible operator** constraint checking - **Refactored constraint checking logic** to shared functions in version.rs - **Ignore RPM constraints with unexpanded macros** (pattern %{xxx}) Conditional Dependencies - **Fixed conditional dependency resolution** - only checks installed/selected packages, not repository - **Proper handling of skipped conditional dependencies** - marks OR groups as satisfied when all are conditional and none satisfied Direct Package Lookup - **Fixed direct package lookup with version constraints** - filters packages before selecting highest version - **Support for package specs with version constraints** in install command Package Format Support ====================== Conda Support - **Added conda repository support** with noarch repos - **Fixed noarch handling** - set arch to "all" at creation time - **Custom deserializer for noarch field** (handles string and boolean values) - **Improved error logging** throughout conda processing pipeline Arch Linux/Pacman - **Added more repositories** for Arch Linux - **Added zstd decoder support** for .tar.zst files - **Skip usr/lib64 symlink** during package installation to prevent overwriting environment symlink - **Fixed library alias parsing** in requires and provides Alpine/APK - **Parse conflicts from requires field** - conflicts with '!' prefix now properly separated - **Fixed pkgconfig dependency resolution** with version constraints for multiple provides Debian/Ubuntu - **Fixed Debian provide version parsing** with parentheses format (e.g., "libgcc1 (= 1:14.2.0-19)") - **Handle ~~ suffix in version constraints** for Debian Rust packages - **Support for python3:any** capability resolution RPM/OpenSUSE/Fedora/OpenEuler - **Fixed RPM provides parsing** with spaces (e.g., ">= 1.0" format) - **Support for RPM files provides** and font provides - **Support for ksym(default:__SCT__cond_resched) provides** - **Fixed openeuler provides parsing** Error Handling and Logging ========================== Logging Improvements - **Improved error logging** in conda processing with full error chains - **Added debug logging** for provider lookup and constraint checking Bug Fixes ========= Dependency Resolution - **Fixed panic when package obsoleted during dependency resolution** - check if package exists before updating dependencies - **Improved version selection** - prefer packages that don't obsolete existing packages - **Fixed self-obsoletes handling** - flip to VersionNotEqual for self-obsoletes - **De-duplicate provides** to avoid redundant entries - **Remove duplicate pkgkeys** from same package in dependency collection Package Indexing - **Fixed last package not saved to index** in RPM repository processing - call on_new_paragraph() in finalize() - **Filter out trivial entries** from provide2pkgnames.yaml (where key == value) - **Fixed cache path collision** for URLs with same filename - include host and path in cache path Package Installation - **Fixed checksum file path resolution** for downloaded files - use resolve_mirror_path() consistently - **Fixed "Text file busy" errors** during package installation Miscellaneous - **Support for pkgkeys like __glibc__2.41__x86_64** - treat leading __ as part of pkgname - **Fixed epkg info command** - support pkgkey format (pkgname__version__arch) for exact package lookup - **Fixed test framework** - ensure constraints test runs even if simple test fails - **Added path-based filtering** to solver tests Documentation and Tests ======================= - **Added comprehensive test cases** for all major features - **Port initial tests** from apk-tools/test/solver/ - **Added test whitelist** for known working packages - **Improved test organization** with data-driven test framework Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 8 个月前 | |
Dependency resolution major rework epkg install --assume-no now uses 'world + resolvo' to work out install plan, the new code is well tested for major distros. Bump version to 0.2.1 Major Features ============== Constraint-Aware Dependency Resolution - **Introduced Alpine 'world' concenpt for top level package specs with version constraints** (e.g., pkgname=version, pkgname>=version, pkgname~=version) - **Implemented resolvo-based dependency solver** that works across all package formats Local Package and URL Support - **Support for local package files** (.rpm, .deb, .apk, .epkg, .conda, .pkg.tar.xz, .pkg.tar.zst, .tar.bz2) - **Support for remote package URLs** (http://, https://, file://) with automatic downloading Testing Infrastructure - **Data-driven test framework** for dependency solver using YAML/JSON test definitions (cargo test solver_tests::tests -- --nocapture) - **Batch package dependency testing script** (test_depends.py) with random package selection and configurable --os/--batch - **Added --assume-no option** for automatic negative prompts in testing scenarios Dependency Parsing Improvements =============================== Operator Parsing Fixes - **Fixed operator parsing order** in parse_operator_from_start() - now checks multi-character operators (>=, <=, ==) before single-character ones (>, <, =) - **Fixed ">>" and "==" parsing** - now correctly parsed instead of being split into ">" and "=" RPM "with" Operator Support - **Added support for RPM "with" operator** to combine multiple constraints on the same package - **Support for parenthesized and unparenthesized "with" clauses** - **Support for OR expressions in "with" clause left side** with De Morgan's law expansion - **Refactored parse_rpm_requires()** into smaller, focused helper functions Conditional Dependencies - **Fixed "if" operator parsing** in conditional dependencies with proper parentheses handling - **Fixed "and" operator handling** in conditional dependencies by normalizing to commas - **Improved conditional dependency resolution** - only checks installed/selected packages, not repository availability Architecture and Capability Parsing - **Support for RPM architecture specifications** in capability names (e.g., wine-cms(x86-32), wine-cms(x86-64)) - **Arch Linux library alias parsing** - distinguishes between version constraints and library aliases (e.g., libfoo=1.0.0 vs libstk-5.0.0.so=libstk-5.0.0.so-64) - **Support for capability tags** (pkgconfig, crate, python3.13dist, etc.) with proper parsing Version Comparison Fixes ======================== Debian Version Comparison - **Fixed Debian revision comparison** for strings with letters (e.g., "0ubuntu8.6" vs "0") - **Fixed parsing of versions with dashes in revision** (e.g., "1.48.0-2-3") - **Fixed alphabetic revision parsing** (e.g., "2.14.14-z" correctly parsed with revision "z") - **Fixed version comparison when string ends with ~** (tilde has lowest precedence) - **Fixed pre-release detection** - only recognized markers (rc, beta, alpha, pre, dev, snapshot) treated as pre-releases - **Strip local version suffixes** for VersionEqual constraints (everything after last '+') - **Strip trailing ~ suffix** for >= and > constraints in Debian format - **Improved trailing ~ handling** for versions with revisions RPM Version Comparison - **Fixed RPM version comparison** for numeric vs alphabetic segments (numbers > letters in RPM) - **Fixed semantic version comparison** - now compares segment-by-segment instead of concatenating - **Fixed revision comparison** - versions with release > versions without release (e.g., "12.0.0-bp160.1.2" > "12.0.0") - **Fixed version matching** for packages with letter-prefixed build numbers (e.g., "9.8.3-bp160.1.34") - **Compare upstream-only when operand has no release/revision** for RPM/Pacman/Apk formats - **Fixed explicit revision "0" handling** - distinguishes between no revision and explicit "0" APK/Alpine Version Comparison - **Fixed APK explicit revision comparison** (e.g., "6.0-r0" < "6.0") - **Fixed VersionCompatible operator** for APK format to ignore revision suffixes - **Fixed dot-separated pre-release version comparison** (e.g., "48.4" > "48.alpha") Wildcard and Pattern Matching - **Implemented VersionEqualStar and VersionNotEqualStar** wildcard matching (e.g., "6.9.*") - **Support for conda version patterns** (e.g., "3.13" matches "3.13.*" in conda format) - **Support for conda 3-part version matching** and underscore handling Dependency Resolution Improvements ================================== Provider Resolution - **Fixed provider constraint checking** - now checks what providers provide, not provider package version - **Filter provider packages by constraints** before version selection - **Try all providers when constraints fail** - fixed to always check mmio providers - **Fixed provider resolution for version-constrained capabilities** (e.g., "php-composer(doctrine/cache) >= 1.6") - **Split Pacman format provides fields** by whitespace for proper SONAME matching - **Split Alpine pkgconfig provides** by whitespace for multiple provides in single string - **Centralized provides parsing** with format-aware version stripping Version Constraint Checking - **Fixed OR condition handling** in version constraint checking - detects mutually exclusive constraints - **Improved OR group detection** for constraints with different operands - **Fixed VersionGreaterThan constraint with ~~ suffix** for versions with revisions - **Implemented VersionCompatible operator** constraint checking - **Refactored constraint checking logic** to shared functions in version.rs - **Ignore RPM constraints with unexpanded macros** (pattern %{xxx}) Conditional Dependencies - **Fixed conditional dependency resolution** - only checks installed/selected packages, not repository - **Proper handling of skipped conditional dependencies** - marks OR groups as satisfied when all are conditional and none satisfied Direct Package Lookup - **Fixed direct package lookup with version constraints** - filters packages before selecting highest version - **Support for package specs with version constraints** in install command Package Format Support ====================== Conda Support - **Added conda repository support** with noarch repos - **Fixed noarch handling** - set arch to "all" at creation time - **Custom deserializer for noarch field** (handles string and boolean values) - **Improved error logging** throughout conda processing pipeline Arch Linux/Pacman - **Added more repositories** for Arch Linux - **Added zstd decoder support** for .tar.zst files - **Skip usr/lib64 symlink** during package installation to prevent overwriting environment symlink - **Fixed library alias parsing** in requires and provides Alpine/APK - **Parse conflicts from requires field** - conflicts with '!' prefix now properly separated - **Fixed pkgconfig dependency resolution** with version constraints for multiple provides Debian/Ubuntu - **Fixed Debian provide version parsing** with parentheses format (e.g., "libgcc1 (= 1:14.2.0-19)") - **Handle ~~ suffix in version constraints** for Debian Rust packages - **Support for python3:any** capability resolution RPM/OpenSUSE/Fedora/OpenEuler - **Fixed RPM provides parsing** with spaces (e.g., ">= 1.0" format) - **Support for RPM files provides** and font provides - **Support for ksym(default:__SCT__cond_resched) provides** - **Fixed openeuler provides parsing** Error Handling and Logging ========================== Logging Improvements - **Improved error logging** in conda processing with full error chains - **Added debug logging** for provider lookup and constraint checking Bug Fixes ========= Dependency Resolution - **Fixed panic when package obsoleted during dependency resolution** - check if package exists before updating dependencies - **Improved version selection** - prefer packages that don't obsolete existing packages - **Fixed self-obsoletes handling** - flip to VersionNotEqual for self-obsoletes - **De-duplicate provides** to avoid redundant entries - **Remove duplicate pkgkeys** from same package in dependency collection Package Indexing - **Fixed last package not saved to index** in RPM repository processing - call on_new_paragraph() in finalize() - **Filter out trivial entries** from provide2pkgnames.yaml (where key == value) - **Fixed cache path collision** for URLs with same filename - include host and path in cache path Package Installation - **Fixed checksum file path resolution** for downloaded files - use resolve_mirror_path() consistently - **Fixed "Text file busy" errors** during package installation Miscellaneous - **Support for pkgkeys like __glibc__2.41__x86_64** - treat leading __ as part of pkgname - **Fixed epkg info command** - support pkgkey format (pkgname__version__arch) for exact package lookup - **Fixed test framework** - ensure constraints test runs even if simple test fails - **Added path-based filtering** to solver tests Documentation and Tests ======================= - **Added comprehensive test cases** for all major features - **Port initial tests** from apk-tools/test/solver/ - **Added test whitelist** for known working packages - **Improved test organization** with data-driven test framework Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 8 个月前 |
Solver Test Framework
This directory contains data-driven tests for the dependency solver, inspired by apk-tools test structure.
Test Structure
Each test case is defined by a test*.yaml file (e.g., test.yaml, test1.yaml, test-basic.yaml).
Test files can be placed directly in subdirectories of the tests/solver directory.
A test directory typically contains:
test*.yaml- Test definition file (required)repo.yaml- Base repository packages (referenced by test.yaml)repo-*.yaml- Additional repository overlay files (optional, referenced by test.yaml)installed.yaml- Currently installed packages (optional, referenced by test.yaml)
Running Tests
Tests are automatically run via the solver_tests::tests::test_solver test function:
cargo test solver_tests::tests::test_solver
Or run with output:
cargo test solver_tests::tests::test_solver -- --nocapture
Test File Format
test.yaml
The test file contains all test configuration and expected results:
format: apk # rpm, deb, apk, epkg, conda, python, pacman
description: Test description
skip: false # Optional, default false
repo: repo.yaml repo-overlay.yaml # Space-separated list of repo files to load and merge
installed: installed.yaml # Optional, installed packages file (if not specified, uses empty set)
# Operation to perform (one of install, upgrade, or remove)
install:
- package1
- package2
# OR
upgrade:
- package1
# OR
remove:
- package1
# Expected InstallationPlan (optional)
plan:
fresh_installs:
package1__1.0__x86_64: {}
package2__2.0__x86_64: {}
upgrades_new:
package1__2.0__x86_64: {}
upgrades_old:
package1__1.0__x86_64: {}
old_removes:
package1__1.0__x86_64: {}
expect_fail: false # Optional, default false. Set to true if test is expected to fail
config:
ignore_missing: false # Optional, default false. Override ignore_missing config option
repo.yaml
List of packages available in the repository. Each package should have:
pkgname- Package nameversion- Package versionarch- Architecturerequires- List of requirements (optional)provides- List of provided capabilities (optional)obsoletes- List of obsoleted packages (optional)- Other fields as needed
Multiple repo files can be specified in the repo: field, and they will be merged together.
installed.yaml
YAML object mapping pkgkey to InstalledPackageInfo (can be empty {}).
This file is optional - if not specified in test.yaml, an empty installed set is used.
Test Behavior
Operations
The test framework supports three operations:
- install: Install specified packages and their dependencies
- upgrade: Upgrade specified packages to their latest versions
- remove: Remove specified packages (and optionally their dependents)
Only one operation type should be specified per test. If multiple are specified, install takes precedence over upgrade, which takes precedence over remove.
Expected Results
Tests can specify an expected InstallationPlan in the plan: field. The plan should contain:
fresh_installs: Map of pkgkeys to install (keys only, values are empty objects)upgrades_new: Map of new package versions (keys only)upgrades_old: Map of old package versions being replaced (keys only)old_removes: Map of packages to remove (keys only)
If no plan is specified, the test will only verify that the operation succeeds (unless expect_fail: true).
Expected Failures
Set expect_fail: true for tests that are expected to fail (e.g., missing dependencies, conflicts). The test will pass if an error occurs and fail if it succeeds.
Config Overrides
Tests can override configuration options via the config: field:
ignore_missing: Iftrue, missing dependencies won't cause the operation to fail immediately (useful for testing error handling)
Note: When expect_fail: true, the test framework automatically sets ignore_missing: true internally to allow error propagation instead of process termination.
Multiple Test Files
You can have multiple test*.yaml files in a subdirectory. Each file will be run as a separate test case. This allows you to:
- Share repository files (
repo.yaml) across multiple tests - Organize related tests together
- Test different scenarios with the same repository setup
Example structure:
tests/solver/
basic/
repo.yaml
installed.yaml
test1.yaml
test2.yaml
test10.yaml
complex/
repo.yaml
repo-overlay.yaml
test1.yaml
test2.yaml
Test Execution
Each test:
- Resets all global state (config, channel config format) to defaults
- Loads repository packages from specified repo files
- Loads installed packages (if specified)
- Sets the channel config format based on the test's
format:field - Applies any config overrides
- Creates a fresh PackageManager with empty caches
- Executes the specified operation (install/upgrade/remove)
- Validates the result against the expected plan (if provided) or expected success/failure