Expand description
Package dependency scanning and resolution.
This module provides the Scan struct for discovering package dependencies
and building a directed acyclic graph (DAG) for build ordering.
§Scan Process
- Create a scan sandbox
- Run
make pbulk-indexon each package to discover dependencies - Recursively discover all transitive dependencies
- Resolve dependency patterns to specific package versions
- Verify no circular dependencies exist
- Return buildable and skipped package lists
§Skip Reasons
Packages may be skipped for several reasons:
PKG_SKIP_REASON- Package explicitly marked to skip on this platformPKG_FAIL_REASON- Package expected to fail on this platform- Unresolved dependencies - Required dependency not found
- Circular dependencies - Package has a dependency cycle
§Example
use bob::{Config, Database, RunContext, Scan};
use pkgsrc::PkgPath;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
let config = Config::load(None, false)?;
let db_path = config.logdir().join("bob").join("bob.db");
let db = Database::open(&db_path)?;
let mut scan = Scan::new(&config);
scan.add(&PkgPath::new("mail/mutt")?);
scan.add(&PkgPath::new("www/curl")?);
let ctx = RunContext::new(Arc::new(AtomicBool::new(false)));
scan.start(&ctx, &db)?; // Discover dependencies
let result = scan.resolve(&db)?;
println!("Buildable: {}", result.buildable.len());
println!("Skipped: {}", result.skipped.len());Structs§
- Resolved
Index - A resolved package index entry with dependency information.
- Scan
- Package dependency scanner.
- Scan
Failure - Information about a package that failed to scan.
- Scan
Result - Result of scanning and resolving packages.
- Skipped
Package - Information about a package that was skipped during scanning.
Enums§
- Skip
Reason - Reason why a package was excluded from the build.